Notifier.new_issue_notification(User.find(admin.user_id)).deliver_now
end
end
- @report = @issue.reports.build(report_params)
- details = params[:report][:details].to_s + "||" + params[:spam].to_s + "||" + params[:offensive].to_s + "||" + params[:threat].to_s + "||" + params[:vandal].to_s + "||" + params[:other].to_s
- @report.reporter_user_id = @user.id
- @report.details = details
- if @issue.save!
- redirect_to root_path, notice: 'Your report has been registered sucessfully.'
+ if params[:report][:details] and (params[:spam] or params[:offensive] or params[:threat] or params[:vandal] or params[:other])
+ @report = @issue.reports.build(report_params)
+ details = params[:report][:details].to_s + "||" + params[:spam].to_s + "||" + params[:offensive].to_s + "||" + params[:threat].to_s + "||" + params[:vandal].to_s + "||" + params[:other].to_s
+ @report.reporter_user_id = @user.id
+ @report.details = details
+ if @issue.save!
+ redirect_to root_path, notice: t('issues.create.successful_report')
+ end
else
- render :new
+ redirect_to new_issue_path(reportable_type: @issue.reportable_type,reportable_id: @issue.reportable_id, reported_user_id: @issue.reported_user_id), notice: t('issues.create.provide_details')
end
end
def update
@issue = Issue.find_by(issue_params)
- @report = @issue.reports.where(reporter_user_id: @user.id).first
- details = params[:report][:details].to_s + "||" + params[:spam].to_s + "||" + params[:offensive].to_s + "||" + params[:threat].to_s + "||" + params[:vandal].to_s + "||" + params[:other].to_s
- @report.details = details
- if @report.save!
- redirect_to root_path, notice: 'Your report was successfully updated.'
+ if params[:report][:details] and (params[:spam] or params[:offensive] or params[:threat] or params[:vandal] or params[:other])
+ @report = @issue.reports.where(reporter_user_id: @user.id).first
+ details = params[:report][:details].to_s + "||" + params[:spam].to_s + "||" + params[:offensive].to_s + "||" + params[:threat].to_s + "||" + params[:vandal].to_s + "||" + params[:other].to_s
+ @report.details = details
+ if @report.save!
+ redirect_to root_path, notice: t('issues.update.successful_update')
+ end
else
- render :edit
+ redirect_to new_issue_path(reportable_type: @issue.reportable_type,reportable_id: @issue.reportable_id, reported_user_id: @issue.reported_user_id), notice: t('issues.update.provide_details')
end
end
def resolve
if @issue.resolve
@issue.save!
- redirect_to @issue, notice: "Issue status has been set to: 'Resolved'"
+ redirect_to @issue, notice: t('issues.resolved')
else
render :show
end
def ignore
if @issue.ignore
@issue.save!
- redirect_to @issue, notice: "Issue status has been set to: 'Ignored'"
+ redirect_to @issue, notice: t('issues.ignored')
else
render :show
end
def reopen
if @issue.reopen
@issue.save!
- redirect_to @issue, notice: "Issue status has been set to: 'Open'"
+ redirect_to @issue, notice: t('issues.reopened')
else
render :show
end
<%= 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 %>
<% if @user and diary_comment.user.id != @user.id %>
- <%= link_to 'Report', new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id) %>
+ <%= link_to t('issues.report'), new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id) %>
<% end %>
</div>
<li>
<% if @user and diary_entry.user.id != @user.id %>
- <%= link_to 'Report', new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id) %>
+ <%= link_to t('issues.report'), new_issue_url(reportable_id: diary_entry.id, reportable_type: diary_entry.class.name, reported_user_id: diary_entry.user.id) %>
<% end %>
</li>
<%= if_administrator(:li) do %>
<%= check_box_tag :spam, "[SPAM]" %>
</div>
<div class="new-report-string">
- <%= label_tag "This #{@issue.reportable.class.name} is/contains spam." %> <br/>
+ <%= label_tag "This #{@issue.reportable.class.name} " + t('issues.report_strings.spam') %> <br/>
</div>
</div>
<br/>
<%= check_box_tag :offensive, "[OFFENSIVE]" %>
</div>
<div class="new-report-string">
- <%= label_tag "This #{@issue.reportable.class.name} is obscene/offensive." %> <br/>
+ <%= label_tag "This #{@issue.reportable.class.name} " + t('issues.report_strings.offensive') %> <br/>
</div>
</div>
<br/>
<%= check_box_tag :threat, "[THREAT]" %>
</div>
<div class="new-report-string">
- <%= label_tag "This #{@issue.reportable.class.name} contains a threat." %> <br/>
+ <%= label_tag "This #{@issue.reportable.class.name} " + t('issues.report_strings.threat') %> <br/>
</div>
</div>
<br/>
<%= check_box_tag :vandal, "[VANDAL]" %>
</div>
<div class="new-report-string">
- <%= label_tag "This #{@issue.reportable.class.name} is a vandal." %> <br/>
+ <%= label_tag "This #{@issue.reportable.class.name} " + t('issues.report_strings.vandal') %> <br/>
</div>
</div>
<br/>
<%= check_box_tag :other, "[OTHER]" %>
</div>
<div class="new-report-string">
- <%= label_tag "Other." %> <br/>
+ <%= label_tag t('issues.report_strings.other') %> <br/>
</div>
</div>
<br/>
<label class="standard-label"><b><%= t 'issue.new.message' -%>: </b></label> <br/>
- <%= text_area :report, :details, :cols => 80, :rows => 20, placeholder: "Please provide some more details into the problem. (This field cannot be left blank!)" %>
+ <%= text_area :report, :details, :cols => 80, :rows => 20, placeholder: t('issues.new.details'), required: true %>
</div>
<div class='buttons'>
<%= @issue.reports.count %> reports | First reported: <%= l @issue.created_at.to_date, :format => :long %> <%= "| Last resolved at #{l(@issue.resolved_at.to_datetime, :format =>:long)}" if @issue.resolved_at? %>
</small>
</p>
- <p><%= link_to "Resolve", resolve_issue_url(@issue), :method => :post if @issue.may_resolve? %></p>
- <p><%= link_to "Ignore", ignore_issue_url(@issue), :method => :post if @issue.may_ignore? %></p>
- <p><%= link_to "Reopen", reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
+ <p><%= link_to t('issues.resolve'), resolve_issue_url(@issue), :method => :post if @issue.may_resolve? %></p>
+ <p><%= link_to t('issues.ignore'), ignore_issue_url(@issue), :method => :post if @issue.may_ignore? %></p>
+ <p><%= link_to t('issues.reopen'), reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
<% end %>
<div class="report-related-block">
</nav>
<nav class='secondary'>
<ul>
+ <% if @user and @user.administrator? %>
+ <li class="compact-hide <%= current_page_class(issues_path) %>"><%= link_to t('layouts.issues'), issues_path %></li>
+ <% end %>
<li class="compact-hide <%= current_page_class(traces_path) %>"><%= link_to t('layouts.gps_traces'), traces_path %></li>
<li class="compact-hide <%= current_page_class(diary_path) %>"><%= link_to t('layouts.user_diaries'), diary_path %></li>
<li class="compact-hide <%= current_page_class(copyright_path) %>"><%= link_to t('layouts.copyright'), copyright_path %></li>
<p><%= t("notifier.new_issue_notification.new_issue") %></p>
-
results:
no_results: No results found
more_results: More results
+ issues:
+ report: Report
+ resolve: Resolve
+ ignore: Ignore
+ reopen: Reopen
+ create:
+ successful_report: Your report has been registered sucessfully
+ provide_details: Please provide the required details
+ update:
+ successful_update: Your report was successfully updated
+ provide_details: Please provide the required details
+ new:
+ details: Please provide some more details into the problem. (This field cannot be left blank!)
+ resolved: Issue status has been set to 'Resolved'
+ ignored: Issue status has been set to 'Ignored'
+ reopened: Issue status has been set to 'Open'
+ report_strings:
+ spam: is/contains spam
+ offensive: is obscene/offensive
+ threat: contains a threat
+ vandal: is a vandal
+ other: Other
layouts:
project_name:
title: OpenStreetMap
edit: Edit
history: History
export: Export
+ issues: Issues
data: Data
export_data: Export Data
gps_traces: GPS Traces
new_issue_notification:
subject: "[OpenStreetMap] New Issue"
greeting: "Hi,"
- new_issue: "A new issue has been created:"
+ new_issue: "A new issue has been created"
message:
inbox:
title: Inbox
results:
no_results: "No results found"
more_results: "More results"
+ issues:
+ report: Report
+ resolve: Resolve
+ ignore: Ignore
+ reopen: Reopen
+ create:
+ successful_report: Your report has been registered sucessfully
+ provide_details: Please provide the required details
+ update:
+ successful_update: Your report was successfully updated
+ provide_details: Please provide the required details
+ new:
+ details: Please provide some more details into the problem. (This field cannot be left blank!)
+ resolved: Issue status has been set to 'Resolved'
+ ignored: Issue status has been set to 'Ignored'
+ reopened: Issue status has been set to 'Open'
+ report_strings:
+ spam: is/contains spam
+ offensive: is obscene/offensive
+ threat: contains a threat
+ vandal: is a vandal
+ other: Other
layouts:
project_name:
# in <title>
edit: Edit
history: History
export: Export
+ issues: Issues
data: Data
export_data: Export Data
gps_traces: GPS Traces
new_issue_notification:
subject: "[OpenStreetMap] New Issue"
greeting: "Hi,"
- new_issue: "A new issue has been created:"
+ new_issue: "A new issue has been created"
message:
inbox:
title: "Inbox"
assert_response :success
assert_difference "Issue.count",1 do
details = "Details of a report"
- post :create, { :report => { :deatils => details},
+ post :create, { :report => { :details => details},
:issue => { reportable_id: 1, reportable_type: "DiaryEntry", reported_user_id: 1} }
end
assert_response :redirect