vrfs-884: tweaking layout
This commit is contained in:
parent
4329338fa8
commit
020f9d544e
|
|
@ -91,24 +91,19 @@
|
|||
for (ii=0, len=bands.length; ii < len; ii++) {
|
||||
bb = bands[ii];
|
||||
instr_logos = '';
|
||||
/*for (var jj=0, ilen=bb['instruments'].length; jj<ilen; jj++) {
|
||||
if (bb['instruments'][jj].instrument_id in instrument_logo_map) {
|
||||
instr = instrument_logo_map[bb['instruments'][jj].instrument_id];
|
||||
}
|
||||
instr_logos += '<img src="' + instr + '" width="24" height="24" /> ';
|
||||
}*/
|
||||
players = '';
|
||||
playerVals = {};
|
||||
for (var jj=0, ilen=bb['players'].length; jj<ilen; jj++) {
|
||||
aPlayer = bb['players'][jj];
|
||||
var player_instrs = '';
|
||||
/*for (var kk=0, klen=aPlayer['instruments'].length; kk<klen; kk++) {
|
||||
var pinstr = aPlayer['instruments'][kk];
|
||||
if (pinstr.instrument_id in instrument_logo_map) {
|
||||
instr = instrument_logo_map[pinstr.instrument_id];
|
||||
var iter_pinstruments = aPlayer['instruments'].split(',');
|
||||
for (var kk=0, klen=iter_pinstruments.length; kk<klen; kk++) {
|
||||
var pinstr = iter_pinstruments[kk];
|
||||
if (pinstr in instrument_logo_map) {
|
||||
instr = instrument_logo_map[pinstr];
|
||||
}
|
||||
player_instrs += '<img src="' + instr + '" width="24" height="24" /> ';
|
||||
}*/
|
||||
}
|
||||
|
||||
playerVals = {
|
||||
player_name: aPlayer.name,
|
||||
|
|
@ -124,19 +119,25 @@
|
|||
button_message: 'button-orange'
|
||||
};
|
||||
var band_actions = context.JK.fillTemplate(aTemplate, actionVals);
|
||||
var bgenres = '';
|
||||
for (jj=0, ilen=bb['genres'].length; jj<ilen; jj++) {
|
||||
bgenres += bb['genres'][jj]['description'] + '<br />';
|
||||
}
|
||||
bgenres += '<br />';
|
||||
|
||||
bVals = {
|
||||
avatar_url: context.JK.resolveAvatarUrl(bb.photo_url),
|
||||
profile_url: "/#/profile/" + bb.id,
|
||||
band_name: bb.name,
|
||||
band_location: bb.city + ', ' + bb.state,
|
||||
genres: bgenres,
|
||||
instruments: instr_logos,
|
||||
biography: bb['biography'],
|
||||
follow_count: bb['follow_count'],
|
||||
recording_count: bb['recording_count'],
|
||||
session_count: bb['session_count'],
|
||||
band_id: bb['id'],
|
||||
band_follow_template: players,
|
||||
band_player_template: players,
|
||||
band_action_template: band_actions
|
||||
};
|
||||
var band_row = context.JK.fillTemplate(mTemplate, bVals);
|
||||
|
|
@ -171,7 +172,7 @@
|
|||
|
||||
evt.stopPropagation();
|
||||
var newFollowing = {};
|
||||
newFollowing.user_id = $(this).parent().data('band-id');
|
||||
newFollowing.band_id = $(this).parent().data('band-id');
|
||||
var url = "/api/users/" + context.JK.currentUserId + "/followings";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
@ -182,7 +183,7 @@
|
|||
processData: false,
|
||||
success: function(response) {
|
||||
// remove the orange look to indicate it's not selectable
|
||||
$('div[data-band-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange');
|
||||
$('div[data-band-id='+newFollowing.band_id+'] .search-m-follow').removeClass('button-orange');
|
||||
},
|
||||
error: app.ajaxError
|
||||
});
|
||||
|
|
|
|||
|
|
@ -270,3 +270,22 @@
|
|||
.band-profile-block-city {
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
#band-filter-results {
|
||||
margin: 0 10px 5px 10px;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.band-list-result {
|
||||
padding-top: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.band-wrapper {
|
||||
overflow: auto;
|
||||
height: 480px;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
@import "client/common.css.scss";
|
||||
@charset "UTF-8";
|
||||
|
||||
.filter-results {
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
border-bottom:solid 1px shade($ColorElementPrimary, 20);
|
||||
clear:both;
|
||||
}
|
||||
|
||||
li strong {
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
li.offline {
|
||||
background-color: shade($ColorElementPrimary, 20);
|
||||
color: shade($text, 10);
|
||||
opacity:0.5;
|
||||
ms-filter: "alpha(opacity=50)";
|
||||
}
|
||||
|
||||
.avatar-small {
|
||||
float:left;
|
||||
padding:1px;
|
||||
width:36px;
|
||||
height:36px;
|
||||
background-color:#ed3618;
|
||||
margin:10px;
|
||||
-webkit-border-radius:18px;
|
||||
-moz-border-radius:18px;
|
||||
border-radius:18px;
|
||||
}
|
||||
|
||||
.avatar-small img {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
-webkit-border-radius:18px;
|
||||
-moz-border-radius:18px;
|
||||
border-radius:18px;
|
||||
}
|
||||
|
||||
li a {
|
||||
color:#B3DD15;
|
||||
}
|
||||
|
||||
li a:hover {
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
.result-name {
|
||||
float:left;
|
||||
font-size:12px;
|
||||
margin-top:12px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.result-location {
|
||||
font-size:11px;
|
||||
color:#D5E2E4;
|
||||
font-weight:200;
|
||||
}
|
||||
|
||||
.results-wrapper {
|
||||
width: 300px;
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ if @search.bands_filter.present?
|
|||
@search.is_follower?(band)
|
||||
end
|
||||
|
||||
child :genres => :genre do
|
||||
child :genres => :genres do
|
||||
attributes :genre_id, :description
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<%= form_tag('', :id => 'find-band-form') do -%>
|
||||
<%= content_tag(:div, render(:partial => "web_filter", :locals => {:search_type => Search::PARAM_BAND}), :class => 'band-filter', :id => 'session-controls') %>
|
||||
<%= content_tag(:div, :class => 'content-scroller') do -%>
|
||||
<%= content_tag(:div, content_tag(:div, '', :id => 'band-filter-results'), :class => 'content-wrapper band-wrapper') %>
|
||||
<%= content_tag(:div, content_tag(:div, '', :id => 'band-filter-results', :class => 'filter-results'), :class => 'content-wrapper band-wrapper') %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
@ -24,24 +24,20 @@
|
|||
|
||||
<!-- name & location -->
|
||||
<div style="width:220px;" class="result-name">{band_name}<br />
|
||||
<span class="result-location">{band_location}
|
||||
<span class="result-location">{band_location}</span>
|
||||
<br /><br />
|
||||
<div id="result_instruments" class="nowrap">{instruments}</div>
|
||||
<br clear="all" /><br />
|
||||
{follow_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" /> {recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" /> {session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" /></span><br /><br />
|
||||
<div id="result_genres" class="nowrap">{genres}</div>
|
||||
<br /><br />
|
||||
{follow_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" /> {recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" /> {session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" /><br /><br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="left ml35 f11 whitespace w40"><br />
|
||||
<div class="left ml20 f11 whitespace w35"><br />
|
||||
{biography}<br />
|
||||
<br />
|
||||
<div data-band-id={band_id}>
|
||||
{band_action_template}
|
||||
</div>
|
||||
<div data-band-id={band_id}>{band_action_template}</div>
|
||||
</div>
|
||||
<div class="left ml10 w25 band-players">
|
||||
<br />
|
||||
<small><strong>FOLLOWING:</strong></small>
|
||||
<table class="musicians" cellpadding="0" cellspacing="5">{band_follow_template}</table>
|
||||
<table class="musicians" cellpadding="0" cellspacing="5">{band_player_template}</table>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ namespace :db do
|
|||
make_band_members
|
||||
end
|
||||
|
||||
task populate_band_genres: :environment do
|
||||
make_band_genres
|
||||
end
|
||||
|
||||
desc "Fill database with music session sample data"
|
||||
task populate_music_sessions: :environment do
|
||||
make_users(10) if 14 > User.count
|
||||
|
|
@ -72,6 +76,15 @@ def make_band_members
|
|||
end
|
||||
end
|
||||
|
||||
def make_band_genres
|
||||
Band.find_each do |bb|
|
||||
next if bb.genres.present?
|
||||
Genre.order('RANDOM()').limit(rand(3)+1).each do |gg|
|
||||
bb.genres << gg
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def make_bands
|
||||
10.times do |nn|
|
||||
name = Faker::Name.name
|
||||
|
|
|
|||
Loading…
Reference in New Issue