diff --git a/Gemfile b/Gemfile index d9bcfea1..231984a5 100644 --- a/Gemfile +++ b/Gemfile @@ -111,6 +111,9 @@ gem 'daemons' # to encapsulate money in objects gem 'money-rails' +# for lists +gem 'acts_as_list' + # Use guard and spring for testing in development group :development do # rspec Guard rules diff --git a/Gemfile.lock b/Gemfile.lock index e1c2e069..4458010b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,6 +36,8 @@ GEM activerecord (>= 3.0) activesupport (>= 3.0) awesome_nested_set (>= 2.0) + acts_as_list (0.4.0) + activerecord (>= 3.0) addressable (2.3.6) ahoy_matey (1.0.0) addressable @@ -166,10 +168,10 @@ GEM i18n (0.6.11) inversion (0.12.3) loggability (~> 0.4) - jquery-datatables-rails (2.2.2) + jquery-datatables-rails (2.2.3) jquery-rails sass-rails - jquery-rails (3.1.0) + jquery-rails (3.1.2) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) @@ -193,7 +195,7 @@ GEM open4 rake mini_portile (0.6.0) - minitest (5.4.2) + minitest (5.4.3) momentjs-rails (2.8.1) railties (>= 3.1) monetize (0.3.0) @@ -351,10 +353,10 @@ GEM ruby-progressbar (1.5.1) rubyzip (1.0.0) sass (3.2.19) - sass-rails (4.0.3) + sass-rails (4.0.4) railties (>= 4.0.0, < 5.0) - sass (~> 3.2.0) - sprockets (~> 2.8, <= 2.11.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 2.12) sprockets-rails (~> 2.0) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) @@ -371,7 +373,7 @@ GEM spring (1.1.2) spring-commands-rspec (1.0.2) spring (>= 0.9.1) - sprockets (2.11.0) + sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -417,6 +419,7 @@ DEPENDENCIES active_model_serializers activeuuid acts_as_commentable_with_threading + acts_as_list ahoy_matey awesome_nested_set (~> 3.0.0.rc.5) axlsx_rails diff --git a/app/assets/javascripts/osem-datatables.js b/app/assets/javascripts/osem-datatables.js index fc76f569..5ba701bc 100644 --- a/app/assets/javascripts/osem-datatables.js +++ b/app/assets/javascripts/osem-datatables.js @@ -1,14 +1,11 @@ $(function () { - $(document).ready(function() { - $('#registrations-datatable').dataTable(); + $(document).ready(function() { + $('.datatable').DataTable({ + // ajax: ..., + autoWidth: false, + pagingType: 'full_numbers' }); - $(document).ready(function() { - $('#users-datatable').dataTable(); - }); - $(document).ready(function() { - $('#events-datatable').dataTable(); - }); - $(document).ready(function() { - $('#buyers-datatable').dataTable(); - }); -} ); + }); +}); + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 2ba27e40..25a8d80e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,6 +8,7 @@ *= require osem-schedule-print *= require osem-dashboard *= require osem-fonts + *= require osem-splash *= require font-awesome *= require bootstrap-markdown.min *= require bootstrap-datetimepicker diff --git a/app/assets/stylesheets/osem-admin.css.scss b/app/assets/stylesheets/osem-admin.css.scss new file mode 100644 index 00000000..532907aa --- /dev/null +++ b/app/assets/stylesheets/osem-admin.css.scss @@ -0,0 +1,59 @@ +.flex-col { + display: flex; + display: -webkit-flex; + flex: 1 100%; + flex-flow: column nowrap; +} + +.flex-grow { + display: flex; + -webkit-flex: 2; + flex: 2; +} + +.row-flex, .row-flex > div[class*='col-'] { + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + flex:1 1 auto; +} + +.row-flex-wrap { + -webkit-flex-flow: row wrap; + align-content: flex-start; + flex:0; +} + +.row-flex > div[class*='col-'], .container-flex > div[class*='col-'] { + margin:-.2px; /* hack adjust for wrapping */ +} + +.nav-header-bigger { + font-size: 15px; + font-weight: bold; + text-transform: uppercase; +} + +.mySidebar { + .fa { + margin-right: 10px; + } + hr { + margin: 1px; + } +} + +.dl-horizontal dt { white-space: normal; } + +.table20 { + width: 20%; +} + + +@media only screen and (max-width: 768px) { + .mySidebar ul.subNav { + display: block; + } +} diff --git a/app/assets/stylesheets/osem-dashboard.css.scss b/app/assets/stylesheets/osem-dashboard.css.scss index a9eca071..394fd764 100644 --- a/app/assets/stylesheets/osem-dashboard.css.scss +++ b/app/assets/stylesheets/osem-dashboard.css.scss @@ -11,4 +11,49 @@ @include breakpoint(lg) { font-size: 5em; } -} \ No newline at end of file +} + +.dashbox { + padding-top: 20px; + padding-bottom: 20px; +} + +.dashbox .icon { + padding-left: 8px; + display: block; + font-size: 3.8em; +} + +.dashbox label { + display: block; + font-size: 1.1em; +} + +.todolist-missing span { + color: #ff0000; +} + +.todolist-ok { + text-decoration: line-through; +} + +.todolist-ok span { + color: #02A10F; +} + +.top-submitter img { + margin: 0 auto; +} + +#doughnut .tab-content { + padding-bottom: 20px; +} + +#submissions { + padding-bottom: 20px; +} + +.conferenceCheckboxes div { + display: inline-block; + padding: 0px 10px 0px 0px; +} diff --git a/app/assets/stylesheets/osem-fonts.css b/app/assets/stylesheets/osem-fonts.css index 0864ce30..50239f2a 100644 --- a/app/assets/stylesheets/osem-fonts.css +++ b/app/assets/stylesheets/osem-fonts.css @@ -44,4 +44,4 @@ .fa-suse:before { content: "a"; -} +} \ No newline at end of file diff --git a/app/assets/stylesheets/osem-splash.css.scss b/app/assets/stylesheets/osem-splash.css.scss new file mode 100644 index 00000000..b2737fb2 --- /dev/null +++ b/app/assets/stylesheets/osem-splash.css.scss @@ -0,0 +1,124 @@ +#splash { + section { + padding-top: 60px; + padding-bottom: 60px; + } + + section:nth-child(even) { + background: none repeat scroll 0 0 #e0e0e0; + color: #555; + } + section:nth-child(odd) { + background: none repeat scroll 0 0 #ffffff; + color: #7b7b7b; + } +} + +#splash-banner{ + background: none; + background-repeat: no-repeat; + background-position: center center; + width: 100%; + background-size: cover; + min-height: 700px; + margin-top: -10px; + .container { + padding-top: 60px; + } + h1, h3{ + color:#3399CC; + } + 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; + } +} + +#program { + .tracks:hover{ + background-color: white; + } +} + +#callforpapers { + .timer-box{ + width: 130px; + margin: 35px 24px 20px 0; + border-radius: 50%; + border:4px solid #989797; + } + #cfp-date{ + font-size: 40px; + color: #ff6633; + } +} + +#location { + background-repeat: no-repeat; + background-position: center center; + width: 100%; + background-size: cover; + min-height: 500px; + h1,h2,p{ + color: #fff; + } + h1,h2,li,p{ + text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); + font-weight: 400; + } +} + +#social-media{ + i{ + color: #4a4a4a; + } + i:hover{ + color: #16a085; + } +} + +.scroll-top-wrapper { + position: fixed; + opacity: 0; + visibility: hidden; + overflow: hidden; + text-align: center; + z-index: 99999999; + background-color: #424242; + width: 50px; + height: 48px; + line-height: 48px; + right: 30px; + bottom: 30px; + padding-top: 2px; + border-top-left-radius: 10px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + border-bottom-left-radius: 10px; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; + i.fa { + line-height: inherit; + } + &.show { + visibility:visible; + cursor:pointer; + opacity: 1.0; + } + a { + color: white; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.css.scss index f59b73b1..18195a9c 100644 --- a/app/assets/stylesheets/osem.css.scss +++ b/app/assets/stylesheets/osem.css.scss @@ -17,158 +17,11 @@ body { /* Set the fixed height of the footer here */ height: 60px; background-color: #f5f5f5; -} - -.container .text-muted { - margin: 20px 0; -} - -#footer > .container { - padding: 15px; -} - -.nav-header-bigger { - font-size: 15px; - font-weight: bold; - text-transform: uppercase; -} - -.fa { - margin-right: 10px; -} - -.mySidebar hr { - margin: 1px; -} - -@media only screen and (max-width: 768px) { - .mySidebar ul.subNav { - display: block; + .container { + padding: 15px; } } -.conferenceCheckboxes div { - display: inline-block; - padding: 0px 10px 0px 0px; -} - -.dashbox { - padding-top: 20px; - padding-bottom: 20px; -} - -.dashbox .icon { - padding-left: 8px; - display: block; - font-size: 3.8em; -} - -.dashbox label { - display: block; - font-size: 1.1em; -} - -.todolist-missing span { - color: #ff0000; -} - -.todolist-ok { - text-decoration: line-through; -} - -.todolist-ok span { - color: #02A10F; -} - -.top-submitter img { - margin: 0 auto; -} - -#doughnut .tab-content { - padding-bottom: 20px; -} - -#submissions { - padding-bottom: 20px; -} - -.banner-disp{ - background-repeat: no-repeat; - background-position: center center; - width: 100%; - background-size: cover; - -webkit-background-size:cover; -} - -#location .with-background { - min-height: 500px; -} - -#splash-banner .with-background{ - min-height: 700px; -} - -.location-links li{ - display: inline-block; - margin-right: 2em; -} - -.banner-text{ - padding-top: 10%; -} - -.pad{ - padding-top: 35px; - padding-bottom: 35px; -} - -.dl-horizontal dt { white-space: normal; } - -.equal, .equal > div[class*='col-'] { - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex:1 0 auto; -} - -.row-flex, .row-flex > div[class*='col-'] { - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex:1 1 auto; -} - -.row-flex-wrap { - -webkit-flex-flow: row wrap; - align-content: flex-start; - flex:0; -} - -.row-flex > div[class*='col-'], .container-flex > div[class*='col-'] { - margin:-.2px; /* hack adjust for wrapping */ -} - -.container-flex > div[class*='col-'] div,.row-flex > div[class*='col-'] div { - width:100%; -} - -.flex-col { - display: flex; - display: -webkit-flex; - flex: 1 100%; - flex-flow: column nowrap; -} - -.flex-grow { - display: flex; - -webkit-flex: 2; - flex: 2; -} - -.table20 { - width: 20%; -} +.nav-tabs { + margin-bottom: 15px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/splash.css.scss b/app/assets/stylesheets/splash.css.scss deleted file mode 100644 index 968235ca..00000000 --- a/app/assets/stylesheets/splash.css.scss +++ /dev/null @@ -1,265 +0,0 @@ -@font-face { - font-family: 'Lato'; - font-style: normal; - font-weight: 300; - src: local('Lato Light'), local('Lato-Light'), url("fonts/Lato-Light.woff") format('woff'); -} - -@font-face { - font-family: 'Lato'; - font-style: normal; - font-weight: 400; - src: local('Lato Regular'), local('Lato-Regular'), url("fonts/Lato-Regular.woff") format('woff'); -} - -@font-face { - font-family: 'Lato'; - font-style: normal; - font-weight: 700; - src: local('Lato Bold'), local('Lato-Bold'), url("fonts/Lato-Bold.woff") format('woff'); -} - -@font-face { - font-family: 'Lato'; - font-style: italic; - font-weight: 300; - src: local('Lato Light Italic'), local('Lato-LightItalic'), url("fonts/Lato-LightItalic.woff") format('woff'); -} - -@font-face { - font-family: 'Lato'; - font-style: italic; - font-weight: 400; - src: local('Lato Italic'), local('Lato-Italic'), url("fonts/Lato-Italic.woff") format('woff'); -} - -@font-face { - font-family: 'Raleway'; - font-style: normal; - font-weight: 300; - src: local('Raleway Light'), local('Raleway-Light'), url("fonts/Raleway-Light.woff") format('woff'); -} - -@font-face { - font-family: 'Raleway'; - font-style: normal; - font-weight: 400; - src: local('Raleway'), url("fonts/Raleway.woff") format('woff'); -} - -@font-face { - font-family: 'Raleway'; - font-style: normal; - font-weight: 700; - src: local('Raleway Bold'), local('Raleway-Bold'), url("fonts/Raleway-Bold.woff") format('woff'); -} - -@font-face { - font-family: 'Coustard'; - font-style: normal; - font-weight: 400; - src: local('Coustard'), url("fonts/Coustard.woff") format('woff'); -} -@font-face { - font-family: 'Coustard'; - font-style: normal; - font-weight: 900; - src: local('Coustard-Black'), url("fonts/Coustard-Black.woff") format('woff'); -} - -.splash { - background-color: #f2f2f2; - font-family: 'Lato'; - font-weight: 300; - font-size: 16px; - color: #555; - margin-top: -10px; - - -webkit-font-smoothing: antialiased; - /*-webkit-overflow-scrolling: touch;*/ - - - /* Titles */ - h1, h2, h3, h4, h5, h6 { - font-family: "Raleway"; - font-weight: 300; - color: #333; - } - - /* Links */ - a { - color: #f85c37; - word-wrap: break-word; - - -webkit-transition: color 0.1s ease-in, background 0.1s ease-in; - -moz-transition: color 0.1s ease-in, background 0.1s ease-in; - -ms-transition: color 0.1s ease-in, background 0.1s ease-in; - -o-transition: color 0.1s ease-in, background 0.1s ease-in; - transition: color 0.1s ease-in, background 0.1s ease-in; - } - - a:hover, - a:focus { - color: #7b7b7b; - text-decoration: none; - outline: 0; - } - - a:before, - a:after { - -webkit-transition: color 0.1s ease-in, background 0.1s ease-in; - -moz-transition: color 0.1s ease-in, background 0.1s ease-in; - -ms-transition: color 0.1s ease-in, background 0.1s ease-in; - -o-transition: color 0.1s ease-in, background 0.1s ease-in; - transition: color 0.1s ease-in, background 0.1s ease-in; - } - - hr { - display: block; - height: 1px; - border: 0; - border-top: 1px solid #ccc; - margin: 1em 0; - padding: 0; - } - /* ========================================================================== - Wrap Sections - ========================================================================== */ - - #splash-banner{ - h1, h3{ - color:#3399CC; - } - 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; - } - } - - #program{ - .tracks:hover{ - background-color: white; - } - } - - #callforpapers{ - .timer-box{ - width: 130px; - margin: 35px 24px 20px 0; - border-radius: 50%; - border:4px solid #989797; - } - #cfp-date{ - font-size: 40px; - font-family: 'Coustard', serif; - color: #ff6633; - } - } - - #registration{ - background-color: #e0e0e0; - } - - #sponsors{ - h2,h3,h4{ - color: #fff; - font-weight: 400; - } - - color: #fff; - background-color: #343b3d; - } - - #social-media{ - i{ - color: #4a4a4a; - } - i:hover{ - color: #16a085; - } - } - - #location{ - - h1,h2,p{ - color: #fff; - } - h1,h2,li,p{ - text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); - font-weight: 400; - } - } - #gallery{ - min-height: 600px; - .item{ - img { - height: 600px; - background-repeat: no-repeat; - background-position: center center; - width: 100%; - background-size: cover; - -webkit-background-size:cover; - } - } - .modal-body{ - i{ - margin-top: 35%; - } - } - #carousel-example-generic{ - visibility: hidden; - } - } - - .scroll-top-wrapper { - position: fixed; - opacity: 0; - visibility: hidden; - overflow: hidden; - text-align: center; - z-index: 99999999; - background-color: #424242; - width: 50px; - height: 48px; - line-height: 48px; - right: 30px; - bottom: 30px; - padding-top: 2px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; - border-bottom-right-radius: 10px; - border-bottom-left-radius: 10px; - -webkit-transition: all 0.5s ease-in-out; - -moz-transition: all 0.5s ease-in-out; - -ms-transition: all 0.5s ease-in-out; - -o-transition: all 0.5s ease-in-out; - transition: all 0.5s ease-in-out; - - i.fa { - line-height: inherit; - } - - &.show { - visibility:visible; - cursor:pointer; - opacity: 1.0; - } - - a { - color: white; - } - } -} - - - diff --git a/app/assets/stylesheets/strap-on.css.scss b/app/assets/stylesheets/strap-on.css.scss index 20448614..a54d2984 100644 --- a/app/assets/stylesheets/strap-on.css.scss +++ b/app/assets/stylesheets/strap-on.css.scss @@ -17,7 +17,7 @@ $navbar-default-link-hover-color: #000000; // Reset and dependencies @import "bootstrap/normalize"; @import "bootstrap/print"; -// @import "bootstrap/glyphicons"; // Using FontAwesome instead +@import "bootstrap/glyphicons"; // Core CSS @import "bootstrap/scaffolding"; diff --git a/app/controllers/admin/sponsorship_levels_controller.rb b/app/controllers/admin/sponsorship_levels_controller.rb index 134295e3..a4f0095b 100644 --- a/app/controllers/admin/sponsorship_levels_controller.rb +++ b/app/controllers/admin/sponsorship_levels_controller.rb @@ -1,22 +1,65 @@ module Admin class SponsorshipLevelsController < Admin::BaseController load_and_authorize_resource :conference, find_by: :short_title - authorize_resource through: :conference + load_and_authorize_resource through: :conference def index authorize! :index, SponsorshipLevel.new(conference_id: @conference.id) end - def update - if @conference.update_attributes(params[:conference]) - redirect_to(admin_conference_sponsorship_levels_path( - conference_id: @conference.short_title), - notice: 'Sponsorship levels were successfully updated.') + def edit; end + + def new + @sponsorship_level = @conference.sponsorship_levels.new + end + + def create + @sponsorship_level = @conference.sponsorship_levels.new(sponsorship_level_params) + if @sponsorship_level.save + redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title), + notice: 'Sponsorship level successfully created.') else + flash[:error] = "Creating Sponsorship Level failed: #{@sponsorship_level.errors.full_messages.join('. ')}." + render :new + end + end + + def update + if @sponsorship_level.update_attributes(sponsorship_level_params) redirect_to(admin_conference_sponsorship_levels_path( conference_id: @conference.short_title), - alert: 'Sponsorship levels update failed') + notice: 'Sponsorship level successfully updated.') + else + flash[:error] = "Update Sponsorship level failed: #{@sponsorship_level.errors.full_messages.join('. ')}." + render :edit end end + + def destroy + if @sponsorship_level.destroy + redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title), + notice: 'Sponsorship level successfully deleted.') + else + redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title), + error: 'Deleting sponsorship level failed! ' \ + "#{@sponsorship_level.errors.full_messages.join('. ')}.") + end + end + + def up + @sponsorship_level.move_higher + redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title)) + end + + def down + @sponsorship_level.move_lower + redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title)) + end + + private + + def sponsorship_level_params + params[:sponsorship_level] + end end end diff --git a/app/models/conference.rb b/app/models/conference.rb index 4d732f95..f71c05f3 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -57,7 +57,7 @@ class Conference < ActiveRecord::Base has_many :participants, through: :registrations, source: :user has_many :vdays, dependent: :destroy has_many :vpositions, dependent: :destroy - has_many :sponsorship_levels, dependent: :destroy + has_many :sponsorship_levels, -> { order('position ASC') }, dependent: :destroy has_many :sponsors, dependent: :destroy has_many :photos, dependent: :destroy has_many :targets, dependent: :destroy diff --git a/app/models/sponsorship_level.rb b/app/models/sponsorship_level.rb index 174a440d..cfdc6a35 100644 --- a/app/models/sponsorship_level.rb +++ b/app/models/sponsorship_level.rb @@ -2,5 +2,6 @@ class SponsorshipLevel < ActiveRecord::Base attr_accessible :title, :conference_id validates_presence_of :title belongs_to :conference + acts_as_list scope: :conference has_many :sponsors end diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 43545dff..12c556ee 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -6,7 +6,7 @@ Events - if @events = "(#{@events.length})" - %table.table.table-striped.table-bordered.table-hover#events-datatable + %table.table.table-striped.table-bordered.table-hover.datatable %thead %th %b ID diff --git a/app/views/admin/rooms/index.html.haml b/app/views/admin/rooms/index.html.haml index 05d6b837..5584fba8 100644 --- a/app/views/admin/rooms/index.html.haml +++ b/app/views/admin/rooms/index.html.haml @@ -3,7 +3,7 @@ - if @conference.rooms.any? .row .col-md-12 - %table.table + %table.table#rooms %thead %th # %th Name diff --git a/app/views/admin/sponsorship_levels/_form.html.haml b/app/views/admin/sponsorship_levels/_form.html.haml new file mode 100644 index 00000000..f90c751c --- /dev/null +++ b/app/views/admin/sponsorship_levels/_form.html.haml @@ -0,0 +1,2 @@ += f.input :title += f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } \ No newline at end of file diff --git a/app/views/admin/sponsorship_levels/_sponsorship_level_fields.html.erb b/app/views/admin/sponsorship_levels/_sponsorship_level_fields.html.erb deleted file mode 100644 index ec4b6220..00000000 --- a/app/views/admin/sponsorship_levels/_sponsorship_level_fields.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -
- <%= f.inputs do %> - <%= f.input :title %> - <%= remove_association_link :sponsorship_level, f %> - <% end %> -
diff --git a/app/views/admin/sponsorship_levels/edit.html.haml b/app/views/admin/sponsorship_levels/edit.html.haml new file mode 100644 index 00000000..91d80ff7 --- /dev/null +++ b/app/views/admin/sponsorship_levels/edit.html.haml @@ -0,0 +1,8 @@ +%h1 Editing Sponsorship Level + +.row + .col-md-8 + = semantic_form_for @sponsorship_level, url: admin_conference_sponsorship_level_path(conference_id: @conference.short_title, id: @sponsorship_level.id) do |f| + = render 'form', f: f + += link_to 'Back', admin_conference_sponsorship_levels_path diff --git a/app/views/admin/sponsorship_levels/index.html.haml b/app/views/admin/sponsorship_levels/index.html.haml index 53bda41b..507ca985 100644 --- a/app/views/admin/sponsorship_levels/index.html.haml +++ b/app/views/admin/sponsorship_levels/index.html.haml @@ -1,4 +1,29 @@ -.col-md-9 - = semantic_form_for(@conference, :url => admin_conference_sponsorship_level_path(@conference.short_title, @conference.sponsorship_levels)) do |f| - = dynamic_association :sponsorship_levels, "Sponsorship Levels", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} +%h1 Sponsorship Levels + +- if @conference.sponsorship_levels.any? + .row + .col-md-12 + %table.table#sponsorship_levels + %thead + %th Title + %th Position + %th Actions + %tbody + - @conference.sponsorship_levels.each_with_index do |sponsorship_level, index| + %tr + %td + = sponsorship_level.title + %td + = sponsorship_level.position + .btn-group-vertical{role: "group"} + = link_to(up_admin_conference_sponsorship_level_path(@conference.short_title, sponsorship_level.id), method: :patch, class: 'btn btn-default btn-xs') do + %i.fa.fa-chevron-up + = link_to(down_admin_conference_sponsorship_level_path(@conference.short_title, sponsorship_level.id), method: :patch, class: 'btn btn-default btn-xs') do + %i.fa.fa-chevron-down + %td + = link_to 'Edit', edit_admin_conference_sponsorship_level_path(@conference.short_title, sponsorship_level.id), + method: :get, class: 'btn btn-primary' + = link_to 'Delete', admin_conference_sponsorship_level_path(@conference.short_title, sponsorship_level.id), + method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the sponsorship level #{sponsorship_level.title}?" } + += link_to 'New Sponsorship Level', new_admin_conference_sponsorship_level_path(@conference.short_title), class: 'btn btn-success' diff --git a/app/views/admin/sponsorship_levels/new.html.haml b/app/views/admin/sponsorship_levels/new.html.haml new file mode 100644 index 00000000..76d7a511 --- /dev/null +++ b/app/views/admin/sponsorship_levels/new.html.haml @@ -0,0 +1,7 @@ +%h1 New Sponsorship Level +.row + .col-md-8 + = semantic_form_for @sponsorship_level, url: admin_conference_sponsorship_levels_path(conference_id: @conference.short_title) do |f| + = render 'form', f: f + += link_to 'Back', admin_conference_sponsorship_levels_path diff --git a/app/views/admin/tickets/show.html.haml b/app/views/admin/tickets/show.html.haml index 066b8648..6f37d1b1 100644 --- a/app/views/admin/tickets/show.html.haml +++ b/app/views/admin/tickets/show.html.haml @@ -7,7 +7,7 @@ = markdown(@ticket.description) %h4 The following persons bought this ticket: -%table.table#buyers-datatable +%table.table.table-striped.table-bordered.table-hover.datatable %thead %th # %th Name diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index dd004b4a..17d25df2 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,12 +1,14 @@ .row .col-md-12 - %h2 - Users - - if @users - = "(#{@users.length})" - - = link_to 'New User', new_admin_user_path, class: 'btn btn-success pull-right' - %table.table.table-striped.table-bordered.table-hover#users-datatable + .page-header + %h2 + Users + - if @users + = "(#{@users.length})" + = link_to 'New User', new_admin_user_path, class: 'btn btn-success pull-right' +.row + .col-md-12 + %table.table.table-striped.table-bordered.table-hover.datatable %thead %th ID %th State @@ -53,4 +55,4 @@ disabled: true, class: 'btn btn-primary disabled btn-danger', role: 'button' - else = link_to 'Delete',admin_user_path(user), method: :delete, - data: { confirm: 'Are you sure ?' }, class: 'btn btn-primary btn-danger' + data: { confirm: 'Are you sure ?' }, class: 'btn btn-primary btn-danger' \ No newline at end of file diff --git a/app/views/commercials/edit.html.haml b/app/views/commercials/edit.html.haml index 029318df..1f85f432 100644 --- a/app/views/commercials/edit.html.haml +++ b/app/views/commercials/edit.html.haml @@ -1,8 +1,10 @@ -%h1 Editing Commercial - -.row - .col-md-8 - = semantic_form_for @commercial, url: conference_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event.id, id: @commercial.id) do |f| - = render 'form', f: f - -= link_to 'Back', edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id) +.container + .row + .col-md-12 + .page-header + %h1 Editing Commercial + .row + .col-md-12 + = semantic_form_for @commercial, url: conference_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event.id, id: @commercial.id) do |f| + = render 'form', f: f + = link_to 'Back', edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id) diff --git a/app/views/commercials/new.html.haml b/app/views/commercials/new.html.haml index ae20cc8a..e4d96ee5 100644 --- a/app/views/commercials/new.html.haml +++ b/app/views/commercials/new.html.haml @@ -1,7 +1,10 @@ -%h1 New Commercial -.row - .col-md-8 - = semantic_form_for @commercial, url: conference_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event.id) do |f| - = render 'form', f: f - -= link_to 'Back', edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id) +.container + .row + .col-md-12 + .page-header + %h1 New Commercial + .row + .col-md-12 + = semantic_form_for @commercial, url: conference_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event.id) do |f| + = render 'form', f: f + = link_to 'Back', edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id) diff --git a/app/views/conference/_call_for_papers.html.haml b/app/views/conference/_call_for_papers.html.haml index 6c405a4d..51e58a87 100644 --- a/app/views/conference/_call_for_papers.html.haml +++ b/app/views/conference/_call_for_papers.html.haml @@ -2,41 +2,36 @@ %li %a.smoothscroll{ href: '#callforpapers' } Call For Papers -%div.container#callforpapers.text-center - %div.row - %div.col-md-12 +.container + .row + .col-md-12.text-center %h1 Call For Papers - if !@conference.call_for_papers.description.blank? - .lead - = markdown(@conference.call_for_papers.description) + = markdown(@conference.call_for_papers.description) + .row + .col-md-12.text-center + .lead + = link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank' - if !@conference.call_for_papers.start_date.blank? && !@conference.call_for_papers.end_date.blank? - .lead Proposals will be accepted between - #cfp-date + %p + Proposals will be accepted between + %p#cfp-date = date_string(@conference.call_for_papers.start_date, @conference.call_for_papers.end_date) - - if @conference.cfp_open? - - if @conference.call_for_papers.end_date.to_time < Time.now - .lead Today is the last day. Hurry Up! - - else - .row - .col-md-8.col-md-offset-3 - %div.col-md-2.timer-box - %h2#days - .lead Days - %div.col-md-2.timer-box - %h2#hours - .lead Hours - %div.col-md-2.timer-box - %h2#minutes - .lead Minutes - %div.col-md-2.timer-box - %h2#seconds - .lead Seconds - .row - .lead - = link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank' - -else - %h3 Call for Papers is currently closed! + .row + .col-md-8.col-md-offset-3.text-center + %div.col-md-2.timer-box + %h2#days + .lead Days + %div.col-md-2.timer-box + %h2#hours + .lead Hours + %div.col-md-2.timer-box + %h2#minutes + .lead Minutes + %div.col-md-2.timer-box + %h2#seconds + .lead Seconds :javascript $( document ).ready(function(){ diff --git a/app/views/conference/_keynote_speakers.html.haml b/app/views/conference/_keynote_speakers.html.haml deleted file mode 100644 index 8fe8931c..00000000 --- a/app/views/conference/_keynote_speakers.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%div.row.text-center - %div.col-md-12 - %h3 Keynote Speakers - - @keynote_speakers.each do |k| - %div{ class: (@keynote_speakers.count.to_i <= 2 ? "col-md-#{12/@keynote_speakers.count.to_i}" : "col-md-4") } - = image_tag(k.gravatar_url(size: '80'), class: 'img-circle') unless k.gravatar_url.blank? - %h4 - = k.name - -unless k.biography.blank? - %p - = k.biography diff --git a/app/views/conference/_location.html.haml b/app/views/conference/_location.html.haml index 7353d2d6..2cff45e3 100644 --- a/app/views/conference/_location.html.haml +++ b/app/views/conference/_location.html.haml @@ -2,25 +2,19 @@ %li %a.smoothscroll{ href: '#location' } Location - -%div.banner-disp{ style: ("background-image: url(#{@conference.venue.photo})" unless @conference.venue.photo.blank?), class:('with-background' unless @conference.venue.photo.blank?) } - %div.container.text-center - .div.row.col-md-12 +.container + .row + .col-md-12.text-center - unless @conference.venue.name.blank? %h1 %strong #{ @conference.venue.name } - unless @conference.venue.address.blank? - %h2 - %strong #{ @conference.venue.address } + = link_to("http://maps.google.com/maps?q=#{@conference.venue.address}") do + %h2 + #{ @conference.venue.address } - unless @conference.venue.description.blank? .lead = markdown(@conference.venue.description) - %ul.location-links - - unless @conference.venue.address.blank? - %li - %b - = link_to 'View in Google Maps', "http://maps.google.com/maps?q=#{@conference.venue.address}", target: '_blank' - - unless @conference.venue.website.blank? - %li - %b - = link_to 'Visit Venue Website', @conference.venue.website, target: '_blank' + - unless @conference.venue.website.blank? + %p.lead + = link_to(@conference.venue.website, @conference.venue.website) diff --git a/app/views/conference/_lodging.html.haml b/app/views/conference/_lodging.html.haml index 50f2c9e7..1a13065e 100644 --- a/app/views/conference/_lodging.html.haml +++ b/app/views/conference/_lodging.html.haml @@ -1,10 +1,10 @@ -%div.container.text-center - %h2 Lodging - -unless @conference.splashpage.lodging_description.blank? - .lead - = markdown(@conference.splashpage.lodging_description) - - %div.row.text-center +.container + .row + .col-md-12.text-center + %h2 Accommodation Deals + %p.lead + We have prepared affordable accommodation deals for your visit. + .row - @conference.venue.lodgings.each do |r| %div{ class: (@conference.venue.lodgings.count.to_i <= 2 ? "col-md-#{12/@conference.venue.lodgings.count.to_i}" : "col-md-4") } .div.thumbnail diff --git a/app/views/conference/_program.html.haml b/app/views/conference/_program.html.haml index dfa2cc31..84aa5f97 100644 --- a/app/views/conference/_program.html.haml +++ b/app/views/conference/_program.html.haml @@ -1,22 +1,36 @@ = content_for :splash_nav do %li - %a.smoothscroll{ href: '#program' } Program + =link_to('#program', class: 'smoothscroll') do + Program -%div.container.text-center - %div.row - %div.col-md-12 +.container + .row + .col-md-12.text-center %h1 Program - - if @conference.call_for_papers and @conference.call_for_papers.schedule_public - %span You can check out our - %span - = link_to 'Schedule', conference_schedule_path(@conference.short_title), target: '_blank' - - else - %span The schedule is not ready yet. Stay tuned! - - - unless @keynote_speakers.blank? - = render 'keynote_speakers' - - -unless @conference.tracks.blank? - - if @conference.splashpage.include_tracks - = render 'tracks' - + - if @conference.splashpage and @conference.splashpage.include_tracks + .row + .col-md-12 + - @conference.tracks.each do |t| + .tracks{ class: (@conference.tracks.count.to_i <= 2 ? "col-md-#{12/@conference.tracks.count.to_i}" : "col-md-4") } + %h4.text-center + = t.name + %p + = markdown(t.description) + - if @conference.call_for_papers and @conference.call_for_papers.schedule_public + .row + .col-md-12 + %p.text-center + Check out our + = link_to 'Schedule', conference_schedule_path(@conference.short_title) + - if !@keynote_speakers.blank? + %div.row.text-center + %div.col-md-12 + %h3 Keynote Speakers + - @keynote_speakers.each do |k| + %div{ class: (@keynote_speakers.count.to_i <= 2 ? "col-md-#{12/@keynote_speakers.count.to_i}" : "col-md-4") } + = image_tag(k.gravatar_url(size: '80'), class: 'img-circle') unless k.gravatar_url.blank? + %h4 + = k.name + -unless k.biography.blank? + %p + = k.biography diff --git a/app/views/conference/_registration.html.haml b/app/views/conference/_registration.html.haml index ed536310..5a5480cf 100644 --- a/app/views/conference/_registration.html.haml +++ b/app/views/conference/_registration.html.haml @@ -1,22 +1,16 @@ = content_for :splash_nav do %li %a.smoothscroll{ href: '#registration' } Registration -%div.container.text-center - %div.row - %h1 Registration - - if !@conference.splashpage.registration_description.blank? - .lead - = markdown(@conference.splashpage.registration_description) - - if @conference.registration_dates_given? - -if @conference.registration_period.end_date >= Date.today - %h4 Registration period #{ date_string(@conference.registration_period.start_date, @conference.registration_period.end_date) } - -else - %h4 Registration is Closed, it was from #{ date_string(@conference.registration_period.start_date, @conference.registration_period.end_date) } - - if @conference.registration_open? - - if current_user && @conference.user_registered?(current_user) - = link_to "Modify Registration for #{@conference.short_title}", edit_conference_conference_registrations_path(@conference.short_title), class: "btn btn-success btn-lg", target: '_blank' - - else - = link_to "Register for #{@conference.short_title}", new_conference_conference_registrations_path(@conference.short_title), class: "btn btn-success btn-lg", target: '_blank' - - if @conference.tickets.any? - - if @conference.splashpage.include_tickets - = render 'tickets' + +.container + .row + .col-md-12.text-center + %h1 Registration + %p.lead + Going to + = @conference.short_title + is free of charge. We only ask you to + = link_to "register yourself", new_conference_conference_registrations_path(@conference.short_title) + until + = @conference.registration_period.end_date + diff --git a/app/views/conference/_sponsor.html.haml b/app/views/conference/_sponsor.html.haml deleted file mode 100644 index a0d6187a..00000000 --- a/app/views/conference/_sponsor.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#sponsors' } Sponsors -%div.container#sponsors.text-center - %div.row - %div.col-md-12 - %h2 Sponsors - -if !@conference.splashpage.sponsor_description.blank? - .lead - = markdown(@conference.splashpage.sponsor_description) - -if @conference.contact && @conference.contact.sponsor_email.present? - %h3= mail_to "#{ @conference.contact.sponsor_email }", 'Become a Sponsor' - - if !@conference.sponsorship_levels.blank? - - @conference.sponsorship_levels.each do |l| - - if !l.sponsors.blank? - %div.row.text-center - %h4 #{l.title} - - l.sponsors.each_with_index do |r,index| - %div.text-center{ class: (l.sponsors.count.to_i <= 2 ? "col-md-#{12/l.sponsors.count.to_i}" : "col-md-4") } - - if !r.logo.blank? - = link_to image_tag(r.logo(:large), alt: "#{r.name} Logo", title: "#{r.description}"), "http://#{r.website_url}" - - unless index == 0 - - if index%2 == 0 - %div.clearfix.visible-md.visible-lg diff --git a/app/views/conference/_sponsors.html.haml b/app/views/conference/_sponsors.html.haml new file mode 100644 index 00000000..bb1755e3 --- /dev/null +++ b/app/views/conference/_sponsors.html.haml @@ -0,0 +1,33 @@ += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#sponsors' } Sponsors + +.container + .row + .col-md-12 + %h2 Sponsors + %p.lead + whom without, + = @conference.short_title + wouldn't be possible! + - @conference.sponsorship_levels.each do |sponsorship_level| + -if sponsorship_level.sponsors.any? + .row + .col-md-12.text-center + %h3 + = sponsorship_level.title + - sponsorship_level.sponsors.each_slice(3) do |slice| + .row + - slice.each do |sponsor| + .col-md-4 + = link_to("http://#{sponsor.website_url}", class: 'thumbnail') do + = image_tag(sponsor.logo(:large), alt: "#{sponsor.name} Logo", title: "#{sponsor.description}") + -if @conference.contact and !@conference.contact.sponsor_email.blank? + .row + .col-md-12 + %p.text-muted.text-center + %small + Want to sponsor #{@conference.short_title}? + = link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do + Please contact us! + diff --git a/app/views/conference/_tickets.html.haml b/app/views/conference/_tickets.html.haml index b77b9962..5f8e43ec 100644 --- a/app/views/conference/_tickets.html.haml +++ b/app/views/conference/_tickets.html.haml @@ -1,15 +1,21 @@ -%div.row - %h3 Tickets - -if @conference.splashpage.ticket_description.present? - .lead - = markdown(@conference.splashpage.ticket_description) - - @conference.tickets.each do |s| - %div.col-md-6 +.container + .row + .col-md-12.text-center + %h1 + Support + =@conference.short_title + %p.lead + To support our event you can purchase tickets + .row + - @conference.tickets.each do |ticket| + %div{ class: (@conference.tickets.count <= 2 ? "col-md-#{12/@conference.tickets.count}" : "col-md-4") } - if ticket.title.present? - %h4 #{ ticket.title } + %h4.text-center + =ticket.title - if ticket.description.present? - .lead - = markdown(ticket.description) - %div.btn-group - = link_to "Buy Ticket", conference_tickets_path(@conference.short_title), class: 'btn btn-success' - = button_tag "#{humanized_money_with_symbol ticket.price}", class: 'btn btn-success' + = markdown(ticket.description) + .text-center + .btn-group + = link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do + Buy Ticket + = "#{humanized_money_with_symbol ticket.price}" diff --git a/app/views/conference/_tracks.html.haml b/app/views/conference/_tracks.html.haml deleted file mode 100644 index 09758ea1..00000000 --- a/app/views/conference/_tracks.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%div.row.text-center - %div.col-md-12 - %h2 Tracks - - @conference.tracks.each do |t| - %div.tracks{ class: (@conference.tracks.count.to_i <= 2 ? "col-md-#{12/@conference.tracks.count.to_i}" : "col-md-4") } - %h4 - = t.name - %p - = markdown(t.description) diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index 731616c8..a5b6e8f4 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -1,60 +1,51 @@ -= content_for :splash do +#splash - if @conference.splashpage - .splash - - if @conference.splashpage.include_banner? - %section{ id: 'splash-banner' } - %div.banner-disp{ style: ("background-image: url(#{@conference.splashpage.banner_photo})" unless @conference.splashpage.banner_photo.blank?), class:('with-background' unless @conference.splashpage.banner_photo.blank?) } - %div.container.text-center.banner-text - .row - %h1 - = @conference.title + - if @conference.splashpage.include_banner? + #splash-banner{ style: ("background-image: url(#{@conference.splashpage.banner_photo})" unless @conference.splashpage.banner_photo.blank?) } + .container + .row + .col-md-12.text-center + %h1= @conference.title - if @conference.start_date && @conference.end_date - .row - %h3 - = date_string(@conference.start_date, @conference.end_date) - + %h3= date_string(@conference.start_date, @conference.end_date) - unless @conference.splashpage.banner_description.blank? - .row-fluid - .col-md-12.lead - .lead - = markdown(@conference.splashpage.banner_description) + %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 - %section{ id: 'program' } - .pad - = render 'program' - - - if @conference.splashpage.include_registrations - %section{ id: 'registration' } - .pad - = render 'registration' - - - -unless @conference.call_for_papers.blank? - - if @conference.call_for_papers.include_cfp_in_splash? - %section{ id:'callforpapers' } - .pad - = render 'call_for_papers' - - -unless @conference.venue.blank? - - if @conference.splashpage.include_venue - %section{ id: 'location' } - .pad - = render 'location' - - unless @conference.venue.lodgings.empty? - - if @conference.splashpage.include_lodgings - = render 'lodging' - - - if @conference.splashpage.include_sponsors - %section{ id: 'sponsors' } - .pad - = render 'sponsor' - - - if @conference.splashpage.include_social_media - %section{ id: 'social-media' } - .pad - = render 'social_media' - - = render 'footer' + + - if @conference.splashpage.include_program + %section#program + = render 'program' + + - if @conference.cfp_open? and @conference.call_for_papers.include_cfp_in_splash? + %section#callforpapers + = render 'call_for_papers' + + - if @conference.venue and @conference.splashpage.include_venue + #location{ style: ("background-image: url(#{@conference.venue.photo})" unless @conference.venue.photo.blank?) } + = render 'location' + + - if @conference.registration_open? and @conference.splashpage.include_registrations + %section#registration + = render 'registration' + + - if @conference.tickets.any? and @conference.splashpage.include_tickets + %section#tickets + = render 'tickets' + + - if @conference.venue.lodgings.any? and @conference.splashpage.include_lodgings + %section#lodging + = render 'lodging' + + - if @conference.sponsors.any? and @conference.splashpage.include_sponsors + %section#sponsors + = render 'sponsors' + + - if @conference.splashpage.include_social_media + %section#social-media + = render 'social_media' + + // grmbl + = render 'footer' diff --git a/app/views/conference_registrations/_form.html.haml b/app/views/conference_registrations/_form.html.haml index 91bbbfce..ac2758b6 100644 --- a/app/views/conference_registrations/_form.html.haml +++ b/app/views/conference_registrations/_form.html.haml @@ -1,22 +1,23 @@ -.row - .col-md-12 - = semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f| - .tabbable - %ul.nav.nav-tabs - %li.active - = link_to 'Register', '#register-content', 'data-toggle' => 'tab' - - if @conference.use_volunteers - %li - = link_to 'Volunteer', '#volunteer-content', 'data-toggle' => 'tab' - .tab-content - #register-content.tab-pane.active - = render 'conference_registrations/registration', f: f - - if @conference.use_volunteers - #volunteer-content.tab-pane - = render 'conference_registrations/volunteer', f: f - - if @conference.user_registered?(current_user) - = f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' } - = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), - method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?' - - else - = f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' } +.container + .row + .col-md-12 + = semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f| + .tabbable + %ul.nav.nav-tabs + %li.active + = link_to 'Register', '#register-content', 'data-toggle' => 'tab' + - if @conference.use_volunteers + %li + = link_to 'Volunteer', '#volunteer-content', 'data-toggle' => 'tab' + .tab-content + #register-content.tab-pane.active + = render 'conference_registrations/registration', f: f + - if @conference.use_volunteers + #volunteer-content.tab-pane + = render 'conference_registrations/volunteer', f: f + - if @conference.user_registered?(current_user) + = f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' } + = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), + method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?' + - else + = f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' } diff --git a/app/views/conference_registrations/show.html.haml b/app/views/conference_registrations/show.html.haml index e09955ef..84537b39 100644 --- a/app/views/conference_registrations/show.html.haml +++ b/app/views/conference_registrations/show.html.haml @@ -1,126 +1,119 @@ -%h1 - = @conference.title - %small - = date_string(@conference.start_date, @conference.end_date) -- if @conference.venue.name and @conference.venue.website and @conference.venue.address - %p - %small - at - = link_to @conference.venue.name, @conference.venue.website - , - \#{link_to @conference.venue.address, "http://maps.google.com/maps?q=#{@conference.venue.address}"} -.row - .col-md-4 - .row +.container + .row + .col-md-12 + .page-header + %h1 + = @conference.title + %small + = date_string(@conference.start_date, @conference.end_date) + .row + .col-md-6 + - if @conference.venue.name and @conference.venue.website and @conference.venue.address + %p + %small + at + = link_to @conference.venue.name, @conference.venue.website + , + = link_to @conference.venue.address, "http://maps.google.com/maps?q=#{@conference.venue.address}" + .col-md-4 - if @conference.contact.facebook.present? - %div.col-md-3 - = link_to "#{ @conference.contact.facebook }" do - %i.fa.fa-facebook-square.fa-2x + = link_to "#{ @conference.contact.facebook }" do + %i.fa.fa-facebook-square - if @conference.contact.twitter.present? - %div.col-md-3 - = link_to "#{ @conference.contact.twitter }" do - %i.fa.fa-twitter.fa-2x + = link_to "#{ @conference.contact.twitter }" do + %i.fa.fa-twitter - if @conference.contact.instagram.present? - %div.col-md-3 - = link_to "#{ @conference.contact.instagram }" do - %i.fa.fa-instagram.fa-2x + = link_to "#{ @conference.contact.instagram }" do + %i.fa.fa-instagram - if @conference.contact.googleplus.present? - %div.col-md-3 - = link_to "#{ @conference.contact.googleplus }" do - %i.fa.fa-google-plus-square.fa-2x - -%br - -- if @conference.tickets.any? - %h3 - Tickets - - if current_user.tickets.any? - %p - You have already purchased the following tickets: - %p - If you would like to buy more tickets, please click - = link_to 'here', conference_tickets_path(@conference.short_title) - = render partial: 'tickets_bought', locals: { tickets: current_user.tickets } - - - else - = render partial: 'tickets', locals: { tickets: @conference.tickets } - %br -- if @conference.speakers.confirmed.any? - %h3 - = pluralize(@conference.speakers.confirmed.count, 'Speaker') - - @conference.speakers.confirmed.limit(12).each_slice(4) do |slice| - .row - - slice.each do |speaker| - .col-md-3 + = link_to "#{ @conference.contact.googleplus }" do + %i.fa.fa-google-plus-square + .row + .col-md-12 + - if @conference.tickets.any? + %h3 + Tickets + - if current_user.tickets.any? + %p + You have purchased the following tickets: + = render partial: 'tickets_bought', locals: { tickets: current_user.tickets } + - else + = render partial: 'tickets', locals: { tickets: @conference.tickets } + %p + If you would like to buy more tickets, please click + = link_to 'here', conference_tickets_path(@conference.short_title) + .row + .col-md-12 + - if @conference.speakers.confirmed.any? + %h3 + = pluralize(@conference.speakers.confirmed.count, 'Speaker') + - @conference.speakers.confirmed.limit(12).each_slice(4) do |slice| .row - .col-md-3 - = image_tag(speaker.gravatar_url(size: '25'), - title: "Yo #{speaker.name}!", - alt: '', 'class' => 'img-circle img-responsive text-center') - .col-md-9 + - slice.each do |speaker| + .col-md-3 + .row + .col-md-3 + = image_tag(speaker.gravatar_url(size: '25'), + title: "Yo #{speaker.name}!", + alt: '', 'class' => 'img-circle img-responsive text-center') + .col-md-9 + %h4 + = speaker.name + .row + .col-md-12 + - if @conference.events.confirmed.any? + %h3 + = pluralize(@conference.events.confirmed.count, 'Event') + %ul.list-unstyled + - @conference.events.confirmed.limit(10).each do |event| + %li %h4 - = speaker.name - %hr - -- if @conference.events.confirmed.any? - %h3 - = pluralize(@conference.events.confirmed.count, 'Event') - %ul.list-unstyled - - @conference.events.confirmed.limit(10).each do |event| - %li - %h4 - = link_to event.title, conference_proposal_path(@conference.short_title, event.id) - %strong - presented by - = event.speaker_names - %hr - -- if @conference.participants.any? - %h3 - = pluralize(@conference.participants.count, 'Participant') - - @conference.participants.limit(36).each_slice(12) do |slice| - .row - - slice.each do |participant| - .col-md-1 - = image_tag(participant.gravatar_url(size: '25'), - title: "Yo #{participant.name}!", - alt: '', 'class' => 'img-circle img-responsive text-center') - %hr - -- if @registration - %h2 - Congratulations! You are now registered for - = "#{@conference.title}!" - - - if @conference.questions.any? - %h3 Your answers to the registrations questions are: - - @conference.questions.each do |q| - %p - %b Question: - = q.title - - %b Your Answer: - - @registration.qanswers.where(:question_id => q.id).each do |qa| - = qa.answer.title - %br - - - if @workshops.any? - %h3 You are registered for the following workshops: - %ul.list-unstyled - - @workshops.each do |workshop| - %li - %h4 - = link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id) - %strong - presented by - = workshop.speaker_names - %br - - %div - = link_to 'Modify your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success' - = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), - method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?' -- else - %p.lead - = "Unfortunately you are not registered for #{@conference.title}. If you want to register click" - = link_to 'here.', new_conference_conference_registrations_path(@conference.short_title) + = link_to event.title, conference_proposal_path(@conference.short_title, event.id) + %strong + presented by + = event.speaker_names + .row + .col-md-12 + - if @conference.participants.any? + %h3 + = pluralize(@conference.participants.count, 'Participant') + - @conference.participants.limit(36).each_slice(12) do |slice| + .row + - slice.each do |participant| + .col-md-1 + = image_tag(participant.gravatar_url(size: '25'), + title: "Yo #{participant.name}!", + alt: '', 'class' => 'img-circle img-responsive text-center') + .row + .col-md-12 + - if @registration + %h2 + Congratulations! You are now registered for + = "#{@conference.title}!" + - if @conference.questions.any? + %h3 Your answers to the registrations questions are: + - @conference.questions.each do |q| + %p + %b Question: + = q.title + %b Your Answer: + - @registration.qanswers.where(:question_id => q.id).each do |qa| + = qa.answer.title + - if @workshops.any? + %h3 You are registered for the following workshops: + %ul.list-unstyled + - @workshops.each do |workshop| + %li + %h4 + = link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id) + %strong + presented by + = workshop.speaker_names + %div + = link_to 'Modify your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success' + = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), + method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?' + - else + %p.lead + = "Unfortunately you are not registered for #{@conference.title}. If you want to register click" + = link_to 'here.', new_conference_conference_registrations_path(@conference.short_title) diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 7168eade..756e00cf 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -1,25 +1,28 @@ -%h1 Edit your Account -.row - .col-md-12 - = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| - = f.inputs name: 'Account' do +.container + .row + .col-md-12 + .page-header + %h1 Edit your Account + .row + .col-md-12 + = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| = f.input :username, required: false, input_html: { autocomplete: 'off' } = f.input :email, required: false, input_html: { autocomplete: 'off' } = f.input :password, hint: "(Leave blank if you don't want to change it)", input_html: { autocomplete: 'off' } = f.input :password_confirmation, input_html: { autocomplete: 'off' } - = f.inputs name: 'OpenID' do - %h4 - Currently the following openIDs are associated with your account - - @openids.each do |openid| - %li= "#{openid.provider}:#{openid.email}" - %br - %h4 - To add an openID with a different email address to your account, sign in with your - openID while logged in to OSEM - - if User.omniauth_providers.present? - #openidlinks - = render 'devise/shared/openid' - = f.inputs name: 'Confirmation' do - = f.input :current_password, input_html: {autocomplete: 'off'}, - hint: '(we need your current password to confirm password, email or username changes)' - = f.action :submit, as: :button, label: 'Update Account', button_html: {class: 'btn btn-primary'} + = f.inputs name: 'OpenID' do + %h4 + Currently the following openIDs are associated with your account + - @openids.each do |openid| + %li= "#{openid.provider}:#{openid.email}" + %br + %h4 + To add an openID with a different email address to your account, sign in with your + openID while logged in to OSEM + - if User.omniauth_providers.present? + #openidlinks + = render 'devise/shared/openid' + = f.inputs name: 'Confirmation' do + = f.input :current_password, input_html: {autocomplete: 'off'}, + hint: '(we need your current password to confirm password, email or username changes)' + = f.action :submit, as: :button, label: 'Update Account', button_html: {class: 'btn btn-primary'} diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 3d458dd6..d81a264b 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,33 +1,34 @@ -.row - .col-md-6.col-md-offset-3 - .panel.panel-default - .panel-heading - %h3.panel-title - Sign Up - .panel-body - = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| - = f.input :username, required: true - = f.input :email - = f.input :name, required: true - = f.input :password - = f.input :password_confirmation - %p.text-right - = f.action :submit, as: :button, label: 'Sign Up', button_html: {class: 'btn btn-success' } - - unless omniauth_configured.empty? - .row - .col-md-4 - %hr - .col-md-4 - %h4.text-center - or sign up using - .col-md-4 - %hr - .row - .col-md-12 - #openidlinks - = render 'devise/shared/openid' - %p.text-right - %a.small{"data-toggle" => "collapse", "data-target" => "#devise-help"} - Need Help? - #devise-help.collapse - = render 'devise/shared/links' +.container + .row + .col-md-6.col-md-offset-3 + .panel.panel-default + .panel-heading + %h3.panel-title + Sign Up + .panel-body + = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| + = f.input :username, required: true + = f.input :email + = f.input :name, required: true + = f.input :password + = f.input :password_confirmation + %p.text-right + = f.action :submit, as: :button, label: 'Sign Up', button_html: {class: 'btn btn-success' } + - unless omniauth_configured.empty? + .row + .col-md-4 + %hr + .col-md-4 + %h4.text-center + or sign up using + .col-md-4 + %hr + .row + .col-md-12 + #openidlinks + = render 'devise/shared/openid' + %p.text-right + %a.small{"data-toggle" => "collapse", "data-target" => "#devise-help"} + Need Help? + #devise-help.collapse + = render 'devise/shared/links' diff --git a/app/views/layouts/_admin_sidebar.html.haml b/app/views/layouts/_admin_sidebar.html.haml index 24f725b2..c30127ad 100644 --- a/app/views/layouts/_admin_sidebar.html.haml +++ b/app/views/layouts/_admin_sidebar.html.haml @@ -100,7 +100,7 @@ %ul - if can? :update, @conference.sponsorship_levels.build %li{:class=> "#{active_nav_li(admin_conference_sponsorship_levels_path(@conference.short_title))}" } - = link_to 'Sponsorship', admin_conference_sponsorship_levels_path(@conference.short_title) + = link_to 'Sponsorship Levels', admin_conference_sponsorship_levels_path(@conference.short_title) - if can? :update, @conference.sponsors.build %li{:class=> active_nav_li(admin_conference_sponsors_path(@conference.short_title))} = link_to 'Sponsors', admin_conference_sponsors_path(@conference.short_title) diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index 223deb38..c1792cd3 100644 --- a/app/views/layouts/_messages.html.haml +++ b/app/views/layouts/_messages.html.haml @@ -8,8 +8,11 @@ %p 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| - %div{:class=>"alert alert-dismissable #{bootstrap_class_for(type)}", :id=>"flash"} - .button.close{"data-dismiss" => "alert", "aria-hidden"=>"true"} - × - %p - = message \ No newline at end of file + .container + .row + .col-md-12 + %div{:class=>"alert alert-dismissable #{bootstrap_class_for(type)}", :id=>"flash"} + .button.close{"data-dismiss" => "alert", "aria-hidden"=>"true"} + × + %p + = message \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2567eaab..9915ab6a 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,7 +6,6 @@ %meta{:content => "", :name => "description"} %meta{:content => "", :name => "author"} = stylesheet_link_tag "application", :media => "all" - = stylesheet_link_tag "splash" if content_for :splash = javascript_include_tag "application" = csrf_meta_tags :javascript @@ -25,23 +24,16 @@ = javascript_include_tag "//cdn.transifex.com/live.js" = yield(:head) - %body{ data: (content_for?(:splash_nav) ? {spy: 'scroll', offset: 0, target: 'splash-nav'} : {} ) } + %body = render 'layouts/navigation' -# Admin area - if controller.class.name.split("::").first=="Admin" = render 'layouts/admin' -else - .container#messages - .row - .col-md-12 - = render 'layouts/messages' - - if content_for :splash - #content - = yield :splash - -else - .container#content - = yield - + #messages + = render 'layouts/messages' + #content + = yield #footer .container %p.muted.text-center diff --git a/app/views/proposal/_form.html.haml b/app/views/proposal/_form.html.haml index 16f9384b..a5b586e0 100644 --- a/app/views/proposal/_form.html.haml +++ b/app/views/proposal/_form.html.haml @@ -1,34 +1,35 @@ -.row - .col-md-12 - .tabbable - %ul.nav.nav-tabs - %li.active - = link_to "Proposal", "#proposal-content", "data-toggle"=>"tab" - %li - = link_to 'Commercials', '#commercials-content', 'data-toggle'=>'tab' - .tab-content - #proposal-content.tab-pane.active - = render 'proposal/proposal_form' - #commercials-content.tab-pane - %p.text-muted - You can add commercials for your event. These commercials will be displayed on the event detail site. - If you don't add a commercial, the conference commercial will be displayed! - We currently support the following commercial types: YouTube, Vimeo, Instagram, Flickr, Speakerdeck and SlideShare. - - - @event.commercials.each_slice(3) do |slice| - .row - - slice.each do |commercial| - .col-md-4 - .thumbnail - %h3.text-center - = commercial.commercial_type - .flexvideo - = render partial: 'shared/media_item', locals: { commercial_type: commercial.commercial_type, commercial_id: commercial.commercial_id } - - if can? :update, commercial - = link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary' - - if can? :destroy, commercial - = link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), - :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' - - if can? :create, @event.commercials.new - %hr - = link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary' +.container + .row + .col-md-12 + .tabbable + %ul.nav.nav-tabs + %li.active + = link_to "Proposal", "#proposal-content", "data-toggle"=>"tab" + %li + = link_to 'Commercials', '#commercials-content', 'data-toggle'=>'tab' + .tab-content + #proposal-content.tab-pane.active + = render 'proposal/proposal_form' + #commercials-content.tab-pane + %p.text-muted + You can add commercials for your event. These commercials will be displayed on the event detail site. + If you don't add a commercial, the conference commercial will be displayed! + We currently support the following commercial types: YouTube, Vimeo, Instagram, Flickr, Speakerdeck and SlideShare. + + - @event.commercials.each_slice(3) do |slice| + .row + - slice.each do |commercial| + .col-md-4 + .thumbnail + %h3.text-center + = commercial.commercial_type + .flexvideo + = render partial: 'shared/media_item', locals: { commercial_type: commercial.commercial_type, commercial_id: commercial.commercial_id } + - if can? :update, commercial + = link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary' + - if can? :destroy, commercial + = link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), + :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' + - if can? :create, @event.commercials.new + %hr + = link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary' diff --git a/app/views/proposal/index.html.haml b/app/views/proposal/index.html.haml index f03b68e0..facfcce8 100644 --- a/app/views/proposal/index.html.haml +++ b/app/views/proposal/index.html.haml @@ -1,46 +1,47 @@ -.row - .col-md-12.page-header - %h1 - = "My Proposals for #{@conference.title}" - - if @conference.cfp_open? || (current_user.has_role? :organizer, @conference) - = link_to "New Proposal", new_conference_proposal_path(@conference.short_title), :class => "btn btn-success pull-right" -- if current_user.proposal_count(@conference) > 0 +.container .row - .col-md-12 - %table.table.table-bordered.table-striped - %thead - %th - %b Title - %th - %b Status - %th - - @events.each do |event| - %tr - %td - = link_to event.title, conference_proposal_path(@conference.short_title, event.id) - %td - - if event.state == 'new' - Review pending - - else - = event.state.humanize - - if event.state == 'confirmed' && event.require_registration == true - (Pre-registered: #{pre_registered(event).count}) - - if event.confirmed? && !@conference.user_registered?(current_user) - %br - = link_to "Register to attend", new_conference_conference_registrations_path(@conference.short_title), :style => "font-size:10px;" - %td - .pull-right - - if event.transition_possible? :confirm - = link_to 'Confirm', - confirm_conference_proposal_path(@conference.short_title, event), - method: :patch, class: 'btn btn-mini btn-success', id: "confirm_proposal_#{event.id}" - = link_to 'Edit', edit_conference_proposal_path(@conference.short_title, event.id), - class: 'btn btn-mini btn-primary', id: "edit_proposal_#{event.id}" - - if event.transition_possible? :withdraw - = link_to 'Withdraw', conference_proposal_path(@conference.short_title, event.id), method: :delete, - confirm: 'Are you sure you want to withdraw this proposal?', class: 'btn btn-mini btn-warning', - id: "delete_proposal_#{event.id}" - - if event.state == 'withdrawn' || event.state == 'rejected' - = link_to 'Re-Submit', - restart_conference_proposal_path(@conference.short_title, event.id), - method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}" + .col-md-12.page-header + %h1 + = "My Proposals for #{@conference.title}" + - if @conference.cfp_open? || (current_user.has_role? :organizer, @conference) + = link_to "New Proposal", new_conference_proposal_path(@conference.short_title), :class => "btn btn-success pull-right" + - if current_user.proposal_count(@conference) > 0 + .row + .col-md-12 + %table.table.table-bordered.table-striped + %thead + %th + %b Title + %th + %b Status + %th + - @events.each do |event| + %tr + %td + = link_to event.title, conference_proposal_path(@conference.short_title, event.id) + %td + - if event.state == 'new' + Review pending + - else + = event.state.humanize + - if event.state == 'confirmed' && event.require_registration == true + (Pre-registered: #{pre_registered(event).count}) + - if event.confirmed? && !@conference.user_registered?(current_user) + %br + = link_to "Register to attend", new_conference_conference_registrations_path(@conference.short_title), :style => "font-size:10px;" + %td + .pull-right + - if event.transition_possible? :confirm + = link_to 'Confirm', + confirm_conference_proposal_path(@conference.short_title, event), + method: :patch, class: 'btn btn-mini btn-success', id: "confirm_proposal_#{event.id}" + = link_to 'Edit', edit_conference_proposal_path(@conference.short_title, event.id), + class: 'btn btn-mini btn-primary', id: "edit_proposal_#{event.id}" + - if event.transition_possible? :withdraw + = link_to 'Withdraw', conference_proposal_path(@conference.short_title, event.id), method: :delete, + confirm: 'Are you sure you want to withdraw this proposal?', class: 'btn btn-mini btn-warning', + id: "delete_proposal_#{event.id}" + - if event.state == 'withdrawn' || event.state == 'rejected' + = link_to 'Re-Submit', + restart_conference_proposal_path(@conference.short_title, event.id), + method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}" diff --git a/app/views/proposal/new.html.haml b/app/views/proposal/new.html.haml index a6325a98..e004dcb0 100644 --- a/app/views/proposal/new.html.haml +++ b/app/views/proposal/new.html.haml @@ -1,6 +1,7 @@ -.row - .col-md-12 - = simple_format(@conference.call_for_papers.description) -.row - .col-md-12 - = render 'proposal_form' +.container + .row + .col-md-12 + = simple_format(@conference.call_for_papers.description) + .row + .col-md-12 + = render 'proposal_form' diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 73b1e2f5..018948a1 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -1,71 +1,72 @@ -.row - .col-md-12.page-header - %h2 - = @event.title - - if @event.subtitle - %br - %small - = @event.subtitle - = link_to "Schedule", conference_schedule_path(@conference.short_title), :class =>"btn btn-success pull-right" - - if can? :edit, @event - = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right" -.row - .col-md-3 - %p - = simple_format(@event.abstract) - %dl - %dt Date: - %dd= @event.start_time.strftime("%Y %B %e %H:%M") if @event.start_time - %dt Duration: - %dd= show_time(@event.event_type.length) - %dt Room: - %dd - - if @event.room_id - = @event.room.name - %dt Conference: - %dd= @event.conference.title - %dt Language: - %dd= @event.language if @event.language - %dt Track: - %dd - - if @event.track_id - %span.label{:style =>"background-color: #{@event.track.color};"} - = @event.track.name - %dt Difficulty: - %dd - - if @event.difficulty_level_id - %span.label{:style =>"background-color: #{@event.difficulty_level.color};"} - = @event.difficulty_level.title - - if @event.require_registration - = link_to "Registration required!", new_conference_conference_registrations_path(@conference.short_title), :class => "btn btn-xs btn-warning" - .col-md-9 - .row - .col-md-12 - - if @event.commercials.empty? - %h5.text-warning - No video of the event yet, sorry! +.container + .row + .col-md-12.page-header + %h2 + = @event.title + - if @event.subtitle + %br + %small + = @event.subtitle + = link_to "Schedule", conference_schedule_path(@conference.short_title), :class =>"btn btn-success pull-right" + - if can? :edit, @event + = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right" + .row + .col-md-3 + %p + = simple_format(@event.abstract) + %dl + %dt Date: + %dd= @event.start_time.strftime("%Y %B %e %H:%M") if @event.start_time + %dt Duration: + %dd= show_time(@event.event_type.length) + %dt Room: + %dd + - if @event.room_id + = @event.room.name + %dt Conference: + %dd= @event.conference.title + %dt Language: + %dd= @event.language if @event.language + %dt Track: + %dd + - if @event.track_id + %span.label{:style =>"background-color: #{@event.track.color};"} + = @event.track.name + %dt Difficulty: + %dd + - if @event.difficulty_level_id + %span.label{:style =>"background-color: #{@event.difficulty_level.color};"} + = @event.difficulty_level.title + - if @event.require_registration + = link_to "Registration required!", new_conference_conference_registrations_path(@conference.short_title), :class => "btn btn-xs btn-warning" + .col-md-9 + .row + .col-md-12 + - if @event.commercials.empty? + %h5.text-warning + No video of the event yet, sorry! + - unless @conference.commercials.empty? + Meanwhile... - unless @conference.commercials.empty? - Meanwhile... - - unless @conference.commercials.empty? - = render partial: 'shared/media_items', locals: { commercials: @conference.commercials } - - else - %p - = render partial: 'shared/media_items', locals: { commercials: @event.commercials } - .row - .speakerinfo - .col-md-8 - %h3 - by - = @speaker.name - ( - = @speaker.email - ) - - if @speaker.affiliation? - %br - %span.muted - from - = @speaker.affiliation - -if @speaker.biography? - = simple_format(@speaker.biography) - .col-md-4 - = image_tag @speaker.gravatar_url(:size => 200), :class => "img-responsive img-rounded" + = render partial: 'shared/media_items', locals: { commercials: @conference.commercials } + - else + %p + = render partial: 'shared/media_items', locals: { commercials: @event.commercials } + .row + .speakerinfo + .col-md-8 + %h3 + by + = @speaker.name + ( + = @speaker.email + ) + - if @speaker.affiliation? + %br + %span.muted + from + = @speaker.affiliation + -if @speaker.biography? + = simple_format(@speaker.biography) + .col-md-4 + = image_tag @speaker.gravatar_url(:size => 200), :class => "img-responsive img-rounded" diff --git a/app/views/schedule/index.html.erb b/app/views/schedule/index.html.erb index e16bd88a..2ffc3cad 100644 --- a/app/views/schedule/index.html.erb +++ b/app/views/schedule/index.html.erb @@ -1,98 +1,99 @@ -
-

