Linking the conferences on home page to their splash page
This commit is contained in:
parent
4e395a0d7a
commit
cb8f4ccd2e
12 changed files with 62 additions and 1 deletions
2
app/assets/javascripts/conferences.js
Normal file
2
app/assets/javascripts/conferences.js
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
// Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
// All this logic will automatically be available in application.js.
|
||||||
3
app/assets/stylesheets/conferences.css.scss
Normal file
3
app/assets/stylesheets/conferences.css.scss
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Place all the styles related to the conferences controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
5
app/controllers/conferences_controller.rb
Normal file
5
app/controllers/conferences_controller.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ConferencesController < ApplicationController
|
||||||
|
def show
|
||||||
|
@conference = Conference.find_by_title(params[:format])
|
||||||
|
end
|
||||||
|
end
|
||||||
2
app/helpers/conferences_helper.rb
Normal file
2
app/helpers/conferences_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
module ConferencesHelper
|
||||||
|
end
|
||||||
11
app/views/conferences/show.html.haml
Normal file
11
app/views/conferences/show.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
%h1
|
||||||
|
= @conference.title
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
= 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
|
||||||
|
= link_to "View Conference", conferences_show_path(conference.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"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# Many of these configuration options can be set straight in your model.
|
# Many of these configuration options can be set straight in your model.
|
||||||
Devise.setup do |config|
|
Devise.setup do |config|
|
||||||
# ==> Secret key, generate one with `rake secret`
|
# ==> Secret key, generate one with `rake secret`
|
||||||
config.secret_key = CONFIG['devise_secret_key']
|
config.secret_key = "CONFIG['devise_secret_key']"
|
||||||
|
|
||||||
# ==> Mailer Configuration
|
# ==> Mailer Configuration
|
||||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
Osem::Application.routes.draw do
|
Osem::Application.routes.draw do
|
||||||
|
|
||||||
|
get 'conferences/show'
|
||||||
|
|
||||||
devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts'
|
devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts'
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :users
|
resources :users
|
||||||
resources :people
|
resources :people
|
||||||
resources :conference do
|
resources :conference do
|
||||||
|
get "conferences/(:title)" => "conferences#show"
|
||||||
get "/schedule" => "schedule#show"
|
get "/schedule" => "schedule#show"
|
||||||
put "/schedule" => "schedule#update"
|
put "/schedule" => "schedule#update"
|
||||||
get "/stats" => "stats#index"
|
get "/stats" => "stats#index"
|
||||||
|
|
|
||||||
2
config/secrets.yml
Normal file
2
config/secrets.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
development:
|
||||||
|
secret_key_base: "12345"
|
||||||
12
spec/controllers/conferences_controller_spec.rb
Normal file
12
spec/controllers/conferences_controller_spec.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe ConferencesController do
|
||||||
|
|
||||||
|
describe "GET 'show'" do
|
||||||
|
it "returns http success" do
|
||||||
|
get 'show'
|
||||||
|
expect(response).to be_success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
15
spec/helpers/conferences_helper_spec.rb
Normal file
15
spec/helpers/conferences_helper_spec.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
# Specs in this file have access to a helper object that includes
|
||||||
|
# the ConferencesHelper. For example:
|
||||||
|
#
|
||||||
|
# describe ConferencesHelper do
|
||||||
|
# describe "string concat" do
|
||||||
|
# it "concats two strings with spaces" do
|
||||||
|
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
describe ConferencesHelper do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
5
spec/views/conferences/show.html.haml_spec.rb
Normal file
5
spec/views/conferences/show.html.haml_spec.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe "conferences/show.html.haml" do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue