diff --git a/config/routes.rb b/config/routes.rb index 42b40f7..64e9a8c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do - mount OpenFest::Engine, at: '/', constraints: {subdomain: 'cfp'} + mount OpenFest::Engine, at: '/', constraints: {subdomain: 'cfp'}, conference_id: 1 devise_for :users, path: 'management' diff --git a/lib/open_fest/app/controllers/open_fest/application_controller.rb b/lib/open_fest/app/controllers/open_fest/application_controller.rb index a8c4551..1f509ad 100644 --- a/lib/open_fest/app/controllers/open_fest/application_controller.rb +++ b/lib/open_fest/app/controllers/open_fest/application_controller.rb @@ -1,12 +1,7 @@ module OpenFest class ApplicationController < ActionController::Base - before_action :set_current_conference + include ::CurrentConferenceAssigning - private - - #TODO: Make this display a nice 404 message when the conference is not found - def set_current_conference - @current_conference ||= Conference.find(1) - end + before_filter :require_current_conference! end end diff --git a/lib/open_fest/app/views/layouts/open_fest/application.html.erb b/lib/open_fest/app/views/layouts/open_fest/application.html.erb index df30c48..9efb4fc 100644 --- a/lib/open_fest/app/views/layouts/open_fest/application.html.erb +++ b/lib/open_fest/app/views/layouts/open_fest/application.html.erb @@ -5,7 +5,7 @@ <% if content_for? :title %> <%= yield :title %> | <% end %> - <%= @current_conference.try :title %> + <%= current_conference.try :title %> <%= stylesheet_link_tag "open_fest/application", media: "all" %> diff --git a/lib/open_fest/app/views/open_fest/users/registrations/edit.slim b/lib/open_fest/app/views/open_fest/users/registrations/edit.slim index 7158882..4653e82 100644 --- a/lib/open_fest/app/views/open_fest/users/registrations/edit.slim +++ b/lib/open_fest/app/views/open_fest/users/registrations/edit.slim @@ -1,18 +1,18 @@ -- content_for(:title) { ":: #{t :edit_speaker_profile}" } +- content_for(:title) { t :edit_speaker_profile } -= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| .form_inputs - h2.entry-title = t :speaker_profile + h2.entry-title = t :personal_profile = f.error_notification - = f.simple_fields_for :speaker_profile do |ff| - = ff.input :picture, as: :image_preview, input_html: {preview_version: :thumb}, required: true + = f.simple_fields_for :personal_profile do |ff| + = ff.input :picture, as: :file, required: true = ff.input :first_name, autofocus: true = ff.input :last_name = ff.input :public_email = ff.input :organisation = ff.input :github = ff.input :twitter - = ff.input :mobile_phone, input_html: {value: resource.speaker_profile.mobile_phone.try(:phony_formatted, format: :international)} + = ff.input :mobile_phone, input_html: {value: resource.personal_profile(current_conference).mobile_phone.try(:phony_formatted, format: :international)} = ff.input :biography .form-inputs diff --git a/lib/open_fest/app/views/open_fest/welcome/index.slim b/lib/open_fest/app/views/open_fest/welcome/index.slim index ead199d..a3222a3 100644 --- a/lib/open_fest/app/views/open_fest/welcome/index.slim +++ b/lib/open_fest/app/views/open_fest/welcome/index.slim @@ -1,14 +1,14 @@ -h1.entry-title = t :home_title, conference: @current_conference.title +h1.entry-title = t :home_title, conference: current_conference.title -= simple_format @current_conference.description += simple_format current_conference.description p = t :what_we_ask ul - = render partial: 'track', collection: @current_conference.tracks + = render partial: 'track', collection: current_conference.tracks p = t :license_notice -- if @current_conference.call_for_participation.in_progress? +- if current_conference.call_for_participation.in_progress? .centered.large - = render partial: 'event_type', collection: @current_conference.event_types + = render partial: 'event_type', collection: current_conference.event_types