mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
Some tiny fixes in the forum
This commit is contained in:
parent
6764224856
commit
138711c70c
@ -28,7 +28,7 @@ already.
|
|||||||
You can check all of them with:
|
You can check all of them with:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt install libmysqlclient-dev libssl-dev libjpeg-dev zlib1g-dev python3-dev
|
sudo apt install libmysqlclient-dev libssl-dev libjpeg-dev zlib1g-dev python3-dev libffi-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The development is done with sqlite, but it is advised to set a more robust DBMS for production (Postgresql for example)
|
The development is done with sqlite, but it is advised to set a more robust DBMS for production (Postgresql for example)
|
||||||
|
@ -166,5 +166,4 @@ class ForumUserInfo(models.Model):
|
|||||||
user = models.OneToOneField(User, related_name="_forum_infos")
|
user = models.OneToOneField(User, related_name="_forum_infos")
|
||||||
last_read_date = models.DateTimeField(_('last read date'), default=datetime(year=settings.SITH_SCHOOL_START_YEAR,
|
last_read_date = models.DateTimeField(_('last read date'), default=datetime(year=settings.SITH_SCHOOL_START_YEAR,
|
||||||
month=1, day=1, tzinfo=pytz.UTC))
|
month=1, day=1, tzinfo=pytz.UTC))
|
||||||
# read_messages = models.ManyToManyField(ForumMessage, related_name="readers", verbose_name=_("read messages"))
|
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
<h3>{% trans %}Forum{% endtrans %}</h3>
|
<h3>{% trans %}Forum{% endtrans %}</h3>
|
||||||
<p>
|
<p>
|
||||||
<a class="ib" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a>
|
<a class="ib" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a>
|
||||||
<a class="ib" href="{{ url('forum:mark_all_as_read') }}">{% trans %}Mark all as read{% endtrans %}</a>
|
|
||||||
<a class="ib" href="{{ url('forum:main') }}">{% trans %}Refresh{% endtrans %}</a>
|
|
||||||
</p>
|
</p>
|
||||||
{% if user.is_in_group(settings.SITH_GROUP_FORUM_ADMIN_ID) or user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) %}
|
{% if user.is_in_group(settings.SITH_GROUP_FORUM_ADMIN_ID) or user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) %}
|
||||||
<p>
|
<p>
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{# m.mark_as_read(user) or "" #}
|
{{ m.mark_as_read(user) or "" }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from django.core.exceptions import PermissionDenied
|
|||||||
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin, TabedViewMixin
|
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin, TabedViewMixin
|
||||||
from forum.models import Forum, ForumMessage, ForumTopic
|
from forum.models import Forum, ForumMessage, ForumTopic
|
||||||
|
|
||||||
class ForumMainView(CanViewMixin, ListView):
|
class ForumMainView(ListView):
|
||||||
queryset = Forum.objects.filter(parent=None)
|
queryset = Forum.objects.filter(parent=None)
|
||||||
template_name = "forum/main.jinja"
|
template_name = "forum/main.jinja"
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class ForumTopicCreateView(CanCreateMixin, CreateView):
|
|||||||
|
|
||||||
class ForumTopicEditView(CanEditMixin, UpdateView):
|
class ForumTopicEditView(CanEditMixin, UpdateView):
|
||||||
model = ForumTopic
|
model = ForumTopic
|
||||||
fields = ['title', 'forum']
|
fields = ['forum']
|
||||||
pk_url_kwarg = "topic_id"
|
pk_url_kwarg = "topic_id"
|
||||||
template_name = "core/edit.jinja"
|
template_name = "core/edit.jinja"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user