Skip to content

Commit

Permalink
v.0.2.7-alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
g4n3sha5 committed Mar 2, 2023
1 parent 7a13ac3 commit 5ff5acb
Show file tree
Hide file tree
Showing 51 changed files with 283 additions and 186 deletions.
Binary file modified Clubs/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified Clubs/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified Clubs/__pycache__/views_schedule.cpython-310.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions Clubs/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ class Meta:


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

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

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

email = forms.CharField(widget=forms.TextInput(attrs={
Expand Down
9 changes: 5 additions & 4 deletions Clubs/templates/Clubs/Clubs_reloadContent.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load static %}
<div class="clubProfile clubContent position-relative overflow-hidden ">
<div class="clubProfile clubContent position-relative overflow-hidden
min-vh-100 ">

<div class="profileBackground w-100 ">
{% if success %}
Expand All @@ -11,13 +12,13 @@ <h4>Saved correctly</h4>
</div>
{% if authorized %}
<form enctype="multipart/form-data"
class="h-100"
class="min-vh-100 h-100"
hx-target=".Clubscontent"
hx-post="."
hx-trigger="change delay:600ms, submit">
{{ csrf.token }}

<div class="row h-100 ">
<div class="row h-100 min-vh-100 ">

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

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

{% include 'Clubs/Clubs_reloadContent_rightColumn.html' %}
{{ form.errors }}
Expand Down
11 changes: 7 additions & 4 deletions Clubs/templates/Clubs/Clubs_reloadContent_rightColumn.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<div class="profileBorderDark p-2 py-4 my-2 mx-1 d-flex justify-content-center ">
<div class="profileBorderDark p-lg-2 py-4
my-2 mx-1 d-flex justify-content-center ">

<div class="formIcon d-flex align-items-center pb-1 position-relative w-75 pb-3">
<div class="formIcon d-flex align-items-center pb-1
position-relative w-100 pb-3">
<i class="bi bi-telephone-fill"></i>
{{ form.phoneNumber }}
</div>
</div>

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

<div class=" profileBorderDark p-2 my-2 mx-4 d-flex justify-content-center">
<div class=" profileBorderDark p-2 my-2 py-md-3 mx-4 d-flex justify-content-center">
<div class="formIcon position-relative d-flex align-items-center locationWrap w-100">
<i class="bi bi-globe"></i>
{{ form.website }}
Expand Down
32 changes: 23 additions & 9 deletions Clubs/templates/Clubs/clubsSchedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="text-center mb-3">Your Club Schedule</h2>
<div class="overflow-auto outer calendar px-5">

{{ scheduleForm.errors }}
<table >
<table>

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

{% for timeHour, sessionsArray in hoursDict %}

{# backend provides dictionary, where key is hour, when trainings happen, and key is all info#}
<tr>
{% for day in days %}
<td class="position-relative">
<div class="tdWRAP w-100">


{% for session in sessionsArray %}
{% if session.0 == day %}


{% if session.0 == day %}
{# DAY #}

{# time #}
{% for info in session.2 %}
{% if info == 'GI' or info == 'NOGI' or info == 'GYM' %}
<div class="{{info}}schedule trainIcon d-flex flex-column justify-content-center p-2">
<div class="{{ info }}schedule trainIcon d-flex flex-column justify-content-center p-2">
<img class="fitIMG "
src="{% static 'BJJournal/img/' %}{{ info }}.png">
{{ info }}
{# TYPE#}
</div>

<div class="d-flex justify-content-center align-items-center scheduleTD p-0 pt-1">
<h1>{{ session.1 }}</h1>
{# HOUR#}
</div>

{% if authorized %}

<form class="deleteTD">
{% csrf_token %}
<span
hx-delete="{% url 'removeTrainingSchedule' info session.0 session.1 club.id %}"
hx-target="#Clubs_view"
class="p-2 border-0">
<i class="bi bi-x"></i>
</span>
</form>
{% endif %}

{% else %}
<p class="scheduleTD">
{{ info }}
{# DESCRIPTON #}
</p>
{% endif %}
<div class="deleteTD">
<i class="bi bi-x"></i>
</div>


{% endfor %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions Clubs/templates/Clubs/clubsScheduleModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
<form class=""
method="POST">
{% csrf_token %}
<button hx-post="{% url 'addTrainingModal' type day %}"
<button hx-post="{% url 'clubSchedule' type day %}"
hx-target="#Clubs_view"
type="button"
class="btn btn-success">save
class="btn btn-success">Save
{# data-dismiss="modal">Save#}
</button>
</form>
Expand Down
5 changes: 3 additions & 2 deletions Clubs/templates/Clubs/clubs_reloadContent_leftColumn.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
{{ form.name }}
</div>
</div>
<div class="profileBorder px-5 py-4 mx-2 d-flex justify-content-center mt-lg-0">
<div class="profileBorder px-lg-5 py-4 mx-2 d-flex justify-content-center mt-lg-0">

<div class="formIcon pb-1 w-100 pb-3">
<i class="bi bi-calendar-event"></i>
{{ form.estabilished }}
</div>
</div>
<div class="profileBorder p-2 py-5 my-2 mx-1 mx-lg-4 d-flex justify-content-center h-50">
<div class="profileBorder p-2 py-5 my-2
mx-1 mx-lg-4 d-flex justify-content-center h-50">
<div class="formIcon 1 w-100 pb-3">
{# <i class="bi bi-braces"></i>#}
<i class="bi bi-file-text-fill pt-1"></i>
Expand Down
5 changes: 3 additions & 2 deletions Clubs/templates/Clubs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
{% load static %}

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

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

Expand Down
6 changes: 3 additions & 3 deletions Clubs/templates/Clubs/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
{%include "common/navbar.html" %}
{% include "Clubs/Clubs_leftSideMenu.html" %}

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

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

{% if user.is_authenticated %}



<div class="myContent col position-relative p-0">
<div class="myContent position-relative p-0">
{% include "common/messages.html" %}
{% block content %}
{% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions Clubs/templates/Clubs/singleClubView.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ <h3 class="py-2"> {{ Club.description }} </h3>


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

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

{% if Club.address %}
<i class="bi bi-geo-alt-fill pt-2 text-white"></i>
Expand Down
2 changes: 2 additions & 0 deletions Clubs/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
path('clubs/removemember/<int:id>', views.memberRemove, name="memberRemove"),
path('clubs/trainings', views.clubTrainings, name="clubTrainings"),
path('clubs/schedule', views_schedule.clubSchedule, name="clubSchedule"),
path('clubs/schedule/delete/<str:type>/<str:day>/<str:hour>/<int:clubID>',
views_schedule.removeTrainingSchedule, name="removeTrainingSchedule"),
path('clubs/schedule/add/<str:type>/<str:day>', views_schedule.addTrainingModal, name="addTrainingModal"),
# path('clubs/schedule/add/<str:type>/<str:day>', views_schedule.scheduleAddTraining, name="scheduleAddTraining"),
path('clubs/list', views.clubsList, name="clubsList"),
Expand Down
25 changes: 18 additions & 7 deletions Clubs/views_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

def clubSchedule(request):
days = Schedule.days

if request.method == 'DELETE':
pass

# userHasClub = False
myClub = userClub(request.user.id)
try:
Expand All @@ -35,6 +31,10 @@ def clubSchedule(request):
hoursDict[timeHours].append([day, time, info])
hoursDict = sorted(hoursDict.items())

authorized = False
membership = UserMembership.objects.get(user_id=request.user.id)
if membership.authorized == 'FULL':
authorized = True

# for timeHour, sessionsArray in hoursDict:
# print(timeHour, sessionsArray)
Expand All @@ -43,6 +43,7 @@ def clubSchedule(request):
# 'userHasClub' : UserMembership.objects.get(user_id = request.user.id),
# 'cal' : mark_safe(HTMLcal),
# 'dayDict' : dayDict,
'authorized' : authorized,
'club' : userClub(request.user.id),
'days' : days,
'hoursDict' : hoursDict
Expand All @@ -52,7 +53,7 @@ def clubSchedule(request):
return render(request, 'Clubs/clubsSchedule.html', context)


def addTrainingModal(request, type, day ):
def addTrainingModal(request, type, day):
form = ScheduleForm()
myClub = userClub(request.user.id)

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


def scheduleAddTraining(request, type, day):
pass
def removeTrainingSchedule(request, type, day, hour, clubID):
mySchedule = Schedule.objects.get(club_id=clubID)
dayField = getattr(mySchedule, day)
print(dayField.items())
for hourDB, info in dayField.items():
if hourDB == hour:
del dayField[hourDB]
mySchedule.save()
break
return HttpResponseRedirect(reverse('clubSchedule'))


# def get_date(req_day):
# if req_day:
# year, month = (int(x) for x in req_day.split('-'))
Expand Down
Empty file added Presentation/__init__.py
Empty file.
Binary file added Presentation/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added Presentation/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file added Presentation/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file added Presentation/__pycache__/models.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions Presentation/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions Presentation/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class PresentationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Presentation'
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions Presentation/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions Presentation/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions Presentation/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
34 changes: 2 additions & 32 deletions account_register/static/account_register/css/base.css
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@

body{
font-family:'Lato', sans-serif !important;
font-size:2.2vh;
}
nav{
background: rgba(255,255,255,0.088);
z-index:1;
padding:0 25px;
line-height: 45px;
list-style: none;
font-family: 'Roboto', serif;


}
nav a{
padding:6px 8px 6px 16px;
text-decoration: none;
color: white;
font-family: 'Roboto', sans-serif;


}
nav a img{
width:60px;
}
.inputsize{
background:url("account_register/static/account_register/img/10.jpg");
object-fit: contain;
font-family: 'Roboto';
}
.banner-image{
background: url("account_register/static/account_register/img/jess-bailey.jpg");
background-size:cover;
position:relative;
}


.napis{
width:100%;
position:absolute;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5ff5acb

Please sign in to comment.