Refactoring Conference Basics #384

This commit is contained in:
Chrisbr 2014-08-07 21:33:08 +02:00
parent ac25561523
commit a8b94c13f3
13 changed files with 309 additions and 109 deletions

View file

@ -0,0 +1,32 @@
.row
.col-md-8
= semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :make_conference_public, hint: 'This will enable the visitors to view the splash page(the "View Conference" button will be visible now on the home page), it is recommended to enable this after you have finished setting up all the components for display'
= f.input :include_program_in_splash, hint: 'On setting this true you will enable the program component to be displayed on the splash page.This component includes tracks, keynote speakers and the schedule'
= f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'"
= f.input :short_title, :hint => "A short title, such as 'osc2013', to be used in URLs"
= f.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"}
- if !@conference.logo.blank?
= image_tag @conference.logo(:thumb)
= f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page."
= f.inputs name: 'Banner for Splash' do
= f.input :include_banner_in_splash, hint: 'This enable the Banner Photo with description to be displayed on the splash'
= f.input :banner_photo, hint: 'This will be the top most component of the splash.This background cover will contain start_date and end_date of the conference and the description'
= f.input :description, hint: markdown_hint("This description will be shown at the bottom of the banner photo of the Splash."), input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.inputs :name => "Scheduling" do
= f.input :timezone, :as => :time_zone, :hint => "The conference time zone"
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
= f.inputs name: 'Registration' do
= f.input :include_registrations_in_splash, hint: 'On setting this true you will enable the registrations to be displayed on the splash page'
= f.input :registration_start_date, :as => :string, :input_html => { :id => "conference-reg-start-datepicker", :readonly => "readonly" }
= f.input :registration_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" }
= f.input :registration_description, hint: markdown_hint("This description will appear in registration segment of the splash."), input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :ticket_description, hint: markdown_hint("This will appear in the Tickets segment of the splash."), input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :sponsor_description, hint: markdown_hint("This will appear in the sponsor segment of the splash."), input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers'
= f.input :lodging_description, hint: markdown_hint("This will appear in the lodging segment of the splash."), input_html: { rows: 5, data: { provide: "markdown-editable" } }
= dynamic_association :photos, "Photos", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,61 @@
.row{'style'=>'padding-top: 15px;'}
.col-md-6
%dl.dl-horizontal
%dt
Title
%dd
= @conference.title
%dt
Short Title
%dd
= @conference.short_title
%dt
Description
%dd
- unless @conference.description.blank?
= markdown(@conference.description)
- else
Not set!
%dt
Date
%dd
= @date_string
%dt
Color
%dd
%div.text-center{'style'=>"width: 25px; height: 25px; background: #{@conference.color};"}
.row.row-flex.row-flex-wrap
.col-md-4
.thumbnail.flex-col
%h3.text-center
Conference Logo
- if @conference.logo?
= image_tag(@conference.logo(:large), class: 'img-responsive')
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @conference.logo_file_name
-else
%h4.text-center
Not set!
.col-md-4
.thumbnail.flex-col
%h3.text-center
Conference Banner
- if @conference.banner_photo?
= image_tag(@conference.banner_photo(:large), class: 'img-responsive')
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @conference.banner_photo_file_name
- else
%h4.text-center
Not set!

View file

@ -1,35 +1,16 @@
.row
.col-md-8
= semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :make_conference_public, hint: 'This will enable the visitors to view the splash page(the "View Conference" button will be visible now on the home page), it is recommended to enable this after you have finished setting up all the components for display'
= f.input :include_program_in_splash, hint: 'On setting this true you will enable the program component to be displayed on the splash page.This component includes tracks, keynote speakers and the schedule'
= f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'"
= f.input :short_title, :hint => "A short title, such as 'osc2013', to be used in URLs"
= f.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"}
= f.inputs name: 'Banner for Splash' do
= f.input :include_banner_in_splash, hint: 'This enable the Banner Photo with description to be displayed on the splash'
= f.input :banner_photo, hint: 'This will be the top most component of the splash.This background cover will contain start_date and end_date of the conference and the description'
= f.input :description, hint: markdown_hint("This description will be shown at the bottom of the banner photo of the Splash."), input_html: { data: { provide: "markdown-editable" } }
= f.inputs :name => "Scheduling" do
= f.input :timezone, :as => :time_zone, :hint => "The conference time zone"
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
= f.inputs name: 'Registration' do
= f.input :include_registrations_in_splash, hint: 'On setting this true you will enable the registrations to be displayed on the splash page'
= f.input :registration_start_date, :as => :string, :input_html => { :id => "conference-reg-start-datepicker", :readonly => "readonly" }
= f.input :registration_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" }
= f.input :registration_description, hint: markdown_hint("This description will appear in registration segment of the splash."), input_html: { data: { provide: "markdown-editable" } }
= f.input :ticket_description, hint: markdown_hint("This will appear in the Tickets segment of the splash."), input_html: { data: { provide: "markdown-editable" } }
= f.input :sponsor_description, hint: markdown_hint("This will appear in the sponsor segment of the splash."), input_html: { data: { provide: "markdown-editable" } }
= f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers'
= f.input :lodging_description, hint: markdown_hint("This will appear in the lodging segment of the splash."), input_html: { data: { provide: "markdown-editable" } }
= dynamic_association :photos, "Photos", f
= f.inputs :name => 'Social Media' do
- if !@conference.logo.blank?
= image_tag @conference.logo(:thumb)
= f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page."
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
.col-md-12
%ul.nav.nav-tabs{'role'=>'tablist'}
%li.active
%a{'href'=> '#show', 'role'=>'tab', 'data-toggle'=>'tab'}
Show
%li
%a{'href'=> '#edit', 'role'=>'tab', 'data-toggle'=>'tab'}
Edit
.row
.col-md-12
.tab-content
.tab-pane.active#show
= render partial: 'edit_show'
.tab-pane#edit
= render partial: 'edit_form'

