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..9c1880ab --- /dev/null +++ b/app/views/conference/show.html.haml @@ -0,0 +1,16 @@ += content_for :splash_header do + %ul.nav.navbar-nav + %li + %a{ href: "#" } Program + %li + %a{ href: "#" } Location + %li + %a{ href: "#" } Registration + %li + %a{ href: "#" } CfP + %li + %a{ href: "#" } Sponsors + %li + %a{ href: "#" } Press + += render :partial => "home/conference_details", :locals => {:conference => @conference} \ No newline at end of file diff --git a/app/views/home/_conference_details.html.haml b/app/views/home/_conference_details.html.haml index 1653b3d8..36f4ad09 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 controller.class.name != "ConferenceController" + = 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 cedea71f..25a32a24 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -7,53 +7,59 @@ %span.icon-bar %span.icon-bar %span.icon-bar - = link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager" - .collapse.navbar-collapse - - if @conference && !@conference.short_title.nil? - %p.navbar-text - = @conference.short_title - - if user_signed_in? - - if has_role?(current_user, "admin") || has_role?(current_user, "organizer") - - if controller.class.name.split("::").first=="Admin" - - if @conference and not @conference.short_title.nil? - = render 'layouts/admin_menu' - %ul.nav.navbar-nav.navbar-right - %li.dropdown - %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"} - - if not current_user.person.public_name.empty? - #{current_user.person.public_name} - -else - #{current_user.email} - = image_tag(current_user.person.gravatar_url(:size => "18"), :title => "Yo #{current_user.person.public_name}!") - %b.caret - %ul.dropdown-menu - = render 'layouts/user_menu' + - if controller.class.name == "ConferenceController" + = link_to @conference.title, "#", :class => 'navbar-brand' - else - %ul.nav.navbar-nav.navbar-right - - if current_page?(new_registration_path('user')) - %li.active - = link_to(new_registration_path('user')) do - %span.glyphicon.glyphicon-heart - Sign Up - - else - %li - = link_to(new_registration_path('user')) do - %span.glyphicon.glyphicon-heart - Sign Up - %li.dropdown.visible-desktop + = link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager" + .collapse.navbar-collapse + - if @conference && controller.class.name == "ConferenceController" + = yield(:splash_header) + - else + - if @conference && !@conference.short_title.nil? + %p.navbar-text + = @conference.short_title + - if user_signed_in? + - if has_role?(current_user, "admin") || has_role?(current_user, "organizer") + - if controller.class.name.split("::").first=="Admin" + - if @conference and not @conference.short_title.nil? + = render 'layouts/admin_menu' + %ul.nav.navbar-nav.navbar-right + %li.dropdown %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"} - %span.glyphicon.glyphicon-user - Sign In - %span.caret - .dropdown-menu{:style => "padding: 17px;"} - = form_tag user_session_path do - = text_field_tag 'user[email]', nil, id: 'user_email_dd' - = password_field_tag 'user[password]', nil, id: 'user_password_dd' - %label.checkbox - = check_box_tag 'user[remember_me]' - Remember me - %button.btn.btn-block Sign in - %br - = link_to "Forgot your password?", new_password_path('user') - %li.hidden-lg - = link_to('Sign In', new_user_session_path) \ No newline at end of file + - if not current_user.person.public_name.empty? + #{current_user.person.public_name} + -else + #{current_user.email} + = image_tag(current_user.person.gravatar_url(:size => "18"), :title => "Yo #{current_user.person.public_name}!") + %b.caret + %ul.dropdown-menu + = render 'layouts/user_menu' + - else + %ul.nav.navbar-nav.navbar-right + - if current_page?(new_registration_path('user')) + %li.active + = link_to(new_registration_path('user')) do + %span.glyphicon.glyphicon-heart + Sign Up + - else + %li + = link_to(new_registration_path('user')) do + %span.glyphicon.glyphicon-heart + Sign Up + %li.dropdown.visible-desktop + %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"} + %span.glyphicon.glyphicon-user + Sign In + %span.caret + .dropdown-menu{:style => "padding: 17px;"} + = form_tag user_session_path do + = text_field_tag 'user[email]', nil, id: 'user_email_dd' + = password_field_tag 'user[password]', nil, id: 'user_password_dd' + %label.checkbox + = check_box_tag 'user[remember_me]' + Remember me + %button.btn.btn-block Sign in + %br + = link_to "Forgot your password?", new_password_path('user') + %li.hidden-lg + = link_to('Sign In', new_user_session_path) \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 1fdcc96f..9e6633e8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,7 +51,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..f9131880 --- /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