]> git.openstreetmap.org Git - rails.git/commitdiff
basic UI for reporting diary entries,diary entry comments and user profiles
authorShrey <shrey14099@iiitd.ac.in>
Thu, 28 May 2015 18:43:08 +0000 (00:13 +0530)
committerMatt Amos <zerebubuth@gmail.com>
Mon, 22 Aug 2016 15:15:12 +0000 (16:15 +0100)
app/controllers/issues_controller.rb
app/helpers/issues_helper.rb
app/views/diary_entry/_diary_comment.html.erb
app/views/issues/new.html.erb
app/views/user/view.html.erb

index a00423a51680d8a9c4e0f56402abc009311a686b..752bcd236c4523b9c4244cf13bc738fcf75b53c3 100644 (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
index 7e9e233df064eea7faf89bf64759ed250a7340ea..109599be4d7a9ccb4291f4f20ac08621ca5a8d40 100644 (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
index c651c294304e3e6805009ad3a38b69ab5f468839..46aab61034c8ee06e2ba9c3f579efa16ce560b34 100644 (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>
index 2a6cd66f943bb8826e33e85a0871234784e3034b..2b26765b6345b1291011bfb8e7d32c4c6e5b2bce 100644 (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>
index f39bafec7392b0f952ca3c5c47f7e304b95c0378..7a422700d288bf3b918973cef1403f13ac0fddfc 100644 (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 %>