diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb new file mode 100644 index 00000000..7a872c26 --- /dev/null +++ b/app/controllers/conference_controller.rb @@ -0,0 +1,5 @@ +class ConferenceController < ApplicationController + def show + @conference = Conference.find_by_short_title(params[:id]) + end +end diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml new file mode 100644 index 00000000..6decc148 --- /dev/null +++ b/app/views/conference/show.html.haml @@ -0,0 +1 @@ += render :partial => "home/conference_details", :locals => {:conference => @conference} diff --git a/app/views/home/_conference_details.html.haml b/app/views/home/_conference_details.html.haml index 1653b3d8..335b25ed 100644 --- a/app/views/home/_conference_details.html.haml +++ b/app/views/home/_conference_details.html.haml @@ -20,6 +20,8 @@ = simple_format(conference.venue.description, class: 'lead') .col-md-2 .btn-group-vertical + - if !@conference || @conference != conference + = link_to "View Conference", conference_path(conference.short_title), :class =>"btn btn-default" - if conference.registration_open? - if conference.user_registered?(current_user) = link_to "Modify Registration", register_conference_path(conference.short_title), :class =>"btn btn-default" diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index a260104c..aeea19d0 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -7,8 +7,12 @@ %span.icon-bar %span.icon-bar %span.icon-bar - = link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager" + - if @conference + = link_to @conference.title, "#", :class => 'navbar-brand' + - else + = link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager" .collapse.navbar-collapse + = yield(:splash_header) - if @conference && !@conference.short_title.nil? %p.navbar-text = @conference.short_title diff --git a/config/routes.rb b/config/routes.rb index 78e9d930..9ba3a543 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -66,7 +66,7 @@ Osem::Application.routes.draw do end end - resources :conference, :only => [] do + resources :conference, only: [:show] do resources :proposal do resources :event_attachment, :controller => "event_attachments" patch "/confirm" => "proposal#confirm" diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb new file mode 100644 index 00000000..b5b373d1 --- /dev/null +++ b/spec/controllers/conference_controller_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe ConferenceController do + + describe 'GET #show' do + it 'returns http success' do + get :show, id: 'sample' + expect(response).to be_success + end + end + +end