basic UI for reporting diary entries,diary entry comments and user profiles

This commit is contained in:
Shrey 2015-05-29 00:13:08 +05:30 committed by Matt Amos
parent 683722ed5c
commit bdc6adddbf
5 changed files with 11 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -3,6 +3,7 @@
<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="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') } %>
<%= 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) %>
</div>

View file

@ -6,9 +6,9 @@
<%= f.error_messages %>
<fieldset>
<div class='form-row'>
<%= 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 %>
</div>
<div class='form-row'>
<label class="standard-label"><%= t 'issue.new.message' -%></label>

View file

@ -81,7 +81,9 @@
<%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
<% end %>
</li>
<li>
<%= link_to 'Report', new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, 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 %>