Create Splash Page using existing routes as Conference#Show
This commit is contained in:
parent
5f6ab4f7ee
commit
1c152c87ab
6 changed files with 90 additions and 49 deletions
5
app/controllers/conference_controller.rb
Normal file
5
app/controllers/conference_controller.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ConferenceController < ApplicationController
|
||||||
|
def show
|
||||||
|
@conference = Conference.find_by_short_title(params[:id])
|
||||||
|
end
|
||||||
|
end
|
||||||
16
app/views/conference/show.html.haml
Normal file
16
app/views/conference/show.html.haml
Normal file
|
|
@ -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}
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
= simple_format(conference.venue.description, class: 'lead')
|
= simple_format(conference.venue.description, class: 'lead')
|
||||||
.col-md-2
|
.col-md-2
|
||||||
.btn-group-vertical
|
.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.registration_open?
|
||||||
- if conference.user_registered?(current_user)
|
- if conference.user_registered?(current_user)
|
||||||
= link_to "Modify Registration", register_conference_path(conference.short_title), :class =>"btn btn-default"
|
= link_to "Modify Registration", register_conference_path(conference.short_title), :class =>"btn btn-default"
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,14 @@
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
|
- if controller.class.name == "ConferenceController"
|
||||||
|
= link_to @conference.title, "#", :class => 'navbar-brand'
|
||||||
|
- else
|
||||||
= link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager"
|
= link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager"
|
||||||
.collapse.navbar-collapse
|
.collapse.navbar-collapse
|
||||||
|
- if @conference && controller.class.name == "ConferenceController"
|
||||||
|
= yield(:splash_header)
|
||||||
|
- else
|
||||||
- if @conference && !@conference.short_title.nil?
|
- if @conference && !@conference.short_title.nil?
|
||||||
%p.navbar-text
|
%p.navbar-text
|
||||||
= @conference.short_title
|
= @conference.short_title
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ Osem::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :conference, :only => [] do
|
resources :conference, :only => [:show] do
|
||||||
resources :proposal do
|
resources :proposal do
|
||||||
resources :event_attachment, :controller => "event_attachments"
|
resources :event_attachment, :controller => "event_attachments"
|
||||||
patch "/confirm" => "proposal#confirm"
|
patch "/confirm" => "proposal#confirm"
|
||||||
|
|
|
||||||
12
spec/controllers/conference_controller_spec.rb
Normal file
12
spec/controllers/conference_controller_spec.rb
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue