]> git.openstreetmap.org Git - rails.git/commitdiff
Added report icon + changes to admin UI + changes to report form + few other minor...
authorShrey <shrey14099@iiitd.ac.in>
Sat, 18 Jul 2015 14:57:03 +0000 (20:27 +0530)
committerMatt Amos <zerebubuth@gmail.com>
Mon, 22 Aug 2016 15:17:54 +0000 (16:17 +0100)
app/assets/stylesheets/common.scss
app/helpers/issues_helper.rb
app/views/browse/changeset.html.erb
app/views/diary_entry/_diary_comment.html.erb
app/views/diary_entry/_diary_entry.html.erb
app/views/issues/index.html.erb
app/views/issues/new.html.erb
app/views/layouts/_header.html.erb
app/views/user/view.html.erb
config/locales/en-GB.yml
config/locales/en.yml

index 9a7785678f010e3c35abd3fda4441dc53173f7e7..b7731130750fc16bd5b8fb0bb82341cd4883e8d7 100644 (file)
@@ -2776,6 +2776,9 @@ input.richtext_title[type="text"] {
 }
 
 .new-report-string {
 }
 
 .new-report-string {
-  text-align:center;
   font-size:15px;
   font-size:15px;
+}
+
+.report-button {
+  float:right;
 }
\ No newline at end of file
 }
\ No newline at end of file
index 9ecb70e3540295ca5fb2c49f5f43da5251437de2..ac5bd59cdb28a4f0b7e917a7fe89d9e61e4f7492 100644 (file)
@@ -19,7 +19,7 @@ module IssuesHelper
                                                                                                                :id => reportable.diary_entry.id,
                                                                                                                :comment_id => reportable.id
                when "Changeset"
                                                                                                                :id => reportable.diary_entry.id,
                                                                                                                :comment_id => reportable.id
                when "Changeset"
-                       link_to "Changeset ##{reportable.id}, Closed at: #{l(reportable.closed_at.to_datetime, :format => :long)}",             :controller => :browse,
+                       link_to "Changeset ##{reportable.id}",          :controller => :browse,
                                                                                                                                                                                                        :action => :changeset,
                                                                                                                                                                                                        :id => reportable.id
                else
                                                                                                                                                                                                        :action => :changeset,
                                                                                                                                                                                                        :id => reportable.id
                else
index 7e08ac3a8f5a62b42e7c48954f0aa146d1fae290..86b17aba1800e075ac303ce01046bfc181ac7b57 100644 (file)
@@ -2,13 +2,23 @@
 
 <h2>
   <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
 
 <h2>
   <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
+  <% if @user and @user.id != @changeset.user.id %>
+    <div class="report-button">
+      <%= link_to new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id), :title => t('browse.changeset.report') do %>
+        <%= image_tag('notice.png', size: '10x10') %>
+      <% end %>
+    </div>
+  <% end %>
   <%= t('browse.changeset.title', :id => @changeset.id) %>
 </h2>
 
   <%= t('browse.changeset.title', :id => @changeset.id) %>
 </h2>
 
+
+
 <div class="browse-section">
   <h4><%= linkify(h(@changeset.tags['comment'].to_s.presence || t('browse.no_comment'))) %></h4>
   <div class="details"><%= changeset_details(@changeset) %></div>
 
 <div class="browse-section">
   <h4><%= linkify(h(@changeset.tags['comment'].to_s.presence || t('browse.no_comment'))) %></h4>
   <div class="details"><%= changeset_details(@changeset) %></div>
 
+
   <%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>
 
   <h4 class="comments-header"><%= t('browse.changeset.discussion') %></h4>
   <%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>
 
   <h4 class="comments-header"><%= t('browse.changeset.discussion') %></h4>
 <% end %>
 
 <div class='secondary-actions'>
 <% end %>
 
 <div class='secondary-actions'>
-  <% if @user and @user.id != @changeset.user.id %>
-    <%= link_to t('browse.changeset.report'), new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id) %>
-    &middot;
-  <% end %>
   <%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %>
   &middot;
   <%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %>
   <%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %>
   &middot;
   <%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %>
