From 3c5a14312a5cbd2f2e6c6d0116570f5fe0847375 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 9 Mar 2014 22:58:57 +0000 Subject: [PATCH 01/14] * Event page 'chrome' is setup and pulling from database--now to add band logic --- admin/app/admin/event.rb | 3 ++ db/manifest | 1 + db/up/events.sql | 10 ++++ ruby/lib/jam_ruby.rb | 1 + ruby/lib/jam_ruby/models/event.rb | 11 ++++ ruby/spec/factories.rb | 9 +++- ruby/spec/jam_ruby/models/event_spec.rb | 18 +++++++ web/app/assets/javascripts/web/videoDialog.js | 40 +++++++-------- web/app/assets/stylesheets/web/main.css.scss | 50 ++++++++++++++++++- .../assets/stylesheets/web/welcome.css.scss | 2 +- web/app/controllers/events_controller.rb | 10 ++++ web/app/controllers/users_controller.rb | 4 +- web/app/views/events/show.html.haml | 31 ++++++++++++ web/app/views/music_sessions/show.html.erb | 2 + web/app/views/recordings/show.html.erb | 44 +--------------- web/app/views/shared/_cta_sidebar.html.erb | 2 +- .../views/users/congratulations_fan.html.erb | 8 +-- .../users/congratulations_musician.html.erb | 8 +-- web/config/routes.rb | 3 +- 19 files changed, 181 insertions(+), 76 deletions(-) create mode 100644 admin/app/admin/event.rb create mode 100644 db/up/events.sql create mode 100644 ruby/lib/jam_ruby/models/event.rb create mode 100644 ruby/spec/jam_ruby/models/event_spec.rb create mode 100644 web/app/controllers/events_controller.rb create mode 100644 web/app/views/events/show.html.haml 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 From b9ee475db5e79ff9e32c69cca5970591e944d248 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 06:31:20 +0000 Subject: [PATCH 02/14] * working on event page --- admin/app/admin/event_session.rb | 3 + db/up/events.sql | 19 +++- ruby/lib/jam_ruby.rb | 1 + ruby/lib/jam_ruby/models/band.rb | 3 + ruby/lib/jam_ruby/models/event.rb | 8 +- ruby/lib/jam_ruby/models/event_session.rb | 29 ++++++ ruby/lib/jam_ruby/models/user.rb | 3 + ruby/spec/factories.rb | 6 +- .../jam_ruby/models/event_session_spec.rb | 26 +++++ ruby/spec/jam_ruby/models/event_spec.rb | 11 ++- .../images/content/logo_centurylink.png | Bin 0 -> 6116 bytes .../stylesheets/client/jamkazam.css.scss | 7 ++ web/app/controllers/events_controller.rb | 2 +- web/app/helpers/avatar_helper.rb | 8 +- web/app/helpers/event_session_helper.rb | 91 ++++++++++++++++++ web/app/views/events/_event_session.html.haml | 19 ++++ .../{show.html.haml => event.html.haml} | 7 +- 17 files changed, 226 insertions(+), 17 deletions(-) create mode 100644 admin/app/admin/event_session.rb create mode 100644 ruby/lib/jam_ruby/models/event_session.rb create mode 100644 ruby/spec/jam_ruby/models/event_session_spec.rb create mode 100644 web/app/assets/images/content/logo_centurylink.png create mode 100644 web/app/helpers/event_session_helper.rb create mode 100644 web/app/views/events/_event_session.html.haml rename web/app/views/events/{show.html.haml => event.html.haml} (84%) diff --git a/admin/app/admin/event_session.rb b/admin/app/admin/event_session.rb new file mode 100644 index 000000000..df540716d --- /dev/null +++ b/admin/app/admin/event_session.rb @@ -0,0 +1,3 @@ +ActiveAdmin.register JamRuby::EventSession, :as => 'Event Session' do + menu :parent => 'Events' +end diff --git a/db/up/events.sql b/db/up/events.sql index 6c0feb664..b0f2d2458 100644 --- a/db/up/events.sql +++ b/db/up/events.sql @@ -1,10 +1,25 @@ CREATE TABLE events ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), slug VARCHAR(512) NOT NULL UNIQUE, - starts_at TIMESTAMP, - ends_at TIMESTAMP, + event_day date, title TEXT, description TEXT, + show_sponser BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE event_sessions ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + starts_at TIMESTAMP, + ends_at TIMESTAMP, + pinned_state VARCHAR(255), + img_url VARCHAR(1024), + img_width INTEGER, + img_height INTEGER, + event_id VARCHAR(64) REFERENCES events(id) ON DELETE CASCADE, + user_id VARCHAR(64) REFERENCES users(id) ON DELETE SET NULL, + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE SET NULL, 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 6c65f40d5..0353c58a0 100755 --- a/ruby/lib/jam_ruby.rb +++ b/ruby/lib/jam_ruby.rb @@ -100,6 +100,7 @@ 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/event_session" 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/band.rb b/ruby/lib/jam_ruby/models/band.rb index 3115e8e23..bce468fd9 100644 --- a/ruby/lib/jam_ruby/models/band.rb +++ b/ruby/lib/jam_ruby/models/band.rb @@ -47,6 +47,9 @@ module JamRuby has_many :music_sessions, :class_name => "JamRuby::MusicSession", :foreign_key => "band_id" has_many :music_session_history, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "band_id", :inverse_of => :band + # events + has_many :event_sessions, :class_name => "JamRuby::EventSession" + include Geokit::ActsAsMappable::Glue unless defined?(acts_as_mappable) acts_as_mappable diff --git a/ruby/lib/jam_ruby/models/event.rb b/ruby/lib/jam_ruby/models/event.rb index 998e1d42d..a5f3e1f02 100644 --- a/ruby/lib/jam_ruby/models/event.rb +++ b/ruby/lib/jam_ruby/models/event.rb @@ -1,11 +1,9 @@ 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 + attr_accessible :slug, :event_day, :title, :description, :show_sponser, as: :admin validates :slug, uniqueness: true, presence: true + validates :show_sponser, :inclusion => {:in => [true, false]} + has_many :event_sessions, class_name: 'JamRuby::EventSession' end diff --git a/ruby/lib/jam_ruby/models/event_session.rb b/ruby/lib/jam_ruby/models/event_session.rb new file mode 100644 index 000000000..21a093c17 --- /dev/null +++ b/ruby/lib/jam_ruby/models/event_session.rb @@ -0,0 +1,29 @@ +class JamRuby::EventSession < ActiveRecord::Base + + attr_accessible :event_id, :user_id, :band_id, :starts_at, :ends_at, :pinned_state, :position, :img_url, :img_width, :img_height, as: :admin + + belongs_to :user, class_name: 'JamRuby::User' + belongs_to :band, class_name: 'JamRuby::Band' + belongs_to :event + + + validates :event, presence: true + validates :pinned_state, :inclusion => {:in => [nil, :not_started, :over]} + validate :one_of_user_band + + before_validation :sanitize_active_admin + + def sanitize_active_admin + puts self.inspect + self.img_url = nil if self.img_url == '' + self.user_id = nil if self.user_id == '' + self.band_id = nil if self.band_id == '' + self.pinned_state = nil if self.pinned_state == '' + end + + def one_of_user_band + if band && user + errors.add(:user, 'specify band, or user. not both') + end + end +end diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index a619f864a..17e4ed46b 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -94,6 +94,9 @@ module JamRuby # crash dumps has_many :crash_dumps, :foreign_key => "user_id", :class_name => "JamRuby::CrashDump" + # events + has_many :event_sessions, :class_name => "JamRuby::EventSession" + # This causes the authenticate method to be generated (among other stuff) #has_secure_password diff --git a/ruby/spec/factories.rb b/ruby/spec/factories.rb index 24866a617..0db11878c 100644 --- a/ruby/spec/factories.rb +++ b/ruby/spec/factories.rb @@ -420,6 +420,8 @@ FactoryGirl.define do sequence(:slug) { |n| "slug-#{n}" } title 'event title' description 'event description' - end - end + + factory :event_session, :class => JamRuby::EventSession do + end +end diff --git a/ruby/spec/jam_ruby/models/event_session_spec.rb b/ruby/spec/jam_ruby/models/event_session_spec.rb new file mode 100644 index 000000000..947370e86 --- /dev/null +++ b/ruby/spec/jam_ruby/models/event_session_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe EventSession do + + it "should be creatable" do + event = FactoryGirl.create(:event) + event_session = FactoryGirl.create(:event_session, event: event) + end + + it "requires a parent event" do + event_session = FactoryGirl.build(:event_session) + event_session.save.should be_false + event_session.errors[:event].should == ["can't be blank"] + end + + it "can't specify both band and user" do + user = FactoryGirl.create(:user) + band = FactoryGirl.create(:band) + event = FactoryGirl.create(:event) + event_session = FactoryGirl.build(:event_session, event: event, user: user, band:band) + event_session.save.should be_false + event_session.errors[:user].should == ["specify band, or user. not both"] + end + +end + diff --git a/ruby/spec/jam_ruby/models/event_spec.rb b/ruby/spec/jam_ruby/models/event_spec.rb index b888ab7e0..93a8629a2 100644 --- a/ruby/spec/jam_ruby/models/event_spec.rb +++ b/ruby/spec/jam_ruby/models/event_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe Event do - before do - end it "should be creatable" do FactoryGirl.create(:event) @@ -15,4 +13,13 @@ describe Event do dup.errors[:slug].should == ["has already been taken"] end + it "can have associated event session, then destroy it by destroying event" do + event = FactoryGirl.create(:event) + event_session = FactoryGirl.create(:event_session, event: event) + event.reload + event.event_sessions.length.should == 1 + event_session.event.should == event + event.destroy + EventSession.find_by_id(event_session.id).should be_nil + end end diff --git a/web/app/assets/images/content/logo_centurylink.png b/web/app/assets/images/content/logo_centurylink.png new file mode 100644 index 0000000000000000000000000000000000000000..57f2deb031a16d2841d595faa24dc9905e1e53dd GIT binary patch literal 6116 zcmV9TT08wGs#f-x3!sk={^WKau>Zpm;7uVgv$Q>FZIGVOAke3;b)MuYdLR zq^}?Pde&D@nt?#@J#pS3@kK~9zx1`JL4F)Sv5ochs>$$8UvY_if%=TJ(i>r(QY1e} zGuOYz(hLLwA;2a`Y9C|*@3}5<{}4@SKw*+Y8esZ9;@<@Vfe>JIXoZ!ciMbC z^*$K^xU<{}1eLdC`fByJX7biopT50kI!S`&?%$ASO@t6?1GB$R`u_*g1O$Tbi?dMj zL(-tC??w~Sj)KCO)rBibPaGfzhzA^4^7p28Co@L+{zR%+AP`hmfDZDrsz6O{Ks;%~ zd7WGGH&gsf?xIY%j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sGn6OzB^;mqn)*Dc~@eXSW0aNHHUbCl7EtSkvf;4$m0 zOVZ4ldRAnDBq~WJ8An1TH{b{{E4SWb&g3&Q-7ggf&Ddz;cTlf53DVnVClm#EI3()R zPXrwbd>@Z$H$>&pxW90$4^ho@OOD))0F|5hE+8RLB>$@IpxF>|c~GC>5D~^Cz9?o1 zp`kJ->N5lbI_H~9Ns@QPRCNW$nmrO?2Org~`iyy_8JHNPJ2g}dJa>g<^^*{+udH&T z&bwGvx$;jmDK6g*tK&g!&+-FFJ)-K2N!is|mfAN+_Frtjx1>xY4)7}iJM%qJflESu znGpz0XL-kJcZI_~P2dqxMPs!c`MIJCyHVSrL1RLS8^R1&`7kGC-pBWM9N$gd1|58^>uH-K;%1m) zzRh^eIUy+gqjy0k)4Ku(!C@Mnjt@KBOYY#y%kak^w`68Fsjl@vQki znlATSX8d2qbfBHzu#;RW{&-So+yk;)%2f^{Updf@fN2-Auyg#g7vM*GVw8C3pf$oy zzf!xt$Q;wUq|3yN@R@`>x5oeLk!RR?!gL1Y{Tb$IZmFlW@r;?~lVLR!S5C@zz_>fi zJZAxIi~WtX=bWU^wVzfXOW_132V(v|k)>_F43)AoxrDBUp`oyQQlj6uElCjwP7sk{ zc7iW#jVj_+ZTlbT1O%O+k+XY+00n}R!(4p^MHe&S6ba*?A2O!8;2T4HfP#~Q#TQl} qRogyMsvJ|iR^RRX3&Ae_C%^#L4r|usRqL$)0000 "web" + render 'event', :layout => "web" end end \ No newline at end of file diff --git a/web/app/helpers/avatar_helper.rb b/web/app/helpers/avatar_helper.rb index 13107ca17..ce7a7632b 100644 --- a/web/app/helpers/avatar_helper.rb +++ b/web/app/helpers/avatar_helper.rb @@ -22,11 +22,15 @@ module AvatarHelper end end - def resolve_avatarables(*avatarables) + def resolve_avatarables(*avatarables, allow_none: false) avatarables.each do |avatarable| return resolve_avatarable(avatarable) if avatarable end - raise "at least one avatarable must be specified" + if allow_none + nil + else + raise "at least one avatarable must be specified" + end end end \ No newline at end of file diff --git a/web/app/helpers/event_session_helper.rb b/web/app/helpers/event_session_helper.rb new file mode 100644 index 000000000..89402bd2c --- /dev/null +++ b/web/app/helpers/event_session_helper.rb @@ -0,0 +1,91 @@ +module EventSessionHelper + + def event_session_img(event_session) + + # need to figure out img, width, height + + # prefer the session URL if specified; otherwise use the band/user + url = nil + width = nil + height = nil + + if event_session.img_url + url = image_path(event_session.img_url) + else + url = resolve_avatarables(event_session.band, event_session.user, allow_none: true) + end + + if url + width = event_session.img_width + height = event_session.img_height + else + url = image_path('web/logo-256.png') + width = 115 + end + + content_tag(:img, nil, src: url, width: width, height: height) + end + + def event_session_title(event_session) + return event_session.band.name if event_session.band + return event_session.user.name if event_session.user + 'TBD' + end + + def event_session_start_hour(event_session) + timezone = ActiveSupport::TimeZone.new('Central Time (US & Canada)') + timezone.at(event_session.starts_at.to_i).strftime('%l:%M %P') + end + + def event_session_button(event_session) + + state = nil # can be :not_started, :over, :playing + state = event_session.pinned_state if event_session.pinned_state + if !state && (event_session.user_id || event_session.band_id) + # if no pinned state, then we try to find if there is a session currently on going during the specified time range + # if so, then we are playing. + # if there has been none, we say it's still coming, + # if there has been at least one, and it's over, we say session over + query = MusicSessionHistory.where(created_at: event_session.event.event_day..(event_session.event.event_day + 1.day)) + if event_session.user_id + query = query.where(user_id: event_session.user_id) + elsif event_session.band_id + query = query.where(band_id: event_session.band_id) + else + raise 'invalid state in event_session_button' + end + + music_session_history = query.order('created_at DESC').first + + if music_session_history + if music_session_history.session_removed_at + state = 'over' + else + state = 'playing' + end + else + state = 'not_started' + end + end + + if state == 'over' + content_tag(:a, 'SESSION ENDED', href: music_session_detail_path(music_session_history.id), class: 'button-grey') + elsif state == 'playing' + content_tag(:a, '', href: music_session_detail_path(music_session_history.id), class: 'button-orange') do + image_tag 'content/icon_playbutton.png', :width => 20, height: 20, align: 'absmiddle' + content_tag(:span, 'LISTEN NOW') + end + elsif state == 'not_started' + nil + else + nil + end + + end + + def event_session_description(event_session) + event_session.band.biography if event_session.band + event_session.user.biography if event_session.user + '' + end +end diff --git a/web/app/views/events/_event_session.html.haml b/web/app/views/events/_event_session.html.haml new file mode 100644 index 000000000..3c912dedf --- /dev/null +++ b/web/app/views/events/_event_session.html.haml @@ -0,0 +1,19 @@ +%hr{ class:'w60' } +.landing-band + = event_session_img(event_session) + %br + %br + %span= event_session_title(event_session) + +.landing-details + .left.f20.teal + %strong + = event_session_start_hour(event_session) + .right + = event_session_button(event_session) + %br{ clear:'all' } + %br + .left + = event_session_description(event_session) + %br + %br \ No newline at end of file diff --git a/web/app/views/events/show.html.haml b/web/app/views/events/event.html.haml similarity index 84% rename from web/app/views/events/show.html.haml rename to web/app/views/events/event.html.haml index a6c62ed38..2a2f57655 100644 --- a/web/app/views/events/show.html.haml +++ b/web/app/views/events/event.html.haml @@ -1,14 +1,15 @@ - provide(:title, @event.title) .landing-content - %h1 Virtual Jam Fest 2014 - %p.w60 - = @event.description + %h1= @event.title + %p.w60= @event.description %br %br %h2 ARTIST LINEUP %br + = render :partial => "event_session", :collection => @event.event_sessions + %br{clear:'all'} .landing-sidebar From 84011ce3399a0afe93d31e969448a19caf38e2d4 Mon Sep 17 00:00:00 2001 From: Scott Comer Date: Mon, 10 Mar 2014 07:26:15 -0500 Subject: [PATCH 03/14] remove bogus reference to non-existent GeoIpIsp --- ruby/lib/jam_ruby/models/jam_isp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/lib/jam_ruby/models/jam_isp.rb b/ruby/lib/jam_ruby/models/jam_isp.rb index e4e77b9e0..dd0de86f3 100644 --- a/ruby/lib/jam_ruby/models/jam_isp.rb +++ b/ruby/lib/jam_ruby/models/jam_isp.rb @@ -45,7 +45,7 @@ module JamRuby # startIpNum,endIpNum,isp self.transaction do - GeoIpIsp.delete_all + self.connection.execute "delete from #{GEOIPISP_TABLE}" File.open(file, 'r:ISO-8859-1') do |io| #s = io.gets.strip # eat the copyright line. gah, why do they have that in their file?? #unless s.eql? 'Copyright (c) 2012 MaxMind LLC. All Rights Reserved.' From c9625a452922aee32415cb3a085bc92511afbf12 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 15:21:21 +0000 Subject: [PATCH 04/14] * VRFS-1377 done, tested. going to manually test soon on production --- db/up/events.sql | 1 - ruby/lib/jam_ruby/models/event.rb | 2 +- ruby/lib/jam_ruby/models/event_session.rb | 1 - .../assets/stylesheets/web/events.css.scss | 12 ++ web/app/helpers/event_session_helper.rb | 41 ++++--- web/app/views/events/_event_session.html.haml | 4 +- web/app/views/events/event.html.haml | 9 +- web/app/views/music_sessions/show.html.erb | 2 +- web/spec/factories.rb | 10 ++ web/spec/features/event_spec.rb | 114 ++++++++++++++++++ 10 files changed, 168 insertions(+), 28 deletions(-) create mode 100644 web/spec/features/event_spec.rb diff --git a/db/up/events.sql b/db/up/events.sql index b0f2d2458..c2992c07b 100644 --- a/db/up/events.sql +++ b/db/up/events.sql @@ -1,7 +1,6 @@ CREATE TABLE events ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), slug VARCHAR(512) NOT NULL UNIQUE, - event_day date, title TEXT, description TEXT, show_sponser BOOLEAN NOT NULL DEFAULT false, diff --git a/ruby/lib/jam_ruby/models/event.rb b/ruby/lib/jam_ruby/models/event.rb index a5f3e1f02..c21e655ab 100644 --- a/ruby/lib/jam_ruby/models/event.rb +++ b/ruby/lib/jam_ruby/models/event.rb @@ -1,6 +1,6 @@ class JamRuby::Event < ActiveRecord::Base - attr_accessible :slug, :event_day, :title, :description, :show_sponser, as: :admin + attr_accessible :slug, :title, :description, :show_sponser, as: :admin validates :slug, uniqueness: true, presence: true validates :show_sponser, :inclusion => {:in => [true, false]} diff --git a/ruby/lib/jam_ruby/models/event_session.rb b/ruby/lib/jam_ruby/models/event_session.rb index ac303b6be..7385de68d 100644 --- a/ruby/lib/jam_ruby/models/event_session.rb +++ b/ruby/lib/jam_ruby/models/event_session.rb @@ -14,7 +14,6 @@ class JamRuby::EventSession < ActiveRecord::Base before_validation :sanitize_active_admin def sanitize_active_admin - puts self.inspect self.img_url = nil if self.img_url == '' self.user_id = nil if self.user_id == '' self.band_id = nil if self.band_id == '' diff --git a/web/app/assets/stylesheets/web/events.css.scss b/web/app/assets/stylesheets/web/events.css.scss index fadb069e8..db8edf865 100644 --- a/web/app/assets/stylesheets/web/events.css.scss +++ b/web/app/assets/stylesheets/web/events.css.scss @@ -9,4 +9,16 @@ .bio { line-height:16px; } + + .session-button { + img.listen-now-play { + vertical-align: top; + padding-right:7px; + } + } +} +.landing-sidebar { + .sponsor { + margin-bottom:50px; + } } \ No newline at end of file diff --git a/web/app/helpers/event_session_helper.rb b/web/app/helpers/event_session_helper.rb index 37a67b798..3c46e7e38 100644 --- a/web/app/helpers/event_session_helper.rb +++ b/web/app/helpers/event_session_helper.rb @@ -13,6 +13,7 @@ module EventSessionHelper url = image_path(event_session.img_url) else url = resolve_avatarables(event_session.band, event_session.user, allow_none: true) + url = image_path(url) if url end if url @@ -38,25 +39,34 @@ module EventSessionHelper timezone.at(event_session.starts_at.to_i).strftime('%l:%M %P') end + def fetch_last_session(event_session) + # if no pinned state, then we try to find if there is a session currently on going during the specified time range + # if so, then we are playing. + # if there has been none, we say it's still coming, + # if there has been at least one, and it's over, we say session over + query = MusicSessionHistory.where(fan_access: true).where(created_at: event_session.starts_at..event_session.ends_at) + if event_session.user_id + query = query.where(user_id: event_session.user_id) + elsif event_session.band_id + query = query.where(band_id: event_session.band_id) + else + raise 'invalid state in event_session_button' + end + + query.order('created_at DESC').first + end + def event_session_button(event_session) state = nil # can be :not_started, :over, :playing state = event_session.pinned_state if event_session.pinned_state - if !state && (event_session.starts_at && event_session.ends_at && (event_session.user_id || event_session.band_id)) - # if no pinned state, then we try to find if there is a session currently on going during the specified time range - # if so, then we are playing. - # if there has been none, we say it's still coming, - # if there has been at least one, and it's over, we say session over - query = MusicSessionHistory.where(created_at: event_session.starts_at..event_session.ends_at) - if event_session.user_id - query = query.where(user_id: event_session.user_id) - elsif event_session.band_id - query = query.where(band_id: event_session.band_id) - else - raise 'invalid state in event_session_button' - end + if state - music_session_history = query.order('created_at DESC').first + music_session_history = fetch_last_session(event_session) + + elsif !state && (event_session.starts_at && event_session.ends_at && (event_session.user_id || event_session.band_id)) + + music_session_history = fetch_last_session(event_session) if music_session_history if music_session_history.session_removed_at @@ -73,8 +83,7 @@ module EventSessionHelper content_tag(:a, 'SESSION ENDED', href: music_session_history.nil? ? '#' : music_session_detail_path(music_session_history.id), class: 'button-grey') elsif state == 'playing' content_tag(:a, '', href: music_session_detail_path(music_session_history.id), class: 'button-orange') do - image_tag 'content/icon_playbutton.png', :width => 20, height: 20, align: 'absmiddle' - content_tag(:span, 'LISTEN NOW') + content_tag(:span, image_tag('content/icon_playbutton.png', :width => 20, height: 20, align: 'absmiddle', class:'listen-now-play') + 'LISTEN NOW') end elsif state == 'not_started' nil diff --git a/web/app/views/events/_event_session.html.haml b/web/app/views/events/_event_session.html.haml index 6cee1162b..f3a75161a 100644 --- a/web/app/views/events/_event_session.html.haml +++ b/web/app/views/events/_event_session.html.haml @@ -3,13 +3,13 @@ = event_session_img(event_session) %br %br - %span= event_session_title(event_session) + %span.event-title= event_session_title(event_session) .landing-details.event .left.f20.teal.time %strong = event_session_start_hour(event_session) - .right + .right.session-button = event_session_button(event_session) %br{ clear:'all' } diff --git a/web/app/views/events/event.html.haml b/web/app/views/events/event.html.haml index 237e554ef..9619bdff2 100644 --- a/web/app/views/events/event.html.haml +++ b/web/app/views/events/event.html.haml @@ -17,12 +17,9 @@ %br %div{align:'center'} - if @event.show_sponser? - %span SPONSORED BY: - = image_tag 'content/logo_centurylink.png', width:320, height:80, class:'play-icon', alt:'CenturyLink logo' - %br - %br - %br - %br + .sponsor + %span SPONSORED BY: + = image_tag 'content/logo_centurylink.png', width:320, height:80, alt:'CenturyLink logo' %div{align: 'center'} LEARN ABOUT JAMKAZAM %br = image_tag 'web/carousel_musicians.jpg', width:350, alt:'JamKazam Overview', class: 'video-slide', diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 5739e0839..a07199666 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -17,7 +17,7 @@ <% end %>
-
+
<% unless @music_session.band.nil? %>
<% unless @music_session.band.photo_url.blank? %> diff --git a/web/spec/factories.rb b/web/spec/factories.rb index 217bc7038..2c2033804 100644 --- a/web/spec/factories.rb +++ b/web/spec/factories.rb @@ -390,4 +390,14 @@ FactoryGirl.define do mix.recording.claimed_recordings << FactoryGirl.create(:claimed_recording, user: user, recording: mix.recording) } end + + + factory :event, :class => JamRuby::Event do + sequence(:slug) { |n| "slug-#{n}" } + title 'event title' + description 'event description' + end + + factory :event_session, :class => JamRuby::EventSession do + end end diff --git a/web/spec/features/event_spec.rb b/web/spec/features/event_spec.rb new file mode 100644 index 000000000..c18d90fd0 --- /dev/null +++ b/web/spec/features/event_spec.rb @@ -0,0 +1,114 @@ +require 'spec_helper' + +describe "Events", :js => true, :type => :feature, :capybara_feature => true, :slow => true do + + subject { page } + + before(:all) do + Capybara.javascript_driver = :poltergeist + Capybara.current_driver = Capybara.javascript_driver + Capybara.default_wait_time = 30 # these tests are SLOOOOOW + end + + before(:each) do + UserMailer.deliveries.clear + MusicSession.delete_all + @event = FactoryGirl.create(:event, :slug => 'so_latency', show_sponser:true) + visit "/events/so_latency" + end + + it "should not break as page gets more and more well-defined" do + find('h1', text: @event.title) + find('h2', text: 'ARTIST LINEUP') + find('p', text: @event.description) + find('.landing-sidebar') + find('.sponsor span', 'SPONSORED BY:') + + # add an event session to the event, with nothing defined + @event_session = FactoryGirl.create(:event_session, event: @event) + visit "/events/so_latency" + find('.landing-band.event img')['src'].should == '/assets/web/logo-256.png' + find('.event-title', text: 'TBD') + find('.time strong', text: 'TBD') + + # define the event better by associating with a band + band = FactoryGirl.create(:band) + @event_session.band = band + @event_session.save! + visit "/events/so_latency" + find('.landing-details.event .bio', text: band.biography) + find('.landing-band.event img')['src'].should == '/assets/shared/avatar_generic_band.png' + + # update starts at + starts_at = 1.hours.ago + @event_session.starts_at = starts_at + @event_session.save! + visit "/events/so_latency" + timezone = ActiveSupport::TimeZone.new('Central Time (US & Canada)') + find('.time strong', text: timezone.at(@event_session.starts_at.to_i).strftime('%l:%M %P').strip) + + # update ends at + ends_at = 1.hours.from_now + @event_session.ends_at = ends_at + @event_session.save! + visit "/events/so_latency" + # UI shouldn't change; as long as it doesn't crash we are OK + + # now start a session, and don't sent session_removed_at + music_session = FactoryGirl.create(:music_session, band: band) + music_session_history = music_session.music_session_history + music_session_history.session_removed_at.should be_nil + visit "/events/so_latency" + find('.landing-details .session-button span', text:'LISTEN NOW') + find('.landing-details .session-button a').trigger(:click) + find('.sessions-page .landing-band', text: band.name) # indication of session landing page + find(".recording-controls[data-music-session=\"#{music_session_history.id}\"]") + + # force the pinned_state to say 'not_started' + @event_session.pinned_state = 'not_started' + @event_session.save! + visit "/events/so_latency" + expect(page).not_to have_css('.landing-details .session-button a') # no button at all + + # force the pinned_state to say 'not_started' + @event_session.pinned_state = 'over' + @event_session.save! + visit "/events/so_latency" + find('.landing-details .session-button a', text:'SESSION ENDED').trigger(:click) + find('.sessions-page .landing-band', text: band.name) # indication of session landing page + find(".recording-controls[data-music-session=\"#{music_session_history.id}\"]") + + # unpin + @event_session.pinned_state = nil + @event_session.save! + + + # turn fan_access = false... this will hide the button + music_session_history.fan_access = false + music_session_history.save! + visit "/events/so_latency" + expect(page).not_to have_css('.landing-details .session-button a') # no button at all + + + # now start a second session, and don't sent session_removed_at + music_session = FactoryGirl.create(:music_session, band: band) + music_session_history = music_session.music_session_history + music_session_history.session_removed_at.should be_nil + visit "/events/so_latency" + find('.landing-details .session-button span', text:'LISTEN NOW') + find('.landing-details .session-button a').trigger(:click) + find('.sessions-page .landing-band', text: band.name) # indication of session landing page + find(".recording-controls[data-music-session=\"#{music_session_history.id}\"]") + visit "/events/so_latency" + + # then end it, and see session_ended + music_session_history = music_session.music_session_history + music_session_history.session_removed_at = Time.now + music_session_history.save! + visit "/events/so_latency" + find('.landing-details .session-button a', text:'SESSION ENDED').trigger(:click) + find('.sessions-page .landing-band', text: band.name) # indication of session landing page + find(".recording-controls[data-music-session=\"#{music_session_history.id}\"]") + + end +end From 030d31eadc0741aa6e226ee5c356eeffbb1b8b18 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 16:24:36 +0000 Subject: [PATCH 05/14] supply link on facebook share - VRFS-1376 --- ruby/spec/jam_ruby/models/feed_spec.rb | 4 ++-- web/app/assets/javascripts/shareDialog.js | 6 ++++-- web/app/controllers/api_users_controller.rb | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ruby/spec/jam_ruby/models/feed_spec.rb b/ruby/spec/jam_ruby/models/feed_spec.rb index b61596fc9..750cbd2f4 100644 --- a/ruby/spec/jam_ruby/models/feed_spec.rb +++ b/ruby/spec/jam_ruby/models/feed_spec.rb @@ -158,8 +158,8 @@ describe Feed do # creates both recording and history record in feed claimed_recording1 = FactoryGirl.create(:claimed_recording) - # move the feed entry created for the recording back more than a months ago - claimed_recording1.recording.feed.created_at = 25.hours.ago + # move the feed entry created for the recording back more than a day ago + claimed_recording1.recording.feed.created_at = 48.hours.ago claimed_recording1.recording.feed.save! feeds, start = Feed.index(user1, :type => 'recording', time_range: 'today') diff --git a/web/app/assets/javascripts/shareDialog.js b/web/app/assets/javascripts/shareDialog.js index 7ef6e2978..aacf3ae6d 100644 --- a/web/app/assets/javascripts/shareDialog.js +++ b/web/app/assets/javascripts/shareDialog.js @@ -106,7 +106,8 @@ description: data.description, caption: data.caption, name: data.title, - picture: data.photo_url + picture: data.photo_url, + link: data.url }) .done(function(response) { checkShareCheckbox('facebook', false); @@ -163,7 +164,8 @@ description: data.description, caption: data.caption, name: data.title, - picture: data.photo_url + picture: data.photo_url, + link: data.url }) .done(function(response) { checkShareCheckbox('facebook', false); diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 0a3bec6ec..36861a7b5 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -531,6 +531,7 @@ class ApiUsersController < ApiController description: view_context.description_for_music_session_history(history), title: view_context.title_for_music_session_history(history, current_user), photo_url: view_context.facebook_image_for_music_session_history(history), + url: share_token_url(history.share_token.token), caption: 'www.jamkazam.com' }, status: 200 @@ -557,6 +558,7 @@ class ApiUsersController < ApiController description: view_context.description_for_claimed_recording(claimed_recording), title: view_context.title_for_claimed_recording(claimed_recording, current_user), photo_url: view_context.facebook_image_for_claimed_recording(claimed_recording), + url: share_token_url(claimed_recording.share_token.token), caption: 'www.jamkazam.com' }, status: 200 From 9225937ee79480c7733f01093ef1330e54640ac1 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 17:24:29 +0000 Subject: [PATCH 06/14] * using UTC date --- web/app/assets/javascripts/tickDuration.js | 2 +- web/app/assets/javascripts/utils.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/app/assets/javascripts/tickDuration.js b/web/app/assets/javascripts/tickDuration.js index 5d267f77b..4e55cf5c1 100644 --- a/web/app/assets/javascripts/tickDuration.js +++ b/web/app/assets/javascripts/tickDuration.js @@ -8,7 +8,7 @@ $.each($(customSelector ? customSelector : '.inprogress .tick-duration'), function(index, item) { var $duration = $(item); var createdAt = new Date(Number($duration.attr('data-created-at')) * 1000) - var millisElapsed = (new Date()).getTime() - createdAt.getTime(); + var millisElapsed = (context.JK.nowUTC().getTime() - createdAt.getTime(); $duration.text(context.JK.prettyPrintSeconds( parseInt(millisElapsed / 1000))); }); }, 333); diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index 306f54249..1c358145d 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -718,6 +718,10 @@ return deviceId; } + context.JK.nowUTC = function() { + var d = new Date(); + return new Date( d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds() ); + } /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. From ae2c2fb8074022d3c34a6ee7f8f14a2ff895ad57 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 18:14:08 +0000 Subject: [PATCH 07/14] * padding at bottom of entry --- web/app/assets/stylesheets/web/events.css.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/web/app/assets/stylesheets/web/events.css.scss b/web/app/assets/stylesheets/web/events.css.scss index db8edf865..3f0ba5cbb 100644 --- a/web/app/assets/stylesheets/web/events.css.scss +++ b/web/app/assets/stylesheets/web/events.css.scss @@ -8,6 +8,7 @@ .bio { line-height:16px; + margin-bottom:20px; } .session-button { From 6867b2711adcc646b42fec9c05ab96fb7ef83121 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 18:19:56 +0000 Subject: [PATCH 08/14] * adding a br clear all between entries --- web/app/views/events/_event_session.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/views/events/_event_session.html.haml b/web/app/views/events/_event_session.html.haml index f3a75161a..484ff1928 100644 --- a/web/app/views/events/_event_session.html.haml +++ b/web/app/views/events/_event_session.html.haml @@ -16,4 +16,5 @@ .left.bio = event_session_description(event_session) %br - %br \ No newline at end of file + %br +%br{ clear:'all' } \ No newline at end of file From 5dd0463d720c52036bde8c6d9971bbb0cef0218c Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 18:36:42 +0000 Subject: [PATCH 09/14] * ugh js error --- web/app/assets/javascripts/tickDuration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/assets/javascripts/tickDuration.js b/web/app/assets/javascripts/tickDuration.js index 4e55cf5c1..107336220 100644 --- a/web/app/assets/javascripts/tickDuration.js +++ b/web/app/assets/javascripts/tickDuration.js @@ -8,7 +8,7 @@ $.each($(customSelector ? customSelector : '.inprogress .tick-duration'), function(index, item) { var $duration = $(item); var createdAt = new Date(Number($duration.attr('data-created-at')) * 1000) - var millisElapsed = (context.JK.nowUTC().getTime() - createdAt.getTime(); + var millisElapsed = (context.JK.nowUTC().getTime() - createdAt.getTime()); $duration.text(context.JK.prettyPrintSeconds( parseInt(millisElapsed / 1000))); }); }, 333); From bfd017b19f7c6123c483fce60ab0dbe09cb26a0a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 21:15:58 +0000 Subject: [PATCH 10/14] * VRFS-1377 - adding sponsor on session page, and making centurylink a link --- web/app/views/events/event.html.haml | 3 ++- web/app/views/music_sessions/show.html.erb | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/web/app/views/events/event.html.haml b/web/app/views/events/event.html.haml index 9619bdff2..b71244cb4 100644 --- a/web/app/views/events/event.html.haml +++ b/web/app/views/events/event.html.haml @@ -19,7 +19,8 @@ - if @event.show_sponser? .sponsor %span SPONSORED BY: - = image_tag 'content/logo_centurylink.png', width:320, height:80, alt:'CenturyLink logo' + %a{href: 'http://www.centurylinktechnology.com/'} + = image_tag 'content/logo_centurylink.png', width:320, height:80, alt:'CenturyLink logo' %div{align: 'center'} LEARN ABOUT JAMKAZAM
%br = image_tag 'web/carousel_musicians.jpg', width:350, alt:'JamKazam Overview', class: 'video-slide', diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index a07199666..d50b3057e 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -82,6 +82,26 @@
+ + <% if true %> +

