Added support for reporting Changesets + Deleting issues from the CLI
This commit is contained in:
parent
cf639202b8
commit
b68b29b43c
9 changed files with 51 additions and 16 deletions
|
@ -60,7 +60,7 @@ class IssuesController < ApplicationController
|
|||
|
||||
# TODO: Find better place to add these
|
||||
admin_issues = [ 'DiaryEntry', 'DiaryComment', 'User']
|
||||
moderator_issues = []
|
||||
moderator_issues = [ 'Changeset' ]
|
||||
|
||||
|
||||
@issue = Issue.find_by_reportable_id_and_reportable_type(params[:reportable_id],params[:reportable_type])
|
||||
|
|
|
@ -10,14 +10,17 @@ module IssuesHelper
|
|||
:id => reportable.id
|
||||
when "User"
|
||||
link_to reportable.display_name.to_s, :controller => reportable.class.name.underscore,
|
||||
:action => "view",
|
||||
:action => :view,
|
||||
:display_name => reportable.display_name
|
||||
when "DiaryComment"
|
||||
link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore,
|
||||
:action => :view,
|
||||
:display_name => reportable.diary_entry.user.display_name,
|
||||
:id => reportable.id
|
||||
|
||||
when "Changeset"
|
||||
link_to "Changeset ##{reportable.id}, Closed at: #{l(reportable.closed_at.to_datetime, :format => :long)}", :controller => :browse,
|
||||
:action => :changeset,
|
||||
:id => reportable.id
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
|
@ -2,8 +2,8 @@ class Issue < ActiveRecord::Base
|
|||
belongs_to :reportable, :polymorphic => true
|
||||
belongs_to :user, :class_name => "User", :foreign_key => :reported_user_id
|
||||
|
||||
has_many :reports
|
||||
has_many :comments, :class_name => "IssueComment"
|
||||
has_many :reports, dependent: :destroy
|
||||
has_many :comments, :class_name => "IssueComment", dependent: :destroy
|
||||
|
||||
validates :reportable_id, :uniqueness => { :scope => [ :reportable_type ] }
|
||||
validates :reported_user_id, :presence => true
|
||||
|
|
|
@ -129,6 +129,10 @@
|
|||
<% end %>
|
||||
|
||||
<div class='secondary-actions'>
|
||||
<% if @user and @user.id != @changeset.user.id %>
|
||||
<%= link_to t('browse.changeset.report'), new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id) %>
|
||||
·
|
||||
<% end %>
|
||||
<%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %>
|
||||
·
|
||||
<%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue