diff --git a/app/assets/javascripts/conferences.js b/app/assets/javascripts/conferences.js new file mode 100644 index 00000000..dee720fa --- /dev/null +++ b/app/assets/javascripts/conferences.js @@ -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. diff --git a/app/assets/stylesheets/conferences.css.scss b/app/assets/stylesheets/conferences.css.scss new file mode 100644 index 00000000..0454fea7 --- /dev/null +++ b/app/assets/stylesheets/conferences.css.scss @@ -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/ diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb new file mode 100644 index 00000000..aff4b4d8 --- /dev/null +++ b/app/controllers/conferences_controller.rb @@ -0,0 +1,5 @@ +class ConferencesController < ApplicationController + def show + @conference = Conference.find_by_title(params[:format]) + end +end diff --git a/app/helpers/conferences_helper.rb b/app/helpers/conferences_helper.rb new file mode 100644 index 00000000..edfcfdd1 --- /dev/null +++ b/app/helpers/conferences_helper.rb @@ -0,0 +1,2 @@ +module ConferencesHelper +end diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml new file mode 100644 index 00000000..9ec58232 --- /dev/null +++ b/app/views/conferences/show.html.haml @@ -0,0 +1,11 @@ +.row + .col-md-12 + %h1 + = @conference.title + + + + + + + diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 73702c5f..13eb233f 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -24,6 +24,7 @@ = simple_format(conference.venue.description, class: 'lead') .col-md-2 .btn-group-vertical + = link_to "View Conference", conferences_show_path(conference.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/config/initializers/devise.rb b/config/initializers/devise.rb index 77208236..610744c7 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,7 +2,7 @@ # Many of these configuration options can be set straight in your model. Devise.setup do |config| # ==> Secret key, generate one with `rake secret` - config.secret_key = CONFIG['devise_secret_key'] + config.secret_key = "CONFIG['devise_secret_key']" # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, diff --git a/config/routes.rb b/config/routes.rb index eb88be3a..972e453f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,11 +1,14 @@ Osem::Application.routes.draw do + get 'conferences/show' + devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts' namespace :admin do resources :users resources :people resources :conference do + get "conferences/(:title)" => "conferences#show" get "/schedule" => "schedule#show" put "/schedule" => "schedule#update" get "/stats" => "stats#index" diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 00000000..880f53c4 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,2 @@ +development: + secret_key_base: "12345" \ No newline at end of file diff --git a/spec/controllers/conferences_controller_spec.rb b/spec/controllers/conferences_controller_spec.rb new file mode 100644 index 00000000..01a3efc0 --- /dev/null +++ b/spec/controllers/conferences_controller_spec.rb @@ -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 diff --git a/spec/helpers/conferences_helper_spec.rb b/spec/helpers/conferences_helper_spec.rb new file mode 100644 index 00000000..5192097f --- /dev/null +++ b/spec/helpers/conferences_helper_spec.rb @@ -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 diff --git a/spec/views/conferences/show.html.haml_spec.rb b/spec/views/conferences/show.html.haml_spec.rb new file mode 100644 index 00000000..b7275a39 --- /dev/null +++ b/spec/views/conferences/show.html.haml_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "conferences/show.html.haml" do + pending "add some examples to (or delete) #{__FILE__}" +end