+
+
+
+ +
LEARN ABOUT JAMKAZAM
+
+ <%= 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') %> +
+
+ <% else %> <% if signed_in? %> <% unless @music_session.band.nil? %> <%= render :partial => "shared/landing_sidebar", :locals => {:user => @music_session.band, :recent_history => @music_session.band.recent_history} %> @@ -91,6 +111,7 @@ <% else %> <%= render :partial => "shared/cta_sidebar" %> <% end %> + <% end %> <% content_for :after_black_bar do %>
From 5a76f42fcd1143ce373352f2b8bc984b90ab2896 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 21:47:19 +0000 Subject: [PATCH 11/14] * beginning feed work, and loosening the query for when a session starts for event feature --- web/app/assets/javascripts/feed.js | 17 +++++++++ web/app/helpers/event_session_helper.rb | 2 +- web/app/views/clients/_feed.html.erb | 49 ------------------------- web/app/views/clients/_feed.html.haml | 13 +++++++ web/app/views/clients/index.html.erb | 3 ++ 5 files changed, 34 insertions(+), 50 deletions(-) create mode 100644 web/app/assets/javascripts/feed.js delete mode 100644 web/app/views/clients/_feed.html.erb create mode 100644 web/app/views/clients/_feed.html.haml diff --git a/web/app/assets/javascripts/feed.js b/web/app/assets/javascripts/feed.js new file mode 100644 index 000000000..ccf56dd8d --- /dev/null +++ b/web/app/assets/javascripts/feed.js @@ -0,0 +1,17 @@ +(function(context,$) { + + "use strict"; + context.JK = context.JK || {}; + context.JK.FeedScreen = function(app) { + + var logger = context.JK.logger; + var rest = context.JK.Rest(); + + function initialize() { + + } + + this.initialize = initialize; + + } +})(window,jQuery); \ No newline at end of file diff --git a/web/app/helpers/event_session_helper.rb b/web/app/helpers/event_session_helper.rb index 3c46e7e38..2e9fb3f1d 100644 --- a/web/app/helpers/event_session_helper.rb +++ b/web/app/helpers/event_session_helper.rb @@ -44,7 +44,7 @@ module EventSessionHelper # if so, then we are playing. # if there has been none, we say it's still coming, # if there has been at least one, and it's over, we say session over - query = MusicSessionHistory.where(fan_access: true).where(created_at: event_session.starts_at..event_session.ends_at) + query = MusicSessionHistory.where(fan_access: true).where(created_at: (event_session.starts_at - 12.hours)..(event_session.ends_at + 12.hours)) if event_session.user_id query = query.where(user_id: event_session.user_id) elsif event_session.band_id diff --git a/web/app/views/clients/_feed.html.erb b/web/app/views/clients/_feed.html.erb deleted file mode 100644 index 329be60dc..000000000 --- a/web/app/views/clients/_feed.html.erb +++ /dev/null @@ -1,49 +0,0 @@ - -<%= content_tag(:div, :layout => 'screen', 'layout-id' => 'feed', :class => "screen secondary") do -%> - <%= content_tag(:div, :class => :content) do -%> - <%= content_tag(:div, :class => 'content-head') do -%> - <%= content_tag(:div, image_tag("content/icon_feed.png", {:height => 19, :width => 19}), :class => 'content-icon') %> - <%= content_tag(:h1, 'feed') %> - <%= render "screen_navigation" %> - <% end -%> - <%= content_tag(:div, :class => 'content-body') do -%> - <%= form_tag('', {:id => 'find-session-form', :class => 'inner-content'}) do -%> - <%= render(:partial => "web_filter", :locals => {:search_type => Search::PARAM_FEED}) %> - <%= content_tag(:div, :class => 'filter-body') do %> - <%= content_tag(:div, :class => 'content-body-scroller') do -%> -

