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
aeltheos
site-kwei
Commits
ce2c2358
Commit
ce2c2358
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
More detailed activities and better display
parent
040a38ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
home/models.py
+18
-0
18 additions, 0 deletions
home/models.py
home/static/css/style.css
+2
-4
2 additions, 4 deletions
home/static/css/style.css
home/templates/activites.html
+6
-1
6 additions, 1 deletion
home/templates/activites.html
home/views.py
+1
-1
1 addition, 1 deletion
home/views.py
with
27 additions
and
6 deletions
home/models.py
+
18
−
0
View file @
ce2c2358
...
...
@@ -7,11 +7,28 @@ class InterludesActivity(models.Model):
"""
une activité des interludes (i.e. JDR, murder)...
"""
title
=
models
.
CharField
(
"
Titre
"
,
max_length
=
200
)
duration
=
models
.
DurationField
(
"
Durée
"
,
help_text
=
"
format hh:mm:ss
"
)
max_participants
=
models
.
PositiveIntegerField
(
"
Nombre maximum de participants
"
,
help_text
=
"
0 pour illimité
"
)
min_paricipants
=
models
.
PositiveIntegerField
(
"
Nombre minimum de participants
"
)
display
=
models
.
BooleanField
(
"
Afficher cette activité
"
,
default
=
False
)
must_book
=
models
.
BooleanField
(
"
Nécessite inscription
"
,
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
)
@property
def
nb_participants
(
self
)
->
str
:
if
self
.
max_participants
==
0
:
return
"
Illimité
"
return
"
{} - {}
"
.
format
(
self
.
min_paricipants
,
self
.
max_participants
)
def
__str__
(
self
):
return
self
.
title
class
InterludesParticipant
(
models
.
Model
):
"""
un participant aux interludes
"""
...
...
@@ -37,3 +54,4 @@ class ActivityList(models.Model):
class
Meta
:
# le couple participant, priority est unique
unique_together
=
((
"
priority
"
,
"
participant
"
))
ordering
=
(
"
participant
"
,
"
priority
"
)
This diff is collapsed.
Click to expand it.
home/static/css/style.css
+
2
−
4
View file @
ce2c2358
...
...
@@ -147,18 +147,16 @@ main a:link {
dl
{
list-style
:
none
;
display
:
grid
;
grid-template-columns
:
1
fr
5
fr
;
grid-template-columns
:
1
fr
4
fr
;
}
dl
dt
{
grid-column
:
1
/
span
1
;
justify-self
:
end
;
text-align
:
right
;
margin
:
5px
10px
;
font-weight
:
bold
;
align-self
:
center
;
}
dl
dd
{
margin
:
5px
5
px
;
margin
:
0
10
px
;
justify-self
:
start
;
text-align
:
left
;
}
...
...
This diff is collapsed.
Click to expand it.
home/templates/activites.html
+
6
−
1
View file @
ce2c2358
...
...
@@ -2,6 +2,9 @@
{% block "content" %}
<h2>
Activités
</h2>
<p>
Durant tout l'événement, des jeux seront en libre-service et des tables disponibles pour jouer.
Certaines activités (JDRs, murders...) ne pourront se faire qu'avec inscription au vue d'un nombre de places limité.
</p>
<p>
TODO : planning et infos si vous voulez proposez une activité
</p>
...
...
@@ -11,7 +14,9 @@
<dl>
<dt>
Durée :
</dt><dd>
{{ activity.duration }}
</dd>
<dt>
MJ :
</dt><dd>
{{ activity.host_name }}
</dd>
<dt>
Description :
</dt><dd>
{{ activity.description }}
</dd>
<dt>
Nombre de places :
</dt><dd>
{{ activity.nb_participants }}
</dd>
<dt>
Sur inscription :
</dt><dd>
{% if activity.must_book %} Oui {% else %} Non {% endif %}
</dd>
<dt>
Description :
</dt><dd>
{{ activity.description|linebreaksbr }}
</dd>
</dl>
{% endfor %}
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
home/views.py
+
1
−
1
View file @
ce2c2358
...
...
@@ -5,7 +5,7 @@ from django.urls import reverse
from
home.models
import
InterludesActivity
def
static_view
(
request
,
slug
):
activities
=
InterludesActivity
.
objects
.
filter
(
display
=
True
)
activities
=
InterludesActivity
.
objects
.
filter
(
display
=
True
)
.
order_by
(
"
title
"
)
return
render
(
request
,
slug
+
'
.html
'
,
{
'
slug
'
:
slug
,
'
activities
'
:
activities
})
...
...
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