Schedule for <%= @conference.title %>

- - -
- <% @dates.each do |date| %> -
- - - - <% @rooms.each do |room| %> - - <% end %> - - - <% span = {} %> - <% @rooms.each do |room| %> - <% span[room.id] = 1 %> - <% end %> - - <% conf_start = DateTime.parse("#{date} 09:00") %> - <% conf_end = DateTime.parse("#{date} 19:00") %> - - <% while conf_start < conf_end %> - <%- - start_hour = conf_start.hour - start_min = conf_start.min %> - - - - - <% @rooms.each do |room| %> - <% events_for_date = @events.find_all {|e| e.room_id == room.id && e.start_time && e.start_time.to_date == date } %> - <% event = events_for_date.find_all{|e| e.start_time.hour == start_hour && e.start_time.min == start_min } %> - <% if !event.empty? %> - - <% span[room.id] = event[0].event_type.length / 15 %> - - <% span[room.id] = span[room.id] + 1 %> - <% elsif span[room.id] > 1 %> - - <% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %> - <% end %> - <% if span[room.id] == 1 %> - - - <% end %> - <%end %> - - <% conf_start += 15.minutes %> - <%end %> -
Time<%= room.name %>
- <%= conf_start.strftime("%H:%M") %> - - <%- if speaker = event[0].speakers.first %> - <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", - :alt => speaker.name, - :title => speaker.name, - :style => "padding:8px;" %> - <%- end %> -
- - <%= event[0].title %> - <% unless event[0].subtitle.blank? %> - - <%= event[0].subtitle %> - - <% end %> -
- - - - <%= "#{speaker.name}" %> - - <% if event[0].track%> - - - <%= event[0].track.name %> - - <% end -%> -
-
-
+
+
+

