More whitespace fixes. Attempting to get tests to pass.
This commit is contained in:
parent
757a1aaa85
commit
c3ad6aa292
13 changed files with 419 additions and 387 deletions
|
@ -69,7 +69,6 @@ class IssuesController < ApplicationController
|
|||
@issue = Issue.find_or_initialize_by(create_new_issue_params)
|
||||
path = "issues.report_strings." + @issue.reportable.class.name.to_s
|
||||
@report_strings_yaml = t(path)
|
||||
flash[:referer] = params[:referer]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -106,7 +105,7 @@ class IssuesController < ApplicationController
|
|||
Notifier.new_issue_notification(@issue.id, User.find(user.user_id)).deliver_now
|
||||
end
|
||||
|
||||
redirect_to flash[:referer], :notice => t("issues.create.successful_report")
|
||||
redirect_back "/", :notice => t("issues.create.successful_report")
|
||||
end
|
||||
else
|
||||
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")
|
||||
|
@ -140,7 +139,7 @@ class IssuesController < ApplicationController
|
|||
if @report.save!
|
||||
@issue.report_count = @issue.reports.count
|
||||
@issue.save!
|
||||
redirect_to flash[:referer], :notice => notice
|
||||
redirect_back "/", :notice => notice
|
||||
end
|
||||
else
|
||||
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")
|
||||
|
@ -272,4 +271,13 @@ class IssuesController < ApplicationController
|
|||
def sort_direction
|
||||
%w(asc desc).include?(params[:direction]) ? params[:direction] : "asc"
|
||||
end
|
||||
|
||||
# back-port of ActionController#redirect_back from rails 5
|
||||
def redirect_back(fallback_location, **args)
|
||||
if referer = request.headers["Referer"]
|
||||
redirect_to referer, **args
|
||||
else
|
||||
redirect_to fallback_location, **args
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<h2>
|
||||
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
|
||||
<%= t "browse.note.#{@note.status}_title", :note_name => @note.id %>
|
||||
<% if @user and @user.id!=@note.author.id %>
|
||||
<% if @user && @note.author && @user.id != @note.author.id %>
|
||||
<%= link_to new_issue_url(reportable_id: @note.id, reportable_type: @note.class.name, reported_user_id: @note.author.id,referer: request.fullpath), :title => t('browse.note.report') do %>
|
||||
⚐
|
||||
<% end %>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<%= user_thumbnail diary_comment.user %>
|
||||
<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}"))) %>
|
||||
<% if @user and diary_comment.user.id != @user.id %>
|
||||
<%= link_to new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id, referer: request.fullpath), :title => t('diary_entry.diary_comment.report') do %>
|
||||
<%= link_to new_issue_url(reportable_id: diary_comment.id, reportable_type: diary_comment.class.name, reported_user_id: diary_comment.user.id, referer: request.fullpath), :title => t('diary_entry.diary_comment.report') do %>
|
||||
⚐
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</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') } %>
|
||||
|
|
|
@ -1,29 +1,30 @@
|
|||
<div class="issue-comments">
|
||||
<% comments.each do |comment| %>
|
||||
<div class="comment">
|
||||
<div style="float:left">
|
||||
<%= link_to user_thumbnail(comment.user), :controller => :user,:action =>:view, :display_name => comment.user.display_name %>
|
||||
</div>
|
||||
<b> <%= link_to comment.user.display_name, :controller => :user,:action =>:view, :display_name => comment.user.display_name %> </b> <br/>
|
||||
<%= comment.body %>
|
||||
<% comments.each do |comment| %>
|
||||
<div class="comment">
|
||||
<div style="float:left">
|
||||
<%= link_to user_thumbnail(comment.user), :controller => :user,:action =>:view, :display_name => comment.user.display_name %>
|
||||
</div>
|
||||
<b> <%= link_to comment.user.display_name, :controller => :user,:action =>:view, :display_name => comment.user.display_name %> </b> <br/>
|
||||
<%= comment.body %>
|
||||
|
||||
<% if comment.reassign %>
|
||||
<br/>
|
||||
<i><%= t('issues.show.comments.reassign') %></i>
|
||||
<% end %>
|
||||
</div>
|
||||
<span class="deemphasize">
|
||||
On <%= l comment.created_at.to_datetime, :format => :friendly %> </span>
|
||||
<hr>
|
||||
<% end %>
|
||||
<% if comment.reassign %>
|
||||
<br/>
|
||||
<i><%= t('issues.show.comments.reassign') %></i>
|
||||
<% end %>
|
||||
</div>
|
||||
<span class="deemphasize">
|
||||
On <%= l comment.created_at.to_datetime, :format => :friendly %>
|
||||
</span>
|
||||
<hr>
|
||||
<% end %>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="comment">
|
||||
<%= form_for :issue_comment, :url => { :action => 'comment', :id => @issue.id, :user_id => @user.id } do |f| %>
|
||||
<%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
|
||||
<%= label_tag t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %>
|
||||
<br/>
|
||||
<br/>
|
||||
<%= submit_tag 'Submit' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_for :issue_comment, :url => { :action => 'comment', :id => @issue.id, :user_id => @user.id } do |f| %>
|
||||
<%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
|
||||
<%= label_tag t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %>
|
||||
<br/>
|
||||
<br/>
|
||||
<%= submit_tag 'Submit' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<% reports.each do |report| %>
|
||||
<% details = report.details.split("--||--") %>
|
||||
<div class="reports">
|
||||
<div style="float:left">
|
||||
<%= link_to user_thumbnail(report.user), :controller => :user,:action =>:view, :display_name => report.user.display_name %>
|
||||
</div>
|
||||
Reported as <b><%= details[1].delete('[').delete(']').downcase %></b> by <b><%= link_to report.user.display_name, :controller => :user,:action =>:view, :display_name => report.user.display_name %></b> <br/>
|
||||
<span class="deemphasize">
|
||||
On <%= l report.updated_at.to_datetime, :format => :friendly %>
|
||||
</span>
|
||||
<br/>
|
||||
<%= details[0] %>
|
||||
<br/>
|
||||
</div>
|
||||
<hr>
|
||||
<% details = report.details.split("--||--") %>
|
||||
<div class="reports">
|
||||
<div style="float:left">
|
||||
<%= link_to user_thumbnail(report.user), :controller => :user,:action =>:view, :display_name => report.user.display_name %>
|
||||
</div>
|
||||
Reported as <b><%= details[1].delete('[').delete(']').downcase %></b> by <b><%= link_to report.user.display_name, :controller => :user,:action =>:view, :display_name => report.user.display_name %></b> <br/>
|
||||
<span class="deemphasize">
|
||||
On <%= l report.updated_at.to_datetime, :format => :friendly %>
|
||||
</span>
|
||||
<br/>
|
||||
<%= details[0] %>
|
||||
<br/>
|
||||
</div>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
|
|
@ -1,47 +1,43 @@
|
|||
<p id= "notice"><%= notice %></p>
|
||||
|
||||
<% content_for :heading do %>
|
||||
<h1>List of <%= @user_role %> issues:</h1>
|
||||
<h1>List of <%= @user_role %> issues:</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" %>
|
||||
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" %>
|
||||
<% end %>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<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>
|
||||
<tbody>
|
||||
<% @issues.each do |issue| %>
|
||||
<tr>
|
||||
<td><%= issue.status.humanize %></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><%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %></td>
|
||||
<td><%= instance_url(issue.reportable) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @issues.each do |issue| %>
|
||||
<tr>
|
||||
<td><%= issue.status.humanize %></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><%= link_to issue.user.display_name , :controller => :user, :action => :view,:display_name => issue.user.display_name %></td>
|
||||
<td><%= instance_url(issue.reportable) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
|
|
@ -1,44 +1,43 @@
|
|||
<% content_for :heading do %>
|
||||
<h1>Report <%= reportable_url(@issue.reportable) %></h1>
|
||||
<h1>Report <%= reportable_url(@issue.reportable) %></h1>
|
||||
<% end %>
|
||||
|
||||
<div class="disclaimer">
|
||||
<ul>
|
||||
<ul>
|
||||
<%= t('issues.new.disclaimer.intro') %>:
|
||||
<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('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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%= form_for(@issue) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<fieldset>
|
||||
<div class='form-row'>
|
||||
<%= f.hidden_field :reportable_id %>
|
||||
<%= f.hidden_field :reportable_type %>
|
||||
<%= f.hidden_field :reported_user_id %>
|
||||
</div>
|
||||
<%= f.error_messages %>
|
||||
<fieldset>
|
||||
<div class='form-row'>
|
||||
<%= f.hidden_field :reportable_id %>
|
||||
<%= f.hidden_field :reportable_type %>
|
||||
<%= f.hidden_field :reported_user_id %>
|
||||
</div>
|
||||
|
||||
<div class='form-row' style='width:600px'>
|
||||
<p><%= t('issues.new.select') %>:</p>
|
||||
<div class='form-row' style='width:600px'>
|
||||
<p><%= t('issues.new.select') %>:</p>
|
||||
|
||||
<div class="new-report-form">
|
||||
<% @report_strings_yaml.each do |k,v| %>
|
||||
<div style="padding-left:5px">
|
||||
<%= radio_button_tag :report_type, v[:type].to_s %>
|
||||
<%= label_tag v[:details].to_s %> <br/>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<%= text_area :report, :details, :cols => 20, :rows => 3, placeholder: t('issues.new.details'), required: true %>
|
||||
</div>
|
||||
<div class="new-report-form">
|
||||
<% @report_strings_yaml.each do |k,v| %>
|
||||
<div style="padding-left:5px">
|
||||
<%= radio_button_tag :report_type, v[:type].to_s %>
|
||||
<%= label_tag v[:details].to_s %> <br/>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class='buttons'>
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
<br/>
|
||||
<%= text_area :report, :details, :cols => 20, :rows => 3, placeholder: t('issues.new.details'), required: true %>
|
||||
</div>
|
||||
|
||||
<div class='buttons'>
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
|
|
@ -1,62 +1,60 @@
|
|||
<% content_for :heading do %>
|
||||
<h2> <%= @issue.status.humanize %> Issue #<%= @issue.id %> <br/></h2>
|
||||
<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 %>
|
||||
</small>
|
||||
</p>
|
||||
<p>
|
||||
<%= link_to t('issues.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 %>
|
||||
<% end %>
|
||||
</p>
|
||||
<p><%= link_to t('issues.reopen'), reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
|
||||
<h2> <%= @issue.status.humanize %> Issue #<%= @issue.id %> <br/></h2>
|
||||
<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 %>
|
||||
</small>
|
||||
</p>
|
||||
<p>
|
||||
<%= link_to t('issues.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 %>
|
||||
<% end %>
|
||||
</p>
|
||||
<p><%= link_to t('issues.reopen'), reopen_issue_url(@issue), :method => :post if @issue.may_reopen? %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="report-related-block">
|
||||
|
||||
<div class="report-block">
|
||||
<h3>Reports under this issue:</h3>
|
||||
<div class="report-block">
|
||||
<h3>Reports under this issue:</h3>
|
||||
|
||||
<% if @read_reports.present? %>
|
||||
<div class="read-reports">
|
||||
<h4>Read Reports:</h4>
|
||||
<br/>
|
||||
<%= render 'reports',reports: @read_reports %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @read_reports.present? %>
|
||||
<div class="read-reports">
|
||||
<h4>Read Reports:</h4>
|
||||
<br/>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<div class="related-block">
|
||||
<h3> Other issues against this user: </h3>
|
||||
<div class="unread-reports">
|
||||
<% if @related_issues.count > 1 %>
|
||||
<% @related_issues.each do |issue| %>
|
||||
<% if issue.id != @issue.id %>
|
||||
<%= reports_url(issue) %> <br/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p>No other reports against this user!</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% if @unread_reports.any? %>
|
||||
<div class="unread-reports">
|
||||
<h4>New Reports:</h4>
|
||||
<br/>
|
||||
<%= render 'reports',reports: @unread_reports %>
|
||||
</div>
|
||||
<% end %>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<div class="related-block">
|
||||
<h3> Other issues against this user: </h3>
|
||||
<div class="unread-reports">
|
||||
<% if @related_issues.count > 1 %>
|
||||
<% @related_issues.each do |issue| %>
|
||||
<% if issue.id != @issue.id %>
|
||||
<%= reports_url(issue) %> <br/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p>No other reports against this user!</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Comments on this issue:</h3>
|
||||
<div class="unread-reports">
|
||||
<%= render 'comments', comments: @comments %>
|
||||
</div>
|
||||
|
||||
<div class="unread-reports">
|
||||
<%= render 'comments', comments: @comments %>
|
||||
</div>
|
||||
|
|
|
@ -319,7 +319,7 @@ en-GB:
|
|||
edit_link: Edit this entry
|
||||
hide_link: Hide this entry
|
||||
confirm: Confirm
|
||||
report: Report this entry?
|
||||
report: Report this entry?
|
||||
diary_comment:
|
||||
comment_from: Comment from %{link_user} on %{comment_created_at}
|
||||
hide_link: Hide this comment
|
||||
|
@ -944,7 +944,7 @@ en-GB:
|
|||
resolve: Resolve
|
||||
ignore: Ignore
|
||||
reopen: Reopen
|
||||
index:
|
||||
index:
|
||||
search:
|
||||
user_not_found: User does not exist
|
||||
issues_not_found: No such issues found
|
||||
|
@ -968,89 +968,89 @@ en-GB:
|
|||
reassign: The Issue was reassigned
|
||||
reassign_param: Reassign Issue?
|
||||
comment:
|
||||
provide_details: Please provide the required details
|
||||
provide_details: Please provide the required details
|
||||
comment_created: Your comment was successfully created
|
||||
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:
|
||||
DiaryEntry:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This Diary Entry is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This Diary Entry is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This Diary Entry contains a threat
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
DiaryComment:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This Diary Comment is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This Diary Comment is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This Diary Comment contains a threat
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
User:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This User profile is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This User profile is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This User profile contains a threat
|
||||
vandal:
|
||||
type: "[VANDAL]"
|
||||
details: This User is a vandal
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
details: Other
|
||||
Changeset:
|
||||
undiscussed_import:
|
||||
type: "[UNDISCUSSED-IMPORT]"
|
||||
details: This changeset is an undiscussed import
|
||||
details: This changeset is an undiscussed import
|
||||
mechanical_edit:
|
||||
type: "[MECH-EDIT]"
|
||||
details: This changeset is a mechanical edit
|
||||
details: This changeset is a mechanical edit
|
||||
edit_error:
|
||||
type: "[EDIT-ERROR]"
|
||||
details: This changeset contains a newbie or an editor error
|
||||
details: This changeset contains a newbie or an editor error
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This changeset is/contains spam
|
||||
details: This changeset is/contains spam
|
||||
vandalism:
|
||||
type: "[VANDALISM]"
|
||||
details: This changeset is/contains vandalism
|
||||
other:
|
||||
details: This changeset is/contains vandalism
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
Note:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This note is spam
|
||||
details: This note is spam
|
||||
vandalism:
|
||||
type: "[VANDALISM]"
|
||||
details: This note is vandalism
|
||||
details: This note is vandalism
|
||||
personal:
|
||||
type: "[PERSONAL]"
|
||||
details: This note contains personal data
|
||||
details: This note contains personal data
|
||||
abusive:
|
||||
type: "[ABUSIVE]"
|
||||
details: This note is abusive
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
details: Other
|
||||
layouts:
|
||||
project_name:
|
||||
title: OpenStreetMap
|
||||
|
|
|
@ -917,7 +917,7 @@ en:
|
|||
index:
|
||||
search:
|
||||
user_not_found: User does not exist
|
||||
issues_not_found: No such issues found
|
||||
issues_not_found: No such issues found
|
||||
create:
|
||||
successful_report: Your report has been registered sucessfully
|
||||
provide_details: Please provide the required details
|
||||
|
@ -933,94 +933,94 @@ en:
|
|||
not_just_mistake: You are sure that the problem is not just a mistake
|
||||
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:
|
||||
show:
|
||||
comments:
|
||||
reassign: The Issue was reassigned
|
||||
reassign_param: Reassign Issue?
|
||||
comment:
|
||||
provide_details: Please provide the required details
|
||||
comment_created: Your comment was successfully created
|
||||
provide_details: Please provide the required details
|
||||
comment_created: Your comment was successfully created
|
||||
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:
|
||||
DiaryEntry:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This Diary Entry is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This Diary Entry is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This Diary Entry contains a threat
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
DiaryComment:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This Diary Comment is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This Diary Comment is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This Diary Comment contains a threat
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
User:
|
||||
spam:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This User profile is/contains spam
|
||||
offensive:
|
||||
offensive:
|
||||
type: "[OFFENSIVE]"
|
||||
details: This User profile is obscene/offensive
|
||||
threat:
|
||||
threat:
|
||||
type: "[THREAT]"
|
||||
details: This User profile contains a threat
|
||||
vandal:
|
||||
type: "[VANDAL]"
|
||||
details: This User is a vandal
|
||||
other:
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
details: Other
|
||||
Changeset:
|
||||
undiscussed_import:
|
||||
type: "[UNDISCUSSED-IMPORT]"
|
||||
details: This changeset is an undiscussed import
|
||||
details: This changeset is an undiscussed import
|
||||
mechanical_edit:
|
||||
type: "[MECH-EDIT]"
|
||||
details: This changeset is a mechanical edit
|
||||
details: This changeset is a mechanical edit
|
||||
edit_error:
|
||||
type: "[EDIT-ERROR]"
|
||||
details: This changeset contains a newbie or an editor error
|
||||
details: This changeset contains a newbie or an editor error
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This changeset is/contains spam
|
||||
details: This changeset is/contains spam
|
||||
vandalism:
|
||||
type: "[VANDALISM]"
|
||||
details: This changeset is/contains vandalism
|
||||
other:
|
||||
details: This changeset is/contains vandalism
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
Note:
|
||||
spam:
|
||||
type: "[SPAM]"
|
||||
details: This note is spam
|
||||
details: This note is spam
|
||||
vandalism:
|
||||
type: "[VANDALISM]"
|
||||
details: This note is vandalism
|
||||
details: This note is vandalism
|
||||
personal:
|
||||
type: "[PERSONAL]"
|
||||
details: This note contains personal data
|
||||
details: This note contains personal data
|
||||
abusive:
|
||||
type: "[ABUSIVE]"
|
||||
details: This note is abusive
|
||||
other:
|
||||
type: "[OTHER]"
|
||||
details: Other
|
||||
details: Other
|
||||
layouts:
|
||||
project_name:
|
||||
# in <title>
|
||||
|
|
302
db/structure.sql
302
db/structure.sql
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class IssuesControllerTest < ActionController::TestCase
|
||||
fixtures :users, :user_roles
|
||||
fixtures :users, :user_roles, :issues
|
||||
|
||||
def test_view_dashboard_without_auth
|
||||
# Access issues_path without login
|
||||
|
@ -18,12 +18,19 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
# Access issues_path by admin
|
||||
session[:user] = users(:administrator_user).id
|
||||
get :index
|
||||
assert_response :success
|
||||
# this is redirected because there are no issues?!
|
||||
assert_response :redirect
|
||||
assert_redirected_to issues_path
|
||||
|
||||
# Access issues_path by moderator
|
||||
session[:user] = users(:moderator_user).id
|
||||
get :index
|
||||
assert_response :success
|
||||
# this is redirected because there are no issues?!
|
||||
assert_response :redirect
|
||||
assert_redirected_to issues_path
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_new_issue_without_login
|
||||
|
@ -54,6 +61,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
assert_equal Issue.count, 1
|
||||
assert_response :redirect
|
||||
assert_redirected_to root_path
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_new_report_with_incomplete_details
|
||||
|
@ -99,6 +109,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
end
|
||||
assert_response :redirect
|
||||
assert_equal Issue.find_by_reportable_id_and_reportable_type(1, "User").reports.count, 1
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_new_report_with_complete_details
|
||||
|
@ -136,6 +149,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
assert_response :redirect
|
||||
report_count = Issue.find_by_reportable_id_and_reportable_type(1, "User").reports.count
|
||||
assert_equal report_count, 2
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_change_status_by_normal_user
|
||||
|
@ -150,6 +166,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
|
||||
assert_response :redirect
|
||||
assert_redirected_to root_path
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_change_status_by_admin
|
||||
|
@ -178,6 +197,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
get :ignore, :id => Issue.find_by_reportable_id_and_reportable_type(1, "User").id
|
||||
assert_equal Issue.find_by_reportable_id_and_reportable_type(1, "User").ignored?, true
|
||||
assert_response :redirect
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_search_issues
|
||||
|
@ -204,6 +226,9 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
# Find Issue against user_id:2
|
||||
get :index, :search_by_user => "test2"
|
||||
assert_response :success
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
|
||||
def test_comment_by_normal_user
|
||||
|
@ -228,5 +253,8 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
get :comment, :id => @issue.id, :issue_comment => { :body => "test comment" }
|
||||
assert_response :redirect
|
||||
assert_redirected_to @issue
|
||||
|
||||
# clear session
|
||||
session.delete(:user)
|
||||
end
|
||||
end
|
||||
|
|
38
test/fixtures/issues.yml
vendored
38
test/fixtures/issues.yml
vendored
|
@ -1,21 +1,23 @@
|
|||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
reportable_type: MyString
|
||||
reportable_id: 1
|
||||
user_id: 1
|
||||
status: 1
|
||||
resolved_at: 2015-05-16 13:06:16
|
||||
resolved_by: 1
|
||||
created_at: 2015-05-16 13:06:16
|
||||
updated_at: 2015-05-16 13:06:16
|
||||
# one:
|
||||
# reportable_type: User
|
||||
# reportable_id: 1
|
||||
# reported_user_id: 1
|
||||
# status: 1
|
||||
# issue_type: administrator
|
||||
# resolved_at: 2015-05-16 13:06:16
|
||||
# resolved_by: 1
|
||||
# created_at: 2015-05-16 13:06:16
|
||||
# updated_at: 2015-05-16 13:06:16
|
||||
|
||||
two:
|
||||
reportable_type: MyString
|
||||
reportable_id: 1
|
||||
user_id: 1
|
||||
status: 1
|
||||
resolved_at: 2015-05-16 13:06:16
|
||||
resolved_by: 1
|
||||
created_at: 2015-05-16 13:06:16
|
||||
updated_at: 2015-05-16 13:06:16
|
||||
# two:
|
||||
# reportable_type: User
|
||||
# reportable_id: 1
|
||||
# reported_user_id: 1
|
||||
# status: 1
|
||||
# issue_type: moderator
|
||||
# resolved_at: 2015-05-16 13:06:16
|
||||
# resolved_by: 1
|
||||
# created_at: 2015-05-16 13:06:16
|
||||
# updated_at: 2015-05-16 13:06:16
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue