fix revision history broken bug
Fixes https://github.com/openSUSE/osem/issues/2334
This commit is contained in:
parent
1544cdd23e
commit
a776641668
2 changed files with 9 additions and 5 deletions
|
|
@ -6,12 +6,15 @@ module Admin
|
||||||
load_and_authorize_resource class: PaperTrail::Version
|
load_and_authorize_resource class: PaperTrail::Version
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@conferences_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title)
|
if Conference.any?
|
||||||
|
@conferences_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title)
|
||||||
|
@conferences_with_role.uniq!
|
||||||
|
end
|
||||||
if current_user.has_cached_role? :organization_admin, :any
|
if current_user.has_cached_role? :organization_admin, :any
|
||||||
@conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten
|
@conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten
|
||||||
|
@conferences_with_role.uniq!
|
||||||
end
|
end
|
||||||
@conferences_with_role.uniq!
|
|
||||||
|
|
||||||
return if @conference.blank?
|
return if @conference.blank?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
%li= link_to 'All Conferences & Users', admin_revision_history_path
|
%li= link_to 'All Conferences & Users', admin_revision_history_path
|
||||||
- @conferences_with_role.each do |conference_short_title|
|
- if !@conferences_with_role.nil?
|
||||||
%li= link_to conference_short_title, admin_conference_revision_history_path(conference_id: conference_short_title)
|
- @conferences_with_role.each do |conference_short_title|
|
||||||
|
%li= link_to conference_short_title, admin_conference_revision_history_path(conference_id: conference_short_title)
|
||||||
|
|
||||||
%h1 Revision History
|
%h1 Revision History
|
||||||
%p.text-muted
|
%p.text-muted
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue