Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
ce46a9d9
Commit
ce46a9d9
authored
Jun 10, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some small clean up and refactoring
Signed-off-by:
Skia
<
skia@libskia.so
>
parent
2925cde8
Pipeline
#1048
failed with stage
in 4 minutes and 40 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
44 deletions
+38
-44
core/views/forms.py
core/views/forms.py
+5
-1
forum/templates/forum/reply.jinja
forum/templates/forum/reply.jinja
+1
-4
forum/views.py
forum/views.py
+0
-7
locale/fr/LC_MESSAGES/django.po
locale/fr/LC_MESSAGES/django.po
+32
-32
No files found.
core/views/forms.py
View file @
ce46a9d9
...
...
@@ -24,6 +24,7 @@
from
django.contrib.auth.forms
import
UserCreationForm
,
AuthenticationForm
,
UserChangeForm
from
django
import
forms
from
django.conf
import
settings
from
django.db
import
transaction
from
django.core.exceptions
import
ValidationError
from
django.contrib.auth
import
logout
,
login
,
authenticate
...
...
@@ -75,7 +76,10 @@ class SelectDate(DateInput):
class
MarkdownInput
(
Textarea
):
def
render
(
self
,
name
,
value
,
attrs
=
None
):
output
=
'<div class="markdown_editor">%(content)s</div>'
%
{
output
=
'<p><a href="%(syntax_url)s">%(help_text)s</a></p>'
\
'<div class="markdown_editor">%(content)s</div>'
%
{
'syntax_url'
:
Page
.
get_page_by_full_name
(
settings
.
SITH_CORE_PAGE_SYNTAX
),
'help_text'
:
_
(
"Help on the syntax"
),
'content'
:
super
(
MarkdownInput
,
self
).
render
(
name
,
value
,
attrs
),
}
return
output
...
...
forum/templates/forum/reply.jinja
View file @
ce46a9d9
...
...
@@ -28,10 +28,7 @@
{%
endif
%}
<form
action=
""
method=
"post"
enctype=
"multipart/form-data"
>
{%
csrf_token
%}
<p>
{{
form.title.errors
}}
<label
for=
"
{{
form.title.name
}}
"
>
{{
form.title.label
}}
</label>
{{
form.title
}}
</p>
<p>
{{
form.message.errors
}}
<label
for=
"
{{
form.message.name
}}
"
>
{{
form.message.label
}}
</label>
</p>
<p><a
href=
"
{{
syntax_help_page.get_absolute_url
()
}}
"
>
{%
trans
%}
Help on the syntax
{%
endtrans
%}
</a>
{{
form.message
}}
{{
form.as_p
()
}}
<p><input
type=
"button"
value=
"
{%
trans
%}
Preview
{%
endtrans
%}
"
onclick=
"javascript:make_preview();"
/></p>
<p><input
type=
"submit"
value=
"
{%
trans
%}
Save
{%
endtrans
%}
"
/></p>
</form>
...
...
forum/views.py
View file @
ce46a9d9
...
...
@@ -166,11 +166,6 @@ class ForumTopicCreateView(CanCreateMixin, CreateView):
form
.
instance
.
author
=
self
.
request
.
user
return
super
(
ForumTopicCreateView
,
self
).
form_valid
(
form
)
def
get_context_data
(
self
,
**
kwargs
):
kwargs
=
super
(
ForumTopicCreateView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'syntax_help_page'
]
=
Page
.
get_page_by_full_name
(
settings
.
SITH_CORE_PAGE_SYNTAX
)
return
kwargs
class
ForumTopicEditView
(
CanEditMixin
,
UpdateView
):
model
=
ForumTopic
fields
=
[
'forum'
]
...
...
@@ -225,7 +220,6 @@ class ForumMessageEditView(CanEditMixin, UpdateView):
def
get_context_data
(
self
,
**
kwargs
):
kwargs
=
super
(
ForumMessageEditView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'topic'
]
=
self
.
object
.
topic
kwargs
[
'syntax_help_page'
]
=
Page
.
get_page_by_full_name
(
settings
.
SITH_CORE_PAGE_SYNTAX
)
return
kwargs
class
ForumMessageDeleteView
(
SingleObjectMixin
,
RedirectView
):
...
...
@@ -282,6 +276,5 @@ class ForumMessageCreateView(CanCreateMixin, CreateView):
def
get_context_data
(
self
,
**
kwargs
):
kwargs
=
super
(
ForumMessageCreateView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'topic'
]
=
self
.
topic
kwargs
[
'syntax_help_page'
]
=
Page
.
get_page_by_full_name
(
settings
.
SITH_CORE_PAGE_SYNTAX
)
return
kwargs
locale/fr/LC_MESSAGES/django.po
View file @
ce46a9d9
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2017-06-10 19:
0
5+0200
\n
"
"POT-Creation-Date: 2017-06-10 19:5
6
+0200
\n
"
"PO-Revision-Date: 2016-07-18
\n
"
"Last-Translator: Skia <skia@libskia.so>
\n
"
"Language-Team: AE info <ae.info@utbm.fr>
\n
"
...
...
@@ -698,7 +698,7 @@ msgstr "Opération liée : "
#: core/templates/core/user_preferences.jinja:12
#: core/templates/core/user_preferences.jinja:19
#: counter/templates/counter/cash_register_summary.jinja:22
#: forum/templates/forum/reply.jinja:3
8
#: forum/templates/forum/reply.jinja:3
3
#: subscription/templates/subscription/subscription.jinja:24
#: trombi/templates/trombi/comment.jinja:26
#: trombi/templates/trombi/user_tools.jinja:13
...
...
@@ -905,7 +905,7 @@ msgid "Mark as old"
msgstr
"Marquer comme ancien"
#: club/templates/club/club_members.jinja:30
#: core/templates/core/file_detail.jinja:19 core/views/forms.py:2
29
#: core/templates/core/file_detail.jinja:19 core/views/forms.py:2
40
#: launderette/views.py:178
msgid
"Add"
msgstr
"Ajouter"
...
...
@@ -1060,7 +1060,7 @@ msgstr "Outils"
msgid
"Props"
msgstr
"Propriétés"
#: club/views.py:131 core/views/forms.py:2
30
counter/views.py:91
#: club/views.py:131 core/views/forms.py:2
41
counter/views.py:91
msgid
"Select user"
msgstr
"Choisir un utilisateur"
...
...
@@ -1213,7 +1213,7 @@ msgstr "Type"
#: com/templates/com/weekmail.jinja:19 com/templates/com/weekmail.jinja:48
#: core/templates/core/base.jinja:243 forum/templates/forum/forum.jinja:27
#: forum/templates/forum/forum.jinja:46 forum/templates/forum/main.jinja:25
#: forum/views.py:14
5
#: forum/views.py:14
9
msgid
"Title"
msgstr
"Titre"
...
...
@@ -1299,7 +1299,7 @@ msgstr ""
#: com/templates/com/news_edit.jinja:55 com/templates/com/weekmail.jinja:10
#: core/templates/core/pagerev_edit.jinja:25
#: forum/templates/forum/reply.jinja:3
7
#: forum/templates/forum/reply.jinja:3
2
msgid
"Preview"
msgstr
"Prévisualiser"
...
...
@@ -1582,7 +1582,7 @@ msgstr "-"
msgid
"XS"
msgstr
"XS"
#: core/models.py:162 core/templates/core/base.jinja:25
7
#: core/models.py:162 core/templates/core/base.jinja:25
6
msgid
"S"
msgstr
"S"
...
...
@@ -1688,7 +1688,7 @@ msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/templates/core/user_edit.jinja:17
#: election/templates/election/election_detail.jinja:317
#: forum/templates/forum/macros.jinja:93 forum/templates/forum/macros.jinja:95
#: forum/templates/forum/reply.jinja:
4
3 forum/templates/forum/reply.jinja:4
5
#: forum/templates/forum/reply.jinja:3
8
forum/templates/forum/reply.jinja:4
0
#: trombi/templates/trombi/user_tools.jinja:43
msgid
"Profile"
msgstr
"Profil"
...
...
@@ -1968,31 +1968,31 @@ msgstr "https://chemin/vers/image.gif"
msgid
"alternative text"
msgstr
"texte alternatif"
#: core/templates/core/base.jinja:25
3
#: core/templates/core/base.jinja:25
2
msgid
"Image"
msgstr
"Image"
#: core/templates/core/base.jinja:25
4
#: core/templates/core/base.jinja:25
3
msgid
"Link"
msgstr
"Lien"
#: core/templates/core/base.jinja:25
5
#: core/templates/core/base.jinja:25
4
msgid
"sup"
msgstr
"exp"
#: core/templates/core/base.jinja:25
6
#: core/templates/core/base.jinja:25
5
msgid
"sub"
msgstr
"ind"
#: core/templates/core/base.jinja:25
8
#: core/templates/core/base.jinja:25
7
msgid
"U"
msgstr
"S"
#: core/templates/core/base.jinja:25
9
#: core/templates/core/base.jinja:25
8
msgid
"I"
msgstr
"I"
#: core/templates/core/base.jinja:2
60
#: core/templates/core/base.jinja:2
59
msgid
"B"
msgstr
"G"
...
...
@@ -2785,7 +2785,7 @@ msgstr "Ajouter un nouveau dossier"
msgid
"Error creating folder %(folder_name)s: %(msg)s"
msgstr
"Erreur de création du dossier %(folder_name)s : %(msg)s"
#: core/views/files.py:97 core/views/forms.py:2
07
core/views/forms.py:2
11
#: core/views/files.py:97 core/views/forms.py:2
18
core/views/forms.py:2
22
#: sas/views.py:77
#, python-format
msgid
"Error uploading file %(file_name)s: %(msg)s"
...
...
@@ -2795,19 +2795,23 @@ msgstr "Erreur d'envoi du fichier %(file_name)s : %(msg)s"
msgid
"Apply rights recursively"
msgstr
"Appliquer les droits récursivement"
#: core/views/forms.py:84 core/views/forms.py:87
#: core/views/forms.py:82
msgid
"Help on the syntax"
msgstr
"Aide sur la syntaxe"
#: core/views/forms.py:95 core/views/forms.py:98
msgid
"Choose file"
msgstr
"Choisir un fichier"
#: core/views/forms.py:9
8
core/views/forms.py:1
0
1
#: core/views/forms.py:
10
9 core/views/forms.py:11
2
msgid
"Choose user"
msgstr
"Choisir un utilisateur"
#: core/views/forms.py:1
2
3
#: core/views/forms.py:13
4
msgid
"Username, email, or account number"
msgstr
"Nom d'utilisateur, email, ou numéro de compte AE"
#: core/views/forms.py:16
5
#: core/views/forms.py:1
7
6
msgid
""
"Profile: you need to be visible on the picture, in order to be recognized (e."
"g. by the barmen)"
...
...
@@ -2815,23 +2819,23 @@ msgstr ""
"Photo de profil: vous devez être visible sur la photo afin d'être reconnu "
"(par exemple par les barmen)"
#: core/views/forms.py:1
66
#: core/views/forms.py:1
77
msgid
"Avatar: used on the forum"
msgstr
"Avatar : utilisé sur le forum"
#: core/views/forms.py:1
6
7
#: core/views/forms.py:17
8
msgid
"Scrub: let other know how your scrub looks like!"
msgstr
"Blouse : montrez aux autres à quoi ressemble votre blouse !"
#: core/views/forms.py:2
1
2
#: core/views/forms.py:22
3
msgid
"Bad image format, only jpeg, png, and gif are accepted"
msgstr
"Mauvais format d'image, seuls les jpeg, png, et gif sont acceptés"
#: core/views/forms.py:2
29
#: core/views/forms.py:2
40
msgid
"Godfather"
msgstr
"Parrain"
#: core/views/forms.py:2
29
#: core/views/forms.py:2
40
msgid
"Godchild"
msgstr
"Fillot"
...
...
@@ -3710,7 +3714,7 @@ msgid "New forum"
msgstr
"Nouveau forum"
#: forum/templates/forum/forum.jinja:22 forum/templates/forum/reply.jinja:8
#: forum/templates/forum/reply.jinja:2
6
#: forum/templates/forum/reply.jinja:2
7
msgid
"New topic"
msgstr
"Nouveau sujet"
...
...
@@ -3761,15 +3765,11 @@ msgstr "Voir les derniers messages non lus"
msgid
"Reply"
msgstr
"Répondre"
#: forum/templates/forum/reply.jinja:32
msgid
"Help on the syntax"
msgstr
"Aide sur la syntaxe"
#: forum/views.py:99
#: forum/views.py:100
msgid
"Apply rights and club owner recursively"
msgstr
"Appliquer les droits et le club propriétaire récursivement"
#: forum/views.py:2
59
#: forum/views.py:2
62
#, python-format
msgid
"%(author)s said"
msgstr
"Citation de %(author)s"
...
...
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