Get rid of the splashpage banner photo and "descriptions"

This commit is contained in:
Henne Vogelsang 2014-11-18 00:58:43 +01:00
parent 60ba81ab46
commit 30e8ab856c
23 changed files with 1235 additions and 184 deletions

View file

@ -59,7 +59,7 @@ GEM
axlsx (>= 2.0.1) axlsx (>= 2.0.1)
rails (>= 3.1) rails (>= 3.1)
bcrypt (3.1.7) bcrypt (3.1.7)
bootstrap-sass (3.1.1.1) bootstrap-sass (3.3.1.0)
sass (~> 3.2) sass (~> 3.2)
bootstrap3-datetimepicker-rails (3.0.3) bootstrap3-datetimepicker-rails (3.0.3)
momentjs-rails (>= 2.8.1) momentjs-rails (>= 2.8.1)

View file

@ -22,6 +22,8 @@
//= require dashboard //= require dashboard
//= require ahoy //= require ahoy
//= require smoothscroll //= require smoothscroll
//= require trianglify.min
//= require tinycolor
//= require bootstrap-markdown //= require bootstrap-markdown
//= require to-markdown //= require to-markdown
//= require markdown //= require markdown
@ -30,6 +32,7 @@
//= require osem-datepickers //= require osem-datepickers
//= require osem-datatables //= require osem-datatables
//= require osem-tickets //= require osem-tickets
//= require osem-splash
$(document).ready(function() { $(document).ready(function() {
$('a[disabled=disabled]').click(function(event){ $('a[disabled=disabled]').click(function(event){

View file

@ -0,0 +1,7 @@
$(function () {
$(document).ready(function() {
var t = new Trianglify({cellsize: 100, x_gradient: triangle_colors });
var pattern = t.generate(document.body.clientWidth, ($( "#splash-banner" ).height() + 200 ));
$('#splash-banner').css('background-image', pattern.dataUrl);
});
});

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -15,32 +15,18 @@
} }
#splash-banner{ #splash-banner{
background: none;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
width: 100%;
background-size: cover; background-size: cover;
min-height: 700px;
margin-top: -10px; margin-top: -10px;
padding-top: 100px;
padding-bottom: 100px;
.container { .container {
padding-top: 60px; #splash-header {
} background-color: rgba(224, 224, 224,.80);
h1, h3{ padding-top: 20px;
color:#3399CC; padding-bottom: 20px;
} }
h3{
font-family: 'Coustard', serif;
font-weight: 600;
text-shadow: 0.2em 0.2em 0 #4A4F6A;
}
h1{
font-size: 5em;
font-weight: 700;
text-shadow:0.04em 0.04em 0 black;
}
p {
color: #fff;
font-weight: 500;
} }
} }

View file

@ -24,4 +24,8 @@ body {
.nav-tabs { .nav-tabs {
margin-bottom: 15px; margin-bottom: 15px;
}
.img-center {
margin: 0 auto;
} }

View file

@ -59,4 +59,4 @@ $navbar-default-link-hover-color: #000000;
// Utility classes // Utility classes
@import "bootstrap/utilities"; @import "bootstrap/utilities";
@import "bootstrap/responsive-utilities"; @import "bootstrap/responsive-utilities";

View file

@ -8,7 +8,7 @@ class Conference < ActiveRecord::Base
default_scope { order('start_date DESC') } default_scope { order('start_date DESC') }
attr_accessible :title, :short_title, :timezone, :html_export_path, attr_accessible :title, :short_title, :description, :timezone, :html_export_path,
:start_date, :end_date, :rooms_attributes, :tracks_attributes, :start_date, :end_date, :rooms_attributes, :tracks_attributes,
:dietary_choices_attributes, :use_dietary_choices, :dietary_choices_attributes, :use_dietary_choices,
:tickets_attributes, :social_events_attributes, :event_types_attributes, :tickets_attributes, :social_events_attributes, :event_types_attributes,

View file

@ -1,15 +1,8 @@
class Splashpage < ActiveRecord::Base class Splashpage < ActiveRecord::Base
belongs_to :conference belongs_to :conference
attr_accessible :public,
attr_accessible :banner_description, :ticket_description, :sponsor_description, :lodging_description, :include_tracks, :include_program,
:registration_description, :include_registrations, :include_sponsors, :include_venue, :include_registrations,
:include_tracks, :include_tickets, :include_program, :public, :banner_photo, :include_banner, :include_tickets, :include_lodgings,
:include_social_media, :include_lodgings, :include_venue, :lodging_description :include_sponsors, :include_social_media
has_attached_file :banner_photo,
styles: { thumb: '100x100>', large: '1300x700>' }
validates_attachment_content_type :banner_photo,
content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes }
end end

View file

@ -1,8 +1,9 @@
.row .row
.col-md-8 .col-md-8
= semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f| = semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :title, :hint => "The full name of the conference, such as 'openSUSE Conference 2013'" = f.input :title, :hint => "The full title of the conference, e.g. 'openSUSE Conference 2014'"
= f.input :short_title, :hint => "A short title, such as 'osc2013', to be used in URLs" = f.input :short_title, :hint => "A short title, e.g. 'oSC14', to be used in URLs"
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"} = f.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"}
- if !@conference.logo.blank? - if !@conference.logo.blank?
= image_tag @conference.logo(:thumb) = image_tag @conference.logo(:thumb)

View file

@ -9,6 +9,10 @@
Short Title Short Title
%dd %dd
= @conference.short_title = @conference.short_title
%dt
Description
%dd
= markdown(@conference.description)
%dt %dt
Date Date
%dd %dd

View file

@ -2,26 +2,14 @@
.row .row
.col-md-8 .col-md-8
= semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| = semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f|
= f.inputs name: 'Banner' do
= 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 :banner_description, hint: markdown_hint('This description will be shown at the bottom of the banner photo of the Splashpage.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :include_banner, label: 'Display banner on the splashpage?'
= f.inputs name: 'Components' do = f.inputs name: 'Components' do
= 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 :include_tickets, label: 'Display tickets on the splashpage?'
%br
= f.input :sponsor_description, hint: markdown_hint('This will appear in the Sponsors segment of the splash.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :include_sponsors, label: 'Display sponsors on the splashpage?'
%br
= f.input :registration_description, hint: markdown_hint(''), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :include_registrations, label: 'Display the registration period on the splashpage?'
%br
= f.input :lodging_description, hint: markdown_hint('This will appear in the Lodgings segment of the splash.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :include_lodgings, label: 'Display the lodgings on the splashpage?'
%br
= f.input :include_tracks, label: 'Display tracks on the splashpage?' = f.input :include_tracks, label: 'Display tracks on the splashpage?'
= f.input :include_program, label: 'Display program on the splashpage?' = f.input :include_program, label: 'Display program on the splashpage?'
= f.input :include_social_media, label: 'Display social media on the splashpage?'
= f.input :include_venue, label: 'Display venue on the splashpage?' = f.input :include_venue, label: 'Display venue on the splashpage?'
= f.input :public, label: 'Make splash page public! (Attention: Please do this only after you have finished the configuration of the conference!)' = f.input :include_registrations, label: 'Display the registration period on the splashpage?'
= f.input :include_tickets, label: 'Display tickets on the splashpage?'
= f.input :include_lodgings, label: 'Display the lodgings on the splashpage?'
= f.input :include_sponsors, label: 'Display sponsors on the splashpage?'
= f.input :include_social_media, label: 'Display social media on the splashpage?'
= f.input :public, label: 'Make splash page public?'
= f.submit 'Save Splashpage', class: 'btn btn-primary' = f.submit 'Save Splashpage', class: 'btn btn-primary'

View file

@ -4,11 +4,6 @@
.row .row
.col-md-8 .col-md-8
%dl.dl-horizontal %dl.dl-horizontal
%dt
Ticket:
%dd
- unless @splashpage.ticket_description.blank?
= markdown(@splashpage.ticket_description)
%dt %dt
Include Tickets: Include Tickets:
%dd %dd
@ -16,11 +11,6 @@
Yes Yes
- else - else
No No
%dt
Sponsor:
%dd
- unless @splashpage.sponsor_description.blank?
= markdown(@splashpage.sponsor_description)
%dt %dt
Include Sponsors: Include Sponsors:
%dd %dd
@ -28,11 +18,6 @@
Yes Yes
- else - else
No No
%dt
Registration:
%dd
- unless @splashpage.registration_description.blank?
= markdown(@splashpage.registration_description)
%dt %dt
Include Registrations: Include Registrations:
%dd %dd
@ -40,11 +25,6 @@
Yes Yes
- else - else
No No
%dt
Lodging:
%dd
- unless @splashpage.lodging_description.blank?
= markdown(@splashpage.lodging_description)
%dt %dt
Include Tracks: Include Tracks:
%dd %dd
@ -74,34 +54,6 @@
- else - else
No No
.row.row-flex.row-flex-wrap
.col-md-4
.thumbnail.flex-col
%h3.text-center
Conference Banner
- if @splashpage.banner_photo?
= image_tag(@splashpage.banner_photo(:large), class: 'img-responsive')
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @splashpage.banner_photo_file_name
%dt Description
%dd
- unless @splashpage.banner_description.blank?
= markdown(@splashpage.banner_description)
%dt Included
%dd
- if @splashpage.include_banner
Yes
- else
No
- else
%h4.text-center
Not set!
%br %br
- if can? :update, @splashpage - if can? :update, @splashpage
= link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary' = link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary'

View file

@ -1,20 +1,27 @@
#splash #splash
- if @conference.splashpage - if @conference.splashpage
- if @conference.splashpage.include_banner? #splash-banner
#splash-banner{ style: ("background-image: url(#{@conference.splashpage.banner_photo})" unless @conference.splashpage.banner_photo.blank?) } .container
.row
.col-md-8.col-md-offset-2#splash-header
.row
.col-md-4
= image_tag(@conference.logo(:original), class: 'img-responsive', id: 'splash-logo') if @conference.logo?
.col-md-8
%h1
= @conference.title
%p.lead
- if @conference.start_date && @conference.end_date
= date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank?
%section#about
.container .container
.row .row
.col-md-12.text-center .col-md-8.col-md-offset-2
%h1= @conference.title %h3.text-center
- if @conference.start_date && @conference.end_date = markdown(@conference.description)
%h3= date_string(@conference.start_date, @conference.end_date)
- unless @conference.splashpage.banner_description.blank?
%p.lead
= markdown(@conference.splashpage.banner_description)
-unless @conference.photos.blank?
= link_to 'Gallery', gallery_photos_conference_path(@conference.short_title), class: 'btn btn-primary btn-lg', id: 'gallery-btn', remote: true
= render 'gallery'
- if @conference.splashpage.include_program - if @conference.splashpage.include_program
%section#program %section#program
= render 'program' = render 'program'
@ -49,3 +56,8 @@
// grmbl // grmbl
= render 'footer' = render 'footer'
- content_for :script_head do
:javascript
var triangle_tcs = tinycolor("#{@conference.color}").monochromatic();
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });

View file

@ -43,8 +43,8 @@
%li{:class=> "#{active_nav_li(admin_conference_photos_path(@conference.short_title))}"} %li{:class=> "#{active_nav_li(admin_conference_photos_path(@conference.short_title))}"}
= link_to 'Photos', admin_conference_photos_path(@conference.short_title) = link_to 'Photos', admin_conference_photos_path(@conference.short_title)
- if can? :update, @conference - if can? :update, @conference
%li{:class=> active_nav_li(admin_conference_splashpage_path(@conference.short_title))} %li{:class=> active_nav_li(edit_admin_conference_splashpage_path(@conference.short_title))}
= link_to 'Splashpage', admin_conference_splashpage_path(@conference.short_title) = link_to 'Splashpage', edit_admin_conference_splashpage_path(@conference.short_title)
- if can? :index, @conference.venue - if can? :index, @conference.venue
%li{:class=> "#{active_nav_li(edit_admin_conference_venue_path(@conference.short_title))}"} %li{:class=> "#{active_nav_li(edit_admin_conference_venue_path(@conference.short_title))}"}
= link_to(edit_admin_conference_venue_path(@conference.short_title)) do = link_to(edit_admin_conference_venue_path(@conference.short_title)) do

View file

@ -8,11 +8,10 @@
%p %p
OSEM requires JavaScript to be enabled to function. Please turn on JavaScript in your browser's settings and reload the page to continue. OSEM requires JavaScript to be enabled to function. Please turn on JavaScript in your browser's settings and reload the page to continue.
- flash.each do |type, message| - flash.each do |type, message|
.container .row
.row .col-md-12
.col-md-12 %div{:class=>"alert alert-dismissable #{bootstrap_class_for(type)}", :id=>"flash"}
%div{:class=>"alert alert-dismissable #{bootstrap_class_for(type)}", :id=>"flash"} .button.close{"data-dismiss" => "alert", "aria-hidden"=>"true"}
.button.close{"data-dismiss" => "alert", "aria-hidden"=>"true"} &times;
&times; %p
%p = message
= message

View file

@ -15,14 +15,9 @@
detectlang: true, detectlang: true,
autocollect: true autocollect: true
}; };
= content_for(:script_head)
$(function() {
$('.dropdown input, .dropdown label').click(function(e) {
e.stopPropagation();
});
});
= javascript_include_tag "//cdn.transifex.com/live.js" = javascript_include_tag "//cdn.transifex.com/live.js"
= yield(:head) = yield(:head)
%body %body
= render 'layouts/navigation' = render 'layouts/navigation'
@ -31,7 +26,8 @@
= render 'layouts/admin' = render 'layouts/admin'
-else -else
#messages #messages
= render 'layouts/messages' .container
= render 'layouts/messages'
#content #content
= yield = yield
#footer #footer

View file

@ -0,0 +1,25 @@
class MoveBannerDescriptionToConference < ActiveRecord::Migration
class TempConference < ActiveRecord::Base
self.table_name = 'conferences'
attr_accessible :description
end
class TempSplashpage < ActiveRecord::Base
self.table_name = 'splashpages'
end
def change
add_column :conferences, :description, :text
TempConference.reset_column_information
# Copy value from splash to conferenc
TempConference.all.each do |conference|
if TempSplashpage.exists?(conference_id: conference.id)
splash = TempSplashpage.find_by(conference_id: conference.id)
conference.update_attributes(description: splash.banner_description)
end
end
remove_column :splashpages, :banner_description, :text
end
end

View file

@ -0,0 +1,10 @@
class DropSplashDescriptionsAndPhoto < ActiveRecord::Migration
def change
remove_column :splashpages, :ticket_description
remove_column :splashpages, :sponsor_description
remove_column :splashpages, :registration_description
remove_column :splashpages, :lodging_description
remove_column :splashpages, :include_banner
remove_attachment :splashpages, :banner_photo
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141113134103) do ActiveRecord::Schema.define(version: 20141117222919) do
create_table "ahoy_events", force: true do |t| create_table "ahoy_events", force: true do |t|
t.uuid "visit_id" t.uuid "visit_id"
@ -106,6 +106,7 @@ ActiveRecord::Schema.define(version: 20141113134103) do
t.boolean "use_volunteers" t.boolean "use_volunteers"
t.string "color" t.string "color"
t.text "events_per_week" t.text "events_per_week"
t.text "description"
end end
create_table "conferences_questions", id: false, force: true do |t| create_table "conferences_questions", id: false, force: true do |t|
@ -385,21 +386,11 @@ ActiveRecord::Schema.define(version: 20141113134103) do
t.boolean "include_tracks" t.boolean "include_tracks"
t.boolean "include_program" t.boolean "include_program"
t.boolean "include_social_media" t.boolean "include_social_media"
t.boolean "include_banner"
t.boolean "include_venue" t.boolean "include_venue"
t.boolean "include_tickets" t.boolean "include_tickets"
t.text "ticket_description"
t.boolean "include_registrations" t.boolean "include_registrations"
t.text "registration_description"
t.boolean "include_sponsors" t.boolean "include_sponsors"
t.text "sponsor_description"
t.boolean "include_lodgings" t.boolean "include_lodgings"
t.text "lodging_description"
t.text "banner_description"
t.string "banner_photo_file_name"
t.string "banner_photo_content_type"
t.integer "banner_photo_file_size"
t.datetime "banner_photo_updated_at"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end

View file

@ -13,33 +13,15 @@ feature Splashpage do
visit admin_conference_splashpage_path(conference.short_title) visit admin_conference_splashpage_path(conference.short_title)
click_link 'Create Splashpage' click_link 'Create Splashpage'
fill_in 'splashpage_banner_description', with: 'banner description'
fill_in 'splashpage_ticket_description', with: 'ticket description'
fill_in 'splashpage_sponsor_description', with: 'sponsor description'
fill_in 'splashpage_registration_description', with: 'registration description'
fill_in 'splashpage_lodging_description', with: 'lodging description'
click_button 'Save Splashpage' click_button 'Save Splashpage'
expect(flash).to eq('Splashpage successfully created.') expect(flash).to eq('Splashpage successfully created.')
expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title))
splashpage = Splashpage.find_by(conference_id: conference.id) splashpage = Splashpage.find_by(conference_id: conference.id)
splashpage.reload
expect(splashpage.banner_description).to eq('banner description')
expect(splashpage.ticket_description).to eq('ticket description')
expect(splashpage.sponsor_description).to eq('sponsor description')
expect(splashpage.registration_description).to eq('registration description')
expect(splashpage.lodging_description).to eq('lodging description')
end end
context 'splashpage already created' do context 'splashpage already created' do
# before(:each) do
# @splashpage = create(:splashpage)
# conference.splashpage = @splashpage
# end
#
let!(:splashpage) { create(:splashpage, conference: conference, public: false)} let!(:splashpage) { create(:splashpage, conference: conference, public: false)}
scenario 'update a valid splashpage', js: true do scenario 'update a valid splashpage', js: true do
@ -47,24 +29,14 @@ feature Splashpage do
visit admin_conference_splashpage_path(conference.short_title) visit admin_conference_splashpage_path(conference.short_title)
click_link 'Edit' click_link 'Edit'
check('Make splash page public')
fill_in 'splashpage_banner_description', with: 'banner description'
fill_in 'splashpage_ticket_description', with: 'ticket description'
fill_in 'splashpage_sponsor_description', with: 'sponsor description'
fill_in 'splashpage_registration_description', with: 'registration description'
fill_in 'splashpage_lodging_description', with: 'lodging description'
click_button 'Save Splashpage' click_button 'Save Splashpage'
expect(flash).to eq('Splashpage successfully updated.') expect(flash).to eq('Splashpage successfully updated.')
expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title))
splashpage.reload click_link 'Edit'
expect(splashpage.banner_description).to eq('banner description') expect(page.has_checked_field?('Make splash page public?')).to be true
expect(splashpage.ticket_description).to eq('ticket description')
expect(splashpage.sponsor_description).to eq('sponsor description')
expect(splashpage.registration_description).to eq('registration description')
expect(splashpage.lodging_description).to eq('lodging description')
end end
scenario 'delete the splashpage', js: true do scenario 'delete the splashpage', js: true do

