comment = @issue.comments.build(issue_comment_params)
comment.user = current_user
comment.save!
- notice = t("issues.comment.comment_created")
+ notice = t(".comment_created")
reassign_issue(@issue) if params[:reassign]
redirect_to @issue, :notice => notice
end
@issues = @issues.where(:reported_user_id => @find_user.id)
else
@issues = @issues.none
- flash.now[:warning] = t("issues.index.user_not_found")
+ flash.now[:warning] = t(".user_not_found")
end
end
def resolve
if @issue.resolve
@issue.save!
- redirect_to @issue, :notice => t("issues.resolved")
+ redirect_to @issue, :notice => t(".resolved")
else
render :show
end
if @issue.ignore
@issue.updated_by = current_user.id
@issue.save!
- redirect_to @issue, :notice => t("issues.ignored")
+ redirect_to @issue, :notice => t(".ignored")
else
render :show
end
if @issue.reopen
@issue.updated_by = current_user.id
@issue.save!
- redirect_to @issue, :notice => t("issues.reopened")
+ redirect_to @issue, :notice => t(".reopened")
else
render :show
end
@report = Report.new
@report.issue = Issue.find_or_initialize_by(create_new_report_params)
else
- redirect_to root_path, :notice => t("reports.new.missing_params")
+ redirect_to root_path, :notice => t(".missing_params")
end
end
if @report.save
@report.issue.save
@report.issue.reopen! unless @report.issue.open?
- redirect_to helpers.reportable_url(@report.issue.reportable), :notice => t("issues.create.successful_report")
+ redirect_to helpers.reportable_url(@report.issue.reportable), :notice => t(".successful_report")
else
- redirect_to new_report_path(:reportable_type => @report.issue.reportable_type, :reportable_id => @report.issue.reportable_id), :notice => t("issues.create.provide_details")
+ redirect_to new_report_path(:reportable_type => @report.issue.reportable_type, :reportable_id => @report.issue.reportable_id), :notice => t(".provide_details")
end
end
<div class="comment">
<%= form_for @new_comment, url: issue_comments_path(@issue) do |f| %>
<%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
- <%= label_tag :reassign, t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %>
+ <%= label_tag :reassign, t('.reassign_param') %> <%= check_box_tag :reassign, true %>
<br/>
<br/>
<%= submit_tag 'Submit' %>
<%= form_tag(issues_path, :method => :get) do %>
<p><%= t ".search_guidance" %></p>
-<%= select_tag :status, options_for_select(Issue.aasm.states.map(&:name).map{|state| [t("issues.states.#{state}"), state]}, params[:status]), :include_blank => t(".select_status"), :data => { :behavior => 'category_dropdown' } %>
+<%= select_tag :status, options_for_select(Issue.aasm.states.map(&:name).map{|state| [t(".states.#{state}"), state]}, params[:status]), :include_blank => t(".select_status"), :data => { :behavior => 'category_dropdown' } %>
<%= select_tag :issue_type, options_for_select(@issue_types, params[:issue_type]), :include_blank => t(".select_type"), :data => { :behavior => 'category_dropdown' } %>
<%= text_field_tag :search_by_user, params[:search_by_user], placeholder: t(".reported_user") %>
<%= select_tag :last_updated_by, options_for_select(@users.all.collect{|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], params[:last_updated_by]), :include_blank => t(".select_last_updated_by"), :data => { :behavior => 'category_dropdown' } %>
<tbody>
<% @issues.each do |issue| %>
<tr>
- <td><%= t "issues.states.#{issue.status}" %></td>
+ <td><%= t ".states.#{issue.status}" %></td>
<td><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
<td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
<td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user.display_name) if issue.reported_user %></td>
</small>
</p>
<p>
- <%= link_to t('issues.resolve'), resolve_issue_url(@issue), :method => :post if @issue.may_resolve? %>
+ <%= link_to t('.resolve'), resolve_issue_url(@issue), :method => :post if @issue.may_resolve? %>
<% if @issue.may_ignore? %>
- | <%= link_to t('issues.ignore'), ignore_issue_url(@issue), :method => :post %>
+ | <%= link_to t('.ignore'), ignore_issue_url(@issue), :method => :post %>
<% end %>
</p>
-<p><%= link_to t('issues.reopen'), reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
+<p><%= link_to t('.reopen'), reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
<% end %>
<div class="report-related-block">
<% end %>
<div class="report-disclaimer">
- <%= t('issues.new.disclaimer.intro') %>
+ <%= t('.disclaimer.intro') %>
<ul>
- <li> <%= t('issues.new.disclaimer.not_just_mistake') %> </li>
- <li> <%= t('issues.new.disclaimer.unable_to_fix') %> </li>
- <li> <%= t('issues.new.disclaimer.resolve_with_user') %> </li>
+ <li> <%= t('.disclaimer.not_just_mistake') %> </li>
+ <li> <%= t('.disclaimer.unable_to_fix') %> </li>
+ <li> <%= t('.disclaimer.resolve_with_user') %> </li>
</ul>
</div>
<% end %>
<div class='form-row'>
- <p><%= t('issues.new.select') %></p>
+ <p><%= t('.select') %></p>
<ul>
<% Report.categories_for(@report.issue.reportable).each do |c| %>
<li>
<%= radio_button :report, :category, c %>
- <%= label_tag "report_category_#{c}", t("reports.categories.#{@report.issue.reportable.class.name.underscore}.#{c}") %> <br/>
+ <%= label_tag "report_category_#{c}", t(".categories.#{@report.issue.reportable.class.name.underscore}.#{c}") %> <br/>
</li>
<% end %>
</ul>
</div>
<div class='form-row'>
- <%= text_area :report, :details, :cols => 20, :rows => 5, placeholder: t('issues.new.details'), required: true %>
+ <%= text_area :report, :details, :cols => 20, :rows => 5, placeholder: t('.details'), required: true %>
</div>
<div class='buttons'>
no_results: "No results found"
more_results: "More results"
issues:
- report: Report
- resolve: Resolve
- ignore: Ignore
- reopen: Reopen
index:
title: Issues
select_status: Select Status
one: "1 Report"
other: "%{count} Reports"
reported_item: Reported Item
- create:
- successful_report: Your report has been registered sucessfully
- provide_details: Please provide the required details
+ states:
+ ignored: Ignored
+ open: Open
+ resolved: Resolved
update:
new_report: Your report has been registered sucessfully
successful_update: Your report has been updated successfully
provide_details: Please provide the required details
- new:
- details: Please provide some more details about the problem (required).
- select: "Select a reason for your report:"
- disclaimer:
- intro: "Before sending your report to the site moderators, please ensure that:"
- not_just_mistake: You are certain that the problem is not just a mistake
- unable_to_fix: You are unable to fix the problem yourself or with the help of your fellow community members
- resolve_with_user: You have already tried to resolve the problem with the user concerned
show:
title: "%{status} Issue #%{issue_id}"
reports:
report_created_at: "First reported at %{datetime}"
last_resolved_at: "Last resolved at %{datetime}"
last_updated_at: "Last updated at %{datetime} by %{displayname}"
+ resolve: Resolve
+ ignore: Ignore
+ reopen: Reopen
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
+ resolve:
+ resolved: Issue status has been set to 'Resolved'
+ ignore:
+ ignored: Issue status has been set to 'Ignored'
+ reopen:
+ reopened: Issue status has been set to 'Open'
comments:
created_at: "On %{datetime}"
+ reassign_param: Reassign Issue?
reports:
updated_at: "On %{datetime}"
reported_by_html: "Reported as %{category} by %{user}"
- resolved: Issue status has been set to 'Resolved'
- ignored: Issue status has been set to 'Ignored'
- reopened: Issue status has been set to 'Open'
- states:
- ignored: Ignored
- open: Open
- resolved: Resolved
+ issue_comments:
+ create:
+ comment_created: Your comment was successfully created
reports:
new:
title_html: "Report %{link}"
missing_params: "Cannot create a new report"
- categories:
- diary_entry:
- spam: This diary entry is/contains spam
- offensive: This diary entry is obscene/offensive
- threat: This diary entry contains a threat
- other: Other
- diary_comment:
- spam: This diary comment is/contains spam
- offensive: This diary comment is obscene/offensive
- threat: This diary comment contains a threat
- other: Other
- user:
- spam: This user profile is/contains spam
- offensive: This user profile is obscene/offensive
- threat: This user profile contains a threat
- vandal: This user is a vandal
- other: Other
- note:
- spam: This note is spam
- personal: This note contains personal data
- abusive: This note is abusive
- other: Other
+ details: Please provide some more details about the problem (required).
+ select: "Select a reason for your report:"
+ disclaimer:
+ intro: "Before sending your report to the site moderators, please ensure that:"
+ not_just_mistake: You are certain that the problem is not just a mistake
+ unable_to_fix: You are unable to fix the problem yourself or with the help of your fellow community members
+ resolve_with_user: You have already tried to resolve the problem with the user concerned
+ categories:
+ diary_entry:
+ spam: This diary entry is/contains spam
+ offensive: This diary entry is obscene/offensive
+ threat: This diary entry contains a threat
+ other: Other
+ diary_comment:
+ spam: This diary comment is/contains spam
+ offensive: This diary comment is obscene/offensive
+ threat: This diary comment contains a threat
+ other: Other
+ user:
+ spam: This user profile is/contains spam
+ offensive: This user profile is obscene/offensive
+ threat: This user profile contains a threat
+ vandal: This user is a vandal
+ other: Other
+ note:
+ spam: This note is spam
+ personal: This note contains personal data
+ abusive: This note is abusive
+ other: Other
+ create:
+ successful_report: Your report has been registered sucessfully
+ provide_details: Please provide the required details
layouts:
project_name:
# in <title>
sign_in_as(create(:moderator_user))
visit issues_path
- assert page.has_content?(I18n.t(".issues.index.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.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.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.issues_not_found"))
+ assert !page.has_content?(I18n.t("issues.index.issues_not_found"))
end
def test_commenting
fill_in :issue_comment_body, :with => "test comment"
click_on "Submit"
- assert page.has_content?(I18n.t(".issues.comment.comment_created"))
+ assert page.has_content?(I18n.t("issue_comments.create.comment_created"))
assert page.has_content?("test comment")
issue.reload
visit issues_path
- assert page.has_link?(I18n.t(".issues.index.reports_count", :count => issue1.reports_count), :href => issue_path(issue1))
- assert page.has_link?(I18n.t(".issues.index.reports_count", :count => issue2.reports_count), :href => issue_path(issue2))
+ assert page.has_link?(I18n.t("issues.index.reports_count", :count => issue1.reports_count), :href => issue_path(issue1))
+ assert page.has_link?(I18n.t("issues.index.reports_count", :count => issue2.reports_count), :href => issue_path(issue2))
end
end
click_on I18n.t("diary_entry.diary_comment.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.diary_comment.spam")
+ choose I18n.t("reports.new.categories.diary_comment.spam")
fill_in "report_details", :with => "This comment is spam"
click_on "Create Report"
click_on I18n.t("diary_entry.diary_entry.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.diary_entry.spam")
+ choose I18n.t("reports.new.categories.diary_entry.spam")
fill_in "report_details", :with => "This is advertising"
click_on "Create Report"
click_on I18n.t("diary_entry.diary_entry.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.diary_entry.spam")
+ choose I18n.t("reports.new.categories.diary_entry.spam")
fill_in "report_details", :with => "This is advertising"
click_on "Create Report"
click_on I18n.t("browse.note.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.note.spam")
+ choose I18n.t("reports.new.categories.note.spam")
fill_in "report_details", :with => "This is spam"
click_on "Create Report"
click_on I18n.t("browse.note.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.note.spam")
+ choose I18n.t("reports.new.categories.note.spam")
fill_in "report_details", :with => "This is spam"
click_on "Create Report"
click_on I18n.t("user.view.report")
assert page.has_content? "Report"
- assert page.has_content? I18n.t("issues.new.disclaimer.intro")
+ assert page.has_content? I18n.t("reports.new.disclaimer.intro")
- choose I18n.t("reports.categories.user.vandal")
+ choose I18n.t("reports.new.categories.user.vandal")
fill_in "report_details", :with => "This user is a vandal"
click_on "Create Report"