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
6a815e5a
Commit
6a815e5a
authored
Apr 12, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small news improvement and bug fixes
parent
44dacce9
Pipeline
#893
failed with stage
in 55 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
12 deletions
+7
-12
com/models.py
com/models.py
+1
-0
com/templates/com/news_edit.jinja
com/templates/com/news_edit.jinja
+0
-10
com/templates/com/news_list.jinja
com/templates/com/news_list.jinja
+4
-2
com/views.py
com/views.py
+2
-0
No files found.
com/models.py
View file @
6a815e5a
...
...
@@ -4,6 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.core.urlresolvers
import
reverse_lazy
,
reverse
from
django.conf
import
settings
from
django.core.mail
import
EmailMultiAlternatives
from
django.core.exceptions
import
ValidationError
from
core.models
import
User
,
Preferences
from
club.models
import
Club
...
...
com/templates/com/news_edit.jinja
View file @
6a815e5a
...
...
@@ -11,16 +11,6 @@
{%
block
content
%}
{%
if
'preview'
in
request.POST.keys
()
%}
<section
class=
"news_event"
>
<h4>
<a
href=
"#"
>
{{
form.instance.title
}}
</a></h4>
<p
class=
"date"
>
<span>
{{
form.instance.dates.first
()
.
start_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
-
<span>
{{
form.instance.dates.first
()
.
end_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
</p>
<p><a
href=
"#"
>
{{
form.instance.club
or
"Club"
}}
</a></p>
<p>
{{
form.instance.summary
|
markdown
}}
</p>
</section>
<hr>
<section
class=
"news_event"
>
<h4>
{{
form.instance.title
}}
</h4>
<p
class=
"date"
>
...
...
com/templates/com/news_list.jinja
View file @
6a815e5a
...
...
@@ -54,8 +54,10 @@ section.news_event:nth-of-type(even) {
<section
class=
"news_event"
>
<h4>
<a
href=
"
{{
url
(
'com:news_detail'
,
news_id
=
news.id
)
}}
"
>
{{
news.title
}}
</a></h4>
<p
class=
"date"
>
<span>
{{
news.dates.first
()
.
start_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
-
<span>
{{
news.dates.first
()
.
end_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
<span>
{{
news.dates.first
()
.
start_date
|
localtime
|
date
(
DATETIME_FORMAT
)
}}
{{
news.dates.first
()
.
start_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
-
<span>
{{
news.dates.first
()
.
end_date
|
localtime
|
date
(
DATETIME_FORMAT
)
}}
{{
news.dates.first
()
.
end_date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
</span>
</p>
<p><a
href=
"
{{
news.club.get_absolute_url
()
}}
"
>
{{
news.club
}}
</a></p>
<p>
{{
news.summary
|
markdown
}}
</p>
...
...
com/views.py
View file @
6a815e5a
...
...
@@ -107,6 +107,8 @@ class NewsForm(forms.ModelForm):
self
.
add_error
(
'start_date'
,
ValidationError
(
_
(
"This field is required."
)))
if
not
self
.
cleaned_data
[
'end_date'
]:
self
.
add_error
(
'end_date'
,
ValidationError
(
_
(
"This field is required."
)))
if
self
.
cleaned_data
[
'start_date'
]
>
self
.
cleaned_data
[
'end_date'
]:
self
.
add_error
(
'end_date'
,
ValidationError
(
_
(
"You crazy? You can not finish an event before starting it."
)))
if
self
.
cleaned_data
[
'type'
]
==
"WEEKLY"
and
not
self
.
cleaned_data
[
'until'
]:
self
.
add_error
(
'until'
,
ValidationError
(
_
(
"This field is required."
)))
return
self
.
cleaned_data
...
...
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