Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
138711c7
Commit
138711c7
authored
Feb 24, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some tiny fixes in the forum
parent
67642248
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
7 deletions
+4
-7
README.md
README.md
+1
-1
forum/models.py
forum/models.py
+0
-1
forum/templates/forum/main.jinja
forum/templates/forum/main.jinja
+0
-2
forum/templates/forum/topic.jinja
forum/templates/forum/topic.jinja
+1
-1
forum/views.py
forum/views.py
+2
-2
No files found.
README.md
View file @
138711c7
...
...
@@ -28,7 +28,7 @@ already.
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)
...
...
forum/models.py
View file @
138711c7
...
...
@@ -166,5 +166,4 @@ class ForumUserInfo(models.Model):
user
=
models
.
OneToOneField
(
User
,
related_name
=
"_forum_infos"
)
last_read_date
=
models
.
DateTimeField
(
_
(
'last read date'
),
default
=
datetime
(
year
=
settings
.
SITH_SCHOOL_START_YEAR
,
month
=
1
,
day
=
1
,
tzinfo
=
pytz
.
UTC
))
# read_messages = models.ManyToManyField(ForumMessage, related_name="readers", verbose_name=_("read messages"))
forum/templates/forum/main.jinja
View file @
138711c7
...
...
@@ -13,8 +13,6 @@
<h3>
{%
trans
%}
Forum
{%
endtrans
%}
</h3>
<p>
<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>
{%
if
user.is_in_group
(
settings.SITH_GROUP_FORUM_ADMIN_ID
)
or
user.is_in_group
(
settings.SITH_GROUP_COM_ADMIN_ID
)
%}
<p>
...
...
forum/templates/forum/topic.jinja
View file @
138711c7
...
...
@@ -76,7 +76,7 @@
</div>
</div>
</div>
{
# m.mark_as_read(user) or "" #
}
{
{
m.mark_as_read
(
user
)
or
""
}
}
{%
endfor
%}
{%
endblock
%}
...
...
forum/views.py
View file @
138711c7
...
...
@@ -12,7 +12,7 @@ from django.core.exceptions import PermissionDenied
from
core.views
import
CanViewMixin
,
CanEditMixin
,
CanEditPropMixin
,
CanCreateMixin
,
TabedViewMixin
from
forum.models
import
Forum
,
ForumMessage
,
ForumTopic
class
ForumMainView
(
CanViewMixin
,
ListView
):
class
ForumMainView
(
ListView
):
queryset
=
Forum
.
objects
.
filter
(
parent
=
None
)
template_name
=
"forum/main.jinja"
...
...
@@ -108,7 +108,7 @@ class ForumTopicCreateView(CanCreateMixin, CreateView):
class
ForumTopicEditView
(
CanEditMixin
,
UpdateView
):
model
=
ForumTopic
fields
=
[
'
title'
,
'
forum'
]
fields
=
[
'forum'
]
pk_url_kwarg
=
"topic_id"
template_name
=
"core/edit.jinja"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment