Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
ap4-HW-64-issatayev-adlet
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Isataev Adlet
ap4-HW-64-issatayev-adlet
Commits
6aad1dee
Commit
6aad1dee
authored
Nov 04, 2021
by
Isataev Adlet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Подправил формат отображения времени в шаблонах. Сделал ссылками профилей в списке участников
parent
3d88a1b8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
13 deletions
+6
-13
settings.py
source/speed_dating/settings.py
+1
-1
forms.py
source/webapp/forms.py
+1
-1
all_user_in_event.html
source/webapp/templates/all_user_in_event.html
+1
-1
event_detail.html
source/webapp/templates/event_detail.html
+1
-1
event_list.html
source/webapp/templates/event_list.html
+1
-1
views.py
source/webapp/views.py
+1
-8
No files found.
source/speed_dating/settings.py
View file @
6aad1dee
...
...
@@ -108,7 +108,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'Asia/
Dhaka
'
TIME_ZONE
=
'Asia/
Almaty
'
USE_I18N
=
True
...
...
source/webapp/forms.py
View file @
6aad1dee
...
...
@@ -3,7 +3,7 @@ from webapp.models import Event
class
EventForm
(
forms
.
ModelForm
):
date
=
forms
.
DateTimeField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'placeholder'
:
'YYYY-MM-DD HH-MM-SS'
}))
date
=
forms
.
DateTimeField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'placeholder'
:
'YYYY-MM-DD HH-MM-SS'
,
'type'
:
'datetime-local'
}))
class
Meta
:
model
=
Event
...
...
source/webapp/templates/all_user_in_event.html
View file @
6aad1dee
...
...
@@ -6,7 +6,7 @@
<h1>
Список участников
</h1>
<p>
{% for u in event.users.all %}
<a
href=
"{% url "
profile
"
event
.
pk
%}"
>
{{ u }}
</a>
<a
href=
"{% url "
profile
"
u
.
pk
%}"
>
{{ u }}
</a>
<br>
{% endfor %}
</p>
...
...
source/webapp/templates/event_detail.html
View file @
6aad1dee
...
...
@@ -14,7 +14,7 @@
{{ event.place.description }}
</div>
</div>
<p
class=
"mt-5"
>
{{ event.date|date:"M d Y -
h:m
" }}
</p>
<p
class=
"mt-5"
>
{{ event.date|date:"M d Y -
H:i
" }}
</p>
{% if perms.webapp.change_event %}
<a
href=
"{% url "
update_events
"
event
.
pk
%}"
class=
"btn btn-info"
>
Редактировать
</a>
...
...
source/webapp/templates/event_list.html
View file @
6aad1dee
...
...
@@ -8,7 +8,7 @@
<div
class=
"mt-5"
>
<a
href=
"{% url 'detail_events' event.pk %}"
>
{{ event.place }} - {{ event.place.address }}
</a>
<br>
<p>
{{ event.date|date:"M d Y -
h:m
" }}
</p>
<p>
{{ event.date|date:"M d Y -
H:i
" }}
</p>
<hr>
</div>
{% endfor %}
...
...
source/webapp/views.py
View file @
6aad1dee
...
...
@@ -3,7 +3,6 @@ from django.urls import reverse, reverse_lazy
from
django.views
import
View
from
django.views.generic
import
CreateView
,
DetailView
,
UpdateView
,
DeleteView
from
django.contrib.auth.mixins
import
PermissionRequiredMixin
,
UserPassesTestMixin
import
datetime
from
webapp.forms
import
EventForm
from
webapp.models
import
Event
...
...
@@ -15,13 +14,7 @@ def index_view(request):
class
EventView
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
events
=
Event
.
objects
.
all
()
# now = datetime.datetime.now(datetime.timezone.utc)
# for event in events:
# print(event.date)
# print(now)
# if event.date < now:
# event.delete()
events
=
Event
.
objects
.
all
()
.
order_by
(
"-date"
)
context
=
{
"events"
:
events
}
return
render
(
request
,
"event_list.html"
,
context
)
...
...
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