diff --git a/web/app/assets/javascripts/commentDialog.js b/web/app/assets/javascripts/commentDialog.js new file mode 100644 index 000000000..ea2f64b5e --- /dev/null +++ b/web/app/assets/javascripts/commentDialog.js @@ -0,0 +1,149 @@ +(function(context,$) { + + "use strict"; + context.JK = context.JK || {}; + context.JK.CommentDialog = function(app, options) { + var logger = context.JK.logger; + var rest = context.JK.Rest(); + var $screen = null; + var $content = null; + var recordingId; + var entityType = options.entity_type; + var sessionId = options.session_id; + var recordingId = options.recording_id; + var claimedRecordingId = options.claimed_recording_id; + + function beforeShow(data) { + } + + function afterShow(data) { + $("#txtComment", $screen).val(''); + renderComments(); + } + + function afterHide() { + } + + function renderComments() { + $content.empty(); + + var h1Text = $('h1', $screen).html('comment on this ' + entityType); + + if (entityType === 'session') { + rest.getSessionHistory(sessionId) + .done(function(response) { + if (response && response.comments) { + $.each(response.comments, function(index, val) { + renderComment(val.comment, val.creator.id, val.creator.name, + context.JK.resolveAvatarUrl(val.creator.photo_url), $.timeago(val.created_at), val.creator.musician, true); + }); + context.JK.bindHoverEvents($content); + context.JK.bindProfileClickEvents($content, ['comment-dialog']); + } + }) + .fail(function(xhr) { + + }); + } + else if (entityType === 'recording') { + rest.getClaimedRecording(claimedRecordingId) + .done(function(response) { + if (response.recording && response.recording.comments) { + $.each(response.recording.comments, function(index, val) { + renderComment(val.comment, val.creator.id, val.creator.name, + context.JK.resolveAvatarUrl(val.creator.photo_url), $.timeago(val.created_at), val.creator.musician, true); + }); + + context.JK.bindHoverEvents($content); + context.JK.bindProfileClickEvents($content, ['comment-dialog']); + } + }) + .fail(function(xhr) { + + }); + } + } + + function renderComment(comment, userId, userName, userAvatarUrl, timeago, musician, append) { + + var options = { + avatar_url: userAvatarUrl, + user_id: userId, + hoverAction: musician ? "musician" : "fan", + name: userName, + comment: comment, + timeago: timeago + }; + + var $comment = $(context._.template($('#template-comments').html(), options, {variable: 'data'})); + if (append) { + $content.append($comment); + } + else { + $content.prepend($comment); + } + } + + function addComment() { + var comment = $("#txtComment", $screen).val(); + if ($.trim(comment).length > 0) { + if (entityType === 'session') { + rest.addSessionComment(sessionId, JK.currentUserId, comment) + .done(function(response) { + // $("#spnCommentCount").html(parseInt($("#spnCommentCount").text()) + 1); + renderComment(comment, context.JK.currentUserId, context.JK.currentUserName, + context.JK.currentUserAvatarUrl, $.timeago(Date.now()), context.JK.currentUserMusician, false); + }); + } + else if (entityType === 'recording') { + rest.addRecordingComment(recordingId, JK.currentUserId, comment) + .done(function(response) { + // $("#spnCommentCount", $scope).html(parseInt($("#spnCommentCount").text()) + 1); + renderComment(comment, context.JK.currentUserId, context.JK.currentUserName, + context.JK.currentUserAvatarUrl, $.timeago(Date.now()), context.JK.currentUserMusician, false); + }); + } + } + } + + function events() { + var $btnSelector = $('#btn-add-comment', $screen); + var $txtComment = $('#txtComment', $screen); + + if (!context.JK.currentUserId) { + $txtComment.attr('placeholder', 'You must be logged in to add a comment.'); + $btnSelector.removeClass('button-orange'); + $btnSelector.addClass('button-grey'); + } + else { + $btnSelector.unbind('click'); + $btnSelector.click(addComment); + } + } + + function showDialog() { + app.layout.showDialog('comment-dialog'); + } + + function initialize() { + + var dialogBindings = { + 'beforeShow' : beforeShow, + 'afterShow' : afterShow, + 'afterHide': afterHide + }; + + app.bindDialog('comment-dialog', dialogBindings); + + $screen = $('[layout-id="comment-dialog"]'); + $content = $screen.find('.dialog-comment-scroller'); + + events(); + } + + this.initialize = initialize; + this.showDialog = showDialog; + } + + return this; +})(window,jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/feed.js b/web/app/assets/javascripts/feed.js index cc176e06a..c32871db9 100644 --- a/web/app/assets/javascripts/feed.js +++ b/web/app/assets/javascripts/feed.js @@ -5,7 +5,8 @@ context.JK.FeedScreen = function(app) { var logger = context.JK.logger; - var rest = context.JK.Rest(); + var rest = new context.JK.Rest(); + var ui = new context.JK.UIHelper(JK.app); var currentQuery = null; var currentPage = 0; var LIMIT = 20; @@ -282,24 +283,6 @@ return false; } - function toggleUserProfile() { - var userId = $(this).attr('user-id'); - window.location = '/client#/profile/' + userId; - return false; - } - - function toggleBandProfile() { - var bandId = $(this).attr('band-id'); - if (bandId == null) { - var userId = $(this).attr('user-id'); - window.location = '/client#/profile/' + userId; - } - else { - window.location = '/client#/bandProfile/' + bandId; - } - return false; - } - function renderFeeds(feeds) { $.each(feeds.entries, function(i, feed) { @@ -319,9 +302,27 @@ $('.details', $feedItem).click(toggleSessionDetails); $('.details-arrow', $feedItem).click(toggleSessionDetails); $('.play-button', $feedItem).click(toggleSessionPlay); - $('.avatar-tiny', $feedItem).click(toggleUserProfile); - $('.musician-name', $feedItem).click(toggleUserProfile); - $('.artist', $feedItem).click(toggleBandProfile); + + if (!feed.session_removed_at) + { + $('.btn-share', $feedItem).click(function() { + ui.launchShareDialog(feed.id, 'session'); + }); + } + else { + $('.btn-share', $feedItem).hide(); + } + + $('.btn-comment', $feedItem).click(function() { + ui.launchCommentDialog({ + session_id: feed.id, + entity_type: 'session' + }); + }); + + $('.btn-like', $feedItem).click(function() { + ui.addSessionLike(feed.id, JK.currentUserId, $('.likes', $feedItem), $('.btn-like', $feedItem)) + }); // put the feed item on the page renderFeed($feedItem); @@ -332,6 +333,7 @@ $('.dotdotdot', $feedItem).dotdotdot(); $feedItem.data('original-max-height', $feedItem.css('height')); context.JK.bindHoverEvents($feedItem); + context.JK.bindProfileClickEvents($feedItem); } else if(feed.type == 'recording') { if(feed.claimed_recordings.length == 0) { @@ -353,6 +355,22 @@ $('.details', $feedItem).click(toggleRecordingDetails); $('.details-arrow', $feedItem).click(toggleRecordingDetails); $('.play-button', $feedItem).click(toggleRecordingPlay); + + $('.btn-share', $feedItem).click(function() { + ui.launchShareDialog(options.candidate_claimed_recording.id, 'recording'); + }); + + $('.btn-comment', $feedItem).click(function() { + ui.launchCommentDialog({ + recording_id: feed.id, + claimed_recording_id: options.candidate_claimed_recording.id, + entity_type: 'recording' + }); + }); + + $('.btn-like', $feedItem).click(function() { + ui.addRecordingLike(feed.id, options.candidate_claimed_recording.id, JK.currentUserId, $('.likes', $feedItem), $('.btn-like', $feedItem)); + }); // put the feed item on the page renderFeed($feedItem); @@ -363,11 +381,14 @@ $('.dotdotdot', $feedItem).dotdotdot(); $feedItem.data('original-max-height', $feedItem.css('height')); context.JK.bindHoverEvents($feedItem); + context.JK.bindProfileClickEvents($feedItem); } else { logger.warn("skipping feed type: " + feed.type); } - }) + + context.JK.bindProfileClickEvents(); + }); } function renderFeed(feed) { diff --git a/web/app/assets/javascripts/feed_item_recording.js b/web/app/assets/javascripts/feed_item_recording.js index 834aedae5..e9c138479 100644 --- a/web/app/assets/javascripts/feed_item_recording.js +++ b/web/app/assets/javascripts/feed_item_recording.js @@ -5,6 +5,8 @@ context.JK = context.JK || {}; context.JK.FeedItemRecording = function($parentElement, options){ + var ui = new context.JK.UIHelper(JK.app); + var claimedRecordingId = $parentElement.attr('data-claimed-recording-id'); var recordingId = $parentElement.attr('id'); var mode = $parentElement.attr('data-mode'); @@ -94,19 +96,39 @@ $('.details', $feedItem).click(toggleDetails); $('.details-arrow', $feedItem).click(toggleDetails); $('.play-button', $feedItem).click(togglePlay); + + $('.btn-share', $feedItem).click(function() { + ui.launchShareDialog(claimedRecordingId, 'recording'); + }); + + $('.btn-comment', $feedItem).click(function() { + ui.launchCommentDialog({ + recording_id: recordingId, + claimed_recording_id: claimedRecordingId, + entity_type: 'recording' + }); + }); + + $('.btn-like', $feedItem).click(function() { + ui.addRecordingLike(recordingId, claimedRecordingId, JK.currentUserId, $('.likes', $feedItem), $('.btn-like', $feedItem)); + }); + $controls.bind('statechange.listenRecording', stateChange); } function initialize() { $('.timeago', $feedItem).timeago(); $('.dotdotdot', $feedItem).dotdotdot(); - $controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'}); + $controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'}); context.JK.prettyPrintElements($('time.duration', $feedItem)); context.JK.setInstrumentAssetPath($('.instrument-icon', $feedItem)); $feedItem.data('original-max-height', $feedItem.css('height')); events(); + + context.JK.bindHoverEvents($feedItem); + //context.JK.bindProfileClickEvents($feedItem); } initialize(); diff --git a/web/app/assets/javascripts/feed_item_session.js b/web/app/assets/javascripts/feed_item_session.js index 95e996b34..c5a39246e 100644 --- a/web/app/assets/javascripts/feed_item_session.js +++ b/web/app/assets/javascripts/feed_item_session.js @@ -6,8 +6,7 @@ context.JK.FeedItemSessionTimer = null; context.JK.FeedItemSession = function($parentElement, options){ - var logger = context.JK.logger; - var rest = new context.JK.Rest(); + var ui = new context.JK.UIHelper(JK.app); var $feedItem = $parentElement; var $description = $('.description', $feedItem) @@ -84,6 +83,22 @@ $('.details', $feedItem).click(toggleDetails); $('.details-arrow', $feedItem).click(toggleDetails); $('.play-button', $feedItem).click(togglePlay); + + $('.btn-share', $feedItem).click(function() { + ui.launchShareDialog(musicSessionId, 'session'); + }); + + $('.btn-comment', $feedItem).click(function() { + ui.launchCommentDialog({ + session_id: musicSessionId, + entity_type: 'session' + }); + }); + + $('.btn-like', $feedItem).click(function() { + ui.addSessionLike(musicSessionId, JK.currentUserId, $('.likes', $feedItem), $('.btn-like', $feedItem)) + }); + $controls.bind('statechange.listenBroadcast', stateChange); } @@ -97,6 +112,9 @@ $feedItem.data('original-max-height', $feedItem.css('height')); events(); + + context.JK.bindHoverEvents($feedItem); + //context.JK.bindProfileClickEvents($feedItem); } initialize(); diff --git a/web/app/assets/javascripts/hoverBand.js b/web/app/assets/javascripts/hoverBand.js index d6498f91a..7f85e0dbc 100644 --- a/web/app/assets/javascripts/hoverBand.js +++ b/web/app/assets/javascripts/hoverBand.js @@ -3,7 +3,6 @@ "use strict"; context.JK = context.JK || {}; context.JK.BandHoverBubble = function(bandId, x, y) { - var logger = context.JK.logger; var rest = context.JK.Rest(); var hoverSelector = "#band-hover"; @@ -13,9 +12,9 @@ var mouseTop = y < (document.body.clientHeight / 2); var css = {}; if (mouseLeft) - css.left = x + 10 + 'px'; + css.left = x + 20 + 'px'; else - css.left = x - (7 + $(hoverSelector).width()) + 'px'; + css.left = x - (25 + $(hoverSelector).width()) + 'px'; if (mouseTop) css.top = y + 10 + 'px'; else diff --git a/web/app/assets/javascripts/hoverFan.js b/web/app/assets/javascripts/hoverFan.js index f5b9926d0..a68f65204 100644 --- a/web/app/assets/javascripts/hoverFan.js +++ b/web/app/assets/javascripts/hoverFan.js @@ -6,7 +6,6 @@ var logger = context.JK.logger; var rest = context.JK.Rest(); - var instrumentLogoMap = context.JK.getInstrumentIconMap24(); var hoverSelector = "#fan-hover"; this.showBubble = function() { @@ -14,9 +13,9 @@ var mouseTop = y < (document.body.clientHeight / 2); var css = {}; if (mouseLeft) - css.left = x + 10 + 'px'; + css.left = x + 20 + 'px'; else - css.left = x - (7 + $(hoverSelector).width()) + 'px'; + css.left = x - (25 + $(hoverSelector).width()) + 'px'; if (mouseTop) css.top = y + 10 + 'px'; else diff --git a/web/app/assets/javascripts/hoverMusician.js b/web/app/assets/javascripts/hoverMusician.js index 6ce0368a6..360bc664d 100644 --- a/web/app/assets/javascripts/hoverMusician.js +++ b/web/app/assets/javascripts/hoverMusician.js @@ -9,14 +9,13 @@ var hoverSelector = "#musician-hover"; this.showBubble = function() { - var mouseLeft = x < (document.body.clientWidth / 2); var mouseTop = y < (document.body.clientHeight / 2); var css = {}; if (mouseLeft) - css.left = x + 10 + 'px'; + css.left = x + 20 + 'px'; else - css.left = x - (7 + $(hoverSelector).width()) + 'px'; + css.left = x - (25 + $(hoverSelector).width()) + 'px'; if (mouseTop) css.top = y + 10 + 'px'; else diff --git a/web/app/assets/javascripts/hoverRecording.js b/web/app/assets/javascripts/hoverRecording.js index 3555b626e..02092717b 100644 --- a/web/app/assets/javascripts/hoverRecording.js +++ b/web/app/assets/javascripts/hoverRecording.js @@ -42,9 +42,9 @@ var mouseTop = y < (document.body.clientHeight / 2); var css = {}; if (mouseLeft) - css.left = x + 10 + 'px'; + css.left = x + 20 + 'px'; else - css.left = x - (7 + $(hoverSelector).width()) + 'px'; + css.left = x - (25 + $(hoverSelector).width()) + 'px'; if (mouseTop) css.top = y + 10 + 'px'; else diff --git a/web/app/assets/javascripts/hoverSession.js b/web/app/assets/javascripts/hoverSession.js index f6a9843c5..5bedf9249 100644 --- a/web/app/assets/javascripts/hoverSession.js +++ b/web/app/assets/javascripts/hoverSession.js @@ -13,9 +13,9 @@ var mouseTop = y < (document.body.clientHeight / 2); var css = {}; if (mouseLeft) - css.left = x + 10 + 'px'; + css.left = x + 20 + 'px'; else - css.left = x - (7 + $(hoverSelector).width()) + 'px'; + css.left = x - (25 + $(hoverSelector).width()) + 'px'; if (mouseTop) css.top = y + 10 + 'px'; else diff --git a/web/app/assets/javascripts/landing/landing.js b/web/app/assets/javascripts/landing/landing.js index 52cd0cc83..fbdb167c0 100644 --- a/web/app/assets/javascripts/landing/landing.js +++ b/web/app/assets/javascripts/landing/landing.js @@ -5,7 +5,9 @@ //= require globals //= require jamkazam //= require utils +//= require ui_helper //= require ga //= require jam_rest //= require landing/init -//= require landing/signup \ No newline at end of file +//= require landing/signup +//= require shareDialog \ No newline at end of file diff --git a/web/app/assets/javascripts/shareDialog.js b/web/app/assets/javascripts/shareDialog.js index c5dceb65b..dc3bca311 100644 --- a/web/app/assets/javascripts/shareDialog.js +++ b/web/app/assets/javascripts/shareDialog.js @@ -413,7 +413,7 @@ $(dialogId + ' .link-contents').text(entity.share_url) }) .fail(function(jqXHR) { - app.notifyServerError(jqXHR, "Unable to Fetch Session Data"); + app.notifyServerError(jqXHR, "Unable to Fetch Recording Data"); }) } else { diff --git a/web/app/assets/javascripts/ui_helper.js b/web/app/assets/javascripts/ui_helper.js new file mode 100644 index 000000000..97eacab17 --- /dev/null +++ b/web/app/assets/javascripts/ui_helper.js @@ -0,0 +1,46 @@ +(function(context,$) { + "use strict"; + + context.JK = context.JK || {}; + + context.JK.UIHelper = function(app) { + var logger = context.JK.logger; + var rest = new context.JK.Rest(); + + function addSessionLike(sessionId, userId, $likeCountSelector, $likeButtonSelector) { + rest.addSessionLike(sessionId, userId) + .done(function(response) { + $likeCountSelector.html(parseInt($likeCountSelector.text()) + 1); + $likeButtonSelector.unbind("click"); + }); + } + + function addRecordingLike(recordingId, claimedRecordingId, userId, $likeCountSelector, $likeButtonSelector) { + rest.addRecordingLike(recordingId, claimedRecordingId, userId) + .done(function(response) { + $likeCountSelector.html(parseInt($likeCountSelector.text()) + 1); + $likeButtonSelector.unbind("click"); + }); + } + + function launchCommentDialog(options) { + var commentDialog = new JK.CommentDialog(JK.app, options); + commentDialog.initialize(); + commentDialog.showDialog(); + } + + function launchShareDialog(entityId, entityType) { + var shareDialog = new JK.ShareDialog(JK.app, entityId, entityType); + shareDialog.initialize(JK.FacebookHelperInstance); + shareDialog.showDialog(); + } + + this.addSessionLike = addSessionLike; + this.addRecordingLike = addRecordingLike; + this.launchCommentDialog = launchCommentDialog; + this.launchShareDialog = launchShareDialog; + + return this; + }; + +})(window,jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index dd5de4c3b..0140c1b9f 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -153,9 +153,39 @@ $element.bt(text, options); } + context.JK.bindProfileClickEvents = function($parent, dialogsToClose) { + if (!$parent) { + $parent = $('body'); + } + + function closeDialogs() { + if (dialogsToClose) { + $.each(dialogsToClose, function(index, val) { + JK.app.layout.closeDialog(val); + }); + } + } + + $("[profileaction='band']", $parent).unbind('click'); + $("[profileaction='band']", $parent).click(function(evt) { + closeDialogs(); + console.log("navigating to band profile %o", $(this).attr('band-id')); + window.location = "/client#/bandProfile/" + $(this).attr('band-id'); + }); + + $("[profileaction='musician']", $parent).unbind('click'); + $("[profileaction='musician']", $parent).click(function(evt) { + closeDialogs(); + console.log("navigating to musician profile %o", $(this).attr('user-id')); + window.location = "/client#/profile/" + $(this).attr('user-id'); + }); + } + context.JK.bindHoverEvents = function ($parent) { var timeout = 300; var fadeoutValue = 100; + var sensitivity = 3; + var interval = 500; if (!$parent) { $parent = $('body'); @@ -194,7 +224,8 @@ out: function () { // this registers for leaving the hoverable element hideBubble($(this)); }, - sensitivity: 1, + sensitivity: sensitivity, + interval: interval, timeout: timeout }); @@ -207,7 +238,8 @@ out: function () { // this registers for leaving the hoverable element hideBubble($(this)); }, - sensitivity: 1, + sensitivity: sensitivity, + interval: interval, timeout: timeout }); @@ -220,7 +252,8 @@ out: function () { // this registers for leaving the hoverable element hideBubble($(this)); }, - sensitivity: 1, + sensitivity: sensitivity, + interval: interval, timeout: timeout }); @@ -233,7 +266,8 @@ out: function () { // this registers for leaving the hoverable element hideBubble($(this)); }, - sensitivity: 1, + sensitivity: sensitivity, + interval: interval, timeout: timeout }); @@ -246,7 +280,8 @@ out: function () { // this registers for leaving the hoverable element hideBubble($(this)); }, - sensitivity: 1, + sensitivity: sensitivity, + interval: interval, timeout: timeout }); } diff --git a/web/app/assets/javascripts/web/recordings.js b/web/app/assets/javascripts/web/recordings.js index 5a901a81e..1fecac65b 100644 --- a/web/app/assets/javascripts/web/recordings.js +++ b/web/app/assets/javascripts/web/recordings.js @@ -2,7 +2,8 @@ context.JK.ShowRecording = function(app) { var logger = context.JK.logger; - var rest = new JK.Rest(); + var rest = JK.Rest(); + var ui = context.JK.UIHelper(); var recordingId = null; var claimedRecordingId = null; var $scope = $(".landing-details"); @@ -105,14 +106,11 @@ $controls.bind('statechange.listenRecording', stateChange); $controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'}); + $("#btnShare", $scope).click(function(e) { + ui.launchShareDialog(claimedRecordingId, "recording"); + }); + if (JK.currentUserId) { - var shareDialog = new JK.ShareDialog(JK.app, claimedRecordingId, "recording"); - shareDialog.initialize(JK.FacebookHelperInstance); - - $("#btnShare", $scope).click(function(e) { - shareDialog.showDialog(); - }); - $("#btnPostComment").click(function(e) { if ($.trim($("#txtRecordingComment").val()).length > 0) { addComment(); diff --git a/web/app/assets/javascripts/web/sessions.js b/web/app/assets/javascripts/web/sessions.js index 55a569142..c31bd62c7 100644 --- a/web/app/assets/javascripts/web/sessions.js +++ b/web/app/assets/javascripts/web/sessions.js @@ -2,7 +2,8 @@ context.JK.ShowMusicSession = function(app) { var logger = context.JK.logger; - var rest = new JK.Rest(); + var rest = JK.Rest(); + var ui = context.JK.UIHelper(); var sessionId = null; var $scope = $(".landing-details"); var $controls = null; @@ -107,14 +108,11 @@ sessionId = musicSessionId; + $("#btnShare").click(function(e) { + ui.launchShareDialog(sessionId, "session"); + }); + if (JK.currentUserId) { - var shareDialog = new JK.ShareDialog(context.JK.app, sessionId, "session"); - shareDialog.initialize(JK.FacebookHelperInstance); - - $("#btnShare").click(function(e) { - shareDialog.showDialog(); - }); - $("#btnPostComment").click(function(e) { if ($.trim($("#txtSessionComment").val()).length > 0) { addComment(); diff --git a/web/app/assets/javascripts/web/web.js b/web/app/assets/javascripts/web/web.js index e5230fbf0..ffcbebaa6 100644 --- a/web/app/assets/javascripts/web/web.js +++ b/web/app/assets/javascripts/web/web.js @@ -35,10 +35,12 @@ //= require hoverSession //= require hoverRecording //= require shareDialog +//= require commentDialog //= require layout //= require user_dropdown //= require jamkazam //= require utils +//= require ui_helper //= require custom_controls //= require ga //= require jam_rest diff --git a/web/app/assets/stylesheets/client/client.css b/web/app/assets/stylesheets/client/client.css index 8dfded0bf..844f9ca42 100644 --- a/web/app/assets/stylesheets/client/client.css +++ b/web/app/assets/stylesheets/client/client.css @@ -57,7 +57,7 @@ *= require ./musician *= require web/audioWidgets *= require web/recordings - #= require web/sessions + *= require web/sessions *= require jquery.Jcrop *= require icheck/minimal/minimal */ \ No newline at end of file diff --git a/web/app/assets/stylesheets/client/dialog.css.scss b/web/app/assets/stylesheets/client/dialog.css.scss index 06e8ca2ba..c7882be42 100644 --- a/web/app/assets/stylesheets/client/dialog.css.scss +++ b/web/app/assets/stylesheets/client/dialog.css.scss @@ -78,5 +78,10 @@ color:#aaa; } +.dialog-comment-scroller { + height:210px; + overflow:auto; +} + diff --git a/web/app/assets/stylesheets/client/hoverBubble.css.scss b/web/app/assets/stylesheets/client/hoverBubble.css.scss index 3d2efd754..a53fff3b8 100644 --- a/web/app/assets/stylesheets/client/hoverBubble.css.scss +++ b/web/app/assets/stylesheets/client/hoverBubble.css.scss @@ -14,15 +14,15 @@ h2 { padding:6px 0px; text-align:center; - font-size:15px; - font-weight:200; + font-size:15px !important; + font-weight:200 !important; width:100%; background-color:#ed3618; } h3 { - font-weight:400; - font-size:16px; + font-weight:400 !important; + font-size:16px !important; color:#fff; } diff --git a/web/app/assets/stylesheets/web/audioWidgets.css.scss b/web/app/assets/stylesheets/web/audioWidgets.css.scss index 9803796b5..da7a933f1 100644 --- a/web/app/assets/stylesheets/web/audioWidgets.css.scss +++ b/web/app/assets/stylesheets/web/audioWidgets.css.scss @@ -238,7 +238,7 @@ font-size:12px; font-weight:bold; color:#ccc; - margin-bottom:10px; + margin-bottom:5px; overflow: hidden; white-space: nowrap; text-decoration: none; diff --git a/web/app/views/api_music_sessions/history_show.rabl b/web/app/views/api_music_sessions/history_show.rabl index d29de5af3..9d22fd4ab 100644 --- a/web/app/views/api_music_sessions/history_show.rabl +++ b/web/app/views/api_music_sessions/history_show.rabl @@ -1,6 +1,6 @@ object @history -attributes :id, :music_session_id, :description, :genres, :like_count, :comment_count, :created_at +attributes :id, :music_session_id, :description, :fan_access, :genres, :like_count, :comment_count, :created_at node :share_url do |history| unless history.share_token.nil? diff --git a/web/app/views/clients/_commentDialog.html.haml b/web/app/views/clients/_commentDialog.html.haml new file mode 100644 index 000000000..065ba4cc4 --- /dev/null +++ b/web/app/views/clients/_commentDialog.html.haml @@ -0,0 +1,29 @@ +.dialog.dialog-overlay-sm{layout: 'dialog', 'layout-id' => 'comment-dialog', id: 'comment-dialog'} + .content-head + %h1 + .dialog-inner + .right + %a.button-orange{id: 'dialog-close-button', 'layout-action' => 'close'} X CLOSE + %h2 Comments: + .avatar-small + = image_tag 'shared/avatar_generic.png', :alt => "" + .left.w80.p10 + %textarea.w100.p5.f15{id: 'txtComment', rows: '2', placeholder: 'Enter a comment...'} + %br/ + %br/ + .right + %a.button-orange{id: 'btn-add-comment'} ADD COMMENT + %br{clear: 'all'}/ + .dialog-comment-scroller + +%script{type: 'text/template', id: 'template-comments'} + .avatar-small.mr10{'user-id' => '{{data.user_id}}', 'hoveraction' => '{{data.hoverAction}}', 'profileaction' => '{{data.hoverAction}}'} + %a{'href' => '/client#/profile/{{data.user_id}}'} + %img{:'src' => '{{data.avatar_url}}', alt: ''} + .w80.left.p10.lightgrey.mt10.comment-text + %a{'user-id' => '{{data.user_id}}', 'hoveraction' => '{{data.hoverAction}}', 'profileaction' => '{{data.hoverAction}}'} {{data.name}} + {{data.comment}} + %br/ + .f12.grey.mt5.comment-timestamp + {{data.timeago}} + %br{clear: 'all'}/ \ No newline at end of file diff --git a/web/app/views/clients/_hoverRecording.html.erb b/web/app/views/clients/_hoverRecording.html.erb index 50d75445e..214cf3df6 100644 --- a/web/app/views/clients/_hoverRecording.html.erb +++ b/web/app/views/clients/_hoverRecording.html.erb @@ -41,6 +41,7 @@
+