Merge branch 'master' into include_speaker_email_in_events
This commit is contained in:
commit
aca8adf6e8
12 changed files with 151 additions and 14 deletions
|
|
@ -4,4 +4,10 @@ class OrganizationsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@organizations = Organization.all
|
@organizations = Organization.all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def conferences
|
||||||
|
@current = @organization.conferences.upcoming.reorder(start_date: :asc)
|
||||||
|
@antiquated = @organization.conferences.past
|
||||||
|
render '/conferences/index'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -171,4 +171,18 @@ module ApplicationHelper
|
||||||
def hidden_if_conference_over(conference)
|
def hidden_if_conference_over(conference)
|
||||||
'hidden' if Date.today > conference.end_date
|
'hidden' if Date.today > conference.end_date
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nav_root_link_for(conference)
|
||||||
|
link_text = (
|
||||||
|
conference.try(:organization).try(:name) ||
|
||||||
|
ENV['OSEM_NAME'] ||
|
||||||
|
'OSEM'
|
||||||
|
)
|
||||||
|
link_to(
|
||||||
|
link_text,
|
||||||
|
root_path,
|
||||||
|
class: 'navbar-brand',
|
||||||
|
title: 'Open Source Event Manager'
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class Ability
|
||||||
|
|
||||||
# Abilities for not signed in users (guests)
|
# Abilities for not signed in users (guests)
|
||||||
def not_signed_in
|
def not_signed_in
|
||||||
can [:index], Organization
|
can [:index, :conferences], Organization
|
||||||
can [:index], Conference
|
can [:index], Conference
|
||||||
can [:show], Conference do |conference|
|
can [:show], Conference do |conference|
|
||||||
conference.splashpage && conference.splashpage.public == true
|
conference.splashpage && conference.splashpage.public == true
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
.page-header
|
.page-header
|
||||||
%h2 Upcoming Conferences
|
%h2 Upcoming Conferences
|
||||||
- @current.each do |conference|
|
- @current.each do |conference|
|
||||||
= render partial: 'conference_details', locals: { conference: conference }
|
= render '/conferences/conference_details', conference: conference
|
||||||
-if @antiquated and @antiquated.any?
|
-if @antiquated and @antiquated.any?
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
%i.fa.fa-chevron-down{ style: 'display: none' }
|
%i.fa.fa-chevron-down{ style: 'display: none' }
|
||||||
#antiquated.collapse
|
#antiquated.collapse
|
||||||
- @antiquated.each do |conference|
|
- @antiquated.each do |conference|
|
||||||
= render partial: 'conference_details', locals: { conference: conference}
|
= render '/conferences/conference_details', conference: conference
|
||||||
|
|
||||||
-content_for :script_body do
|
-content_for :script_body do
|
||||||
:javascript
|
:javascript
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,8 @@
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
- if conference.nil? || conference.new_record?
|
= nav_root_link_for conference
|
||||||
= link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
|
||||||
- else
|
|
||||||
= link_to conference.organization.name, organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager'
|
|
||||||
.collapse.navbar-collapse#main-nav
|
.collapse.navbar-collapse#main-nav
|
||||||
- if content_for :splash_nav
|
- if content_for :splash_nav
|
||||||
%ul.nav.navbar-nav#splash-nav
|
%ul.nav.navbar-nav#splash-nav
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,7 @@
|
||||||
.caption
|
.caption
|
||||||
%h4
|
%h4
|
||||||
= organization.name
|
= 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'
|
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'
|
||||||
|
|
|
||||||
42
bootstrap.sh
42
bootstrap.sh
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# set env os release variables
|
||||||
|
. /etc/os-release
|
||||||
|
|
||||||
|
if [[ "$ID" == "opensuse" ]]; then
|
||||||
|
|
||||||
pushd /vagrant
|
pushd /vagrant
|
||||||
|
|
||||||
echo -e "\ninstalling required software packages...\n"
|
echo -e "\ninstalling required software packages...\n"
|
||||||
|
|
@ -14,6 +20,42 @@ echo 'install: --no-format-executable' >> /etc/gemrc
|
||||||
echo -e "\ninstalling bundler...\n"
|
echo -e "\ninstalling bundler...\n"
|
||||||
gem.ruby2.4 install bundler
|
gem.ruby2.4 install bundler
|
||||||
|
|
||||||
|
elif [[ "$ID" == "centos" || "$VERSION" == "7" ]]; then
|
||||||
|
_YELLOW='\033[1;33m' # yellow color
|
||||||
|
_LRED='\033[1;31m' # Light red color
|
||||||
|
_NO_COLOUR='\033[0m' # no color
|
||||||
|
|
||||||
|
printf "${_YELLOW}CEntOS-7 Setup${_NO_COLOUR}\n"
|
||||||
|
|
||||||
|
printf "${_YELLOW}installing ruby-2.4${_NO_COLOUR}\n"
|
||||||
|
yum install -q -y https://github.com/feedforce/ruby-rpm/releases/download/2.4.2/ruby-2.4.2-1.el7.centos.x86_64.rpm
|
||||||
|
if [[ ! "$?" -eq 0 ]]; then
|
||||||
|
printf "${_LRED}Error trying to install ruby-2.4${_NO_COLOUR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "${_YELLOW}installing ruby-2.4 gems dependencies${_NO_COLOUR}\n"
|
||||||
|
gem install bundler
|
||||||
|
if [[ ! "$?" -eq 0 ]]; then
|
||||||
|
printf "${_LRED}Error trying to install ruby-2.4 bundler${_NO_COLOUR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "${_YELLOW}installing nodejs repo${_NO_COLOUR}\n"
|
||||||
|
curl -sL https://rpm.nodesource.com/setup_9.x | bash - > /dev/null
|
||||||
|
|
||||||
|
printf "${_YELLOW}installing nodejs and devel tools${_NO_COLOUR}\n"
|
||||||
|
yum install -q -y git make gcc gcc-c++ libxml2-devel libxslt-devel nodejs screen mariadb mariadb-devel sqlite-devel ImageMagick bzip2
|
||||||
|
|
||||||
|
# for production: bundle install --without test development
|
||||||
|
printf "${_YELLOW}Opening firewall port: 3000${_NO_COLOUR}\n"
|
||||||
|
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
|
||||||
|
|
||||||
|
printf "${_YELLOW}installing phantomjs${_NO_COLOUR}\n"
|
||||||
|
curl -L --silent https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -o /tmp/phantomjs-2.1.1-linux-x86_64.tar.bz2
|
||||||
|
tar jxvf /tmp/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /tmp/ phantomjs-2.1.1-linux-x86_64/bin/phantomjs
|
||||||
|
mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\ninstalling your bundle...\n"
|
echo -e "\ninstalling your bundle...\n"
|
||||||
su - vagrant -c "cd /vagrant/; bundle install --quiet"
|
su - vagrant -c "cd /vagrant/; bundle install --quiet"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,11 @@ Osem::Application.routes.draw do
|
||||||
get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object'
|
get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object'
|
||||||
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
||||||
end
|
end
|
||||||
resources :organizations, only: [:index]
|
resources :organizations, only: [:index] do
|
||||||
|
member do
|
||||||
|
get :conferences
|
||||||
|
end
|
||||||
|
end
|
||||||
resources :conferences, only: [:index, :show] do
|
resources :conferences, only: [:index, :show] do
|
||||||
resources :booths do
|
resources :booths do
|
||||||
member do
|
member do
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,26 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe OrganizationsController do
|
describe OrganizationsController do
|
||||||
let!(:organization) { create(:organization) }
|
let!(:organization) { create(:organization) }
|
||||||
|
let!(:conference) do
|
||||||
|
create(
|
||||||
|
:conference,
|
||||||
|
splashpage: create(:splashpage, public: true),
|
||||||
|
venue: create(:venue),
|
||||||
|
organization: organization
|
||||||
|
)
|
||||||
|
end
|
||||||
|
let!(:antiquated_conference) do
|
||||||
|
create(
|
||||||
|
:conference,
|
||||||
|
splashpage: create(:splashpage, public: true),
|
||||||
|
venue: create(:venue),
|
||||||
|
organization: organization,
|
||||||
|
start_date: 2.weeks.ago,
|
||||||
|
end_date: 1.week.ago
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
let!(:other_conference) { create(:conference) }
|
||||||
let!(:user) { create(:user) }
|
let!(:user) { create(:user) }
|
||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
|
@ -12,4 +32,27 @@ describe OrganizationsController do
|
||||||
|
|
||||||
it { expect(response).to render_template('index') }
|
it { expect(response).to render_template('index') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #conferences' do
|
||||||
|
before :each do
|
||||||
|
get :conferences, id: organization.id
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'loads the organization' do
|
||||||
|
expect(assigns(:organization)).to eq organization
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'includes organization conferences' do
|
||||||
|
expect(assigns(:current)).to include conference
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does not include conferences outside organization' do
|
||||||
|
expect(assigns(:current)).not_to include other_conference
|
||||||
|
expect(assigns(:antiquated)).not_to include other_conference
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'includes antiquated organization conferences' do
|
||||||
|
expect(assigns(:antiquated)).to include antiquated_conference
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,12 @@ feature Organization do
|
||||||
|
|
||||||
it_behaves_like 'successfully updates an organization'
|
it_behaves_like 'successfully updates an organization'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'anonymously' do
|
||||||
|
scenario 'index should link to conferences list' do
|
||||||
|
visit organizations_path
|
||||||
|
|
||||||
|
expect(page).to have_link('Conferences', href: "/organizations/#{organization.id}/conferences")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,12 @@ feature Splashpage do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'public splashpage already created' do
|
context 'navigation' do
|
||||||
let!(:splashpage) { create(:splashpage, conference: conference, public: true)}
|
let!(:splashpage) { create(:splashpage, conference: conference, public: true)}
|
||||||
|
|
||||||
|
context 'multiple organizations' do
|
||||||
|
let!(:additional_organization) { create(:organization) }
|
||||||
|
|
||||||
scenario 'should have organization name', feature: true, js: true do
|
scenario 'should have organization name', feature: true, js: true do
|
||||||
sign_in participant
|
sign_in participant
|
||||||
visit conference_path(conference.short_title)
|
visit conference_path(conference.short_title)
|
||||||
|
|
@ -73,3 +76,4 @@ feature Splashpage do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,21 @@ describe ApplicationHelper, type: :helper do
|
||||||
expect(concurrent_events(event).present?).to eq false
|
expect(concurrent_events(event).present?).to eq false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'navigation title link' do
|
||||||
|
it 'should default to OSEM' do
|
||||||
|
ENV.delete('OSEM_NAME')
|
||||||
|
expect(nav_root_link_for(nil)).to match 'OSEM'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should use the environment variable' do
|
||||||
|
ENV['OSEM_NAME'] = Faker::Company.name
|
||||||
|
expect(nav_root_link_for(nil)).to match ENV['OSEM_NAME']
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should use the conference organization name' do
|
||||||
|
expect(nav_root_link_for(conference)).to match conference.organization.name
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue