diff --git a/core/realtime/notification.py b/core/realtime/notification.py index 0fb6e50..e52cf05 100644 --- a/core/realtime/notification.py +++ b/core/realtime/notification.py @@ -1,6 +1,7 @@ import requests import logging import redis +from requests.packages.urllib3.exceptions import ConnectionError from core.serialisers import json from dss import localsettings # TODO(fergal.moran@gmail.com): refactor these out to @@ -13,18 +14,22 @@ logger = logging.getLogger('spa') def post_notification(session_id, image, message): - payload = { - 'sessionid': session_id, - 'image': image, - 'message': message - } - data = json.dumps(payload) - r = requests.post( - localsettings.REALTIME_HOST + 'notification', - data=data, - headers=HEADERS - ) - if r.status_code == 200: - return "" - else: - return r.text + try: + payload = { + 'sessionid': session_id, + 'image': image, + 'message': message + } + data = json.dumps(payload) + r = requests.post( + localsettings.REALTIME_HOST + 'notification', + data=data, + headers=HEADERS + ) + if r.status_code == 200: + return "" + else: + return r.text + except ConnectionError: + #should probably implement some sort of retry in here + pass \ No newline at end of file diff --git a/spa/management/commands/archive_mixes.py b/spa/management/commands/archive_mixes.py index 0246b7a..36c1ed9 100755 --- a/spa/management/commands/archive_mixes.py +++ b/spa/management/commands/archive_mixes.py @@ -19,7 +19,6 @@ class Command(NoArgsCommand): container = driver.get_container(container_name=settings.AZURE_CONTAINER) mixes = Mix.objects \ - .filter(upload_date__lte=datetime.today() - timedelta(days=180)) \ .exclude(archive_path__isnull=False) \ .annotate(num_plays=Count('activity_plays')) \ .order_by('num_plays')[:10] diff --git a/spa/models/activity.py b/spa/models/activity.py index d6fc325..cf9e09e 100755 --- a/spa/models/activity.py +++ b/spa/models/activity.py @@ -81,7 +81,6 @@ class Activity(BaseModel): notification.save() except Exception, ex: print "Error creating activity notification: %s" % ex.message - raise ex def get_activity_url(self): return '/api/v1/activity/%s' % self.id diff --git a/static/css/ace/fonts/FontAwesome.otf b/static/css/ace/fonts/FontAwesome.otf index 3461e3f..81c9ad9 100644 Binary files a/static/css/ace/fonts/FontAwesome.otf and b/static/css/ace/fonts/FontAwesome.otf differ diff --git a/static/css/ace/fonts/fontawesome-webfont.eot b/static/css/ace/fonts/fontawesome-webfont.eot index 6cfd566..84677bc 100644 Binary files a/static/css/ace/fonts/fontawesome-webfont.eot and b/static/css/ace/fonts/fontawesome-webfont.eot differ diff --git a/static/css/ace/fonts/fontawesome-webfont.svg b/static/css/ace/fonts/fontawesome-webfont.svg index a9f8469..d907b25 100644 --- a/static/css/ace/fonts/fontawesome-webfont.svg +++ b/static/css/ace/fonts/fontawesome-webfont.svg @@ -32,473 +32,489 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - \ No newline at end of file diff --git a/static/css/ace/fonts/fontawesome-webfont.ttf b/static/css/ace/fonts/fontawesome-webfont.ttf index 5cd6cff..96a3639 100644 Binary files a/static/css/ace/fonts/fontawesome-webfont.ttf and b/static/css/ace/fonts/fontawesome-webfont.ttf differ diff --git a/static/css/ace/fonts/fontawesome-webfont.woff b/static/css/ace/fonts/fontawesome-webfont.woff index 9eaecb3..628b6a5 100644 Binary files a/static/css/ace/fonts/fontawesome-webfont.woff and b/static/css/ace/fonts/fontawesome-webfont.woff differ diff --git a/static/css/ace/uncompressed/font-awesome.css b/static/css/ace/uncompressed/font-awesome.css index eb4127b..4040b3c 100644 --- a/static/css/ace/uncompressed/font-awesome.css +++ b/static/css/ace/uncompressed/font-awesome.css @@ -1,22 +1,21 @@ /*! - * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome + * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; - src: url('../fonts/fontawesome-webfont.eot?v=4.1.0'); - src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg'); + src: url('../fonts/fontawesome-webfont.eot?v=4.2.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } .fa { display: inline-block; - font-family: FontAwesome; - font-style: normal; - font-weight: normal; - line-height: 1; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @@ -78,36 +77,20 @@ margin-left: .3em; } .fa-spin { - -webkit-animation: spin 2s infinite linear; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; } -@-moz-keyframes spin { - 0% { - -moz-transform: rotate(0deg); - } - 100% { - -moz-transform: rotate(359deg); - } -} -@-webkit-keyframes spin { +@-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); + transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); + transform: rotate(359deg); } } -@-o-keyframes spin { - 0% { - -o-transform: rotate(0deg); - } - 100% { - -o-transform: rotate(359deg); - } -} -@keyframes spin { +@keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); @@ -120,43 +103,40 @@ .fa-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); - -o-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); - -o-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); - -moz-transform: rotate(270deg); -ms-transform: rotate(270deg); - -o-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); - -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); - -o-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); - -moz-transform: scale(1, -1); -ms-transform: scale(1, -1); - -o-transform: scale(1, -1); transform: scale(1, -1); } +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} .fa-stack { position: relative; display: inline-block; @@ -222,6 +202,8 @@ .fa-check:before { content: "\f00c"; } +.fa-remove:before, +.fa-close:before, .fa-times:before { content: "\f00d"; } @@ -551,7 +533,8 @@ .fa-arrows-h:before { content: "\f07e"; } -.fa-bar-chart-o:before { +.fa-bar-chart-o:before, +.fa-bar-chart:before { content: "\f080"; } .fa-twitter-square:before { @@ -1380,7 +1363,6 @@ .fa-digg:before { content: "\f1a6"; } -.fa-pied-piper-square:before, .fa-pied-piper:before { content: "\f1a7"; } @@ -1497,6 +1479,7 @@ content: "\f1cc"; } .fa-life-bouy:before, +.fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { @@ -1564,3 +1547,126 @@ .fa-bomb:before { content: "\f1e2"; } +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} diff --git a/static/css/dss.main.css b/static/css/dss.main.css index 726a403..bc36d53 100644 --- a/static/css/dss.main.css +++ b/static/css/dss.main.css @@ -788,4 +788,8 @@ img.mix-listing-image { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} + +.white-bg { + background: #ffffff !important; } \ No newline at end of file diff --git a/static/js/dss/apps/comments/views/commentItemView.coffee b/static/js/dss/apps/comments/views/commentItemView.coffee index bee730a..b8adb9e 100644 --- a/static/js/dss/apps/comments/views/commentItemView.coffee +++ b/static/js/dss/apps/comments/views/commentItemView.coffee @@ -5,6 +5,8 @@ "click #delete-comment": "deleteComment" "click #like-comment": "likeComment" + className: "itemdiv dialogdiv" + deleteComment: -> utils.messageBox "/dlg/DeleteCommentConfirm", => @model.destroy() diff --git a/static/js/dss/apps/comments/views/commentListView.coffee b/static/js/dss/apps/comments/views/commentListView.coffee index 51154ca..37d4c08 100644 --- a/static/js/dss/apps/comments/views/commentListView.coffee +++ b/static/js/dss/apps/comments/views/commentListView.coffee @@ -5,4 +5,3 @@ className: "activity-listing media-list" childView: Views.CommentItemView childViewContainer: "#comment-list-container" - diff --git a/static/js/dss/apps/mix/views/mixDetailView.coffee b/static/js/dss/apps/mix/views/mixDetailView.coffee index 9ebad7d..08689fc 100644 --- a/static/js/dss/apps/mix/views/mixDetailView.coffee +++ b/static/js/dss/apps/mix/views/mixDetailView.coffee @@ -3,7 +3,7 @@ template: "mixdetailview" regions: mix: "#mix" - comments: "#comments" + comments: "#comment-list-container-outer" ui: commentText: '#comment-text' events: @@ -30,7 +30,7 @@ comments.mix = @model comments.fetch success: (data) -> content = new App.CommentsApp.Views.CommentListView(collection: comments).render() - $("#comments", @el).html content.el + $("#comment-list-container-outer", @el).html content.el true true @@ -49,7 +49,7 @@ @model.addComment comment, (=> @ui.commentText.val "" utils.showMessage "Comment saved.." - activeTab.tab().show() + @renderComments() ), (error) => utils.showError "Woops \n" + error $('#comment-input').addClass('has-error') diff --git a/static/js/dss/templates/commentitemview.jst b/static/js/dss/templates/commentitemview.jst index c99fd7f..9f43cef 100644 --- a/static/js/dss/templates/commentitemview.jst +++ b/static/js/dss/templates/commentitemview.jst @@ -1,4 +1,3 @@ -
<%= user_name %>'s Avatar
@@ -26,4 +25,3 @@
<% } %> - \ No newline at end of file diff --git a/static/js/dss/templates/commentlistview.jst b/static/js/dss/templates/commentlistview.jst index a1a9838..8756ce0 100644 --- a/static/js/dss/templates/commentlistview.jst +++ b/static/js/dss/templates/commentlistview.jst @@ -1,14 +1,4 @@ -
-
-

- -

-
- -
-
-
-
-
+
+ diff --git a/static/js/dss/templates/mixdetailview.jst b/static/js/dss/templates/mixdetailview.jst index 2ce689c..5ecbcb1 100644 --- a/static/js/dss/templates/mixdetailview.jst +++ b/static/js/dss/templates/mixdetailview.jst @@ -6,44 +6,51 @@
    -
    -
    -
    - - - - -
    -
    -
    +
    - - -
    -
    -
    <%= description %>
    +
    +
    +
    +

    + Description +

    +
    +
    +
    <%= description %>
    +
    -
    +
    +
    +
    +
    +

    + + Comments +

    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    +
    +