Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
site-kwei
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediatek
site-kwei
Commits
6cd058ef
Commit
6cd058ef
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Added activity list
parent
5e4642f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
home/models.py
+2
-1
2 additions, 1 deletion
home/models.py
home/templates/activites.html
+10
-1
10 additions, 1 deletion
home/templates/activites.html
home/views.py
+4
-1
4 additions, 1 deletion
home/views.py
with
16 additions
and
3 deletions
home/models.py
+
2
−
1
View file @
6cd058ef
...
...
@@ -6,7 +6,8 @@ from django.utils.translation import gettext_lazy as _
class
InterludesActivity
(
models
.
Model
):
"""
une activité des interludes (i.e. JDR, murder)...
"""
title
=
models
.
CharField
(
"
Titre
"
,
max_length
=
200
)
duration
=
models
.
DurationField
(
"
Durée
"
)
duration
=
models
.
DurationField
(
"
Durée
"
,
help_text
=
"
format hh:mm:ss
"
)
display
=
models
.
BooleanField
(
"
Afficher cette activité
"
,
default
=
False
)
host_name
=
models
.
CharField
(
"
Nom de l
'
organisateur
"
,
max_length
=
50
)
host_email
=
models
.
EmailField
(
"
Email de l
'
organisateur
"
)
description
=
models
.
TextField
(
"
Description
"
,
max_length
=
2000
)
...
...
This diff is collapsed.
Click to expand it.
home/templates/activites.html
+
10
−
1
View file @
6cd058ef
...
...
@@ -3,6 +3,15 @@
{% block "content" %}
<h2>
Activités
</h2>
<p>
TODO :
liste des activités,
planning et infos si vous voulez proposez une activité
TODO : planning et infos si vous voulez proposez une activité
</p>
{% for activity in activities %}
<h3>
{{ activity.title }}
</h3>
<dl>
<dd>
Durée :
</dd><dt>
{{ activity.duration }}
</dt>
<dd>
MJ :
</dd><dt>
{{ activity.host_name }}
</dt>
<dd>
Description :
</dd><dt>
{{ activity.description }}
</dt>
</dl>
{% endfor %}
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
home/views.py
+
4
−
1
View file @
6cd058ef
...
...
@@ -2,8 +2,11 @@ from django.contrib.sitemaps import Sitemap
from
django.shortcuts
import
render
from
django.urls
import
reverse
from
home.models
import
InterludesActivity
def
static_view
(
request
,
slug
):
return
render
(
request
,
slug
+
'
.html
'
,
{
'
slug
'
:
slug
})
activities
=
InterludesActivity
.
objects
.
filter
(
display
=
True
)
return
render
(
request
,
slug
+
'
.html
'
,
{
'
slug
'
:
slug
,
'
activities
'
:
activities
})
class
StaticViewSitemap
(
Sitemap
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment