Skip to content

Commit

Permalink
v0.3.2-alpha0
Browse files Browse the repository at this point in the history
  • Loading branch information
g4n3sha5 committed Mar 18, 2023
1 parent dcf0def commit 9def659
Show file tree
Hide file tree
Showing 47 changed files with 624 additions and 399 deletions.
Binary file modified Clubs/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified Clubs/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified Clubs/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified Clubs/__pycache__/views_schedule.cpython-310.pyc
Binary file not shown.
4 changes: 3 additions & 1 deletion Clubs/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .models import Club
from .models import *


class ClubForm(ModelForm):
class Meta:
model = Club
Expand Down Expand Up @@ -59,6 +58,9 @@ class Meta:
'placeholder': 'Website (optional) [www.example.com or example.com]'
}), required=False)




class MemberForm(ModelForm):
class Meta:
model = UserMembership
Expand Down
26 changes: 26 additions & 0 deletions Clubs/migrations/0026_clubtrainingsession.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.1.2 on 2023-03-18 19:17

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('WorkoutJournal', '0009_remove_trainingsession_addedbyuser_and_more'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('Clubs', '0025_rename_field_schedule_friday_schedule_monday_and_more'),
]

operations = [
migrations.CreateModel(
name='ClubTrainingSession',
fields=[
('trainingsession_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='WorkoutJournal.trainingsession')),
('Club', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='Clubs.club')),
('participants', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
],
bases=('WorkoutJournal.trainingsession',),
),
]
16 changes: 16 additions & 0 deletions Clubs/migrations/0027_delete_clubtrainingsession.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.1.2 on 2023-03-18 20:23

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('Clubs', '0026_clubtrainingsession'),
]

operations = [
migrations.DeleteModel(
name='ClubTrainingSession',
),
]
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions Clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from account_register.models import UserProfile
from django.db.models.signals import post_save
from django.dispatch import receiver
from WorkoutJournal.models import TrainingSession
from django.db.models import Case, When, Value

# Create your models here.
Expand Down Expand Up @@ -52,6 +53,9 @@ def requestList(self):
def __str__(self):
return f'{self.name} {self.estabilished}'

# class ClubTrainingSession(TrainingSession):
# participants = models.ManyToManyField(User, blank=True)
#

class UserMembership(models.Model):
MEMBER_TYPES = (
Expand All @@ -73,8 +77,8 @@ class UserMembership(models.Model):
slug = models.SlugField(null=True, blank=True)
club = models.ForeignKey(Club, related_name='membersClub', on_delete=models.CASCADE, null=True)

def userClub( userID):
return UserMembership.objects.get(user_id=userID).club


class Request(models.Model):
ACCEPTED = (
('YES', 'YES'),
Expand Down
Binary file added Clubs/static/Clubs/sorry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion Clubs/templates/Clubs/clubMembers.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{% extends base_template %}{#{% if %}#}
{% block content %}
{% if not userHasClub %}
{% include 'Clubs/noClub.html' %}
{% else %}

{% include 'CLubs/membersModals.html' %}

<div class="row p-0 m-0">
<div class="clubsListWrap px-lg-5 px-2 col-12 col-xl-8 h-100 navPadding membersWrap
vh-100 overflow-hidden pb-5">
Expand Down Expand Up @@ -167,4 +172,5 @@ <h1> Requests</h1>
{% endif %}
</div>
</div>
{% endblock %}
{% endif %}
{% endblock %}
11 changes: 7 additions & 4 deletions Clubs/templates/Clubs/clubsList.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends base_template %}
{% block content %}
<div class="clubsListWrap px-5 navPadding vh-100 overflow-hidden ">
<div class="clubsListWrap px-lg-5 navPadding overflow-hidden ">

<div class="clubsListWrapper d-flex flex-column align-items-center">
<div class="clubsListWrapper h-100 d-flex flex-column align-items-center overflow-hidden pb-2">

<h3 class="text-center"> Clubs List</h3>
<hr class="text-white mx-5 my-3">
Expand All @@ -11,7 +11,8 @@ <h3 class="text-center"> Clubs List</h3>
<input class="searchBox py-1 " type="text" placeholder="Search ">
</div>

<ul class=" customScroll clubsList h-75 w-100 px-5 d-flex flex-column align-items-center " multiple>

<ul class="customScroll overflow-auto w-100 px-5 d-flex flex-column align-items-center " multiple>

{% for club in clubsList %}
<li hx-get = "{% url 'singleClubView' club.id %}"
Expand All @@ -23,10 +24,12 @@ <h4 class="clubsTextWrap">
{{ forloop.counter }}. {{ club.name }}
</h4>
</li>
<hr class="text-white w-75 p-0 m-0 mb-1">
{% endfor %}

</ul>

</div>


</div>
{% endblock %}
Loading

0 comments on commit 9def659

Please sign in to comment.