Commit d7d98912 authored by Steffen van Bergerem's avatar Steffen van Bergerem

Merge pull request #5722 from AugierLe42e/add-notif-unsubscribe-single-post-view

Add a notification subscribtion to the single post view
parents fb8bc7b9 08871372
......@@ -192,6 +192,7 @@ diaspora.yml file**. The existing settings from 0.4.x and before will not work a
* Update and improve help section [#5665](https://github.com/diaspora/diaspora/pull/5665), [#5706](https://github.com/diaspora/diaspora/pull/5706)
* Expose participation controls in the stream view [#5511](https://github.com/diaspora/diaspora/pull/5511)
* Reimplement photo export [#5685](https://github.com/diaspora/diaspora/pull/5685)
* Add participation controls in the single post view [#5722](https://github.com/diaspora/diaspora/pull/5722)
# 0.4.1.2
......
......@@ -6,12 +6,14 @@ app.views.SinglePostModeration = app.views.Feedback.extend({
events: function() {
return _.defaults({
"click .remove_post": "destroyModel",
"click .create_participation": "createParticipation",
"click .destroy_participation": "destroyParticipation"
}, app.views.Feedback.prototype.events);
},
presenter: function() {
return _.extend(this.defaultPresenter(), {
authorIsCurrentUser : this.authorIsCurrentUser(),
authorIsCurrentUser : this.authorIsCurrentUser()
});
},
......@@ -42,6 +44,25 @@ app.views.SinglePostModeration = app.views.Feedback.extend({
});
});
}
}
},
createParticipation: function (evt) {
if(evt) { evt.preventDefault(); }
var self = this;
$.post(Routes.post_participation_path(this.model.get("id")), {}, function () {
self.model.set({participation: true});
self.render();
});
},
destroyParticipation: function (evt) {
if(evt) { evt.preventDefault(); }
var self = this;
$.post(Routes.post_participation_path(this.model.get("id")), { _method: "delete" }, function () {
self.model.set({participation: false});
self.render();
});
},
participation: function(){ return this.model.get("participation"); }
});
......@@ -11,6 +11,15 @@
<a href="#" data-type="post" class="block_user" title="{{t "ignore"}}">
<i class="entypo block"></i>
</a>
{{#if participation}}
<a href="#" data-type="nofollow" class="destroy_participation" title="{{t "stream.disable_post_notifications"}}">
<i class="entypo bell"></i>
</a>
{{else}}
<a href="#" data-type="nofollow" class="create_participation" title="{{t "stream.enable_post_notifications"}}">
<i class="entypo bell"></i>
</a>
{{/if}}
<a href="#" data-type="post" class="hide_post" title="{{t "stream.hide"}}">
<i class="entypo cross"></i>
</a>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment