VRFS-986 landing page sidebar complete / session landing fixes
This commit is contained in:
parent
576e8deeee
commit
998ebfdc6c
|
|
@ -63,8 +63,15 @@ module JamRuby
|
|||
end
|
||||
|
||||
def recent_history
|
||||
recordings = ClaimedRecording.joins(:recordings).where(:recordings => {:band_id => "#{self.id}"}).limit(10)
|
||||
msh = MusicSessionHistory.where(:band_id => self.id).limit(10)
|
||||
recordings = ClaimedRecording.joins(:recordings)
|
||||
.where(:recordings => {:band_id => "#{self.id}"})
|
||||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
msh = MusicSessionHistory.where(:band_id => self.id)
|
||||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
recordings.concat(msh)
|
||||
recordings.sort! {|a,b| b.created_at <=> a.created_at}.first(5)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ module JamRuby
|
|||
:foreign_key => :band_id,
|
||||
:inverse_of => :music_session_history)
|
||||
|
||||
has_many :music_session_user_history, :class_name => "JamRuby::MusicSessionUserHistory", :foreign_key => "music_session_id"
|
||||
has_many :music_session_user_histories, :class_name => "JamRuby::MusicSessionUserHistory", :foreign_key => "music_session_id"
|
||||
has_many :comments, :class_name => "JamRuby::MusicSessionComment", :foreign_key => "music_session_id"
|
||||
has_many :likes, :class_name => "JamRuby::MusicSessionLiker", :foreign_key => "music_session_id"
|
||||
|
||||
|
|
@ -31,16 +31,22 @@ module JamRuby
|
|||
|
||||
def tracks
|
||||
tracks = []
|
||||
self.music_session_user_history.each do |msuh|
|
||||
binding.pry
|
||||
self.music_session_user_histories.each do |msuh|
|
||||
user = User.find(msuh.user_id)
|
||||
instruments = msuh.instruments.split(SEPARATOR)
|
||||
instruments.each do |instrument|
|
||||
t = Track.new
|
||||
t.user = user
|
||||
binding.pry
|
||||
t.musician = user
|
||||
binding.pry
|
||||
t.instrument_id = instrument
|
||||
binding.pry
|
||||
tracks << t
|
||||
binding.pry
|
||||
end
|
||||
end
|
||||
binding.pry
|
||||
tracks
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ module JamRuby
|
|||
validate :validate_part_complete
|
||||
validate :validate_too_many_upload_failures
|
||||
|
||||
def musician
|
||||
self.user
|
||||
end
|
||||
|
||||
def can_download?(some_user)
|
||||
!ClaimedRecording.find_by_user_id_and_recording_id(some_user.id, recording.id).nil?
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ module JamRuby
|
|||
|
||||
default_scope order('created_at ASC')
|
||||
|
||||
attr_accessor :musician
|
||||
|
||||
SOUND = %w(mono stereo)
|
||||
|
||||
belongs_to :connection, :class_name => "JamRuby::Connection", :inverse_of => :tracks
|
||||
|
|
@ -18,6 +20,14 @@ module JamRuby
|
|||
self.connection.user
|
||||
end
|
||||
|
||||
def musician
|
||||
@musician
|
||||
end
|
||||
|
||||
def musician=(user)
|
||||
@musician = user
|
||||
end
|
||||
|
||||
def self.index(current_user, music_session_id)
|
||||
query = Track
|
||||
.joins(
|
||||
|
|
|
|||
|
|
@ -290,8 +290,15 @@ module JamRuby
|
|||
end
|
||||
|
||||
def recent_history
|
||||
recordings = ClaimedRecording.joins(:recording).where(:recordings => {:owner_id => "#{self.id}"}).limit(10)
|
||||
msh = MusicSessionHistory.where(:user_id => self.id).limit(10)
|
||||
recordings = ClaimedRecording.joins(:recording)
|
||||
.where(:recordings => {:owner_id => "#{self.id}"})
|
||||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
msh = MusicSessionHistory.where(:user_id => self.id)
|
||||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
recordings.concat(msh)
|
||||
recordings.sort! {|a,b| b.created_at <=> a.created_at}.first(5)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -150,64 +150,60 @@ textarea {
|
|||
|
||||
/* Start of Jeff's common.css file */
|
||||
body {
|
||||
font-family: Raleway, Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
color: #FFF;
|
||||
padding:3% 6%;
|
||||
background-color: #262626;
|
||||
position:relative;
|
||||
font-family: Raleway, Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
color: #FFF;
|
||||
padding:3% 6%;
|
||||
background-color: #262626;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p, div, table, form, img, tr, td, th {
|
||||
margin:0;
|
||||
border:0;
|
||||
padding:0;
|
||||
margin:0;
|
||||
border:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
a {
|
||||
display:inline-block;
|
||||
}
|
||||
a {display:inline-block;}
|
||||
a img {border:none;}
|
||||
.clearall {clear:both;}
|
||||
.clearleft {clear:left;}
|
||||
small, .small {font-size:11px;}
|
||||
.bold {font-weight:bold;}
|
||||
|
||||
small, .small {
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight:bold;
|
||||
}
|
||||
.button-grey {
|
||||
margin:0px 8px 0px 8px;
|
||||
background-color:#666;
|
||||
border: solid 1px #868686;
|
||||
outline:solid 2px #666;
|
||||
padding:3px 10px;
|
||||
font-family:raleway;
|
||||
font-size:12px;
|
||||
font-weight:300;
|
||||
cursor:pointer;
|
||||
color:#ccc;
|
||||
text-decoration:none;
|
||||
margin:0px 8px 0px 8px;
|
||||
background-color:#666;
|
||||
border: solid 1px #868686;
|
||||
outline:solid 2px #666;
|
||||
padding:3px 10px;
|
||||
font-family:raleway;
|
||||
font-size:12px;
|
||||
font-weight:300;
|
||||
cursor:pointer;
|
||||
color:#ccc;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.button-grey:hover {
|
||||
background-color:#999;
|
||||
color:#FFF;
|
||||
background-color:#999;
|
||||
color:#FFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.button-orange {
|
||||
margin:0px 8px 0px 8px;
|
||||
background-color: #ED3618;
|
||||
border: solid 1px #F27861;
|
||||
outline: solid 2px #ED3618;
|
||||
padding:3px 10px;
|
||||
font-family:raleway;
|
||||
font-size:12px;
|
||||
font-weight:300;
|
||||
cursor:pointer;
|
||||
color:#FC9;
|
||||
text-decoration:none;
|
||||
margin:0px 8px 0px 8px;
|
||||
background-color: #ED3618;
|
||||
border: solid 1px #F27861;
|
||||
outline: solid 2px #ED3618;
|
||||
padding:3px 10px;
|
||||
font-family:raleway;
|
||||
font-size:12px;
|
||||
font-weight:300;
|
||||
cursor:pointer;
|
||||
color:#FC9;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.smallbutton {
|
||||
|
|
@ -216,8 +212,8 @@ small, .small {
|
|||
}
|
||||
|
||||
.button-orange:hover {
|
||||
background-color:#f16750;
|
||||
color:#FFF;
|
||||
background-color:#f16750;
|
||||
color:#FFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
|
|
@ -234,17 +230,6 @@ small, .small {
|
|||
background-color:#666;
|
||||
}
|
||||
|
||||
a img {
|
||||
border:none;
|
||||
}
|
||||
|
||||
.clearall {
|
||||
clear:both;
|
||||
}
|
||||
.clearleft {
|
||||
clear:left;
|
||||
}
|
||||
|
||||
.f8 {font-size:8px !important}
|
||||
.f9 {font-size:9px !important}
|
||||
.f10 {font-size:10px !important}
|
||||
|
|
@ -337,29 +322,29 @@ a img {
|
|||
}
|
||||
|
||||
.op50 {
|
||||
opacity: .5;
|
||||
-ms-filter: "alpha(opacity=50)";
|
||||
opacity: .5;
|
||||
-ms-filter: "alpha(opacity=50)";
|
||||
}
|
||||
|
||||
.op30 {
|
||||
opacity: .3;
|
||||
-ms-filter: "alpha(opacity=30)";
|
||||
opacity: .3;
|
||||
-ms-filter: "alpha(opacity=30)";
|
||||
}
|
||||
|
||||
.nowrap {
|
||||
display:inline-block;
|
||||
white-space:nowrap;
|
||||
display:inline-block;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.overlay {
|
||||
display:none;
|
||||
position:fixed;
|
||||
width:100%;
|
||||
height:100%;
|
||||
top:0px;
|
||||
left:0px;
|
||||
position:fixed;
|
||||
width:100%;
|
||||
height:100%;
|
||||
top:0px;
|
||||
left:0px;
|
||||
z-index: 999;
|
||||
background-image:url('/assets/shared/bkg_overlay.png');
|
||||
background-image:url('/assets/shared/bkg_overlay.png');
|
||||
}
|
||||
|
||||
.overlay-small {
|
||||
|
|
|
|||
|
|
@ -58,12 +58,19 @@ body.web {
|
|||
padding:25px;
|
||||
padding-top:0px;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size:18px !important;
|
||||
line-height:normal;
|
||||
color:#fff;
|
||||
}
|
||||
a {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
.landing-sidebar h2 {
|
||||
font-size:18px !important;
|
||||
line-height:normal;
|
||||
color:#fff;
|
||||
em {
|
||||
font-style: italic !important;
|
||||
}
|
||||
}
|
||||
|
||||
.landing-band {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,19 @@
|
|||
/*.session-controls {
|
||||
background-color:#471f18;
|
||||
}
|
||||
|
||||
.session-controls.inprogress {
|
||||
background-color:#4C742E;
|
||||
}
|
||||
|
||||
.session-status-ended, .session-status {
|
||||
float:left;
|
||||
font-size:18px;
|
||||
}
|
||||
|
||||
.session-status-inprogress {
|
||||
float:left;
|
||||
font-size:15px;
|
||||
color:#cccc00;
|
||||
margin-left:20px;
|
||||
}*/
|
||||
|
|
@ -12,39 +12,43 @@
|
|||
<%= @music_session.band.name %>
|
||||
<% else %>
|
||||
<div class="landing-avatar">
|
||||
<% unless @music_session.creator.photo_url.blank? %>
|
||||
<%= image_tag "#{@music_session.creator.photo_url}", {:alt => ""} %>
|
||||
<% unless @music_session.user.photo_url.blank? %>
|
||||
<%= image_tag "#{@music_session.user.photo_url}", {:alt => ""} %>
|
||||
<% else %>
|
||||
<%= image_tag "shared/avatar_generic.png", {:alt => ""} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= @music_session.creator.name %>
|
||||
<%= @music_session.user.name %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="landing-details">
|
||||
<div class="left f20 teal"><strong>SESSION: Live Session in Progress</strong></div>
|
||||
<div class="right f14 grey"><%= @cmusic_session.created_at.strftime("%b %e %Y, %l:%M %p") %></div>
|
||||
<div class="left f20 teal"><strong>SESSION</strong></div>
|
||||
<div class="right f14 grey"><%= @music_session.created_at.strftime("%b %e %Y, %l:%M %p") %></div>
|
||||
<br clear="all" /><br />
|
||||
<h2 class="left"><%= @music_session.name %></h2>
|
||||
<div class="left w70"><%= @music_session.description %><br /><br /></div>
|
||||
<div class="right">
|
||||
<a href="#"><%= image_tag "content/icon_like.png", {:width => 12, :height => 12} %> LIKE</a>
|
||||
<a href="#"><%= image_tag "content/icon_share.png", {:width => 13, :height => 15} %> SHARE</a>
|
||||
</div>
|
||||
<br clear="all" />TODO: Which field is this in the database??<br /><br />
|
||||
<br clear="all" />
|
||||
<div class="w100">
|
||||
<div class="recording-controls">
|
||||
<a class="left mr20" href="#"><%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %></a>
|
||||
<div class="session-status">LIVE SESSION IN PROGRESS</div>
|
||||
<div class="recording-current">1:23</div>
|
||||
<% if @music_session.session_removed_at.blank? %>
|
||||
<div class="session-status">SESSION IN PROGRESS</div>
|
||||
<div class="recording-current">1:23</div>
|
||||
<% else %>
|
||||
<div class="session-status-ended">LIVE SESSION ENDED</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="left white"><%= @music_session.genres.split('|').first.id.capitalize %></div>
|
||||
<div class="left white"><%= @music_session.genres.split('|').first.capitalize %></div>
|
||||
<div class="right white">
|
||||
<%= @music_session.comment_count %>
|
||||
<%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>
|
||||
<%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %>
|
||||
<%= @music_session.like_count %>
|
||||
<%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %>
|
||||
<%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %>
|
||||
</div>
|
||||
</div>
|
||||
<br clear="all" /><br />
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<a href="#"><%= image_tag "content/icon_like.png", {:width => 12, :height => 12} %> LIKE</a>
|
||||
<a href="#"><%= image_tag "content/icon_share.png", {:width => 13, :height => 15} %> SHARE</a>
|
||||
</div>
|
||||
<br clear="all" />TODO: Which field is this in the database??<br /><br />
|
||||
<br clear="all" /><%= @claimed_recording.description %><br /><br />
|
||||
<div class="w100">
|
||||
<div class="recording-controls">
|
||||
<a class="left" href="#"><%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %></a>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,43 @@
|
|||
<div class="landing-sidebar"><br />
|
||||
<h2>More by <%= user.name %>:</h2><br />
|
||||
<div class="grey f16"><em>Now:</em></div>
|
||||
<div class="f16"><span class="teal"><strong>SESSION:</strong></span> <a href="#" class="white">Live Session in Progress</a></div>
|
||||
<div class="f13 lightgrey">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.</div>
|
||||
<br /><br />
|
||||
<div class="grey f16"><em>Yesterday:</em></div>
|
||||
<div class="f16"><span class="orange"><strong>RECORDING:</strong></span> <a href="#" class="white">You Hurt Me Bad</a></div>
|
||||
<div class="f13 lightgrey">Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. </div>
|
||||
<br /><br />
|
||||
<div class="grey f16"><em>Dec. 18th:</em></div>
|
||||
<div class="f16"><span class="teal"><strong>SESSION:</strong></span> <span class="grey">Session Ended. Unavailable.</span></div>
|
||||
<div class="f13 lightgrey">Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. </div>
|
||||
<br /><br />
|
||||
<div class="grey f16"><em>Dec. 12th:</em></div>
|
||||
<div class="f16"><span class="orange"><strong>RECORDING:</strong></span> <a href="#" class="white">Bustin' My Chops</a></div>
|
||||
<div class="f13 lightgrey">Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.</div>
|
||||
<br /><br />
|
||||
<div class="grey f16"><em>Dec. 10th:</em></div>
|
||||
<div class="f16"><span class="teal"><strong>SESSION:</strong></span> <span class="grey">Session Ended. Unavailable.</span></div>
|
||||
<div class="f13 lightgrey">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.</div>
|
||||
<br /><br />
|
||||
<div class="grey f16"><em>Nov. 29th:</em></div>
|
||||
<div class="f16"><span class="teal"><strong>SESSION:</strong></span> <span class="grey">Session Ended. Unavailable.</span></div>
|
||||
<div class="f13 lightgrey">Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. </div>
|
||||
<div class="landing-sidebar" style="z-index:900;"><br />
|
||||
|
||||
<h2>More by <%= user.name %>:</h2><br />
|
||||
|
||||
<% recent_history.each do |history_record| %>
|
||||
|
||||
<% if history_record.instance_of? ClaimedRecording %>
|
||||
<div class="grey f16">
|
||||
<em><%= history_record.created_at.strftime("%b #{history_record.created_at.day.ordinalize}") %>:</em>
|
||||
</div>
|
||||
<div class="f16">
|
||||
<span class="orange"><strong>RECORDING:</strong></span>
|
||||
<a href="/recordings/<%= history_record.recording_id %>" class="white">Test</a>
|
||||
</div>
|
||||
|
||||
<% elsif history_record.instance_of? MusicSessionHistory %>
|
||||
<div class="grey f16">
|
||||
<em>
|
||||
<% if history_record.session_removed_at.blank? %>
|
||||
Now:
|
||||
<% else %>
|
||||
<%= history_record.session_removed_at.strftime("%b #{history_record.session_removed_at.day.ordinalize}") %>:
|
||||
<% end %>
|
||||
</em>
|
||||
</div>
|
||||
<div class="f16">
|
||||
<span class="teal"><strong>SESSION:</strong></span>
|
||||
<% if history_record.session_removed_at.blank? %>
|
||||
<a href="/sessions/<%= history_record.music_session_id %>" class="white">Live Session in Progress</a>
|
||||
<% else %>
|
||||
<span class="grey">Session Ended. Unavailable.</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="f13 lightgrey"><%= history_record.description %></div>
|
||||
<% if history_record != recent_history.last %>
|
||||
<br /><br />
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
@ -9,14 +9,14 @@
|
|||
<tr>
|
||||
<td>
|
||||
<div class="avatar-small m0">
|
||||
<% unless track.user.photo_url.blank? %>
|
||||
<%= image_tag "#{track.user.photo_url}", {:alt => ""} %>
|
||||
<% unless track.musician.photo_url.blank? %>
|
||||
<%= image_tag "#{track.musician.photo_url}", {:alt => ""} %>
|
||||
<% else %>
|
||||
<%= image_tag "shared/avatar_generic.png", {:alt => ""} %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width:150px;"><div class="lightgrey f15 ml10"><%= track.user.name %></div></td>
|
||||
<td style="width:150px;"><div class="lightgrey f15 ml10"><%= track.musician.name %></div></td>
|
||||
<td class="p10">
|
||||
<div class="ml10">
|
||||
<%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => "", :title => "#{track.instrument_id}"} %>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ SampleApp::Application.configure do
|
|||
config.assets.debug = false
|
||||
|
||||
# Set the logging destination(s)
|
||||
config.log_to = %w[stdout file]
|
||||
# config.log_to = %w[stdout file]
|
||||
|
||||
# Show the logging configuration on STDOUT
|
||||
config.show_log_configuration = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue