From cb8f4ccd2e9e39ab5c43c8fb2fca8132d2ae6169 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 08:26:25 +0530 Subject: [PATCH 01/13] Linking the conferences on home page to their splash page --- app/assets/javascripts/conferences.js | 2 ++ app/assets/stylesheets/conferences.css.scss | 3 +++ app/controllers/conferences_controller.rb | 5 +++++ app/helpers/conferences_helper.rb | 2 ++ app/views/conferences/show.html.haml | 11 +++++++++++ app/views/home/index.html.haml | 1 + config/initializers/devise.rb | 2 +- config/routes.rb | 3 +++ config/secrets.yml | 2 ++ spec/controllers/conferences_controller_spec.rb | 12 ++++++++++++ spec/helpers/conferences_helper_spec.rb | 15 +++++++++++++++ spec/views/conferences/show.html.haml_spec.rb | 5 +++++ 12 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/conferences.js create mode 100644 app/assets/stylesheets/conferences.css.scss create mode 100644 app/controllers/conferences_controller.rb create mode 100644 app/helpers/conferences_helper.rb create mode 100644 app/views/conferences/show.html.haml create mode 100644 config/secrets.yml create mode 100644 spec/controllers/conferences_controller_spec.rb create mode 100644 spec/helpers/conferences_helper_spec.rb create mode 100644 spec/views/conferences/show.html.haml_spec.rb 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 From 8e31dd04d7012fc12ef7396975ef87d463cb329d Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 08:33:05 +0530 Subject: [PATCH 02/13] correction mentioned by hound --- app/controllers/conferences_controller.rb | 2 +- config/routes.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index aff4b4d8..88a39551 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -1,5 +1,5 @@ class ConferencesController < ApplicationController def show - @conference = Conference.find_by_title(params[:format]) + @conference = Conference.find_by_title(params[:format]) end end diff --git a/config/routes.rb b/config/routes.rb index 972e453f..b5c75471 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,6 @@ Osem::Application.routes.draw 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" From 928db0e4f4dca5061ef5ccc7a8131e839bb95e83 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 08:35:56 +0530 Subject: [PATCH 03/13] Minor typo in devise --- config/initializers/devise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 610744c7..77208236 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, From c620d63b0f19a75cbaa113e53e8c8171cfc6c353 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 17:56:09 +0530 Subject: [PATCH 04/13] Added view and controller for splash page with routes for show --- app/assets/javascripts/conferences.js | 2 -- app/assets/stylesheets/conferences.css.scss | 3 --- app/controllers/conference_controller.rb | 5 +++++ app/controllers/conferences_controller.rb | 5 ----- app/helpers/conferences_helper.rb | 2 -- app/views/conference/show.html.haml | 4 ++++ app/views/conferences/show.html.haml | 11 ----------- app/views/home/index.html.haml | 2 +- config/routes.rb | 4 ++-- ...ntroller_spec.rb => conference_controller_spec.rb} | 2 +- ...ences_helper_spec.rb => conference_helper_spec.rb} | 6 +++--- spec/views/conference/show.html.haml_spec.rb | 5 +++++ 12 files changed, 21 insertions(+), 30 deletions(-) delete mode 100644 app/assets/javascripts/conferences.js delete mode 100644 app/assets/stylesheets/conferences.css.scss create mode 100644 app/controllers/conference_controller.rb delete mode 100644 app/controllers/conferences_controller.rb delete mode 100644 app/helpers/conferences_helper.rb create mode 100644 app/views/conference/show.html.haml delete mode 100644 app/views/conferences/show.html.haml rename spec/controllers/{conferences_controller_spec.rb => conference_controller_spec.rb} (82%) rename spec/helpers/{conferences_helper_spec.rb => conference_helper_spec.rb} (76%) create mode 100644 spec/views/conference/show.html.haml_spec.rb diff --git a/app/assets/javascripts/conferences.js b/app/assets/javascripts/conferences.js deleted file mode 100644 index dee720fa..00000000 --- a/app/assets/javascripts/conferences.js +++ /dev/null @@ -1,2 +0,0 @@ -// 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 deleted file mode 100644 index 0454fea7..00000000 --- a/app/assets/stylesheets/conferences.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// 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/conference_controller.rb b/app/controllers/conference_controller.rb new file mode 100644 index 00000000..85f72ea0 --- /dev/null +++ b/app/controllers/conference_controller.rb @@ -0,0 +1,5 @@ +class ConferenceController < ApplicationController + def show + @conference = Conference.find_by_title(params[:conference_id]) + end +end diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb deleted file mode 100644 index 88a39551..00000000 --- a/app/controllers/conferences_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index edfcfdd1..00000000 --- a/app/helpers/conferences_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ConferencesHelper -end diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml new file mode 100644 index 00000000..56e2509f --- /dev/null +++ b/app/views/conference/show.html.haml @@ -0,0 +1,4 @@ +.row + .col-md-12 + %h1 + = @conference.title \ No newline at end of file diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml deleted file mode 100644 index 9ec58232..00000000 --- a/app/views/conferences/show.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -.row - .col-md-12 - %h1 - = @conference.title - - - - - - - diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 13eb233f..b4478c89 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -24,7 +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" + = link_to "View Conference", conference_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/routes.rb b/config/routes.rb index b5c75471..3bc6e021 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,5 @@ Osem::Application.routes.draw do - - get 'conferences/show' + devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts' @@ -50,6 +49,7 @@ Osem::Application.routes.draw do end resources :conference, :only => [] do + get '/show' => 'conference#show' resources :proposal do resources :event_attachment, :controller => "event_attachments" put "/confirm" => "proposal#confirm" diff --git a/spec/controllers/conferences_controller_spec.rb b/spec/controllers/conference_controller_spec.rb similarity index 82% rename from spec/controllers/conferences_controller_spec.rb rename to spec/controllers/conference_controller_spec.rb index 01a3efc0..33874774 100644 --- a/spec/controllers/conferences_controller_spec.rb +++ b/spec/controllers/conference_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe ConferencesController do +describe ConferenceController do describe "GET 'show'" do it "returns http success" do diff --git a/spec/helpers/conferences_helper_spec.rb b/spec/helpers/conference_helper_spec.rb similarity index 76% rename from spec/helpers/conferences_helper_spec.rb rename to spec/helpers/conference_helper_spec.rb index 5192097f..fe33f1b6 100644 --- a/spec/helpers/conferences_helper_spec.rb +++ b/spec/helpers/conference_helper_spec.rb @@ -1,15 +1,15 @@ require 'spec_helper' # Specs in this file have access to a helper object that includes -# the ConferencesHelper. For example: +# the ConferenceHelper. For example: # -# describe ConferencesHelper do +# describe ConferenceHelper 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 +describe ConferenceHelper do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/views/conference/show.html.haml_spec.rb b/spec/views/conference/show.html.haml_spec.rb new file mode 100644 index 00000000..900c39b7 --- /dev/null +++ b/spec/views/conference/show.html.haml_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "conference/show.html.haml" do + pending "add some examples to (or delete) #{__FILE__}" +end From 3b8b33e2d53d651ad85eb65c8bef520021f96759 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 17:58:31 +0530 Subject: [PATCH 05/13] Fixes by houndci --- config/routes.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 3bc6e021..bbf43ce6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,4 @@ Osem::Application.routes.draw do - - devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts' namespace :admin do From 5da601c2351b68c7128b64aca86340790956d261 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 18:38:14 +0530 Subject: [PATCH 06/13] Fixed initial splash page view --- app/assets/javascripts/conference.js | 2 ++ app/assets/stylesheets/conference.css.scss | 3 +++ app/helpers/conference_helper.rb | 2 ++ app/views/conference/show.html.haml | 6 +++--- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/conference.js create mode 100644 app/assets/stylesheets/conference.css.scss create mode 100644 app/helpers/conference_helper.rb diff --git a/app/assets/javascripts/conference.js b/app/assets/javascripts/conference.js new file mode 100644 index 00000000..dee720fa --- /dev/null +++ b/app/assets/javascripts/conference.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/conference.css.scss b/app/assets/stylesheets/conference.css.scss new file mode 100644 index 00000000..20356924 --- /dev/null +++ b/app/assets/stylesheets/conference.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the conference controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb new file mode 100644 index 00000000..26a58bdd --- /dev/null +++ b/app/helpers/conference_helper.rb @@ -0,0 +1,2 @@ +module ConferenceHelper +end diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index 56e2509f..e25729d1 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -1,4 +1,4 @@ .row - .col-md-12 - %h1 - = @conference.title \ No newline at end of file + .col-md-12 + %h1 + = @conference.title \ No newline at end of file From 5831b76955d5f1e7a2df603d77b4db75a3b5c661 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 18:56:43 +0530 Subject: [PATCH 07/13] Removed conferences folder from spec/views --- spec/views/conferences/show.html.haml_spec.rb | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 spec/views/conferences/show.html.haml_spec.rb diff --git a/spec/views/conferences/show.html.haml_spec.rb b/spec/views/conferences/show.html.haml_spec.rb deleted file mode 100644 index b7275a39..00000000 --- a/spec/views/conferences/show.html.haml_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe "conferences/show.html.haml" do - pending "add some examples to (or delete) #{__FILE__}" -end From 047c1dd2880acf5660d1b2f244f6ff848ec5881b Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 19:12:18 +0530 Subject: [PATCH 08/13] View and controller without tests --- app/assets/javascripts/conference.js | 2 -- app/assets/stylesheets/conference.css.scss | 3 --- app/helpers/conference_helper.rb | 2 -- spec/controllers/conference_controller_spec.rb | 12 ------------ spec/helpers/conference_helper_spec.rb | 15 --------------- 5 files changed, 34 deletions(-) delete mode 100644 app/assets/javascripts/conference.js delete mode 100644 app/assets/stylesheets/conference.css.scss delete mode 100644 app/helpers/conference_helper.rb delete mode 100644 spec/controllers/conference_controller_spec.rb delete mode 100644 spec/helpers/conference_helper_spec.rb diff --git a/app/assets/javascripts/conference.js b/app/assets/javascripts/conference.js deleted file mode 100644 index dee720fa..00000000 --- a/app/assets/javascripts/conference.js +++ /dev/null @@ -1,2 +0,0 @@ -// 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/conference.css.scss b/app/assets/stylesheets/conference.css.scss deleted file mode 100644 index 20356924..00000000 --- a/app/assets/stylesheets/conference.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the conference controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb deleted file mode 100644 index 26a58bdd..00000000 --- a/app/helpers/conference_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ConferenceHelper -end diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb deleted file mode 100644 index 33874774..00000000 --- a/spec/controllers/conference_controller_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'spec_helper' - -describe ConferenceController 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/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb deleted file mode 100644 index fe33f1b6..00000000 --- a/spec/helpers/conference_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -# Specs in this file have access to a helper object that includes -# the ConferenceHelper. For example: -# -# describe ConferenceHelper 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 ConferenceHelper do - pending "add some examples to (or delete) #{__FILE__}" -end From 65152f87539c1501406ebf1dac915d8334b467cb Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Thu, 8 May 2014 23:35:03 +0530 Subject: [PATCH 09/13] Fixes to splash page view&controller --- app/assets/javascripts/conference.js | 2 ++ app/assets/stylesheets/conference.css.scss | 3 +++ app/controllers/conference_controller.rb | 2 +- app/helpers/conference_helper.rb | 2 ++ app/views/home/index.html.haml | 2 +- config/routes.rb | 3 +-- spec/controllers/conference_controller_spec.rb | 12 ++++++++++++ spec/helpers/conference_helper_spec.rb | 15 +++++++++++++++ 8 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/conference.js create mode 100644 app/assets/stylesheets/conference.css.scss create mode 100644 app/helpers/conference_helper.rb create mode 100644 spec/controllers/conference_controller_spec.rb create mode 100644 spec/helpers/conference_helper_spec.rb diff --git a/app/assets/javascripts/conference.js b/app/assets/javascripts/conference.js new file mode 100644 index 00000000..dee720fa --- /dev/null +++ b/app/assets/javascripts/conference.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/conference.css.scss b/app/assets/stylesheets/conference.css.scss new file mode 100644 index 00000000..20356924 --- /dev/null +++ b/app/assets/stylesheets/conference.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the conference 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/conference_controller.rb b/app/controllers/conference_controller.rb index 85f72ea0..fd1fe19c 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -1,5 +1,5 @@ class ConferenceController < ApplicationController def show - @conference = Conference.find_by_title(params[:conference_id]) + @conference = Conference.find_by_title(params[:id]) end end diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb new file mode 100644 index 00000000..26a58bdd --- /dev/null +++ b/app/helpers/conference_helper.rb @@ -0,0 +1,2 @@ +module ConferenceHelper +end diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index b4478c89..59755fd6 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -24,7 +24,7 @@ = simple_format(conference.venue.description, class: 'lead') .col-md-2 .btn-group-vertical - = link_to "View Conference", conference_show_path(conference.title), :class => " btn btn-default" + = link_to "View Conference", conference_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/routes.rb b/config/routes.rb index bbf43ce6..88b8b9b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -46,8 +46,7 @@ Osem::Application.routes.draw do end end - resources :conference, :only => [] do - get '/show' => 'conference#show' + resources :conference, :only => [:show] do resources :proposal do resources :event_attachment, :controller => "event_attachments" put "/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..1cc61fe5 --- /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 diff --git a/spec/helpers/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb new file mode 100644 index 00000000..fe33f1b6 --- /dev/null +++ b/spec/helpers/conference_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the ConferenceHelper. For example: +# +# describe ConferenceHelper 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 ConferenceHelper do + pending "add some examples to (or delete) #{__FILE__}" +end From 53809aacebc8965a7380cf801808acf261abdf11 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Fri, 9 May 2014 07:31:00 +0530 Subject: [PATCH 10/13] Deleted scaffold files --- app/assets/javascripts/conference.js | 2 -- app/assets/stylesheets/conference.css.scss | 3 --- spec/helpers/conference_helper_spec.rb | 15 --------------- 3 files changed, 20 deletions(-) delete mode 100644 app/assets/javascripts/conference.js delete mode 100644 app/assets/stylesheets/conference.css.scss delete mode 100644 spec/helpers/conference_helper_spec.rb diff --git a/app/assets/javascripts/conference.js b/app/assets/javascripts/conference.js deleted file mode 100644 index dee720fa..00000000 --- a/app/assets/javascripts/conference.js +++ /dev/null @@ -1,2 +0,0 @@ -// 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/conference.css.scss b/app/assets/stylesheets/conference.css.scss deleted file mode 100644 index 20356924..00000000 --- a/app/assets/stylesheets/conference.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the conference controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/spec/helpers/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb deleted file mode 100644 index fe33f1b6..00000000 --- a/spec/helpers/conference_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -# Specs in this file have access to a helper object that includes -# the ConferenceHelper. For example: -# -# describe ConferenceHelper 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 ConferenceHelper do - pending "add some examples to (or delete) #{__FILE__}" -end From 2a3410c7ec87c9ba4b1186d797cc3fafc1eb2b77 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Sat, 10 May 2014 17:55:01 +0530 Subject: [PATCH 11/13] Header done, needs suggestion --- app/controllers/conference_controller.rb | 2 ++ app/views/conference/show.html.haml | 42 +++++++++++++++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index fd1fe19c..556c1657 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -1,4 +1,6 @@ class ConferenceController < ApplicationController + layout false + def show @conference = Conference.find_by_title(params[:id]) end diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index e25729d1..a4b02568 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -1,4 +1,38 @@ -.row - .col-md-12 - %h1 - = @conference.title \ No newline at end of file +!!! +%html + %head + %meta{:charset => "utf-8"} + %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"} + %title= content_for?(:title) ? yield(:title) : "OSEM" + %meta{:content => "", :name => "description"} + %meta{:content => "", :name => "author"} + = stylesheet_link_tag "application", :media => "all" + = javascript_include_tag "application" + = csrf_meta_tags + %nav{:class=>"navbar navbar-default", :role => "navigation"} + %div{:class => "container-fluid"} + %div{ :class => "navbar-header" } + %button{ :type=> "button", :class => "navbar-toggle", :data => {:toggle => "collapse", :target => "#navbar-collapse"}} + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a{ :class=>"navbar-brand",:href=>"#" } + = @conference.short_title + %div{:class=>"collapse navbar-collapse",:id=>"navbar-collapse"} + %ul{:class=>"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 + + %body + + From f9ec6cc8939a981038bda476699b028f57cc28f6 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Mon, 12 May 2014 20:38:29 +0530 Subject: [PATCH 12/13] Revert "Header done, needs suggestion" This reverts commit 2a3410c7ec87c9ba4b1186d797cc3fafc1eb2b77. --- app/controllers/conference_controller.rb | 2 -- app/views/conference/show.html.haml | 42 +++--------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 556c1657..fd1fe19c 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -1,6 +1,4 @@ class ConferenceController < ApplicationController - layout false - def show @conference = Conference.find_by_title(params[:id]) end diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index a4b02568..e25729d1 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -1,38 +1,4 @@ -!!! -%html - %head - %meta{:charset => "utf-8"} - %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"} - %title= content_for?(:title) ? yield(:title) : "OSEM" - %meta{:content => "", :name => "description"} - %meta{:content => "", :name => "author"} - = stylesheet_link_tag "application", :media => "all" - = javascript_include_tag "application" - = csrf_meta_tags - %nav{:class=>"navbar navbar-default", :role => "navigation"} - %div{:class => "container-fluid"} - %div{ :class => "navbar-header" } - %button{ :type=> "button", :class => "navbar-toggle", :data => {:toggle => "collapse", :target => "#navbar-collapse"}} - %span.icon-bar - %span.icon-bar - %span.icon-bar - %a{ :class=>"navbar-brand",:href=>"#" } - = @conference.short_title - %div{:class=>"collapse navbar-collapse",:id=>"navbar-collapse"} - %ul{:class=>"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 - - %body - - +.row + .col-md-12 + %h1 + = @conference.title \ No newline at end of file From 116b862e98262b41e8bf23b7f33d47b0caa39c15 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Mon, 12 May 2014 20:45:53 +0530 Subject: [PATCH 13/13] fixes by houndci --- spec/controllers/conference_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb index 1cc61fe5..fd6b8077 100644 --- a/spec/controllers/conference_controller_spec.rb +++ b/spec/controllers/conference_controller_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe ConferenceController do - describe "GET 'show'" do - it "returns http success" do + describe 'GET #show' do + it 'returns http success' do get :show, :id => 'sample' expect(response).to be_success end