before_action :find_issue, :only => [:show, :resolve, :reopen, :ignore]
def index
+ @title = t ".title"
+
if current_user.moderator?
@issue_types = @moderator_issues
@users = User.joins(:roles).where(:user_roles => { :role => "moderator" })
if @find_user
@issues = @issues.where(:reported_user_id => @find_user.id)
else
- notice = t("issues.index.search.user_not_found")
+ notice = t("issues.index.user_not_found")
end
end
<%= comment.body %>
</div>
<span class="deemphasize">
- On <%= l comment.created_at.to_datetime, :format => :friendly %>
+ <%= t(".created_at", :datetime => l(comment.created_at.to_datetime, :format => :friendly)) %>
</span>
<hr>
<% end %>
<div style="float:left">
<%= link_to user_thumbnail(report.user), :controller => :user, :action =>:view, :display_name => report.user.display_name %>
</div>
- Reported by <b><%= link_to report.user.display_name, :controller => :user, :action =>:view, :display_name => report.user.display_name %></b> <br/>
+ <%= t(".reported_by_html", :user_name => report.user.display_name, :user_url => url_for(:controller => :user, :action => :view, :display_name => report.user.display_name)) %> <br/>
<span class="deemphasize">
- On <%= l report.updated_at.to_datetime, :format => :friendly %>
+ <%= t(".updated_at", :datetime => l(report.updated_at.to_datetime, :format => :friendly)) %>
</span>
<br/>
<span class="deemphasize">
- Category: <%= report.category %>
+ <%= t ".category", category: report.category %>
</span>
<br/>
<%= report.details %>
<% content_for :heading do %>
- <h1>List of issues:</h1>
+ <h1><%= t ".title" %></h1>
<% end %>
<%= form_tag(issues_path, :method => :get) do %>
-Search for a particular issue(s): <br/>
-<%= select :status, nil, [['open', 0],['resolved',2],['ignored',1]],{:include_blank => "Select status"},data: { behavior: 'category_dropdown' } %>
-<%= select :issue_type, nil, @issue_types,{:include_blank => "Select type"}, data: { behavior: 'category_dropdown' } %>
-<%= text_field_tag :search_by_user, params[:search_by_user], placeholder: "Reported User" %>
-<%= select :last_reported_by, nil, @users.all.collect {|f| [f.display_name, f.id]} << ['Not updated',"nil"], {:include_blank => "Select last updated by"}, data: { behavior: 'category_dropdown' } %>
-<%= submit_tag "Search" %>
+<p><%= t ".search_guidance" %></p>
+<%= select :status, nil, [['open', 0], ['resolved', 2], ['ignored', 1]], { :include_blank => t(".select_status")}, data: { behavior: 'category_dropdown' } %>
+<%= select :issue_type, nil, @issue_types, { :include_blank => t(".select_type")}, data: { behavior: 'category_dropdown' } %>
+<%= text_field_tag :search_by_user, params[:search_by_user], placeholder: t(".reported_user") %>
+<%= select :last_reported_by, nil, @users.all.collect {|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], { :include_blank => t(".select_last_updated_by")}, data: { behavior: 'category_dropdown' } %>
+<%= submit_tag t(".search") %>
<% end %>
<br/>
<% if @issues.length == 0 %>
- <p><%= t ".search.issues_not_found" %></p>
+ <p><%= t ".issues_not_found" %></p>
<% end %>
<br/>
<table>
<thead>
<tr>
- <td><b>Status</b></td>
- <td><b>Number of Reports</b></td>
- <td><b>Last updated at</b></td>
- <td><b>Last updated by</b></td>
- <td><b>Link to reports</b></td>
- <td><b>Reported User</b></td>
- <td><b>Link to reported instance</b></td>
+ <td><b><%= t ".status" %></b></td>
+ <td><b><%= t ".number_of_reports" %></b></td>
+ <td><b><%= t ".last_updated_at" %></b></td>
+ <td><b><%= t ".last_updated_by" %></b></td>
+ <td><b><%= t ".link_to_reports" %></b></td>
+ <td><b><%= t ".reported_user" %></b></td>
+ <td><b><%= t ".link_to_reported_instance" %></b></td>
</tr>
</thead>
<tbody>
<% content_for :heading do %>
-<h2> <%= @issue.status.humanize %> Issue #<%= @issue.id %> <br/></h2>
+<h2><%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %></h2>
<p><%= report_type(@issue.reportable_type) %> : <%= reportable_url(@issue.reportable) %></p>
<p class="deemphasize">
<small>
<%= @issue.assigned_role %>
- | <%= @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 #{@issue.user_updated.display_name}" if @issue.user_updated %>
+ | <%= t ".reports", :count => @issue.reports.count %>
+ | <%= t ".report_created_at", :datetime => l(@issue.created_at.to_datetime, :format => :friendly) %>
+ <%= " | " + t(".last_resolved_at", :datetime => l(@issue.resolved_at.to_datetime, :format =>:friendly)) if @issue.resolved_at? %>
+ <%= " | " + t(".last_updated_at", :datetime => l(@issue.updated_at.to_datetime, :format => :friendly), :displayname => @issue.user_updated.display_name ) if @issue.user_updated %>
</small>
</p>
<p>
<div class="report-related-block">
<div class="report-block">
- <h3>Reports under this issue:</h3>
+ <h3><%= t ".reports_of_this_issue" %></h3>
<% if @read_reports.present? %>
<div class="read-reports">
- <h4>Read Reports:</h4>
- <br/>
- <%= render 'reports',reports: @read_reports %>
+ <h4><%= t ".read_reports" %></h4>
+ <%= render 'reports', reports: @read_reports %>
</div>
<% end %>
<% if @unread_reports.any? %>
<div class="unread-reports">
- <h4>New Reports:</h4>
- <br/>
- <%= render 'reports',reports: @unread_reports %>
+ <h4><%= t ".new_reports" %></h4>
+ <%= render 'reports', reports: @unread_reports %>
</div>
<% end %>
<br/>
</div>
<div class="related-block">
- <h3> Other issues against this user: </h3>
+ <h3><%= t ".other_issues_against_this_user" %></h3>
<div class="unread-reports">
<% if @related_issues.count > 1 %>
<% @related_issues.each do |issue| %>
<% end %>
<% end %>
<% else %>
- <p>No other reports against this user!</p>
+ <p><%= t ".no_other_issues" %></p>
<% end %>
</div>
</div>
</div>
-<h3>Comments on this issue:</h3>
+<h3><%= t ".comments_on_this_issue" %></h3>
<div class="unread-reports">
<%= render 'comments', comments: @comments %>
</div>
<% content_for :heading do %>
- <h1>Report <%= reportable_url(@report.issue.reportable) %></h1>
+ <h1><%= t ".title_html", :link => reportable_url(@report.issue.reportable) %></h1>
<% end %>
<div class="disclaimer">
ignore: Ignore
reopen: Reopen
index:
- search:
- user_not_found: User does not exist
- issues_not_found: No such issues found
+ title: Issues
+ select_status: Select Status
+ select_type: Select Type
+ select_last_updated_by: Select Last Updated By
+ reported_user: Reported User
+ not_updated: Not Updated
+ search: Search
+ search_guidance: "Search Issues:"
+ user_not_found: User does not exist
+ issues_not_found: No such issues found
+ status: Status
+ number_of_reports: Number of Reports
+ last_updated_at: Last Updated At
+ last_updated_by: Last Updated By
+ link_to_reports: Link to Reports
+ reported_user: Reported User
+ link_to_reported_instance: Link to Reported Instance
create:
successful_report: Your report has been registered sucessfully
provide_details: Please provide the required details
unable_to_fix: You are unable to fix the problem yourself
resolve_with_user: You have tried to resolve the problem with the user
show:
+ title: "%{status} Issue #%{issue_id}"
+ reports:
+ zero: No reports
+ one: 1 report
+ other: "%{count} reports"
+ report_created_at: "First reported at %{datetime}"
+ last_resolved_at: "Last resolved at %{datetime}"
+ last_updated_at: "Last updated at %{datetime} by %{displayname}"
+ reports_of_this_issue: Reports of this Issue
+ read_reports: Read Reports
+ new_reports: New Reports
+ other_issues_against_this_user: Other issues against this user
+ no_other_issues: No other issues against this user.
+ comments_on_this_issue: Comments on this issue
comments:
reassign_param: Reassign Issue?
comment:
provide_details: Please provide the required details
comment_created: Your comment was successfully created
+ comments:
+ created_at: "On %{datetime}"
+ reports:
+ category: "Category: %{category}"
+ updated_at: "On %{datetime}"
+ reported_by_html: "Reported by <a href=\"%{user_url}\">%{user_name}</a>"
resolved: Issue status has been set to 'Resolved'
ignored: Issue status has been set to 'Ignored'
reopened: Issue status has been set to 'Open'
reports:
+ new:
+ title_html: "Report %{link}"
categories:
DiaryEntry:
spam: This Diary Entry is/contains spam
sign_in_as(create(:moderator_user))
visit issues_path
- assert page.has_content?(I18n.t(".issues.index.search.issues_not_found"))
+ assert page.has_content?(I18n.t(".issues.index.issues_not_found"))
end
def test_view_issues
visit issues_path
fill_in "search_by_user", :with => good_user.display_name
click_on "Search"
- assert page.has_content?(I18n.t(".issues.index.search.issues_not_found"))
+ assert page.has_content?(I18n.t(".issues.index.issues_not_found"))
# User doesn't exist
visit issues_path
fill_in "search_by_user", :with => "Nonexistant User"
click_on "Search"
- assert page.has_content?(I18n.t(".issues.index.search.user_not_found"))
+ assert page.has_content?(I18n.t(".issues.index.user_not_found"))
# Find Issue against bad_user
visit issues_path
fill_in "search_by_user", :with => bad_user.display_name
click_on "Search"
- assert !page.has_content?(I18n.t(".issues.index.search.issues_not_found"))
+ assert !page.has_content?(I18n.t(".issues.index.issues_not_found"))
end
def test_commenting