diff --git a/common/static/common/scss/main.scss b/common/static/common/scss/main.scss index b628e3b..d683da0 100644 --- a/common/static/common/scss/main.scss +++ b/common/static/common/scss/main.scss @@ -102,5 +102,12 @@ form { border-top: 1px solid $input-border-color; width: 100%; text-align: right; + + .button { + background-color: #fdd649 !important; + color: rgba(16,28,66,1) !important; + border-radius: .375rem !important; + font-weight: 600 !important; + } } } diff --git a/common/templates/base.html b/common/templates/base.html index c107a38..8c112d1 100644 --- a/common/templates/base.html +++ b/common/templates/base.html @@ -10,6 +10,7 @@ {% block css %} + {% compress css %} diff --git a/jobs/admin.py b/jobs/admin.py index 32f67ad..566223c 100644 --- a/jobs/admin.py +++ b/jobs/admin.py @@ -7,14 +7,33 @@ class JobAdmin(MarkdownxModelAdmin): + list_display = ( + "title", + "company", + "user", + "is_active", + "is_approved", + "is_sponsored", + "created_at", + "updated_at", + ) + search_fields = ("title",) + list_filter = ( + "is_approved", + "is_active", + "is_sponsored", + ) + def save_model(self, request, obj, form, change): data = form.cleaned_data super().save_model(request, obj, form, change) - if 'is_approved' in form.changed_data and data.get('is_approved'): + if "is_approved" in form.changed_data and data.get("is_approved"): notify_slack( - '✨ *New job posting* ✨ \n {} \n {} \n\n :python: '.format(obj.title, obj.company.name), - settings.SLACK_JOBS_CHANNEL + "✨ *New job posting* ✨ \n {} \n {} \n\n :python: ".format( + obj.title, obj.company.name + ), + settings.SLACK_JOBS_CHANNEL, ) diff --git a/jobs/forms.py b/jobs/forms.py index 750b8b4..0db78e6 100644 --- a/jobs/forms.py +++ b/jobs/forms.py @@ -5,11 +5,17 @@ class CompanyForm(ModelForm): class Meta: model = Company - exclude = ['user'] + exclude = ["user"] class JobForm(ModelForm): class Meta: model = Job - exclude = ['user', 'company', 'is_approved', 'is_sponsored'] - + exclude = [ + "tags", + "user", + "company", + "is_approved", + "is_sponsored", + "is_active", + ] diff --git a/jobs/static/jobs/js/src/jobs.js b/jobs/static/jobs/js/src/jobs.js index c0c664d..95971aa 100644 --- a/jobs/static/jobs/js/src/jobs.js +++ b/jobs/static/jobs/js/src/jobs.js @@ -2,10 +2,30 @@ var React = require('react/addons') var superagent = require('superagent') var marked = require('marked') var cn = require('classnames') +var moment = require('moment') require('velocity-animate') require('velocity-animate/velocity.ui') +moment.locale('en', { + relativeTime: { + future: 'in %s', + past: '%s', + s: '1s', + ss: '%ss', + m: '1m', + mm: '%dm', + h: '1h', + hh: '%dh', + d: '1d', + dd: '%dd', + M: '1M', + MM: '%dM', + y: '1Y', + yy: '%dY' + } +}) + var Job = React.createClass({ toggleDetails: function (e) { e.preventDefault() @@ -39,6 +59,9 @@ var Job = React.createClass({ Posted by {this.props.user.name} +
+ 📌 {moment(this.props.created_at).fromNow()} +
) } @@ -68,7 +91,7 @@ var Content = React.createClass({ />

diff --git a/jobs/templates/jobs/post.html b/jobs/templates/jobs/post.html index d131159..86bd027 100644 --- a/jobs/templates/jobs/post.html +++ b/jobs/templates/jobs/post.html @@ -22,7 +22,7 @@

Job

{{ job_form.as_p }}

-

diff --git a/landing/models.py b/landing/models.py index 9504e74..2d62b2e 100644 --- a/landing/models.py +++ b/landing/models.py @@ -1,14 +1,15 @@ from ckeditor.fields import RichTextField -from django.db import models from model_utils.models import SoftDeletableModel +from django.db import models + class Section(SoftDeletableModel): name = models.CharField(max_length=255) content = RichTextField() order = models.PositiveIntegerField(default=0) - def __unicode(self): + def __unicode__(self): return self.name def __str__(self): diff --git a/landing/static/landing/assets/css/mail.css b/landing/static/landing/assets/css/mail.css new file mode 100644 index 0000000..f9265eb --- /dev/null +++ b/landing/static/landing/assets/css/mail.css @@ -0,0 +1,20 @@ +#mc_embed_signup { + background: transparent; + color: white; + clear: left; + width: 50%; + margin: auto; +} + +#mce-EMAIL { + color: black; +} + +div.mce_inline_error { + margin-left: 20px; + background-color: transparent !important; +} + +#mce-success-response, #mce-error-response { + color: white !important; +} diff --git a/landing/static/landing/assets/img/Python_for_Beginner_Programmers.png b/landing/static/landing/assets/img/Python_for_Beginner_Programmers.png new file mode 100644 index 0000000..a8932ad Binary files /dev/null and b/landing/static/landing/assets/img/Python_for_Beginner_Programmers.png differ diff --git a/landing/static/landing/assets/img/icon/icon-logo.svg b/landing/static/landing/assets/img/icon/icon-logo.svg index 09da3c5..9bd435c 100644 --- a/landing/static/landing/assets/img/icon/icon-logo.svg +++ b/landing/static/landing/assets/img/icon/icon-logo.svg @@ -1,6 +1 @@ - - - - - - + \ No newline at end of file diff --git a/landing/static/landing/assets/img/logo/codev.png b/landing/static/landing/assets/img/logo/codev.png new file mode 100644 index 0000000..02a7651 Binary files /dev/null and b/landing/static/landing/assets/img/logo/codev.png differ diff --git a/landing/static/landing/assets/img/people/ciara.jpg b/landing/static/landing/assets/img/people/ciara.jpg new file mode 100644 index 0000000..3ac0678 Binary files /dev/null and b/landing/static/landing/assets/img/people/ciara.jpg differ diff --git a/landing/static/landing/assets/img/python_hour/python_hour_1.png b/landing/static/landing/assets/img/python_hour/python_hour_1.png new file mode 100644 index 0000000..0e8ce2a Binary files /dev/null and b/landing/static/landing/assets/img/python_hour/python_hour_1.png differ diff --git a/landing/static/landing/assets/img/python_hour/python_hour_2.png b/landing/static/landing/assets/img/python_hour/python_hour_2.png new file mode 100644 index 0000000..57158c0 Binary files /dev/null and b/landing/static/landing/assets/img/python_hour/python_hour_2.png differ diff --git a/landing/static/landing/assets/img/python_hour/python_hour_3.png b/landing/static/landing/assets/img/python_hour/python_hour_3.png new file mode 100644 index 0000000..9de618a Binary files /dev/null and b/landing/static/landing/assets/img/python_hour/python_hour_3.png differ diff --git a/landing/templates/landing/index.html b/landing/templates/landing/index.html index 324dc84..ae1fd8b 100644 --- a/landing/templates/landing/index.html +++ b/landing/templates/landing/index.html @@ -14,6 +14,8 @@ + +
-

- What We Do -

+ {% include "landing/python_hour.html" %}
+
+ + +
+ {% include "landing/code_of_conduct.html" %} + + {% include "landing/mailing_list.html" %} +
+ + +
+ diff --git a/landing/templates/landing/mailing_list.html b/landing/templates/landing/mailing_list.html new file mode 100644 index 0000000..4d031cc --- /dev/null +++ b/landing/templates/landing/mailing_list.html @@ -0,0 +1,68 @@ +
+
+
+

+ Subscribe +

+
+
+

+ Subscribe to our mailing list and get interesting stuff and updates + to your email inbox. +

+
+
+
+
+ * indicates required +
+
+ + +
+ + + +
+
+
+
diff --git a/landing/templates/landing/our_team.html b/landing/templates/landing/our_team.html index 9b5284e..269a9a7 100644 --- a/landing/templates/landing/our_team.html +++ b/landing/templates/landing/our_team.html @@ -188,6 +188,21 @@ /> +
+
+ +
+

-
-

- Meetup -

-
-
-
    -
  • Vanessa Bermudez
  • -
  • Jonathan Doydora
  • -
  • Khim Shae Delos Reyes
  • -
  • Von Louie Cruto
  • -
  • Jay Tero
  • -
  • Mark Anthony Yabis
  • -
  • Janine Bagares
  • -
-
    -
  • Laurence Rebadulla
  • -
  • Rommel Philip Afurong
  • -
  • Ciara Bautista
  • -
  • Jay Mendez
  • -
  • First Val Babon
  • -
  • Rhea Baguion
  • -
  • Renz Jeremy Albandia
  • -
-
    -
  • Ariel Conde
  • -
  • Crispin Sarmiento
  • -
  • Jessica Apostol
  • -
  • Freilla Mae Espinola
  • -
  • Lionel Amarado
  • -
-
- -
-
+ {% for commitee in commitees %}

- Admin + {{ commitee.name }}

    -
  • Matt Lebrun
  • -
  • Micaela Reyes
  • -
  • Sony Valdez
  • -
  • Angelica Lapastora
  • -
  • Alysson Alvaran
  • -
  • Ryan Ermita
  • -
  • Zorex Salvo
  • -
  • Vanessa Bermudez
  • -
-
-
-

- Public Training -

-
    -
  • Ryan Ermita
  • -
  • Zorex Salvo
  • -
  • Dan Belza
  • -
  • Albert Yumol
  • + {% for volunteer in commitee.volunteers.all %} +
  • {{ volunteer.display_name }}
  • + {% endfor %}
+ {% endfor %}
diff --git a/landing/templates/landing/python_hour.html b/landing/templates/landing/python_hour.html new file mode 100644 index 0000000..b4eb12a --- /dev/null +++ b/landing/templates/landing/python_hour.html @@ -0,0 +1,87 @@ +{% load static from staticfiles %} + + diff --git a/landing/templates/landing/sponsorship.html b/landing/templates/landing/sponsorship.html index f770a72..5363dad 100644 --- a/landing/templates/landing/sponsorship.html +++ b/landing/templates/landing/sponsorship.html @@ -87,6 +87,21 @@

+
+
+
+ +
+ +
+
diff --git a/landing/templates/landing/team.html b/landing/templates/landing/team.html index 20eb484..d79df90 100644 --- a/landing/templates/landing/team.html +++ b/landing/templates/landing/team.html @@ -3,89 +3,28 @@

Our Team

Officers and Directors

+ {% for member in board_members %}
-

Micaela Reyes

- Director of Operations -
-
-

Matt Lebrun

- President -
-
-

Sony Valdez

- Director of Community Relations -
-
-

Angelica Lapastora

- Director of Marketing -
-
-

Alysson Alvaran

- Treasurer -
-
-

Vanessa Bermudez

- Committee Head - Meetups -
-
-

Ryan Ermita

- Director of Public Training -
-
-

Zorex Salvo

- Director of Engineering -
-
-

Jonathan Doydora

- Committee Head - Meetups +

{{ member.display_name }}

+ {{ member.title }}
+ {% endfor %}
+

Core Volunteers

+ + {% for commitee in commitees %}
-
Meetup
-
-
-
Vanessa Bermudez
-
Jonathan Doydora
-
Khim Shae Delos Reyes
-
Von Louie Cruto
-
Jay Tero
-
Mark Anthony Yabis
-
Janine Bagares
-
-
-
Laurence Rebadulla
-
Rommel Philip Afurong
-
Ciara Bautista
-
Jay Mendez
-
First Val Babon
-
Rhea Baguion
-
Renz Jeremy Albandia
-
-
-
Ariel Conde
-
Crispin Sarmiento
-
Jessica Apostol
-
Freilla Mae Espinola
-
Lionel Amarado
+
{{ commitee.name }}
-
-
Admin
-
Matt Lebrun
-
Micaela Reyes
-
Sony Valdez
-
Angelica Lapastora
-
Alysson Alvaran
-
-
-
Public Training
-
Ryan Ermita
-
Zorex Salvo
-
Dan Belza
-
Albert Yumol
-
+ {% for volunteer in commitee.volunteers.all %} +
+
{{ volunteer.display_name }}
+
+ {% endfor %} + {% endfor %}
diff --git a/landing/views.py b/landing/views.py index 2256407..ae41cde 100644 --- a/landing/views.py +++ b/landing/views.py @@ -1,12 +1,48 @@ from django.shortcuts import render from .models import Event, Section +from organisation.models import Volunteer, Commitee def index(request): - events = Event.objects.all() - sections = Section.objects.all() + events = Event.available_objects.all() + sections = Section.available_objects.all() + board_members = Volunteer.available_objects.filter(is_staff=True) + commitees = Commitee.available_objects.prefetch_related('volunteers') + python_hour = [ + { + "link": "#", + "tag": "Python Hour", + "title": "Let's create animated Memes using Python and MoviePy", + "date": "Thursday, October 13, 2022", + "time": "7PM-8PM PHT", + "location": "Via Zoom and Youtube Live", + "cover_image": "landing/assets/img/python_hour/python_hour_1.png" + }, + { + "link": "#", + "tag": "Python Hour", + "title": "API Development using Flask", + "date": "Thursday, October 20, 2022", + "time": "7PM-8PM PHT", + "location": "Via Zoom and Youtube Live", + "cover_image": "landing/assets/img/python_hour/python_hour_2.png" + }, + { + "link": "#", + "tag": "Python Hour", + "title": "Data Science using Python!", + "date": "Thursday, October 27, 2022", + "time": "7PM-8PM PHT", + "location": "Via Zoom and Youtube Live", + "cover_image": "landing/assets/img/python_hour/python_hour_3.png" + } + ] + return render(request, 'landing/index.html', { 'events': events, - 'sections': sections + 'sections': sections, + 'board_members': board_members, + 'commitees': commitees, + 'python_hour': python_hour, }) diff --git a/organisation/__init__.py b/organisation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/organisation/admin.py b/organisation/admin.py new file mode 100644 index 0000000..0d7bb7d --- /dev/null +++ b/organisation/admin.py @@ -0,0 +1,13 @@ +from django.contrib import admin + +from .models import Commitee, Volunteer + + + +class VolunteerAdmin(admin.ModelAdmin): + list_display = ("display_name", "commitee", "first_name", "last_name",) + list_filter = ("commitee",) + + +admin.site.register(Commitee) +admin.site.register(Volunteer, VolunteerAdmin) diff --git a/organisation/apps.py b/organisation/apps.py new file mode 100644 index 0000000..ef39521 --- /dev/null +++ b/organisation/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class OrganisationConfig(AppConfig): + name = 'organisation' diff --git a/organisation/migrations/0001_initial.py b/organisation/migrations/0001_initial.py new file mode 100644 index 0000000..2b363a6 --- /dev/null +++ b/organisation/migrations/0001_initial.py @@ -0,0 +1,42 @@ +# Generated by Django 2.2.18 on 2022-08-04 06:09 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Commitee', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('is_removed', models.BooleanField(default=False)), + ('name', models.CharField(max_length=255)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='Volunteer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('is_removed', models.BooleanField(default=False)), + ('display_name', models.CharField(max_length=255)), + ('first_name', models.CharField(max_length=128)), + ('last_name', models.CharField(max_length=128)), + ('title', models.CharField(blank=True, default='', max_length=255)), + ('is_staff', models.BooleanField(default=False)), + ('commitee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='volunteers', to='organisation.Commitee')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/organisation/migrations/__init__.py b/organisation/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/organisation/models.py b/organisation/models.py new file mode 100644 index 0000000..7d7bac9 --- /dev/null +++ b/organisation/models.py @@ -0,0 +1,28 @@ +from model_utils.models import SoftDeletableModel + +from django.db import models + + +class Commitee(SoftDeletableModel): + name = models.CharField(max_length=255) + + def __str__(self): + return self.name + + +class Volunteer(SoftDeletableModel): + display_name = models.CharField(max_length=255) + first_name = models.CharField(max_length=128) + last_name = models.CharField(max_length=128) + title = models.CharField(max_length=255, blank=True, default='') + is_staff = models.BooleanField(default=False) + commitee = models.ForeignKey( + Commitee, + blank=True, + null=True, + on_delete=models.SET_NULL, + related_name='volunteers', + ) + + def __str__(self): + return self.display_name diff --git a/organisation/tests.py b/organisation/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/organisation/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/organisation/views.py b/organisation/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/organisation/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/package.json b/package.json index fc499ee..09ac210 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "browserify": "^10.1.0", "classnames": "^2.1.2", "marked": "^0.3.3", + "moment": "^2.29.4", "react": "^0.12.2", "superagent": "^0.21.0", "velocity-animate": "^1.2.1", diff --git a/pythonph/settings.py b/pythonph/settings.py index e009bb1..c52c269 100644 --- a/pythonph/settings.py +++ b/pythonph/settings.py @@ -30,6 +30,7 @@ 'jobs', 'slack', 'common', + 'organisation', ) MIDDLEWARE = ( 'django.middleware.security.SecurityMiddleware', diff --git a/requirements.txt b/requirements.txt index 7416b7c..0027c6b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==2.2.18 +Django==2.2.28 gunicorn==20.0.4 psycopg2-binary==2.8.5