Admin frontend for marking a default channel as sponsored

This commit is contained in:
SQ 2013-12-18 20:43:52 -05:00 committed by Ricky Ramirez
parent e3a82eb68b
commit 6658b0dd6a
3 changed files with 51 additions and 6 deletions

View File

@ -609,7 +609,9 @@
if ($thumb) $thumb_url = $thumb->thumbnail_url;
?>
<li class="channel col-lg-3" data-feed="<?php echo $channel->feed; ?>">
<div class="thumbnail"<?php if ($thumb_url != '') : ?> style="background-image: url(<?php echo $thumb_url; ?>);"<?php endif; ?>></div>
<div class="thumbnail"<?php if ($thumb_url != '') : ?> style="background-image: url(<?php echo $thumb_url; ?>);"<?php endif; ?>>
<div class="sponsored"><label><span>Sponsored</span><input type="checkbox" <?php if ($channel->owner == 'sponsor') : ?>checked="checked"<?php endif; ?>/></label></div>
</div>
<span class="name" spellcheck="false" contenteditable="true"><?php echo $channel->channel; ?></span>
</li>
<?php endforeach; ?>

View File

@ -397,11 +397,15 @@ $.each(channelTypes, function(i, channelType) {
postData;
$('#' + channelType + '-channels li.channel').each(function() {
var chan = $(this);
feed[feed.length] = {
'channel' : chan.find('.name').text(),
'feed' : chan.attr('data-feed')
};
var chan = $(this),
data = {
'channel' : chan.find('.name').text(),
'feed' : chan.attr('data-feed')
};
if (chan.find('.sponsored input').is(':checked')) data.owner = 'sponsor';
feed.push(data);
});
feed = JSON.stringify(feed);

View File

@ -88,6 +88,10 @@ form.edit, .item.edit {
width: 140px;
}
#channels {
width: auto;
}
#video-thumbnail, .vid-thumbnail {
position: absolute;
background-color: #fff;
@ -294,6 +298,41 @@ div.show-videos ol.videos {
padding: 6px 15px;
}
#default-channels .thumbnail .sponsored {
float: right;
background: #5f99cf;
margin: -6px -6px 0 0;
width: 24px;
height: 24px;
line-height: 24px;
border-radius: 0 4px 0 4px;
}
#default-channels .thumbnail .sponsored label {
cursor: pointer;
}
#default-channels .thumbnail .sponsored input {
position: absolute;
top: -4px;
right: -1px;
width: 13px;
height: 13px;
outline: none;
}
#default-channels .thumbnail:hover .sponsored {
width: auto;
padding: 0 6px;
}
#default-channels .thumbnail .sponsored span {
display: none;
padding-right: 18px;
}
#default-channels .thumbnail:hover .sponsored span {
display: inline;
}
/*!
* Stylesheet for the Date Range Picker, for use with Bootstrap 3.x
*