index c741d7734630f5ca93b206c1102db4ec82979933..8f98285d0bbb472c809eebdd63f1be004eb2fad9 100644 (file)
@@ -1,11 +1,17 @@
 <div class="clearfix diary-comment">
   <%= user_thumbnail diary_comment.user %>
   <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %></p>
 <div class="clearfix diary-comment">
   <%= user_thumbnail diary_comment.user %>
   <p class="deemphasize comment-heading" id="comment<%= diary_comment.id %>"><%= raw(t('diary_entry.diary_comment.comment_from', :link_user => (link_to h(diary_comment.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_comment.user.display_name), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}"))) %></p>
+  
+  <% if @user and diary_comment.user.id != @user.id %>
+       <div class="report-button">
+               <%= link_to new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id), :title => t('diary_entry.diary_comment.report') do %>
+                       <%= image_tag('notice.png', size: '10x10') %>
+               <% end %>
+       </div>
+  <% end %>
+  
   <div class="richtext"><%= diary_comment.body.to_html %></div>
   <%= if_administrator(:span) do %>
   <div class="richtext"><%= diary_comment.body.to_html %></div>
   <%= if_administrator(:span) do %>
-    <%= link_to t('diary_entry.diary_comment.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('diary_entry.diary_comment.confirm') } %> |
-  <% end %>
-  <% if @user and diary_comment.user.id != @user.id %>
-       <%= link_to t('issues.report'), new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id) %>
+    <%= link_to t('diary_entry.diary_comment.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('diary_entry.diary_comment.confirm') } %>
   <% end %>
 </div>
   <% end %>
 </div>
index 5a34bad5e6c331ef007dcb6737e9a3e660bfaaa3..9af5586d3414882c31d72b716f0d416980df9eee 100644 (file)
@@ -6,6 +6,14 @@
 
     <h2><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></h2>
 
 
     <h2><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></h2>
 
+    <% if @user and diary_entry.user.id != @user.id %>
+      <div class="report-button">
+          <%= link_to new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id), :title => t('diary_entry.diary_entry.report') do %>
+            <%= image_tag('notice.png', size: '10x10') %>
+          <% end %>
+      </div>
+    <% end %>
+
     <small class='deemphasize'>
       <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
     </small>
     <small class='deemphasize'>
       <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
     </small>
       <%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>
     <% end %>
 
       <%= link_to t('diary_entry.diary_entry.edit_link'), :action => 'edit', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>
     <% end %>
 
-    <% if @user and diary_entry.user.id != @user.id %>
-      <li>
-          <%= link_to t('issues.report'), new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id) %>
-      </li>
-    <% end %>
 
     <%= if_administrator(:li) do %>
       <%= link_to t('diary_entry.diary_entry.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('diary_entry.diary_entry.confirm') } %>
 
     <%= if_administrator(:li) do %>
       <%= link_to t('diary_entry.diary_entry.hide_link'), hide_diary_entry_path(:display_name => diary_entry.user.display_name, :id => diary_entry.id), :method => :post, :data => { :confirm => t('diary_entry.diary_entry.confirm') } %>
index 4002e9db3e40152d14a2ea01e9aa19a276ea676f..98fbbaa2d345525ffc4e266fcc0c6fda4bd75cc5 100644 (file)
        <thead>
                <tr>
                        <tr>
        <thead>
                <tr>
                        <tr>
-                               <td style="text-align:center"><b> # </b> </td>
-                               <td style="text-align:center"><b>Issue Type </b></td>
-                               <td style="text-align:center"><b> Status </b></td>
-                               <td style="text-align:center"><b> Number of Reports</b></td>
-                               <td style="text-align:center"><b> Link to instance </b></td>
-                               <td style="text-align:center"><b> Reported User </b></td>
-                               <td style="text-align:center"></td>
+                               <td><b> Status </b></td>
+                               <td><b> Number of Reports</b></td>
+                               <td><b> Last updated at</b></td>
+                               <td><b> Link to instance </b></td>
+                               <td><b> Reported User </b></td>
+                               <td></td>
                        </tr>
                </tr>
        </thead>
        <tbody>
                <% @issues.each do |issue| %>
                        <tr>
                        </tr>
                </tr>
        </thead>
        <tbody>
                <% @issues.each do |issue| %>
                        <tr>
-                               <td style="text-align:center">Issue #<%= issue.id %> </td>
-                               <td style="text-align:center"> <%= issue.reportable_type %></td>
-                               <td style="text-align:center"><span class="count-number"> <strong><%= issue.status %></strong></span> </td>
-                               <td style="text-align:center"><%= issue.reports.count %></td>
-                               <td style="text-align:center"> <%= reportable_url(issue.reportable) %></td>
-                               <td style="text-align:center"><%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %></td>
-                               <td style="text-align:center"><%= link_to "Show Issue", issue %></td>
+                               <td><span class="count-number"> <strong><%= issue.status %></strong></span> </td>
+                               <td><%= issue.reports.count %></td>
+                               <td><%= issue.updated_at.strftime('%H:%M, %m/%d/%y') %></td>
+                               <td> <%= reportable_url(issue.reportable) %></td>
+                               <td><%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %></td>
+                               <td><b><%= link_to "Show Reports", issue %></b></td>
                        </tr>
                <% end %>
        </tbody>
                        </tr>
                <% end %>
        </tbody>
index e42ec19a627e101eb01dfca5d69f136d2ff04f39..ea01890cfbc4eed3680a66d48a4213248bc1a1c4 100644 (file)
@@ -11,8 +11,8 @@
                 <%= f.hidden_field :reported_user_id %>
             </div>
 
                 <%= f.hidden_field :reported_user_id %>
             </div>
 
-            <div class='form-row'>
-                <p>Select one (or more) reasons for your report:</p>
+            <div class='form-row' style='width:600px'>
+                <p><%= t('issues.new.select') %>:</p>
 
                 <% @report_strings_yaml.each do |k,v| %>
                     <div class="new-report-form">
 
                 <% @report_strings_yaml.each do |k,v| %>
                     <div class="new-report-form">
@@ -26,8 +26,7 @@
                     <br/>
                 <% end %> 
                 
                     <br/>
                 <% end %> 
                 
-                <label class="standard-label"><b><%= t 'issue.new.message' %>: </b></label> <br/>
-                <%= text_area :report, :details, :cols => 80, :rows => 20, placeholder: t('issues.new.details'), required: true %>
+                <%= text_area :report, :details, :cols => 20, :rows => 3, placeholder: t('issues.new.details'), required: true %>
             </div>
 
             <div class='buttons'>
             </div>
 
             <div class='buttons'>
index 29216de72e27ef128742bcb7ee46dbeb9442e4e2..bc8fde49c73c4ed4e276195fe36fc2d754d87ba5 100644 (file)
@@ -39,7 +39,7 @@
   <nav class='secondary'>
     <ul>
       <% if @user and ( @user.administrator? or @user.moderator? ) %>
   <nav class='secondary'>
     <ul>
       <% if @user and ( @user.administrator? or @user.moderator? ) %>
-        <li class="compact-hide <%= current_page_class(issues_path) %>"><%= link_to t('layouts.issues'), issues_path %></li>
+        <li class="compact-hide <%= current_page_class(issues_path) %>"><b><%= link_to t('layouts.reports'), issues_path %></b></li>
       <% end %>
       <li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
       <li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
       <% end %>
       <li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
       <li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
index 41d7b0064213c819b62fa66486cbed77a4d16767..c85ca5fd9a5c9b77585c30fe831a52ffdf3c300b 100644 (file)
@@ -81,9 +81,6 @@
               <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
             <% end %>
           </li>
               <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
             <% end %>
           </li>
-          <li>
-             <%= link_to t('user.view.report'), new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, reported_user_id: @this_user.id) %>
-          </li>
           <% if @this_user.blocks.exists? %>
             <li>
               <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
           <% if @this_user.blocks.exists? %>
             <li>
               <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
       </p>
     </div>
 
       </p>
     </div>
 
