From: Shrey Date: Thu, 28 May 2015 18:43:08 +0000 (+0530) Subject: basic UI for reporting diary entries,diary entry comments and user profiles X-Git-Tag: live~2937^2~153 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/bdc6adddbfdcc57bd300688f48b28e027e561728 basic UI for reporting diary entries,diary entry comments and user profiles --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index a00423a51..752bcd236 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -95,7 +95,7 @@ class IssuesController < ApplicationController end def issue_params - params.permit(:reportable_id, :reportable_type,:user_id) + params[:issue].permit(:reportable_id, :reportable_type,:user_id) end def report_params diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7e9e233df..109599be4 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -11,9 +11,9 @@ module IssuesHelper when "User" link_to reportable.display_name, :controller => reportable.class.name.underscore, :action => "view", - :display_name => reportable.diary_entry.user.display_name + :display_name => reportable.display_name when "DiaryComment" - link_to "#{reportable.diary_entry.title} Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore, + link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.id diff --git a/app/views/diary_entry/_diary_comment.html.erb b/app/views/diary_entry/_diary_comment.html.erb index c651c2943..46aab6103 100644 --- a/app/views/diary_entry/_diary_comment.html.erb +++ b/app/views/diary_entry/_diary_comment.html.erb @@ -3,6 +3,7 @@

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

<%= 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') } %> + <%= 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 %> + <%= link_to 'Report', new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, user_id: diary_comment.user.id) %> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 2a6cd66f9..2b26765b6 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -6,9 +6,9 @@ <%= f.error_messages %>
- <%= f.hidden_field :reportable_id, :value => params[:reportable_id] %> - <%= f.hidden_field :reportable_type, :value => params[:reportable_type] %> - <%= f.hidden_field :user_id, :value => params[:user_id] %> + <%= f.hidden_field :reportable_id %> + <%= f.hidden_field :reportable_type %> + <%= f.hidden_field :user_id %>
diff --git a/app/views/user/view.html.erb b/app/views/user/view.html.erb index f39bafec7..7a422700d 100644 --- a/app/views/user/view.html.erb +++ b/app/views/user/view.html.erb @@ -81,7 +81,9 @@ <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %> <% end %> - +
  • + <%= link_to 'Report', new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, user_id: @this_user.id) %> +
  • <% if @this_user.blocks.exists? %>
  • <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>