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 9a77856..b773113 100644 (file)
@@ -2776,6 +2776,9 @@ input.richtext_title[type="text"] {
 }
 
 .new-report-string {
-  text-align:center;
   font-size:15px;
+}
+
+.report-button {
+  float:right;
 }
\ No newline at end of file
index 9ecb70e..ac5bd59 100644 (file)
@@ -19,7 +19,7 @@ module IssuesHelper
                                                                                                                :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
index 7e08ac3..86b17ab 100644 (file)
@@ -2,13 +2,23 @@
 
 <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>
 
+
+
 <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>
 <% 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") %>
index c741d77..8f98285 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>
+  
+  <% 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 %>
-    <%= 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>
index 5a34bad..9af5586 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>
 
+    <% 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>
       <%= 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') } %>
index 4002e9d..98fbbaa 100644 (file)
        <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>
-                               <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>
index e42ec19..ea01890 100644 (file)
@@ -11,8 +11,8 @@
                 <%= 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">
@@ -26,8 +26,7 @@
                     <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'>
index 29216de..bc8fde4 100644 (file)
@@ -39,7 +39,7 @@
   <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>
index 41d7b00..c85ca5f 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>
-          <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 %>
       </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>
index ec8845b..2fc05a3 100644 (file)
@@ -145,7 +145,7 @@ en-GB:
         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}'
@@ -318,10 +318,12 @@ en-GB:
       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
+      report: Report this comment?
     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!)
+      select: Select a reason for your report
     show:
       comments:
         reassign: The Issue was reassigned
@@ -1058,7 +1061,7 @@ en-GB:
     edit: Edit
     history: History
     export: Export
-    issues: Issues
+    reports: Reports
     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
-      report: Report User
+      report: Report this user?
     popup:
       your location: Your location
       nearby mapper: Nearby mapper
index b7a6a18..ac4b97b 100644 (file)
@@ -131,7 +131,7 @@ en:
         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}"
@@ -297,10 +297,12 @@ en:
       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
+      report: Report this comment?
     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!)
+      select: Select a reason for your report
     show: 
       comments:
         reassign: The Issue was reassigned
@@ -1030,7 +1033,7 @@ en:
     edit: Edit
     history: History
     export: Export
-    issues: Issues
+    reports: Reports
     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"
-      report: "Report User"
+      report: "Report this user?"
     popup:
       your location: "Your location"
       nearby mapper: "Nearby mapper"