From 514a88e0bec0b36f3168d928be21c355d93c22ee Mon Sep 17 00:00:00 2001 From: AnithaPal Date: Mon, 26 Sep 2016 14:46:46 -0400 Subject: [PATCH] display current events based on track --- app/assets/stylesheets/osem.css.scss | 17 ++++++++++++++ .../admin/conferences_controller.rb | 2 +- .../conference/_current_events.html.haml | 13 ----------- .../conference/conference_info.html.haml | 16 ------------- .../_conference_tweets.html.haml | 3 +-- .../conferences/_current_events.html.haml | 14 +++++++++++ .../_sponsors.html.haml | 0 .../conferences/conference_info.html.haml | 23 +++++++++++++++++++ .../conference_info.js.haml | 0 config/secrets.yml.example | 7 ------ 10 files changed, 56 insertions(+), 39 deletions(-) delete mode 100644 app/views/admin/conference/_current_events.html.haml delete mode 100644 app/views/admin/conference/conference_info.html.haml rename app/views/admin/{conference => conferences}/_conference_tweets.html.haml (84%) create mode 100644 app/views/admin/conferences/_current_events.html.haml rename app/views/admin/{conference => conferences}/_sponsors.html.haml (100%) create mode 100644 app/views/admin/conferences/conference_info.html.haml rename app/views/admin/{conference => conferences}/conference_info.js.haml (100%) diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.css.scss index d2a2cd10..462fa955 100644 --- a/app/assets/stylesheets/osem.css.scss +++ b/app/assets/stylesheets/osem.css.scss @@ -90,3 +90,20 @@ p.comment-body { .changeset{ display: none; } + +#conference-header{ + margin: auto; + width: 304px; + .conference-heading{ + float: left; + width: 150px; + } + .conference-logo{ + float: left; + width: 150px; + img{ + width: 100px; + height: 100px; + } + } +} diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 95b56d53..67836ec5 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -176,8 +176,8 @@ module Admin def conference_info # To display sponsors in the conference wide information page @sponsors = @conference.sponsors - @current_event_schedules = @program.selected_schedule.event_schedules.current @tweets = twitter_client.search_tweets(15, @conference.contact.social_tag) + @current_event_schedules = @program.selected_schedule.event_schedules.current.group_by{|es| es.event.track.name} respond_to do |format| format.html{render layout: 'conference_info'} diff --git a/app/views/admin/conference/_current_events.html.haml b/app/views/admin/conference/_current_events.html.haml deleted file mode 100644 index 65ad7c8f..00000000 --- a/app/views/admin/conference/_current_events.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -.container - .row - .col-md-12.text-center - %h2 Current Events - - @current_event_schedules.each do |es| - %div - %h3 - = es.event.title - %h4 - presented by - = es.event.speaker_names - in - = es.event.room.name diff --git a/app/views/admin/conference/conference_info.html.haml b/app/views/admin/conference/conference_info.html.haml deleted file mode 100644 index 603a1dce..00000000 --- a/app/views/admin/conference/conference_info.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -- if @conference.present? - .row - .col-md-12.text-center - %h1 - = @conference.title - - if @conference.description.present? - %h3 - = @conference.description - - if @current_event_schedules.present? - .row#current-events - = render 'current_events' - - if @conference.contact.social_tag.present? && @tweets.any? - .row#conference-tweets - = render 'conference_tweets' - - if @sponsors.any? - = render 'sponsors' diff --git a/app/views/admin/conference/_conference_tweets.html.haml b/app/views/admin/conferences/_conference_tweets.html.haml similarity index 84% rename from app/views/admin/conference/_conference_tweets.html.haml rename to app/views/admin/conferences/_conference_tweets.html.haml index 58ed4e9e..99f1be51 100644 --- a/app/views/admin/conference/_conference_tweets.html.haml +++ b/app/views/admin/conferences/_conference_tweets.html.haml @@ -2,7 +2,7 @@ .row .col-md-12.text-center %h2 - = "#" + @conference.contact.social_tag + " Tweets" + = "##{@conference.contact.social_tag} Tweets" %div#tweet-container - @tweets.each do |tweet| %div#tweet @@ -11,4 +11,3 @@ = tweet.text = link_to "— @" + tweet.user.name, "http://www.twitter.com/#{tweet.user.name}", target: "_blank" = link_to tweet.url, tweet.url.to_s - diff --git a/app/views/admin/conferences/_current_events.html.haml b/app/views/admin/conferences/_current_events.html.haml new file mode 100644 index 00000000..109b96af --- /dev/null +++ b/app/views/admin/conferences/_current_events.html.haml @@ -0,0 +1,14 @@ +.container + .row.row-centered + - @current_event_schedules.each do |track, event_schedules| + .col-md-4.col-sm-4.col-centered + %h2.text-center + = track + - event_schedules.each do |event_schedule| + %h3.text-center + = event_schedule.event.title + %h4.text-center + presented by + = event_schedule.event.speaker_names + in + = event_schedule.event.room.name diff --git a/app/views/admin/conference/_sponsors.html.haml b/app/views/admin/conferences/_sponsors.html.haml similarity index 100% rename from app/views/admin/conference/_sponsors.html.haml rename to app/views/admin/conferences/_sponsors.html.haml diff --git a/app/views/admin/conferences/conference_info.html.haml b/app/views/admin/conferences/conference_info.html.haml new file mode 100644 index 00000000..21c7bbc3 --- /dev/null +++ b/app/views/admin/conferences/conference_info.html.haml @@ -0,0 +1,23 @@ +.container + - if @conference.present? + .row + .col-md-12.text-center + %div#conference-header + %div.conference-logo + = image_tag(@conference.picture_url, class: 'img-responsive') if @conference.picture? + %div.conference-heading + %h1 + = @conference.title + %span + = @conference.short_title + - if @conference.description.present? + %h3 + = @conference.description + - if @current_event_schedules.present? + .row#current-events + = render 'current_events' + - if @conference.contact.social_tag.present? && @tweets.any? + .row#conference-tweets + = render 'conference_tweets' + - if @sponsors.any? + = render 'sponsors' diff --git a/app/views/admin/conference/conference_info.js.haml b/app/views/admin/conferences/conference_info.js.haml similarity index 100% rename from app/views/admin/conference/conference_info.js.haml rename to app/views/admin/conferences/conference_info.js.haml diff --git a/config/secrets.yml.example b/config/secrets.yml.example index 0ee787cc..a8d67504 100644 --- a/config/secrets.yml.example +++ b/config/secrets.yml.example @@ -54,13 +54,6 @@ production: facebook_key: '' facebook_secret: '' - # Register your application with Twitter from - # https://apps.twitter.com/ - twitter_consumer_key: '' - twitter_consumer_secret: '' - twitter_access_token: '' - twitter_access_token_secret: '' - # Developers do not need to register their application for suse account to # work. You must, however, add some sample value to the variables, for the # login option to appear. For example: