Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
c4facf33
Commit
c4facf33
authored
Dec 26, 2020
by
yourcoke
Browse files
Options
Downloads
Patches
Plain Diff
Frontend Implementation
parent
32d89066
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backoffice/templates/backoffice/assembly_event.html
+25
-0
25 additions, 0 deletions
src/backoffice/templates/backoffice/assembly_event.html
src/backoffice/urls.py
+1
-1
1 addition, 1 deletion
src/backoffice/urls.py
src/backoffice/views/events.py
+9
-2
9 additions, 2 deletions
src/backoffice/views/events.py
with
35 additions
and
3 deletions
src/backoffice/templates/backoffice/assembly_event.html
+
25
−
0
View file @
c4facf33
{% extends 'backoffice/base.html' %}
{% load bootstrap4 %}
{% load widget_tweaks %}
{% load i18n %}
{% block title %}
...
...
@@ -9,6 +10,30 @@
{% block content %}
{% include "backoffice/assembly_edit_header.html" %}
<div
class=
"row mb-3"
>
<div
class=
"col-md-12"
>
<div
class=
"card border-secondary"
>
<div
class=
"card-header bg-default"
>
{% trans 'Event__participants-title' %}
</div>
<div
class=
"card-body"
>
<h3>
{% trans 'Event__participants' %}
</h3>
<ul>
{% for participant in event.participants.all %}
<li>
{{ participant }}
</li>
{% endfor %}
</ul>
<h3>
{% trans 'Event__speaker-assign-title' %}
</h3>
<form
class=
"form-inline"
action=
"{% url 'backoffice:assembly-event-assign-speaker' assembly=assembly.pk pk=event.pk %}"
method=
"POST"
>
{% csrf_token %}
<label
class=
"sr-only"
for=
"nickname"
>
Name
</label>
{% render_field assign_form.nickname class+="form-control mb-2 mr-sm-2" placeholder="Nickname" %}
<button
type=
"submit"
class=
"btn btn-secondary mb-2"
>
{% trans 'Event__speaker-assign-btn' %}
</button>
</form>
</div>
</div>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"col-md-12"
>
<form
action=
""
method=
"POST"
enctype=
"multipart/form-data"
>
{% csrf_token %}
...
...
This diff is collapsed.
Click to expand it.
src/backoffice/urls.py
+
1
−
1
View file @
c4facf33
...
...
@@ -64,7 +64,7 @@ urlpatterns = [
path
(
'
assembly/<uuid:assembly>/events
'
,
events
.
AssemblyEventsView
.
as_view
(),
name
=
'
assembly-events
'
),
path
(
'
assembly/<uuid:assembly>/e/<uuid:pk>/
'
,
events
.
AssemblyEventView
.
as_view
(),
name
=
'
assembly-event
'
),
path
(
'
assembly/<uuid:assembly>/e/<uuid:pk>/remove
'
,
events
.
AssemblyRemoveEventView
.
as_view
(),
name
=
'
assembly-event-remove
'
),
path
(
'
assembly/<uuid:assembly>/e/<uuid:pk>/assign/speaker
'
,
events
.
AssignRoleView
.
as_view
(),
name
=
'
assembly-event-assign-speaker
'
),
path
(
'
assembly/<uuid:assembly>/e/<uuid:pk>/assign/speaker
'
,
events
.
AssignRoleView
.
as_view
(),
{
'
role
'
:
'
speaker
'
,},
name
=
'
assembly-event-assign-speaker
'
),
path
(
'
assembly/<uuid:assembly>/new_room
'
,
assemblies
.
CreateRoomView
.
as_view
(),
name
=
'
assembly-create-room
'
),
path
(
'
assembly/<uuid:assembly>/new_project
'
,
assemblies
.
CreateProjectView
.
as_view
(),
name
=
'
assembly-create-project
'
),
...
...
This diff is collapsed.
Click to expand it.
src/backoffice/views/events.py
+
9
−
2
View file @
c4facf33
...
...
@@ -116,6 +116,9 @@ class AssemblyCreateEventView(AssemblyMixin, CreateView):
class
AssignRoleView
(
AssemblyMixin
,
FormView
):
assembly_url_param
=
'
assembly
'
assembly_management
=
True
form_class
=
AssignRoleForm
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -136,10 +139,14 @@ class AssignRoleView(AssemblyMixin, FormView):
user
=
get_object_or_404
(
PlatformUser
,
is_active
=
True
,
username
=
data
[
'
nickname
'
])
event
=
get_object_or_404
(
Event
,
id
=
event_id
)
participant
=
EventParticipant
(
role
=
role
,
event
=
event
,
participant
=
user
)
# I guess this is correct.
participant
.
is_accepted
=
True
participant
.
is_public
=
True
participant
.
save
()
messages
.
success
(
self
.
request
,
_
(
'
Event__Role-award-to
'
)
+
str
(
user
))
logger
.
info
(
f
'
assigned role
{
role
}
to
{
user
}
by
{
self
.
request
.
user
}
for
{
event
}
'
)
return
redirect
(
'
backoffice:assembly-event
s
'
,
assembly
=
self
.
assembly
.
pk
,
pk
=
self
.
event_id
)
return
redirect
(
'
backoffice:assembly-event
'
,
assembly
=
self
.
assembly
.
pk
,
pk
=
event_id
)
except
PlatformUser
.
DoesNotExist
:
messages
.
error
(
self
.
request
,
_
(
'
404__User Not Found:
'
)
+
data
[
'
nickname
'
])
return
redirect
(
'
backoffice:assembly-events
'
,
assembly
=
self
.
assembly
.
pk
,
pk
=
self
.
event_id
)
\ No newline at end of file
return
redirect
(
'
backoffice:assembly-event
'
,
assembly
=
self
.
assembly
.
pk
,
pk
=
event_id
)
\ No newline at end of file
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
sign in
to comment