Skip to content

Commit 5ff5acb

Browse files
committed
v.0.2.7-alpha1
1 parent 7a13ac3 commit 5ff5acb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+283
-186
lines changed
85 Bytes
Binary file not shown.
117 Bytes
Binary file not shown.
277 Bytes
Binary file not shown.

Clubs/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ class Meta:
3535

3636

3737
address = forms.CharField(widget=forms.Textarea(attrs={
38-
'class': 'form-control w-100 h-100 text-center',
38+
'class': 'form-control w-100 h-100 text-center ',
3939
'placeholder': 'Address...'
4040
}), required=False)
4141

4242
city = forms.CharField(widget=forms.TextInput(attrs={
43-
'class': 'form-control w-100 h-100 text-center',
43+
'class': 'form-control w-100 text-center',
4444
'placeholder': 'Postal code (optional), City'
4545
}), required=False)
4646

4747
phoneNumber = forms.CharField(widget=forms.TextInput(attrs={
4848
'class': 'form-control w-100 text-center',
49-
'placeholder': 'Contact phone number(s)'
49+
'placeholder': 'Phone number(s) 615 515 242, 555 555 555 '
5050
}), required=False)
5151

5252
email = forms.CharField(widget=forms.TextInput(attrs={

Clubs/templates/Clubs/Clubs_reloadContent.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% load static %}
2-
<div class="clubProfile clubContent position-relative overflow-hidden ">
2+
<div class="clubProfile clubContent position-relative overflow-hidden
3+
min-vh-100 ">
34

45
<div class="profileBackground w-100 ">
56
{% if success %}
@@ -11,13 +12,13 @@ <h4>Saved correctly</h4>
1112
</div>
1213
{% if authorized %}
1314
<form enctype="multipart/form-data"
14-
class="h-100"
15+
class="min-vh-100 h-100"
1516
hx-target=".Clubscontent"
1617
hx-post="."
1718
hx-trigger="change delay:600ms, submit">
1819
{{ csrf.token }}
1920

20-
<div class="row h-100 ">
21+
<div class="row h-100 min-vh-100 ">
2122

2223
<div class="col-md-6 d-flex align-items-center justify-content-start
2324
flex-column position-relative">
@@ -39,7 +40,7 @@ <h4>Saved correctly</h4>
3940
{# Save Info#}
4041
{# </button>#}
4142

42-
<div class="rightSideProfile col-md-6 pt-5 px-3 d-flex flex-column align-items-center">
43+
<div class="rightSideProfile col-md-6 px-3 d-flex flex-column align-items-center">
4344

4445
{% include 'Clubs/Clubs_reloadContent_rightColumn.html' %}
4546
{{ form.errors }}

Clubs/templates/Clubs/Clubs_reloadContent_rightColumn.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
<div class="profileBorderDark p-2 py-4 my-2 mx-1 d-flex justify-content-center ">
1+
<div class="profileBorderDark p-lg-2 py-4
2+
my-2 mx-1 d-flex justify-content-center ">
23

3-
<div class="formIcon d-flex align-items-center pb-1 position-relative w-75 pb-3">
4+
<div class="formIcon d-flex align-items-center pb-1
5+
position-relative w-100 pb-3">
46
<i class="bi bi-telephone-fill"></i>
57
{{ form.phoneNumber }}
68
</div>
79
</div>
810

9-
<div class="profileBorderDark p-2 w-75 pt-3 my-2 mx-1 d-flex justify-content-center ">
11+
<div class="profileBorderDark p-2 w-100 px-lg-5
12+
pt-3 my-2 mx-1 d-flex justify-content-center ">
1013
<div class="formIcon d-flex align-items-center pb-1 position-relative w-75 pb-3">
1114
<i class="bi bi-envelope-at-fill"></i>
1215
{{ form.email }}
@@ -26,7 +29,7 @@
2629
</div>
2730
</div>
2831

29-
<div class=" profileBorderDark p-2 my-2 mx-4 d-flex justify-content-center">
32+
<div class=" profileBorderDark p-2 my-2 py-md-3 mx-4 d-flex justify-content-center">
3033
<div class="formIcon position-relative d-flex align-items-center locationWrap w-100">
3134
<i class="bi bi-globe"></i>
3235
{{ form.website }}

Clubs/templates/Clubs/clubsSchedule.html

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2 class="text-center mb-3">Your Club Schedule</h2>
2222
<div class="overflow-auto outer calendar px-5">
2323

2424
{{ scheduleForm.errors }}
25-
<table >
25+
<table>
2626

2727
<tr>
2828
{% for day in days %}
@@ -38,38 +38,52 @@ <h2 class="text-center mb-3">Your Club Schedule</h2>
3838
</tr>
3939

4040
{% for timeHour, sessionsArray in hoursDict %}
41-
41+
{# backend provides dictionary, where key is hour, when trainings happen, and key is all info#}
4242
<tr>
4343
{% for day in days %}
4444
<td class="position-relative">
4545
<div class="tdWRAP w-100">
4646

4747

4848
{% for session in sessionsArray %}
49-
{% if session.0 == day %}
50-
5149

50+
{% if session.0 == day %}
51+
{# DAY #}
5252

53-
{# time #}
5453
{% for info in session.2 %}
5554
{% if info == 'GI' or info == 'NOGI' or info == 'GYM' %}
56-
<div class="{{info}}schedule trainIcon d-flex flex-column justify-content-center p-2">
55+
<div class="{{ info }}schedule trainIcon d-flex flex-column justify-content-center p-2">
5756
<img class="fitIMG "
5857
src="{% static 'BJJournal/img/' %}{{ info }}.png">
5958
{{ info }}
59+
{# TYPE#}
6060
</div>
6161

6262
<div class="d-flex justify-content-center align-items-center scheduleTD p-0 pt-1">
6363
<h1>{{ session.1 }}</h1>
64+
{# HOUR#}
6465
</div>
66+
67+
{% if authorized %}
68+
69+
<form class="deleteTD">
70+
{% csrf_token %}
71+
<span
72+
hx-delete="{% url 'removeTrainingSchedule' info session.0 session.1 club.id %}"
73+
hx-target="#Clubs_view"
74+
class="p-2 border-0">
75+
<i class="bi bi-x"></i>
76+
</span>
77+
</form>
78+
{% endif %}
79+
6580
{% else %}
6681
<p class="scheduleTD">
6782
{{ info }}
83+
{# DESCRIPTON #}
6884
</p>
6985
{% endif %}
70-
<div class="deleteTD">
71-
<i class="bi bi-x"></i>
72-
</div>
86+
7387

7488
{% endfor %}
7589
{% endif %}

Clubs/templates/Clubs/clubsScheduleModal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
<form class=""
6060
method="POST">
6161
{% csrf_token %}
62-
<button hx-post="{% url 'addTrainingModal' type day %}"
62+
<button hx-post="{% url 'clubSchedule' type day %}"
6363
hx-target="#Clubs_view"
6464
type="button"
65-
class="btn btn-success">save
65+
class="btn btn-success">Save
6666
{# data-dismiss="modal">Save#}
6767
</button>
6868
</form>

Clubs/templates/Clubs/clubs_reloadContent_leftColumn.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
{{ form.name }}
99
</div>
1010
</div>
11-
<div class="profileBorder px-5 py-4 mx-2 d-flex justify-content-center mt-lg-0">
11+
<div class="profileBorder px-lg-5 py-4 mx-2 d-flex justify-content-center mt-lg-0">
1212

1313
<div class="formIcon pb-1 w-100 pb-3">
1414
<i class="bi bi-calendar-event"></i>
1515
{{ form.estabilished }}
1616
</div>
1717
</div>
18-
<div class="profileBorder p-2 py-5 my-2 mx-1 mx-lg-4 d-flex justify-content-center h-50">
18+
<div class="profileBorder p-2 py-5 my-2
19+
mx-1 mx-lg-4 d-flex justify-content-center h-50">
1920
<div class="formIcon 1 w-100 pb-3">
2021
{# <i class="bi bi-braces"></i>#}
2122
<i class="bi bi-file-text-fill pt-1"></i>

Clubs/templates/Clubs/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
{% load static %}
33

44
{% block content %}
5-
<section id="Clubs_view" class="Clubscontent container-fluid w-100 h-100 px-0
6-
flex-column d-flex position-relative " >
5+
<section id="Clubs_view" class="Clubscontent container-fluid w-100
6+
h-100 px-0
7+
flex-column d-flex position-relative " >
78

89
{% include 'Clubs/Clubs_reloadContent.html' %}
910

Clubs/templates/Clubs/layout.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
{%include "common/navbar.html" %}
1515
{% include "Clubs/Clubs_leftSideMenu.html" %}
1616

17-
<div class = "leftNavPadding BJR container-fluid p-0 ">
17+
<div class = "leftNavPadding BJR container-fluid p-0 overflow-hidden ">
1818

19-
<div class ="p-0 row h-100" >
19+
<div class ="p-0 min-vh-100" >
2020

2121
{% if user.is_authenticated %}
2222

2323

2424

25-
<div class="myContent col position-relative p-0">
25+
<div class="myContent position-relative p-0">
2626
{% include "common/messages.html" %}
2727
{% block content %}
2828
{% endblock %}

Clubs/templates/Clubs/singleClubView.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ <h3 class="py-2"> {{ Club.description }} </h3>
5656

5757

5858
<div class="rightSideProfile px-0 col-md-6 d-flex flex-column
59-
align-items-center clubProfileInfo">
59+
align-items-around clubProfileInfo">
6060

61-
<div class="w-100 d-flex flex-column align-items-center adresSingleProfile">
61+
<div class="w-100 pt-md-5 d-flex flex-column align-items-center adresSingleProfile">
6262

6363
{% if Club.address %}
6464
<i class="bi bi-geo-alt-fill pt-2 text-white"></i>

Clubs/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
path('clubs/removemember/<int:id>', views.memberRemove, name="memberRemove"),
1515
path('clubs/trainings', views.clubTrainings, name="clubTrainings"),
1616
path('clubs/schedule', views_schedule.clubSchedule, name="clubSchedule"),
17+
path('clubs/schedule/delete/<str:type>/<str:day>/<str:hour>/<int:clubID>',
18+
views_schedule.removeTrainingSchedule, name="removeTrainingSchedule"),
1719
path('clubs/schedule/add/<str:type>/<str:day>', views_schedule.addTrainingModal, name="addTrainingModal"),
1820
# path('clubs/schedule/add/<str:type>/<str:day>', views_schedule.scheduleAddTraining, name="scheduleAddTraining"),
1921
path('clubs/list', views.clubsList, name="clubsList"),

Clubs/views_schedule.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
def clubSchedule(request):
1212
days = Schedule.days
13-
14-
if request.method == 'DELETE':
15-
pass
16-
1713
# userHasClub = False
1814
myClub = userClub(request.user.id)
1915
try:
@@ -35,6 +31,10 @@ def clubSchedule(request):
3531
hoursDict[timeHours].append([day, time, info])
3632
hoursDict = sorted(hoursDict.items())
3733

34+
authorized = False
35+
membership = UserMembership.objects.get(user_id=request.user.id)
36+
if membership.authorized == 'FULL':
37+
authorized = True
3838

3939
# for timeHour, sessionsArray in hoursDict:
4040
# print(timeHour, sessionsArray)
@@ -43,6 +43,7 @@ def clubSchedule(request):
4343
# 'userHasClub' : UserMembership.objects.get(user_id = request.user.id),
4444
# 'cal' : mark_safe(HTMLcal),
4545
# 'dayDict' : dayDict,
46+
'authorized' : authorized,
4647
'club' : userClub(request.user.id),
4748
'days' : days,
4849
'hoursDict' : hoursDict
@@ -52,7 +53,7 @@ def clubSchedule(request):
5253
return render(request, 'Clubs/clubsSchedule.html', context)
5354

5455

55-
def addTrainingModal(request, type, day ):
56+
def addTrainingModal(request, type, day):
5657
form = ScheduleForm()
5758
myClub = userClub(request.user.id)
5859

@@ -77,8 +78,18 @@ def addTrainingModal(request, type, day ):
7778
return render(request, 'Clubs/clubsScheduleModal.html', context)
7879

7980

80-
def scheduleAddTraining(request, type, day):
81-
pass
81+
def removeTrainingSchedule(request, type, day, hour, clubID):
82+
mySchedule = Schedule.objects.get(club_id=clubID)
83+
dayField = getattr(mySchedule, day)
84+
print(dayField.items())
85+
for hourDB, info in dayField.items():
86+
if hourDB == hour:
87+
del dayField[hourDB]
88+
mySchedule.save()
89+
break
90+
return HttpResponseRedirect(reverse('clubSchedule'))
91+
92+
8293
# def get_date(req_day):
8394
# if req_day:
8495
# year, month = (int(x) for x in req_day.split('-'))

Presentation/__init__.py

Whitespace-only changes.
166 Bytes
Binary file not shown.
207 Bytes
Binary file not shown.
457 Bytes
Binary file not shown.
204 Bytes
Binary file not shown.

Presentation/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

Presentation/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class PresentationConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'Presentation'

Presentation/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.

Presentation/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

Presentation/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

Presentation/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

account_register/static/account_register/css/base.css

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11

2-
body{
3-
font-family:'Lato', sans-serif !important;
4-
font-size:2.2vh;
5-
}
6-
nav{
7-
background: rgba(255,255,255,0.088);
8-
z-index:1;
9-
padding:0 25px;
10-
line-height: 45px;
11-
list-style: none;
12-
font-family: 'Roboto', serif;
13-
14-
15-
}
16-
nav a{
17-
padding:6px 8px 6px 16px;
18-
text-decoration: none;
19-
color: white;
20-
font-family: 'Roboto', sans-serif;
21-
22-
23-
}
242
nav a img{
253
width:60px;
264
}
27-
.inputsize{
28-
background:url("account_register/static/account_register/img/10.jpg");
29-
object-fit: contain;
30-
font-family: 'Roboto';
31-
}
32-
.banner-image{
33-
background: url("account_register/static/account_register/img/jess-bailey.jpg");
34-
background-size:cover;
35-
position:relative;
36-
}
5+
6+
377
.napis{
388
width:100%;
399
position:absolute;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading

0 commit comments

Comments
 (0)