mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Create view for splash page from existing routes
This commit is contained in:
parent
e11ad83b32
commit
7a5f47257a
8 changed files with 39 additions and 1 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
|
||||||
3
app/views/conference/show.html.haml
Normal file
3
app/views/conference/show.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
= content_for :splash_logo do
|
||||||
|
= link_to @conference.title, "#", :class => 'navbar-brand'
|
||||||
|
= 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 !@conference || @conference != conference
|
||||||
|
= 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,10 @@
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
%span.icon-bar
|
%span.icon-bar
|
||||||
|
= yield(:splash_logo)
|
||||||
= 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
|
||||||
|
= yield(:splash_header)
|
||||||
- if @conference && !@conference.short_title.nil?
|
- if @conference && !@conference.short_title.nil?
|
||||||
%p.navbar-text
|
%p.navbar-text
|
||||||
= @conference.short_title
|
= @conference.short_title
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
Osem::Application.routes.draw do
|
Osem::Application.routes.draw do
|
||||||
|
|
||||||
|
get 'conference/show'
|
||||||
|
|
||||||
devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts'
|
devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts'
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
|
|
@ -66,7 +68,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
|
||||||
|
|
@ -44,6 +44,8 @@ RSpec.configure do |config|
|
||||||
# Enables devise sign_in function
|
# Enables devise sign_in function
|
||||||
config.include Devise::TestHelpers, type: :controller
|
config.include Devise::TestHelpers, type: :controller
|
||||||
|
|
||||||
|
config.include Devise::TestHelpers, type: :view
|
||||||
|
|
||||||
# Use capybara-webkit as default javascript driver
|
# Use capybara-webkit as default javascript driver
|
||||||
Capybara.javascript_driver = :webkit
|
Capybara.javascript_driver = :webkit
|
||||||
|
|
||||||
|
|
|
||||||
10
spec/views/conference/show.html.haml_spec.rb
Normal file
10
spec/views/conference/show.html.haml_spec.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "conference/show.html.haml" do
|
||||||
|
it 'renders conference details' do
|
||||||
|
@conference = create(:conference)
|
||||||
|
assign :conference, @conference
|
||||||
|
render
|
||||||
|
expect(render).to include("#{@conference.title}")
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue