]> git.openstreetmap.org Git - rails.git/commitdiff
Added helper + minor UI changes
authorShrey <shrey14099@iiitd.ac.in>
Fri, 14 Aug 2015 09:24:08 +0000 (14:54 +0530)
committerMatt Amos <zerebubuth@gmail.com>
Mon, 22 Aug 2016 15:18:15 +0000 (16:18 +0100)
(cherry picked from commit 3a6550ff54eb08ec282d13ebf85dc3461cca2983)

app/helpers/issues_helper.rb
app/views/issues/index.html.erb
app/views/issues/show.html.erb

index bcae2e224a9d62e3e2cc06c3fd8935a6718aafa9..92fe74ca7daaf62e81a48233af547e1ba0bef023 100644 (file)
@@ -89,4 +89,21 @@ module IssuesHelper
                end
                link_to title, params.merge(:sort => column, :direction => direction)
        end
                end
                link_to title, params.merge(:sort => column, :direction => direction)
        end
+
+       def report_type(report_class) 
+               case report_class
+               when "DiaryEntry"
+                       t('activerecord.models.diary_entry')
+               when "User"
+                       t('activerecord.models.user')
+               when "DiaryComment"
+                       t('activerecord.models.diary_comment')
+               when "Changeset"
+                       t('activerecord.models.changeset')
+               when "Note"
+                       t('activerecord.models.note')                           
+               else
+                       nil
+               end
+       end
 end
 end
index 12cd79b376459fb86af7b7f1efaa8df1ab3653b3..340f5ab9b81973b7d3a432e8eeb944cbeb994b5a 100644 (file)
        <thead>
                <tr>
                        <tr>
        <thead>
                <tr>
                        <tr>
-                               <td><b> <%= sortable("status") %></b></td>
-                               <td><b> <%= sortable("report_count", "Number of Reports") %></b></td>
-                               <td><b> <%= sortable("updated_at","Last updated at") %></b></td>
-                               <td><b> <%= sortable("updated_by","Last updated by") %></b></td>
-                               <td><b> Link to reports </b></td>
-                               <td><b> <%= sortable("reported_user_id","Reported User") %> </b></td>
-                               <td><b> Link to reported instance</b></td>
+                               <td style="width:40px;"><b> <%= sortable("status") %></b></td>
+                               <td style="width:160px;"><b> <%= sortable("report_count", "Number of Reports") %></b></td>
+                               <td style="width:141px;"><b> <%= sortable("updated_at","Last updated at") %></b></td>
+                               <td style="width:140px;"><b> <%= sortable("updated_by","Last updated by") %></b></td>
+                               <td style="width:203px;"><b> Link to reports </b></td>
+                               <td style="width:128px;"><b> <%= sortable("reported_user_id","Reported User") %> </b></td>
+                               <td style="width:67px;"><b> Link to reported instance</b></td>
                        </tr>
                </tr>
        </thead>
                        </tr>
                </tr>
        </thead>
@@ -33,7 +33,7 @@
                <% @issues.each do |issue| %>
                        <tr>
                                <td><%= issue.status.humanize %></td>
                <% @issues.each do |issue| %>
                        <tr>
                                <td><%= issue.status.humanize %></td>
-                               <td><%= issue.report_count %></td>
+                               <td style="text-align:center;"><%= issue.report_count %></td>
                                <td><%= l(issue.updated_at.to_datetime, :format => :friendly) %></td>
                                <td><% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %></td>
                                <td> <%= reports_url(issue) %></td>
                                <td><%= l(issue.updated_at.to_datetime, :format => :friendly) %></td>
                                <td><% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %></td>
                                <td> <%= reports_url(issue) %></td>
index 51e179da1de3770179ad6fa870d65fdb44f212d8..4611324f31e1047bfe63cd6c0c0d250c68683fb1 100644 (file)
@@ -1,6 +1,6 @@
 <% content_for :heading do %>
        <h2> <%= @issue.status.humanize %> Issue #<%= @issue.id %> <br/></h2>
 <% content_for :heading do %>
        <h2> <%= @issue.status.humanize %> Issue #<%= @issue.id %> <br/></h2>
-       <p><%= @issue.reportable_type %> : <%= reportable_url(@issue.reportable) %></p>
+       <p><%= report_type(@issue.reportable_type) %> : <%= reportable_url(@issue.reportable) %></p>
        <p class="deemphasize">
                <small>
                        <%= @issue.reports.count %> reports | First reported: <%= l @issue.created_at.to_datetime, :format => :friendly %>  <%= "| Last resolved at #{l(@issue.resolved_at.to_datetime, :format =>:friendly)}" if @issue.resolved_at? %> <%= "| Last updated at #{l(@issue.updated_at.to_datetime, :format => :friendly)} by #{@updated_by_admin.display_name}" if @updated_by_admin %>
        <p class="deemphasize">
                <small>
                        <%= @issue.reports.count %> reports | First reported: <%= l @issue.created_at.to_datetime, :format => :friendly %>  <%= "| Last resolved at #{l(@issue.resolved_at.to_datetime, :format =>:friendly)}" if @issue.resolved_at? %> <%= "| Last updated at #{l(@issue.updated_at.to_datetime, :format => :friendly)} by #{@updated_by_admin.display_name}" if @updated_by_admin %>