This feature not yet implemented

- <%= content_tag(:div, content_tag(:div, '', :id => 'session-filter-results', :class => 'filter-results'), :class => 'content-wrapper') %> - <% end -%> - <% end -%> - <% end -%> - <% end -%> - <% end -%> -<% end -%> - - - diff --git a/web/app/views/clients/_feed.html.haml b/web/app/views/clients/_feed.html.haml new file mode 100644 index 000000000..002770ef3 --- /dev/null +++ b/web/app/views/clients/_feed.html.haml @@ -0,0 +1,13 @@ +%div{ layout: 'screen', :'layout-id' => 'feed', :class => 'screen secondary'} + .content + .content-head + .content-icon= image_tag("content/icon_feed.png", {:height => 19, :width => 19}) + %h1 feed + = render "screen_navigation" + .content-body + = form_tag('', {:id => 'find-session-form', :class => 'inner-content'}) do + = render(:partial => "web_filter", :locals => {:search_type => Search::PARAM_FEED}) + .filter-body + .content-body-scroller + %p This feature not yet implemented + .content-wrapper diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index 7bdc683e5..21e359063 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -184,6 +184,9 @@ var bandSetupPhotoScreen = new JK.BandSetupPhotoScreen(JK.app); bandSetupPhotoScreen.initialize(); + var feedScreen = new JK.FeedScreen(JK.app); + feedScreen.initialize(); + var findSessionScreen = new JK.FindSessionScreen(JK.app); var sessionLatency = null; if ("jamClient" in window) { From 59b21c557bcf4c677a9c99d728cca69558efec57 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 22:01:11 +0000 Subject: [PATCH 12/14] * fix feed screen --- web/app/assets/javascripts/feed.js | 15 ++++ .../users/_feed_music_session_ajax.html.haml | 72 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 web/app/views/users/_feed_music_session_ajax.html.haml diff --git a/web/app/assets/javascripts/feed.js b/web/app/assets/javascripts/feed.js index ccf56dd8d..8baa2b36f 100644 --- a/web/app/assets/javascripts/feed.js +++ b/web/app/assets/javascripts/feed.js @@ -7,11 +7,26 @@ var logger = context.JK.logger; var rest = context.JK.Rest(); + function beforeShow(data) { + + } + + function afterShow(data) { + + } + + function initialize() { + var screenBindings = { + 'beforeShow': beforeShow, + 'afterShow': afterShow + }; + app.bindScreen('feed', screenBindings); } this.initialize = initialize; + return this; } })(window,jQuery); \ No newline at end of file diff --git a/web/app/views/users/_feed_music_session_ajax.html.haml b/web/app/views/users/_feed_music_session_ajax.html.haml new file mode 100644 index 000000000..590bc829a --- /dev/null +++ b/web/app/views/users/_feed_music_session_ajax.html.haml @@ -0,0 +1,72 @@ +%script {type: 'text/javascript'} + .feed-entry.music-session-history-entry{'data-music-session' => feed_item.id} + / avatar + .avatar-small.ib + = session_avatar(feed_item) + / type and artist + .left.ml20.w15 + .title{hoveraction: 'session', :'session-id' => feed_item.id } SESSION + .artist + = session_artist_name(feed_item) + = timeago(feed_item.created_at, class: 'small created_at') + / name and description + .left.ml20.w30 + .description.dotdotdot + = session_description(feed_item) + / timeline and controls + .right.w40 + / recording play controls + .session-controls{ class: "#{(feed_item.is_over? ? 'ended' : 'inprogress')} #{feed_item.has_mount? ? 'has-mount' : 'no-mount'}", 'data-music-session' => feed_item.id, 'fan-access' => feed_item.fan_access.to_s} + / session status + %a.left.play-button{href:'#'} + = image_tag 'content/icon_playbutton.png', width:20, height:20, class:'play-icon' + - if feed_item.has_mount? + %audio{preload: 'none'} + %source{src: feed_item.music_session.mount.url, type: feed_item.music_session.mount.resolve_string(:mime_type)} + %span.session-status + = session_text(feed_item) + / current playback time + = session_duration(feed_item, class: 'session-duration tick-duration recording-current', 'data-created-at' => feed_item.created_at.to_i) + / end recording play controls + / genre and social + .left.small + = session_genre(feed_item) + .right.small.feed-details + %span.play-count + %span.plays + = feed_item.play_count + = image_tag 'content/icon_arrow.png', :height => "12", :width => "7" + %span.comment-count + %span.comments + = feed_item.comment_count + = image_tag 'content/icon_comment.png', :height => "12", :width => "13" + %span.like-count + %span.likes + = feed_item.like_count + = image_tag 'content/icon_like.png', :height => "12", :width => "12" + %a.details{:href => "#"} Details + %a.details-arrow.arrow-down-orange{:href => "#"} + %br/ + .musician-detail.hidden + / sub-table of musicians + %table.musicians{:cellpadding => "0", :cellspacing => "5"} + %tbody + - feed_item.unique_user_histories.each do |user| + %tr + %td{:width => "24"} + %a.avatar-tiny{:href => "#"} + = render_avatarable(user) + %td + %a{:href => "#"} + = "#{user.first_name} #{user.last_name}" + %td + .nowrap + - if user.total_instruments + - user.total_instruments.split('|').uniq.each do |instrument_id| + %img.instrument-icon{'instrument-id' =>instrument_id, height:24, width:24} + - else + %img.instrument-icon{'instrument-id' =>'default', height:24, width:24} + + + %br{:clear => "all"}/ + %br/ \ No newline at end of file From 10b10bb9d2a3ca83bdf2244ea686df3f8566b0bf Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Mar 2014 23:16:38 +0000 Subject: [PATCH 13/14] * allow html in descr --- web/app/views/events/event.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/views/events/event.html.haml b/web/app/views/events/event.html.haml index b71244cb4..ae260005d 100644 --- a/web/app/views/events/event.html.haml +++ b/web/app/views/events/event.html.haml @@ -2,7 +2,7 @@ .landing-content %h1= @event.title - %p.w60= @event.description + %p.w60= raw(@event.description) %br %br %h2 ARTIST LINEUP From 1af692c75c7bf0c33281a188113c18c7f264ccfb Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 10 Mar 2014 19:35:48 -0400 Subject: [PATCH 14/14] VRFS-1399 format testimonial page --- .../stylesheets/corp/corporate.css.scss.erb | 12 ++++- web/app/views/corps/testimonials.html.erb | 54 ++++++++++--------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/web/app/assets/stylesheets/corp/corporate.css.scss.erb b/web/app/assets/stylesheets/corp/corporate.css.scss.erb index c4f69802d..a492f717c 100644 --- a/web/app/assets/stylesheets/corp/corporate.css.scss.erb +++ b/web/app/assets/stylesheets/corp/corporate.css.scss.erb @@ -16,8 +16,12 @@ float:left; } -span.testimonial-user-desc { - font-style: italic !important; + +ul.quote { + li { + font-style: italic !important; + color: white !important; + } } span.press-date { @@ -113,6 +117,10 @@ body.corporate ul { padding-left:20px; margin-bottom:20px; list-style:disc outside none; + + li { + padding-bottom: 10px; + } } .wrapper { diff --git a/web/app/views/corps/testimonials.html.erb b/web/app/views/corps/testimonials.html.erb index f6ecaf0ff..e0cb9caa1 100644 --- a/web/app/views/corps/testimonials.html.erb +++ b/web/app/views/corps/testimonials.html.erb @@ -3,13 +3,15 @@

Testimonials

+
+

JULIE BONK

- Julie is a well-respected and oft-recorded pianist and teacher in jazz and blues improvisation, composition, and theory, and has mentored students including Grammy winner Norah Jones.
-

    -
  • I've been hoping and waiting for something like this for a long time. It's amazing!
  • -
  • I use Skype to give music lessons, but it won't work for rehearsals, and this will really help with preparation.
  • -
  • I'll be using this every week.
  • + Julie is a well-respected and oft-recorded pianist and teacher in jazz and blues improvisation, composition, and theory, and has mentored students including Grammy winner Norah Jones.
    +
      +
    • "I've been hoping and waiting for something like this for a long time. It's amazing!"
    • +
    • "I use Skype to give music lessons, but it won't work for rehearsals, and this will really help with preparation."
    • +
    • "I'll be using this every week."

    @@ -17,11 +19,11 @@

    JUSTIN PIERCE

    -

    Justin holds a master's degree in jazz studies, performs regularly with bands in Texas, and has played with John Clayton, The Temptations, Wayne Newton, and others.

    -
      -
    • The sound quality is exceptional. It reminds me of recording in a studio.
    • -
    • The service met and exceeded my expectations, and I'm excited for its future.
    • -
    • The sound quality is significantly better than Skype for giving remote lessons.
    • + Justin holds a master's degree in jazz studies, performs regularly with bands in Texas, and has played with John Clayton, The Temptations, Wayne Newton, and others.
      +
        +
      • "The sound quality is exceptional. It reminds me of recording in a studio."
      • +
      • "The service met and exceeded my expectations, and I'm excited for its future."
      • +
      • "The sound quality is significantly better than Skype for giving remote lessons."

      @@ -29,10 +31,10 @@

      CHRIS BENNETT

      -

      Chris has decades of musical experience in touring bands, has been published in Classic Drummer and Not So Modern Drummer, started Bopworks Drumsticks, and teaches at the Austin School of Music.

      -
        -
      • Far from being futuristically cold and isolating, playing was way easier than a studio.
      • -
      • Given the fact that I had never met, seen, or played with any of the musicians I played with using JamKazam, the experience was great.
      • + Chris has decades of musical experience in touring bands, has been published in Classic Drummer and Not So Modern Drummer, started Bopworks Drumsticks, and teaches at the Austin School of Music.
        +
          +
        • "Far from being futuristically cold and isolating, playing was way easier than a studio."
        • +
        • "Given the fact that I had never met, seen, or played with any of the musicians I played with using JamKazam, the experience was great."

        @@ -40,10 +42,10 @@

        SARA NELSON

        -

        Sara holds a bachelor's degree in music, performs as a cellist for the Austin Lyric Opera, and has also played with the Austin Symphony Orchestra and bands such as David Byrne and Bob Schneider.

        -
          -
        • JamKazam is a great tool for musicians who want to rehearse without the hassle of finding a common location to meet.
        • -
        • Being able to play with people in different cities is very exciting!
        • + Sara holds a bachelor's degree in music, performs as a cellist for the Austin Lyric Opera, and has also played with the Austin Symphony Orchestra and bands such as David Byrne and Bob Schneider.
          +
            +
          • "JamKazam is a great tool for musicians who want to rehearse without the hassle of finding a common location to meet."
          • +
          • "Being able to play with people in different cities is very exciting!"

          @@ -51,10 +53,10 @@

          GEORGE PRADO

          -

          George spent 15 years in LA performing and recording with numerous industry greats including Eartha Kitt and Chuck Berry, founded the legendary Regency Jazz Band, and has played and taught 40+ years.

          -
            -
          • An exciting tool with great sound and fidelity, this has unlimited potential for musicians and others in the entertainment industry, not to mention its use for educators. Check it out!
          • -
          • Working for over 50 years as a professional musician, I am excited about this new method of sharing musical ideas. It allows me to connect with friends far away and close by through the means of this technology.
          • + George spent 15 years in LA performing and recording with numerous industry greats including Eartha Kitt and Chuck Berry, founded the legendary Regency Jazz Band, and has played and taught 40+ years.
            +
              +
            • "An exciting tool with great sound and fidelity, this has unlimited potential for musicians and others in the entertainment industry, not to mention its use for educators. Check it out!"
            • +
            • "Working for over 50 years as a professional musician, I am excited about this new method of sharing musical ideas. It allows me to connect with friends far away and close by through the means of this technology."

            @@ -62,10 +64,10 @@

            CHRIS MAX

            -

            Chris is the lead guitar player and backing vocalist for LC Rocks, which has been playing top Austin clubs since 2002, and also frequently plays solo gigs throughout Central Texas.

            -
              -
            • JamKazam, now here's a concept whose time has come!
            • -
            • No loading gear, driving, or rehearsal room rental fees. Just plug into your home computer, interface with your bandmates, and start getting ready for your upcoming shows.
            • + Chris is the lead guitar player and backing vocalist for LC Rocks, which has been playing top Austin clubs since 2002, and also frequently plays solo gigs throughout Central Texas.
              +
                +
              • "JamKazam, now here's a concept whose time has come!"
              • +
              • "No loading gear, driving, or rehearsal room rental fees. Just plug into your home computer, interface with your bandmates, and start getting ready for your upcoming shows."