forked from ellmetha/django-machina
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to subscribe to a forum
When a new topic is posted, all the users who are subscribed to its forum will automatically be subscribed to it.
- Loading branch information
1 parent
215eb27
commit 2adf216
Showing
9 changed files
with
224 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.6 on 2017-11-30 18:26 | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('forum', '0009_auto_20170928_2327'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='forum', | ||
name='subscribers', | ||
field=models.ManyToManyField(blank=True, related_name='forum_subscriptions', to=settings.AUTH_USER_MODEL, verbose_name='Subscribers'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
machina/templates/machina/forum_member/forum_subscribe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends 'board_base.html' %} | ||
{% load i18n %} | ||
{% load forum_conversation_tags %} | ||
|
||
{% block sub_title %}{% trans "Subscribe to forum" %}{% endblock sub_title %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<div class="panel panel-default post-delete"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title">{% trans "Subscribe to forum" %}</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<div class="warning-message">{% trans "Would you like to subscribe to this forum?" %}</div> | ||
<form action="" method="post">{% csrf_token %} | ||
<input type="hidden" name="post" value="yes" /> | ||
<input type="submit" value="{% trans "Yes" %}" class="btn btn-warning" /> | ||
<a href="{% url 'forum:forum' forum.slug forum.pk %}" class="btn">{% trans "No" %}</a> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
25 changes: 25 additions & 0 deletions
25
machina/templates/machina/forum_member/forum_unsubscribe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends 'board_base.html' %} | ||
{% load i18n %} | ||
{% load forum_conversation_tags %} | ||
|
||
{% block sub_title %}{% trans "Unsubscribe from forum" %}{% endblock sub_title %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<div class="panel panel-default post-delete"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title">{% trans "Unsubscribe from forum" %}</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<div class="warning-message">{% trans "Would you like to unsubscribe from this forum?" %}</div> | ||
<form action="" method="post">{% csrf_token %} | ||
<input type="hidden" name="post" value="yes" /> | ||
<input type="submit" value="{% trans "Yes" %}" class="btn btn-warning" /> | ||
<a href="{% url 'forum:forum' forum.slug forum.pk %}" class="btn">{% trans "No" %}</a> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |