mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Show code of conduct on organizations
This commit is contained in:
parent
a6daff8582
commit
217ec1a46f
5 changed files with 30 additions and 7 deletions
|
|
@ -5,6 +5,12 @@ class OrganizationsController < ApplicationController
|
|||
@organizations = Organization.all
|
||||
end
|
||||
|
||||
def code_of_conduct
|
||||
@title = "#{@organization.name}: Code of Conduct"
|
||||
@content = @organization.code_of_conduct
|
||||
render 'document'
|
||||
end
|
||||
|
||||
def conferences
|
||||
@current = @organization.conferences.upcoming.reorder(start_date: :asc)
|
||||
@antiquated = @organization.conferences.past
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Ability
|
|||
|
||||
# Abilities for not signed in users (guests)
|
||||
def not_signed_in
|
||||
can [:index, :conferences], Organization
|
||||
can [:index, :conferences, :code_of_conduct], Organization
|
||||
can [:index], Conference
|
||||
can [:show], Conference do |conference|
|
||||
conference.splashpage && conference.splashpage.public == true
|
||||
|
|
|
|||
|
|
@ -6,13 +6,16 @@
|
|||
.btn-group.pull-right
|
||||
/ = link_to 'Add new', new_organization_path, class: 'btn btn-mini btn-success'
|
||||
- @organizations.each do |organization|
|
||||
.col-md-4
|
||||
.col-md-4{ id: "organization-#{organization.id}" }
|
||||
.thumbnail
|
||||
= image_tag(organization.picture.thumb.url, width: '20%') if organization.picture?
|
||||
.caption
|
||||
%h4
|
||||
= organization.name
|
||||
= link_to 'Conferences',
|
||||
conferences_organization_path(organization),
|
||||
class: 'btn btn-success'
|
||||
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'
|
||||
.btn-group
|
||||
= link_to 'Conferences',
|
||||
conferences_organization_path(organization),
|
||||
class: 'btn btn-success'
|
||||
- unless organization.code_of_conduct.blank?
|
||||
= link_to 'Code of Conduct', [:code_of_conduct, organization], class: 'btn btn-info'
|
||||
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ Osem::Application.routes.draw do
|
|||
end
|
||||
resources :organizations, only: [:index] do
|
||||
member do
|
||||
get :conferences
|
||||
get :conferences, 'code-of-conduct'
|
||||
end
|
||||
end
|
||||
resources :conferences, only: [:index, :show] do
|
||||
|
|
|
|||
|
|
@ -30,5 +30,19 @@ feature 'Code of Conduct:' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'anonymously' do
|
||||
let!(:organization) { create(:organization, code_of_conduct: sample_text) }
|
||||
|
||||
context 'on the organization' do
|
||||
it 'can be read' do
|
||||
visit organizations_path
|
||||
within "#organization-#{organization.id}" do
|
||||
click_on 'Code of Conduct'
|
||||
end
|
||||
expect(page).to have_text(sample_text)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue