Fix missing link on public organizations page
When viewing a conference, the Instance Name in the header points to /organizations. On the organizations index, there's a button to see conferences, but it does nothing. This makes it easy for public users to get lost. This commit: * Adds a function to the organizations controller to show child conferences * Adds a public permission to see conferences through an organization * Represents a subset of conferences, reusing conferences/index view, for the organization
This commit is contained in:
parent
170051af81
commit
714f89f6ba
7 changed files with 68 additions and 5 deletions
|
|
@ -4,4 +4,10 @@ class OrganizationsController < ApplicationController
|
|||
def index
|
||||
@organizations = Organization.all
|
||||
end
|
||||
|
||||
def conferences
|
||||
@current = @organization.conferences.upcoming.reorder(start_date: :asc)
|
||||
@antiquated = @organization.conferences.past
|
||||
render '/conferences/index'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Ability
|
|||
|
||||
# Abilities for not signed in users (guests)
|
||||
def not_signed_in
|
||||
can [:index], Organization
|
||||
can [:index, :conferences], Organization
|
||||
can [:index], Conference
|
||||
can [:show], Conference do |conference|
|
||||
conference.splashpage && conference.splashpage.public == true
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
.page-header
|
||||
%h2 Upcoming Conferences
|
||||
- @current.each do |conference|
|
||||
= render partial: 'conference_details', locals: { conference: conference }
|
||||
= render '/conferences/conference_details', conference: conference
|
||||
-if @antiquated and @antiquated.any?
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
%i.fa.fa-chevron-down{ style: 'display: none' }
|
||||
#antiquated.collapse
|
||||
- @antiquated.each do |conference|
|
||||
= render partial: 'conference_details', locals: { conference: conference}
|
||||
= render '/conferences/conference_details', conference: conference
|
||||
|
||||
-content_for :script_body do
|
||||
:javascript
|
||||
|
|
|
|||
|
|
@ -12,5 +12,7 @@
|
|||
.caption
|
||||
%h4
|
||||
= organization.name
|
||||
%button.btn.btn-success Conferences
|
||||
= link_to 'Conferences',
|
||||
conferences_organization_path(organization),
|
||||
class: 'btn btn-success'
|
||||
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue