[openstreetmap/openstreetmap-website] unable to watch changesets that are not yet closed but there is a "watch" button (#1627)

mmd notifications at github.com
Sun Dec 10 10:08:47 UTC 2017


We could disable the "Watch" button and display some explanatory text, see the example below. Wording may not be ideal, it's just an idea how it could look like.

### Changeset still open

![grafik](https://user-images.githubusercontent.com/5842757/33803856-d16b975c-dd99-11e7-8f30-8c7212bf546c.png)

### Changeset closed

![grafik](https://user-images.githubusercontent.com/5842757/33803871-0376a368-dd9a-11e7-93a2-5d61bc8dadaa.png)

```ruby
diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb
index 86d1906..d4fd2e8 100644
--- a/app/views/browse/changeset.html.erb
+++ b/app/views/browse/changeset.html.erb
@@ -13,6 +13,7 @@
 
   <h4 class="comments-header"><%= t('browse.changeset.discussion') %></h4>
 
+  <% unless @changeset.is_open? %>
   <div class="buttons clearfix subscribe-buttons">
     <form action="#" class="hide_unless_logged_in">
       <% if current_user and @changeset.subscribers.exists?(current_user.id) %>
@@ -22,6 +23,7 @@
       <% end %>
     </form>
   </div>
+  <% end %>
 
   <div class="clearfix"></div>
 
@@ -72,6 +74,10 @@
         <input type="submit" name="comment" value="<%= t('javascripts.changesets.show.comment') %>" data-changeset-id="<%= @changeset.id %>" data-method="POST" data-url="<%= changeset_comment_url(@changeset) %>" disabled="1"/>
       </div>
     </form>
+  <% else %>
+    <div class="notice hide_unless_logged_in">
+    <%= t('browse.changeset.still_open') %>
+    </div>
   <% end %>
 
   <% unless @ways.empty? %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 062fd95..6a59614 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -131,6 +131,7 @@ en:
         title_comment: "Changeset %{id} - %{comment}"
       join_discussion: "Log in to join the discussion"
       discussion: Discussion
+      still_open: "Changeset still open, check back later for discussion"
     node:
       title: "Node: %{name}"
       history_title: "Node History: %{name}"
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/1627#issuecomment-350537583
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20171210/b63a03fa/attachment.html>


More information about the rails-dev mailing list