From 206e1309a95b498a220d8de6cf4ed5970ebd6778 Mon Sep 17 00:00:00 2001 From: Shrey Date: Sat, 18 Jul 2015 20:27:03 +0530 Subject: [PATCH] Added report icon + changes to admin UI + changes to report form + few other minor changes --- app/assets/stylesheets/common.scss | 5 +++- app/helpers/issues_helper.rb | 2 +- app/views/browse/changeset.html.erb | 14 +++++++--- app/views/diary_entry/_diary_comment.html.erb | 14 +++++++--- app/views/diary_entry/_diary_entry.html.erb | 13 ++++++---- app/views/issues/index.html.erb | 26 +++++++++---------- app/views/issues/new.html.erb | 7 +++-- app/views/layouts/_header.html.erb | 2 +- app/views/user/view.html.erb | 11 +++++--- config/locales/en-GB.yml | 9 ++++--- config/locales/en.yml | 9 ++++--- 11 files changed, 69 insertions(+), 43 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 9a7785678..b77311307 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -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 diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 9ecb70e35..ac5bd59cd 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -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 diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 7e08ac3a8..86b17aba1 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -2,13 +2,23 @@

+ <% if @user and @user.id != @changeset.user.id %> +
+ <%= 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 %> +
+ <% end %> <%= t('browse.changeset.title', :id => @changeset.id) %>

+ +

<%= linkify(h(@changeset.tags['comment'].to_s.presence || t('browse.no_comment'))) %>

<%= changeset_details(@changeset) %>
+ <%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>

<%= t('browse.changeset.discussion') %>

@@ -129,10 +139,6 @@ <% end %>
- <% 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) %> - · - <% end %> <%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %> · <%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %> diff --git a/app/views/diary_entry/_diary_comment.html.erb b/app/views/diary_entry/_diary_comment.html.erb index c741d7734..8f98285d0 100644 --- a/app/views/diary_entry/_diary_comment.html.erb +++ b/app/views/diary_entry/_diary_comment.html.erb @@ -1,11 +1,17 @@
<%= user_thumbnail diary_comment.user %>

<%= 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}"))) %>

+ + <% if @user and diary_comment.user.id != @user.id %> +
+ <%= 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 %> +
+ <% end %> +
<%= diary_comment.body.to_html %>
<%= 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 %>
diff --git a/app/views/diary_entry/_diary_entry.html.erb b/app/views/diary_entry/_diary_entry.html.erb index 5a34bad5e..9af5586d3 100644 --- a/app/views/diary_entry/_diary_entry.html.erb +++ b/app/views/diary_entry/_diary_entry.html.erb @@ -6,6 +6,14 @@

<%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %>

+ <% if @user and diary_entry.user.id != @user.id %> +
+ <%= 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 %> +
+ <% end %> + <%= 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)) %> @@ -31,11 +39,6 @@ <%= 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 %> -
  • - <%= 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) %> -
  • - <% 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') } %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 4002e9db3..98fbbaa2d 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -15,26 +15,24 @@ - # - Issue Type - Status - Number of Reports - Link to instance - Reported User - + Status + Number of Reports + Last updated at + Link to instance + Reported User + <% @issues.each do |issue| %> - Issue #<%= issue.id %> - <%= issue.reportable_type %> - <%= issue.status %> - <%= issue.reports.count %> - <%= reportable_url(issue.reportable) %> - <%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %> - <%= link_to "Show Issue", issue %> + <%= issue.status %> + <%= issue.reports.count %> + <%= issue.updated_at.strftime('%H:%M, %m/%d/%y') %> + <%= reportable_url(issue.reportable) %> + <%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %> + <%= link_to "Show Reports", issue %> <% end %> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index e42ec19a6..ea01890cf 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -11,8 +11,8 @@ <%= f.hidden_field :reported_user_id %>
    -
    -

    Select one (or more) reasons for your report:

    +
    +

    <%= t('issues.new.select') %>:

    <% @report_strings_yaml.each do |k,v| %>
    @@ -26,8 +26,7 @@
    <% end %> -
    - <%= 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 %>
    diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 29216de72..bc8fde49c 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -39,7 +39,7 @@
    + <% if @user and @this_user.id != @user.id %> +
    + <%= 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 %> +
    + <% end %> +
    <%= @this_user.description.to_html %>
    diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index ec8845b5b..2fc05a365 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index b7a6a1895..ac4b97b82 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" -- 2.43.2