diff --git a/admin/app/admin/event.rb b/admin/app/admin/event.rb new file mode 100644 index 000000000..186592d30 --- /dev/null +++ b/admin/app/admin/event.rb @@ -0,0 +1,3 @@ +ActiveAdmin.register JamRuby::Event, :as => 'Event' do + menu :parent => 'Events' +end diff --git a/db/manifest b/db/manifest index 92caba43c..460706511 100755 --- a/db/manifest +++ b/db/manifest @@ -131,3 +131,4 @@ connection_client_type.sql add_countries_regions_and_cities.sql plays_refactor.sql fix_max_mind_isp_and_geo.sql +events.sql \ No newline at end of file diff --git a/db/up/events.sql b/db/up/events.sql new file mode 100644 index 000000000..6c0feb664 --- /dev/null +++ b/db/up/events.sql @@ -0,0 +1,10 @@ +CREATE TABLE events ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + slug VARCHAR(512) NOT NULL UNIQUE, + starts_at TIMESTAMP, + ends_at TIMESTAMP, + title TEXT, + description TEXT, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/ruby/lib/jam_ruby.rb b/ruby/lib/jam_ruby.rb index 6d3903af7..6c65f40d5 100755 --- a/ruby/lib/jam_ruby.rb +++ b/ruby/lib/jam_ruby.rb @@ -99,6 +99,7 @@ require "jam_ruby/models/claimed_recording" require "jam_ruby/models/crash_dump" require "jam_ruby/models/isp_score_batch" require "jam_ruby/models/promotional" +require "jam_ruby/models/event" require "jam_ruby/models/icecast_admin_authentication" require "jam_ruby/models/icecast_directory" require "jam_ruby/models/icecast_limit" diff --git a/ruby/lib/jam_ruby/models/event.rb b/ruby/lib/jam_ruby/models/event.rb new file mode 100644 index 000000000..998e1d42d --- /dev/null +++ b/ruby/lib/jam_ruby/models/event.rb @@ -0,0 +1,11 @@ +class JamRuby::Event < ActiveRecord::Base + + attr_accessible :slug, :starts_at, :ends_at, + :'starts_at(1i)', :'starts_at(2i)', :'starts_at(3i)', :'starts_at(4i)', :'starts_at(5i)', + :'ends_at(1i)', :'ends_at(2i)', :'ends_at(3i)', :'ends_at(4i)', :'ends_at(5i)', + :title, + :description, as: :admin + + validates :slug, uniqueness: true, presence: true + +end diff --git a/ruby/spec/factories.rb b/ruby/spec/factories.rb index 4a9b70b8e..24866a617 100644 --- a/ruby/spec/factories.rb +++ b/ruby/spec/factories.rb @@ -415,4 +415,11 @@ FactoryGirl.define do factory :music_session_like, :class => JamRuby::MusicSessionLiker do end -end + + factory :event, :class => JamRuby::Event do + sequence(:slug) { |n| "slug-#{n}" } + title 'event title' + description 'event description' + + end + end diff --git a/ruby/spec/jam_ruby/models/event_spec.rb b/ruby/spec/jam_ruby/models/event_spec.rb new file mode 100644 index 000000000..b888ab7e0 --- /dev/null +++ b/ruby/spec/jam_ruby/models/event_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe Event do + before do + end + + it "should be creatable" do + FactoryGirl.create(:event) + end + + it "should not have duplicate slugs" do + event1 = FactoryGirl.create(:event) + dup = FactoryGirl.build(:event, slug: event1.slug) + dup.save.should be_false + dup.errors[:slug].should == ["has already been taken"] + end + +end diff --git a/web/app/assets/javascripts/web/videoDialog.js b/web/app/assets/javascripts/web/videoDialog.js index 3a11c7479..9f59fa8bc 100644 --- a/web/app/assets/javascripts/web/videoDialog.js +++ b/web/app/assets/javascripts/web/videoDialog.js @@ -9,27 +9,27 @@ var rest = context.JK.Rest(); var dialogId = '#video-dialog'; + function videoClick(e) { + var $self = $(this); + if (!context.jamClient || !context.jamClient.IsNativeClient()) { + + $('#video-dialog-header').html($self.data('video-header') || $self.attr('data-video-header')); + $('#video-dialog-iframe').attr('src', $self.data('video-url') || $self.atr('data-video-url')); + app.layout.showDialog('video-dialog'); + e.stopPropagation(); + e.preventDefault(); + return false; + } + else { + var videoUrl = $.param.querystring(window.location.href, 'showVideo=' + encodeURIComponent($self.data('video-url'))); + console.log("videoUrl: ", videoUrl); + context.jamClient.OpenSystemBrowser(videoUrl); + } + } + function events() { - $('.carousel .slides').on('click', '.slideItem', function (e) { - - var $self = $(this); - if (!context.jamClient || !context.jamClient.IsNativeClient()) { - - $('#video-dialog-header').html($self.data('video-header')); - $('#video-dialog-iframe').attr('src', $self.data('video-url')); - app.layout.showDialog('video-dialog'); - e.stopPropagation(); - e.preventDefault(); - return false; - } - else { - - - var videoUrl = $.param.querystring(window.location.href, 'showVideo=' + encodeURIComponent($self.data('video-url'))); - console.log("videoUrl: ", videoUrl); - context.jamClient.OpenSystemBrowser(videoUrl); - } - }) + $('.carousel .slides').on('click', '.slideItem', videoClick); + $('.video-slide').on('click', videoClick); $(dialogId + '-close').click(function (e) { app.layout.closeDialog('video-dialog'); diff --git a/web/app/assets/stylesheets/web/main.css.scss b/web/app/assets/stylesheets/web/main.css.scss index 0b4e29340..c680de296 100644 --- a/web/app/assets/stylesheets/web/main.css.scss +++ b/web/app/assets/stylesheets/web/main.css.scss @@ -52,6 +52,7 @@ body.web { color:#ed3718; font-size:26px; font-weight:300; + line-height:30px; } } @@ -68,18 +69,48 @@ body.web { width:100%; min-height: 366px; position:relative; - padding-top:15px; padding-bottom:30px; + p { + color:#CCC; + line-height:150%; + } + .welcome { padding-top: 30px; } + .wrapper h1 { + position:relative; + padding-top:15px; + color:#ed3718 !important; + font-weight:normal; + font-size:40px; + } + + .wrapper h2 { + font-weight:300; + } + h2 { font-size:24px; color:#ccc; font-weight:200; } + + .button-orange, .button-grey { + display:inline-block; + height: 20px; + line-height:20px; + margin-bottom:10px; + margin-right:0px; + } + + .button-grey:hover { + cursor:default; + background-color:#666; + color:#ccc; + } } .landing-sidebar { @@ -217,10 +248,17 @@ body.web { p, ul { color:#999; line-height:160%; - margin-bottom:20px; width:90%; white-space:normal; + } + + ul { font-size:16px; + margin-bottom:20px; + } + + p { + font-size:14px; } h2 { @@ -383,6 +421,14 @@ body.web { padding-left:40px; } } + + .congratulations { + padding-top:1px; + } + + .recordings-page, .sessions-page { + padding-top:15px; + } } diff --git a/web/app/assets/stylesheets/web/welcome.css.scss b/web/app/assets/stylesheets/web/welcome.css.scss index 9f18a0e5c..80b10babf 100644 --- a/web/app/assets/stylesheets/web/welcome.css.scss +++ b/web/app/assets/stylesheets/web/welcome.css.scss @@ -81,7 +81,7 @@ Version: 1.1 { display:none; position :relative ; - margin :30px auto 0; + margin :15px auto 0; width :auto; height :auto; border :none; diff --git a/web/app/controllers/events_controller.rb b/web/app/controllers/events_controller.rb new file mode 100644 index 000000000..e5fb01079 --- /dev/null +++ b/web/app/controllers/events_controller.rb @@ -0,0 +1,10 @@ +class EventsController < ApplicationController + + respond_to :html + + def show + @event = Event.find_by_slug!(params[:slug]) + render :layout => "web" + end + +end \ No newline at end of file diff --git a/web/app/controllers/users_controller.rb b/web/app/controllers/users_controller.rb index 33b4ace7f..92aa2c9b0 100644 --- a/web/app/controllers/users_controller.rb +++ b/web/app/controllers/users_controller.rb @@ -198,10 +198,10 @@ class UsersController < ApplicationController def welcome @slides = [ - Slide.new("JamKazam Overview", "web/carousel_musicians.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s"), + Slide.new("JamKazam Overview", "web/carousel_musicians.jpg", "http://www.youtube.com/embed/ylYcvTY9CVo?autoplay=1"), Slide.new("Getting Started", "web/carousel_fans.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s"), Slide.new("Playing in a Session", "web/carousel_bands.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s"), - Slide.new("JamKazam Overview", "web/carousel_musicians.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s"), + Slide.new("JamKazam Overview", "web/carousel_musicians.jpg", "http://www.youtube.com/embed/ylYcvTY9CVo?autoplay=1"), Slide.new("Getting Started", "web/carousel_fans.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s"), Slide.new("Playing in a Session", "web/carousel_bands.jpg", "http://www.youtube.com/embed/eaYNM7p6Z5s") ] diff --git a/web/app/views/events/show.html.haml b/web/app/views/events/show.html.haml new file mode 100644 index 000000000..a6c62ed38 --- /dev/null +++ b/web/app/views/events/show.html.haml @@ -0,0 +1,31 @@ +- provide(:title, @event.title) + +.landing-content + %h1 Virtual Jam Fest 2014 + %p.w60 + = @event.description + %br + %br + %h2 ARTIST LINEUP + %br + + %br{clear:'all'} + + .landing-sidebar + %br + %br + %div{align:'center'} + %span SPONSORED BY: + = image_tag 'content/logo_centurylink.png', width:320, height:80, class:'play-icon', alt:'CenturyLink logo' + %br + %br + %br + %br + %div{align: 'center'} LEARN ABOUT JAMKAZAM + %br + = image_tag 'web/carousel_musicians.jpg', width:350, alt:'JamKazam Overview', class: 'video-slide', + :'data-video-header' => 'JamKazam Overview', :'data-video-url' => 'http://www.youtube.com/embed/ylYcvTY9CVo?autoplay=1' + + %br{clear:'all'} + + diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 6cff31b7b..5739e0839 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -16,6 +16,7 @@ <% end %> +
<% unless @music_session.band.nil? %>
@@ -79,6 +80,7 @@ <%= render :partial => "shared/track_details", :locals => {:tracks => @music_session.grouped_tracks} %>

+
<% if signed_in? %> <% unless @music_session.band.nil? %> diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 0a18d8021..4e79ace09 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -17,6 +17,7 @@ <% end %> +
<% unless @claimed_recording.recording.band.blank? %>
@@ -89,7 +90,7 @@ <%= render :partial => "shared/track_details", :locals => {:tracks => @claimed_recording.recording.grouped_tracks} %>

- +
<% if signed_in? %> <% unless @claimed_recording.recording.band.nil? %> <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.band, :recent_history => @claimed_recording.recording.band.recent_history} %> @@ -114,47 +115,6 @@ $(function () { var showRecording = new JK.ShowRecording(JK.app); showRecording.initialize("<%= @claimed_recording.id %>", "<%= @claimed_recording.recording_id %>"); - - $("#recordingDuration").html(formatTime("<%= @claimed_recording.recording.duration %>")); - - // remainder of this code is related to playing/pausing the recording - var htmlAudio = $(".recording-controls").find('audio').get(0); - var $imgPlayPauseSelector = $("#imgPlayPause"); - var playButtonPath = '/assets/content/icon_playbutton.png'; - var pauseButtonPath = '/assets/content/icon_pausebutton.png'; - var durationInitialized = false; - - function formatTime(time) { - var minutes = Math.floor(time / 60); - var seconds = Math.floor(time % 60); - return minutes.toString() + ":" + (seconds > 9 ? seconds.toString() : '0' + seconds.toString()); - } - - // this sets the slider to the appropriate position and updates the current play time - $(htmlAudio).on('timeupdate', function() { - var percentComplete = (htmlAudio.currentTime / htmlAudio.duration) * 100; - $(".recording-slider").css({'left': percentComplete + '%'}); - $(".recording-current").html(formatTime(htmlAudio.currentTime)); - - // reset icon to play and slider to far left when done - if (percentComplete === 100) { - $imgPlayPauseSelector.attr('src', playButtonPath); - $(".recording-slider").css({'left': 0 + '%'}); - $(".recording-current").html("0:00"); - } - }); - - $("#btnPlayPause").click(function() { - if (htmlAudio.paused) { - htmlAudio.play(); - $imgPlayPauseSelector.attr('src', pauseButtonPath); - } - else { - htmlAudio.pause(); - $imgPlayPauseSelector.attr('src', playButtonPath); - } - }); - }); <% end %> diff --git a/web/app/views/shared/_cta_sidebar.html.erb b/web/app/views/shared/_cta_sidebar.html.erb index 7742e983b..656b2bb1f 100644 --- a/web/app/views/shared/_cta_sidebar.html.erb +++ b/web/app/views/shared/_cta_sidebar.html.erb @@ -4,7 +4,7 @@ Already have an account?


- <%= image_tag "web/carousel_musicians.jpg", {:width => 350, :alt => ""} %>

+ <%= image_tag "web/carousel_musicians.jpg", {:width => 350, :alt => "", :class => 'video-slide', :'data-video-header' => 'JamKazam Overview', :'data-video-url' => 'http://www.youtube.com/embed/ylYcvTY9CVo?autoplay=1'} %>

<%= image_tag "web/carousel_fans.jpg", {:width => 350, :alt => ""} %>

<%= image_tag "web/carousel_bands.jpg", {:width => 350, :alt => ""} %>
\ No newline at end of file diff --git a/web/app/views/users/congratulations_fan.html.erb b/web/app/views/users/congratulations_fan.html.erb index 5d94567bd..7c0735c9d 100644 --- a/web/app/views/users/congratulations_fan.html.erb +++ b/web/app/views/users/congratulations_fan.html.erb @@ -1,11 +1,13 @@ <% provide(:title, 'Congratulations') %> -
Congratulations!
+
+
Congratulations!
-

You have successfully registered as a JamKazam fan.

+

You have successfully registered as a JamKazam fan.

-
<%= link_to "PROCEED TO JAMKAZAM SITE", client_path, :class =>"button-orange m0" %>
+
<%= link_to "PROCEED TO JAMKAZAM SITE", client_path, :class =>"button-orange m0" %>
+
\ No newline at end of file diff --git a/web/app/views/users/congratulations_musician.html.erb b/web/app/views/users/congratulations_musician.html.erb index 335980a78..f2684fff2 100644 --- a/web/app/views/users/congratulations_musician.html.erb +++ b/web/app/views/users/congratulations_musician.html.erb @@ -1,9 +1,11 @@ <% provide(:title, 'Congratulations') %> <% if @nativeClient %> -
Congratulations!
-

You have successfully registered as a musician.

-
<%= link_to "PROCEED TO JAMKAZAM SITE", client_path, :class =>"button-orange m0" %>
+
+
Congratulations!
+

You have successfully registered as a musician.

+
<%= link_to "PROCEED TO JAMKAZAM SITE", client_path, :class =>"button-orange m0" %>
+
<% else %> <%= render "users/downloads" %> <% end %> diff --git a/web/config/routes.rb b/web/config/routes.rb index b42a218d7..8b588ee5e 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -60,8 +60,9 @@ SampleApp::Application.routes.draw do match '/gmail_contacts', to: 'gmail#gmail_contacts' + match '/events/:slug', to: 'events#show', :via => :get - # temporarily allow for debugging + # temporarily allow for debugging--only allows admini n match '/listen_in', to: 'spikes#listen_in' # embed resque-web if this is development mode