Schedule for <%= @conference.title %>

+
- + + +
+ <% @dates.each do |date| %> +
+ + + + <% @rooms.each do |room| %> + + <% end %> + + + <% span = {} %> + <% @rooms.each do |room| %> + <% span[room.id] = 1 %> + <% end %> + + <% conf_start = DateTime.parse("#{date} 09:00") %> + <% conf_end = DateTime.parse("#{date} 19:00") %> + + <% while conf_start < conf_end %> + <%- + start_hour = conf_start.hour + start_min = conf_start.min %> + + + + + <% @rooms.each do |room| %> + <% events_for_date = @events.find_all {|e| e.room_id == room.id && e.start_time && e.start_time.to_date == date } %> + <% event = events_for_date.find_all{|e| e.start_time.hour == start_hour && e.start_time.min == start_min } %> + <% if !event.empty? %> + + <% span[room.id] = event[0].event_type.length / 15 %> + + <% span[room.id] = span[room.id] + 1 %> + <% elsif span[room.id] > 1 %> + + <% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %> + <% end %> + <% if span[room.id] == 1 %> + + + <% end %> + <%end %> + + <% conf_start += 15.minutes %> + <%end %> +
Time<%= room.name %>
+ <%= conf_start.strftime("%H:%M") %> + + <%- if speaker = event[0].speakers.first %> + <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right", + :alt => speaker.name, + :title => speaker.name, + :style => "padding:8px;" %> + <%- end %> +
+ + <%= event[0].title %> + <% unless event[0].subtitle.blank? %> + + <%= event[0].subtitle %> + + <% end %> +
+ + + + <%= "#{speaker.name}" %> + + <% if event[0].track%> + + + <%= event[0].track.name %> + + <% end -%> +
+
+
+ <% end %> +
+
<%= javascript_tag do %> jQuery( function($) { $('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) { diff --git a/app/views/tickets/index.html.haml b/app/views/tickets/index.html.haml index 435019c5..bf916484 100644 --- a/app/views/tickets/index.html.haml +++ b/app/views/tickets/index.html.haml @@ -1,37 +1,38 @@ -.row - .col-sm-12.col-md-10.col-md-offset-1 - %h1 - Tickets - %p.lead - Please buy a ticket if you want to support - %b - = @conference.title - ! - =form_tag(conference_ticket_purchases_path, method: :post) do |f| - %table.table.table-hover - %thead - %tr - %th Ticket - %th Quantity - %th Price - %th Total - %tbody - - @conference.tickets.each do |ticket| - = render partial: 'ticket', f: f, locals: {ticket: ticket} - %tr - %td - %td - %td.col-sm-1.col-md-1.text-center - %h4 - Total - %td.col-sm-1.col-md-1.text-center - %h4 - %strong - %span{id: 'total_price'} - 0 - .pull-right - = button_tag(type: 'submit', class: 'btn btn-success btn-lg') do - Support - %i.fa.fa-shopping-cart - = link_to 'Continue without a Ticket!', conference_conference_registrations_path(@conference.short_title), - class: 'btn btn-danger btn-sm' +.container + .row + .col-md-12 + .page-header + %h1 + Tickets + %p.lead + Please buy a ticket to support + %b + = @conference.title + =form_tag(conference_ticket_purchases_path, method: :post) do |f| + %table.table.table-hover + %thead + %tr + %th Ticket + %th Quantity + %th Price + %th Total + %tbody + - @conference.tickets.each do |ticket| + = render partial: 'ticket', f: f, locals: {ticket: ticket} + %tr + %td + %td + %td.col-sm-1.col-md-1.text-center + %h4 + Total + %td.col-sm-1.col-md-1.text-center + %h4 + %strong + %span{id: 'total_price'} + 0 + .pull-right + = button_tag(type: 'submit', class: 'btn btn-success btn-lg') do + Support + %i.fa.fa-shopping-cart + = link_to 'Continue without a Ticket!', conference_conference_registrations_path(@conference.short_title), + class: 'btn btn-danger btn-sm' diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 572e12fc..d235fb5d 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -1,8 +1,11 @@ -%h1 Edit your profile -.row - .col-md-12 - = semantic_form_for(@user, url: user_path(@user.id)) do |f| - = f.inputs name: 'Profile' do +.container + .row + .col-md-12 + .page-header + %h1 Edit your profile + .row + .col-md-12 + = semantic_form_for(@user, url: user_path(@user.id)) do |f| = f.input :name, as: :string = f.input :nickname, as: :string = f.input :affiliation, as: :string, @@ -14,4 +17,4 @@ words. Biographies are limited to 150 words. %br %br - = f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'} + = f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'} diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 7ba218bf..9755310d 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1,16 +1,24 @@ -%h1 - = @user.name -%h4 - = @user.biography - -- if @user.events.confirmed.any? - %h3 - = "#{@user.name} presents #{pluralize(@user.events.confirmed.count, 'Event')}:" - %ul.list-unstyled - - @user.events.confirmed.each do |event| - %li - %h4 - = link_to event.title, conference_proposal_path(event.conference.short_title, event.id) - %strong - at - = event.conference.title \ No newline at end of file +.container + .row + .col-md-12 + .page-header + %h1 + = image_tag(current_user.gravatar_url(size: '48'), title: "Yo #{current_user.name}!", :alt => '') + = @user.name + %small + = @user.nickname + %p + = @user.biography + .row + .col-md-12 + - if @user.events.confirmed.any? + %h3 + = "#{@user.name} presents #{pluralize(@user.events.confirmed.count, 'Event')}:" + %ul.list-unstyled + - @user.events.confirmed.each do |event| + %li + %h4 + = link_to event.title, conference_proposal_path(event.conference.short_title, event.id) + %strong + at + = event.conference.title \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 1886fdc0..7caa0366 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -48,7 +48,12 @@ Osem::Application.routes.draw do resources :tracks, only: [:show, :update, :index] - resources :sponsorship_levels, only: [:show, :update, :index] + resources :sponsorship_levels, except: [:show] do + member do + patch :up + patch :down + end + end resources :sponsors, only: [:show, :update, :index] diff --git a/db/migrate/20141113134103_add_position_to_sponsorship_level.rb b/db/migrate/20141113134103_add_position_to_sponsorship_level.rb new file mode 100644 index 00000000..5663d3e6 --- /dev/null +++ b/db/migrate/20141113134103_add_position_to_sponsorship_level.rb @@ -0,0 +1,5 @@ +class AddPositionToSponsorshipLevel < ActiveRecord::Migration + def change + add_column :sponsorship_levels, :position, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 39af7835..f1d20fc4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20141109172204) do +ActiveRecord::Schema.define(version: 20141113134103) do create_table "ahoy_events", force: true do |t| t.uuid "visit_id" @@ -423,6 +423,7 @@ ActiveRecord::Schema.define(version: 20141109172204) do t.integer "conference_id" t.datetime "created_at" t.datetime "updated_at" + t.integer "position" end create_table "subscriptions", force: true do |t| diff --git a/spec/features/rooms_spec.rb b/spec/features/rooms_spec.rb index 322db098..f725ce5b 100644 --- a/spec/features/rooms_spec.rb +++ b/spec/features/rooms_spec.rb @@ -11,22 +11,22 @@ feature Room do visit admin_conference_rooms_path( conference_id: conference.short_title) - expect(page.has_content?('Room Name')).to be false - expect(page.has_content?('100')).to be false + expect(page.has_no_table?('#rooms')).to be true # Add room click_link 'New Room' - fill_in 'room_name', with: 'Room Name' + fill_in 'room_name', with: 'Auditorium' fill_in 'room_size', with: '100' click_button 'Create Room' # Validations expect(flash).to eq('Room successfully created.') - - expect(page.has_content?('Room Name')).to be true - expect(page.has_content?('100')).to be true + within('table#rooms') do + expect(page.has_content?('Auditorium')).to be true + expect(page.assert_selector('tr', count: 2)).to be true + end end scenario 'updates a room', feature: true, js: true do @@ -35,17 +35,19 @@ feature Room do visit edit_admin_conference_room_path( conference_id: conference.short_title, id: room.id) - fill_in 'room_name', with: 'Room Name' + fill_in 'room_name', with: 'Auditorium' fill_in 'room_size', with: '100' click_button 'Update Room' # Validations expect(flash).to eq('Room successfully updated.') - expect(page.has_content?('Room Name')).to be true - expect(page.has_content?('100')).to be true + within('table#rooms') do + expect(page.has_content?('Auditorium')).to be true + expect(page.assert_selector('tr', count: 2)).to be true + end room.reload - expect(room.name).to eq('Room Name') + expect(room.name).to eq('Auditorium') expect(room.size).to eq(100) end end diff --git a/spec/features/sponsorship_level_spec.rb b/spec/features/sponsorship_level_spec.rb index 229cb926..9df66e9a 100644 --- a/spec/features/sponsorship_level_spec.rb +++ b/spec/features/sponsorship_level_spec.rb @@ -5,37 +5,51 @@ feature SponsorshipLevel do let!(:organizer_role) { create(:organizer_role, resource: conference) } let!(:organizer) { create(:user, role_ids: [organizer_role.id]) } - shared_examples 'sponsorship levels' do - scenario 'adds and updates sponsorship level', feature: true, js: true do - + shared_examples 'sponsorship_levels' do + scenario 'adds a sponsorship level', feature: true, js: true do sign_in organizer visit admin_conference_sponsorship_levels_path( conference_id: conference.short_title) - # Add sponsorship level - click_link 'Add sponsorship_level' - expect(page.all('div.nested-fields').count == 1).to be true - page. - find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input'). - set('Example sponsorship level') + expect(page.has_no_table?('#sponsorship_levels')).to be true - click_button 'Update Conference' + # Add SponsorshipLevel + click_link 'New Sponsorship Level' + + fill_in 'sponsorship_level_title', with: 'Platin' + + click_button 'Create Sponsorship level' # Validations - expect(flash).to eq('Sponsorship levels were successfully updated.') - expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input'). - value).to eq('Example sponsorship level') + expect(flash).to eq('Sponsorship level successfully created.') + within('table#sponsorship_levels') do + expect(page.has_content?('Platin')).to be true + expect(page.assert_selector('tr', count: 2)).to be true + end + end - # Remove sponsorship level - click_link 'Remove sponsorship_level' - expect(page.all('div.nested-fields').count == 0).to be true - click_button 'Update Conference' - expect(flash).to eq('Sponsorship levels were successfully updated.') - expect(page.all('div.nested-fields').count == 0).to be true + scenario 'updates a sponsorship level', feature: true, js: true do + level = create(:sponsorship_level, conference_id: conference.id) + sign_in organizer + visit edit_admin_conference_sponsorship_level_path( + conference_id: conference.short_title, id: level.id) + + fill_in 'sponsorship_level_title', with: 'Gold' + + click_button 'Update Sponsorship level' + + # Validations + expect(flash).to eq('Sponsorship level successfully updated.') + within('table#sponsorship_levels') do + expect(page.has_content?('Gold')).to be true + expect(page.assert_selector('tr', count: 2)).to be true + end + level.reload + expect(level.title).to eq('Gold') end end describe 'organizer' do - it_behaves_like 'sponsorship levels' + it_behaves_like 'sponsorship_levels' end end diff --git a/spec/views/conference/show.html.haml_spec.rb b/spec/views/conference/show.html.haml_spec.rb index 4203834b..43f28b21 100644 --- a/spec/views/conference/show.html.haml_spec.rb +++ b/spec/views/conference/show.html.haml_spec.rb @@ -5,9 +5,9 @@ describe 'conference/show.html.haml' do @conference = create(:conference) @conference.splashpage = create(:splashpage, - banner_description: 'Lorem Ipsum', - sponsor_description: 'Lorem Ipsum Dolor', - registration_description: 'Lorem Ipsum Dolor', + banner_description: 'Banner Description', + sponsor_description: 'Sponsor Description', + registration_description: 'Registration Description', include_registrations: true, include_program: true, include_sponsors: true, @@ -19,13 +19,13 @@ describe 'conference/show.html.haml' do include_lodgings: true) @conference.contact.update(sponsor_email: 'example@example.com', - facebook: 'http://www.fbexample.com', - googleplus: 'http://www.google-example.com', + facebook: 'http://facebook.com', + googleplus: 'http://google.com', instagram: 'http://instagram.com', twitter: 'http://twitter.com') @conference.registration_period = create(:registration_period, - start_date: Date.today, + start_date: Date.yesterday, end_date: Date.tomorrow) @conference.call_for_papers = create(:call_for_papers, conference: @conference, @@ -43,8 +43,8 @@ describe 'conference/show.html.haml' do end it 'renders banner component' do - expect(view.content_for(:splash)).to include("#{@conference.splashpage.banner_description}") - expect(view.content_for(:splash)).to include("#{@conference.short_title}") + expect(rendered).to match(/#{@conference.splashpage.banner_description}/) + expect(rendered).to match(/#{@conference.short_title}/) end it 'renders program partial' do @@ -52,45 +52,43 @@ describe 'conference/show.html.haml' do end it 'renders registration partial' do - expect(view.content_for(:splash)).to include("#{@conference.splashpage.registration_description}") expect(view).to render_template(partial: 'conference/_registration') end it 'renders call_for_papers partial' do - expect(view.content_for(:splash)).to include("#{@conference.call_for_papers.description}") + expect(rendered).to match(/#{@conference.call_for_papers.description}/) end it 'renders sponsors partial' do - expect(view).to render_template(partial: 'conference/_sponsor') - expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor') - expect(view.content_for(:splash)).to include('example@example.com') - expect(view.content_for(:splash)).to include('Platin') - expect(view.content_for(:splash)).to include('Example sponsor') - expect(view.content_for(:splash)).to include('http://www.example.com') - expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor') - expect(view.content_for(:splash)).to include('rails.jpg') + expect(view).to render_template(partial: 'conference/_sponsors') + expect(rendered).to match(/example@example.com/) + expect(rendered).to match(/Platin/) + expect(rendered).to match(/Example sponsor/) + expect(rendered).to match(/www.example.com/) + expect(rendered).to match(/Lorem Ipsum Dolor/) + expect(rendered).to match(/rails.jpg/) end it 'renders social media partial' do expect(view).to render_template('conference/_social_media') - expect(view.content_for(:splash)).to include('http://www.fbexample.com') - expect(view.content_for(:splash)).to include('http://www.google-example.com') - expect(view.content_for(:splash)).to include('http://instagram.com') - expect(view.content_for(:splash)).to include('http://twitter.com') + expect(rendered).to match(/facebook.com/) + expect(rendered).to match(/google.com/) + expect(rendered).to match(/instagram.com/) + expect(rendered).to match(/twitter.com/) end it 'renders location partial' do expect(view).to render_template(partial: 'conference/_location') - expect(view.content_for(:splash)).to include('Suse Office') - expect(view.content_for(:splash)).to include('Maxfeldstrasse 5 \n90409 Nuremberg') - expect(view.content_for(:splash)).to include('www.opensuse.org') - expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor') + expect(rendered).to match(/Suse Office/) + expect(rendered).to match(/Maxfeldstrasse 5/) + expect(rendered).to match(/www.opensuse.org/) + expect(rendered).to match(/Lorem Ipsum Dolor/) end it 'renders lodging partial' do expect(view).to render_template(partial: 'conference/_lodging') - expect(view.content_for(:splash)).to include('Example Hotel') - expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor') - expect(view.content_for(:splash)).to include('http://www.example.com') + expect(rendered).to match(/Example Hotel/) + expect(rendered).to match(/Lorem Ipsum Dolor/) + expect(rendered).to match(/www.example.com/) end end