+    <% if @user and @this_user.id != @user.id %>
+      <div class="report-button">
+         <%= link_to new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, reported_user_id: @this_user.id), :title => t('user.view.report') do%>
+            <%= image_tag('notice.png', size: '10x10') %>
+         <% end %>
+      </div>
+    <% end %>
+
     <div class="user-description richtext"><%= @this_user.description.to_html %></div>
 
   </div>
     <div class="user-description richtext"><%= @this_user.description.to_html %></div>
 
   </div>
index ec8845b5b12feeb45c9d4dd1c43313e1582b86a4..2fc05a3654a799827bb523a4b1d34fec8398dafa 100644 (file)
@@ -145,7 +145,7 @@ en-GB:
         title_comment: Changeset %{id} - %{comment}
       join_discussion: Log in to join the discussion
       discussion: Discussion
         title_comment: Changeset %{id} - %{comment}
       join_discussion: Log in to join the discussion
       discussion: Discussion
-      report: Report this changeset
+      report: Report this changeset?
     node:
       title: 'Node: %{name}'
       history_title: 'Node History: %{name}'
     node:
       title: 'Node: %{name}'
       history_title: 'Node History: %{name}'
@@ -318,10 +318,12 @@ en-GB:
       edit_link: Edit this entry
       hide_link: Hide this entry
       confirm: Confirm
       edit_link: Edit this entry
       hide_link: Hide this entry
       confirm: Confirm