View file

@ -2,18 +2,14 @@ require 'spec_helper'
describe 'conference/show.html.haml' do describe 'conference/show.html.haml' do
before(:each) do before(:each) do
allow(view).to receive(:date_string).and_return('January 17 - 21 2014') allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
@conference = create(:conference) @conference = create(:conference, description: 'Lorem Ipsum')
@conference.splashpage = create(:splashpage, @conference.splashpage = create(:splashpage,
banner_description: 'Banner Description',
sponsor_description: 'Sponsor Description',
registration_description: 'Registration Description',
include_registrations: true, include_registrations: true,
include_program: true, include_program: true,
include_sponsors: true, include_sponsors: true,
include_tracks: true, include_tracks: true,
include_tickets: true, include_tickets: true,
include_banner: true,
include_social_media: true, include_social_media: true,
include_venue: true, include_venue: true,
include_lodgings: true) include_lodgings: true)
@ -43,8 +39,7 @@ describe 'conference/show.html.haml' do
end end
it 'renders banner component' do it 'renders banner component' do
expect(rendered).to match(/#{@conference.splashpage.banner_description}/) expect(rendered).to match(/#{@conference.description}/)
expect(rendered).to match(/#{@conference.short_title}/)
end end
it 'renders program partial' do it 'renders program partial' do