View file

@ -1,31 +1,13 @@
= form_for @contact, url: admin_conference_contact_path do |f|
- if @contact.errors.any?
#error_explanation
%h2= "#{pluralize(@contact.errors.count, "error")} prohibited this contact from being saved:"
%ul
- @contact.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :social_tag
= f.text_field :social_tag
.field
= f.label :email
= f.text_field :email
.field
= f.label :facebook
= f.text_field :facebook
.field
= f.label :googleplus
= f.text_field :googleplus
.field
= f.label :twitter
= f.text_field :twitter
.field
= f.label :instagram
= f.text_field :instagram
.field
= f.label :public
= f.check_box :public
.actions
= f.submit 'Save'
.row
.col-md-8
= semantic_form_for(@contact, :url => admin_conference_contact_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.inputs :name => 'Contact' do
= f.input :email, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.'
= f.inputs :name => 'Social Media' do
= f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'"
= f.input :facebook, hint: 'This will appear in the social media section as link to the Facebook page of your Conference'
= f.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as the link to the Google+ Page of your Conference'
= f.input :twitter, hint: 'This will appear in the social media section as the link to the Twitter Page of your Conference'
= f.input :instagram, hint: 'This will appear in the social media section as the link to the Instagram Page of your Conference'
= f.input :public, hint: 'On setting this true you will enable the social media links to be displayed on the splash page'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -0,0 +1,31 @@
%ul.list-unstyled
- unless @contact.email.blank?
%li
= link_to "#{ @contact.email }" do
%i.fa.fa-envelope.fa-3x
= @contact.email
- unless @contact.social_tag.blank?
%li
= link_to "#{ @contact.social_tag }" do
%i.fa.fa-thumbs-o-up.fa-3x
= "##{@contact.social_tag}"
- unless @contact.facebook.blank?
%li
= link_to "#{ @contact.facebook }" do
%i.fa.fa-facebook-square.fa-3x
= @contact.facebook
- unless @contact.twitter.blank?
%li
= link_to "#{ @contact.twitter }" do
%i.fa.fa-twitter.fa-3x
= @contact.twitter
- unless @contact.instagram.blank?
%li
= link_to "#{ @contact.instagram }" do
%i.fa.fa-instagram.fa-3x
= @contact.instagram
- unless @contact.googleplus.blank?
%li
= link_to "#{ @contact.googleplus }" do
%i.fa.fa-google.fa-3x
= @contact.googleplus

View file

@ -1,5 +1,16 @@
%h1 Editing contact
= render 'form'
= link_to 'Back', admin_conference_contact_path
.row
.col-md-12
%ul.nav.nav-tabs{'role'=>'tablist'}
%li.active
%a{'href'=> '#show', 'role'=>'tab', 'data-toggle'=>'tab'}
Show
%li
%a{'href'=> '#edit', 'role'=>'tab', 'data-toggle'=>'tab'}
Edit
.row
.col-md-12
.tab-content
.tab-pane.active#show
= render partial: 'show'
.tab-pane#edit
= render partial: 'form'

View file

@ -19,16 +19,24 @@
= link_to(new_admin_conference_path) do
%span.glyphicon.glyphicon-plus
New Conference
%hr
%li{:class=> active_nav_li(admin_conference_commercials_path(@conference.short_title))}
= link_to(admin_conference_commercials_path(@conference.short_title)) do
%span.fa.fa-picture-o
Commercials
%hr
%li{:class=> "#{active_nav_li(admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
= link_to(admin_conference_path(@conference.short_title)) do
%span.glyphicon.glyphicon-dashboard
Manage
%span.fa.fa-tachometer
Dashboard
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"}
= link_to(edit_admin_conference_path(@conference.short_title)) do
%span.fa.fa-home
Basics
%ul
%li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"}
= link_to(edit_admin_conference_contact_path(@conference.short_title)) do
%span.fa.fa-envelope-o
Contact
%li{:class=> "#{active_nav_li(admin_conference_commercials_path(@conference.short_title))}"}
= link_to(admin_conference_commercials_path(@conference.short_title)) do
%span.fa.fa-comment
Commercials
%li{:class=> active_nav_li(admin_conference_events_path(@conference.short_title))}
= link_to(admin_conference_events_path(@conference.short_title)) do
%span.glyphicon.glyphicon-comment
@ -46,10 +54,6 @@
%span.glyphicon.glyphicon-bullhorn
Campaigns
%hr
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
= link_to(edit_admin_conference_path(@conference.short_title)) do
%span.glyphicon.glyphicon-cog
Settings
%li{:class=> "#{active_nav_li(admin_conference_targets_path(@conference.short_title))}"}
= link_to(admin_conference_targets_path(@conference.short_title)) do
%span.glyphicon.glyphicon-flag