+      report: Report this entry?      
     diary_comment:
       comment_from: Comment from %{link_user} on %{comment_created_at}
       hide_link: Hide this comment
       confirm: Confirm
     diary_comment:
       comment_from: Comment from %{link_user} on %{comment_created_at}
       hide_link: Hide this comment
       confirm: Confirm
+      report: Report this comment?
     location:
       location: 'Location:'
       view: View
     location:
       location: 'Location:'
       view: View
@@ -954,6 +956,7 @@ en-GB:
       provide_details: Please provide the required details
     new:
       details: Please provide some more details into the problem. (This field cannot be left blank!)
       provide_details: Please provide the required details
     new:
       details: Please provide some more details into the problem. (This field cannot be left blank!)
+      select: Select a reason for your report
     show:
       comments:
         reassign: The Issue was reassigned
     show:
       comments:
         reassign: The Issue was reassigned
@@ -1058,7 +1061,7 @@ en-GB:
     edit: Edit
     history: History
     export: Export
     edit: Edit
     history: History
     export: Export
-    issues: Issues
+    reports: Reports
     data: Data
     export_data: Export Data
     gps_traces: GPS Traces
     data: Data
     export_data: Export Data
     gps_traces: GPS Traces
@@ -2080,7 +2083,7 @@ en-GB:
       friends_diaries: friends' diary entries
       nearby_changesets: nearby user changesets
       nearby_diaries: nearby user diary entries
       friends_diaries: friends' diary entries
       nearby_changesets: nearby user changesets
       nearby_diaries: nearby user diary entries
-      report: Report User
+      report: Report this user?
     popup:
       your location: Your location
       nearby mapper: Nearby mapper
     popup:
       your location: Your location
       nearby mapper: Nearby mapper
index b7a6a189580a9991f385fdf71cd4fab6f8ad53dc..ac4b97b8229cdf638a276c9650a04ba6b05415f9 100644 (file)
@@ -131,7 +131,7 @@ en:
         title_comment: "Changeset %{id} - %{comment}"
       join_discussion: "Log in to join the discussion"
       discussion: Discussion
         title_comment: "Changeset %{id} - %{comment}"
       join_discussion: "Log in to join the discussion"
       discussion: Discussion
-      report: Report this changeset
+      report: Report this changeset?
     node:
       title: "Node: %{name}"
       history_title: "Node History: %{name}"
     node:
       title: "Node: %{name}"
       history_title: "Node History: %{name}"
@@ -297,10 +297,12 @@ en:
       edit_link: Edit this entry
       hide_link: Hide this entry
       confirm: Confirm
       edit_link: Edit this entry
       hide_link: Hide this entry
       confirm: Confirm
+      report: Report this entry?
     diary_comment:
       comment_from: "Comment from %{link_user} on %{comment_created_at}"
       hide_link: Hide this comment
       confirm: Confirm
     diary_comment:
       comment_from: "Comment from %{link_user} on %{comment_created_at}"
       hide_link: Hide this comment
       confirm: Confirm
+      report: Report this comment?
     location:
       location: "Location:"
       view: "View"
     location:
       location: "Location:"
       view: "View"
@@ -924,6 +926,7 @@ en:
       provide_details: Please provide the required details
     new:
       details: Please provide some more details into the problem. (This field cannot be left blank!)
       provide_details: Please provide the required details
     new:
       details: Please provide some more details into the problem. (This field cannot be left blank!)
+      select: Select a reason for your report
     show: 
       comments:
         reassign: The Issue was reassigned
     show: 
       comments:
         reassign: The Issue was reassigned
@@ -1030,7 +1033,7 @@ en:
     edit: Edit
     history: History
     export: Export
     edit: Edit
     history: History
     export: Export
-    issues: Issues
+    reports: Reports
     data: Data
     export_data: Export Data
     gps_traces: GPS Traces
     data: Data
     export_data: Export Data
     gps_traces: GPS Traces
@@ -1999,7 +2002,7 @@ en:
       friends_diaries: "friends' diary entries"
       nearby_changesets: "nearby user changesets"
       nearby_diaries: "nearby user diary entries"
       friends_diaries: "friends' diary entries"
       nearby_changesets: "nearby user changesets"
       nearby_diaries: "nearby user diary entries"
-      report: "Report User"
+      report: "Report this user?"
     popup:
       your location: "Your location"
       nearby mapper: "Nearby mapper"
     popup:
       your location: "Your location"
       nearby mapper: "Nearby mapper"