Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #43

Closed
wants to merge 209 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
c97fd06
error page complete
wryonik Dec 3, 2019
d408bdb
feat:made mobile responsive designs for error page
wryonik Dec 15, 2019
9ec81af
make mobile responsive changes in homepage and change logo and images
ayanchoudhary Dec 24, 2019
4019065
added random color to project image backlap
ayanchoudhary Dec 27, 2019
f129bca
feat:made navbar for mobile view
ayanchoudhary Dec 27, 2019
012d61a
feat:integrated mobile nav with frontend
ayanchoudhary Dec 27, 2019
872bae2
feat: made sister group components
ayanchoudhary Dec 1, 2019
592e876
feat:made mobile responsive designs for sister groups
ayanchoudhary Dec 13, 2019
a428e00
fix:image path in sister_group component
ayanchoudhary Dec 24, 2019
1170e3a
feat: made team related component of About Us page
ayanchoudhary Dec 1, 2019
5008307
fix: alignment issues
ayanchoudhary Dec 3, 2019
159c3da
feat: made responsive design for mobile
ayanchoudhary Dec 13, 2019
557f365
feat: developed news page and event page templates
ayanchoudhary Nov 30, 2019
976a90d
feat: componentisation of updatecard and fix: tailwind.js inconsisten…
ayanchoudhary Dec 1, 2019
3c9c37f
feat: made models for news feed
ayanchoudhary Dec 3, 2019
f1cbaf0
feat: add width field for field in tailwind
ayanchoudhary Dec 11, 2019
9791ee2
fix:change models to suit dynamic rendering
ayanchoudhary Dec 16, 2019
03f6ae7
add register model code
wryonik Dec 19, 2019
57ad3e1
backend integration of news page
wryonik Dec 20, 2019
7011d20
feat: made components for large and small feed and configure backend …
ayanchoudhary Dec 21, 2019
57526e3
fix: restructure axios request to fetch data for news page
ayanchoudhary Dec 23, 2019
5dd6617
feat: made event page mobile responsive
ayanchoudhary Dec 23, 2019
bf98a7d
Minor changes fixed
wryonik Dec 24, 2019
c40521f
feat:make news page mobile view responsive and tweek model to display…
ayanchoudhary Dec 24, 2019
21e63e2
Minor changes
wryonik Dec 24, 2019
e04ce2f
Fix News page event rendering error
wryonik Dec 25, 2019
b6b438a
feat:configure get requests for fetching specific events
ayanchoudhary Dec 25, 2019
698ace8
fix:configure links in news feed
ayanchoudhary Dec 25, 2019
26485ab
fix:display order of feed in news page
ayanchoudhary Dec 25, 2019
31afbd4
added masonry for news page layout and fixed minor spacing isses
ayanchoudhary Dec 25, 2019
999102d
feat: removed hardcoded values from event page
wryonik Dec 25, 2019
1a9233e
fix:api request for fetching data for event page
ayanchoudhary Dec 25, 2019
1de7c3a
feat: event page events rendering
wryonik Dec 25, 2019
8df718a
fix:label rendering in image page
ayanchoudhary Dec 25, 2019
6c72cfd
fix:added timing field in eventUpdate and changed display in frontend
ayanchoudhary Dec 26, 2019
b89d81c
added masonry package for news feed rendering and removed redundant i…
ayanchoudhary Dec 26, 2019
7c37868
feat: add is_visible to events and fix: change link label in small feed
ayanchoudhary Dec 27, 2019
c805777
feat: made dynamic color rendering for feed link labels
ayanchoudhary Dec 27, 2019
43b079a
[WIP] Basic components for Area of Interet and Timeline
wryonik Nov 30, 2019
b1dceb0
[WIP] Minor linting fixes
wryonik Nov 30, 2019
08cae2b
made basic compnents for what is sdslabs and what we do
ayanchoudhary Sep 23, 2019
7f93ef0
fixed gallery component width
ayanchoudhary Sep 23, 2019
631f858
fix size variations and linting issues
ayanchoudhary Nov 30, 2019
0051447
fix: inconsistencies in tailwind.js and minor spacing issues
ayanchoudhary Dec 1, 2019
340bc07
refactor: add state to about us component
ayanchoudhary Dec 4, 2019
93d719c
feat: completed gallery component
ayanchoudhary Dec 4, 2019
5521592
feat: made responsive for mobile view
ayanchoudhary Dec 13, 2019
2601aa1
fix:side margin in about us page
ayanchoudhary Dec 13, 2019
31a6f13
fix:views breaking due to rebase
ayanchoudhary Dec 29, 2019
ed663fd
fix: changes in project and news to accomodate rebase breaks
ayanchoudhary Dec 29, 2019
4476a25
fix:label color
ayanchoudhary Dec 29, 2019
2a9f06e
fix:import backend for timeline
ayanchoudhary Dec 29, 2019
e0ed3ff
fix:change navlink url for contact
ayanchoudhary Dec 29, 2019
b6ec48a
feat: added sister-groups component to aboutus page
ayanchoudhary Dec 29, 2019
9b13438
fix: margin and spacing in sister-groups
ayanchoudhary Dec 29, 2019
b0c2acb
feat:integrated team component with about us page
ayanchoudhary Dec 29, 2019
f90ded2
make mobile responsive changes in homepage and change logo and images
ayanchoudhary Dec 24, 2019
513d238
added random color to project image backlap
ayanchoudhary Dec 27, 2019
c02e14c
feat:made navbar for mobile view
ayanchoudhary Dec 27, 2019
402b50c
feat:integrated mobile nav with frontend
ayanchoudhary Dec 27, 2019
3315754
feat: made sister group components
ayanchoudhary Dec 1, 2019
31f9419
feat:made mobile responsive designs for sister groups
ayanchoudhary Dec 13, 2019
c6e92de
fix:image path in sister_group component
ayanchoudhary Dec 24, 2019
e07af2a
feat: made team related component of About Us page
ayanchoudhary Dec 1, 2019
9afc03a
fix: alignment issues
ayanchoudhary Dec 3, 2019
5e3aba7
feat: made responsive design for mobile
ayanchoudhary Dec 13, 2019
37ed959
feat: developed news page and event page templates
ayanchoudhary Nov 30, 2019
e17dead
feat: componentisation of updatecard and fix: tailwind.js inconsisten…
ayanchoudhary Dec 1, 2019
354b34a
feat: made models for news feed
ayanchoudhary Dec 3, 2019
d70948b
feat: add width field for field in tailwind
ayanchoudhary Dec 11, 2019
16ccc2a
fix:change models to suit dynamic rendering
ayanchoudhary Dec 16, 2019
c0acc06
add register model code
wryonik Dec 19, 2019
242af30
backend integration of news page
wryonik Dec 20, 2019
10385f8
feat: made components for large and small feed and configure backend …
ayanchoudhary Dec 21, 2019
dfa1da8
fix: restructure axios request to fetch data for news page
ayanchoudhary Dec 23, 2019
bdc9b7b
feat: made event page mobile responsive
ayanchoudhary Dec 23, 2019
d8c9144
Minor changes fixed
wryonik Dec 24, 2019
2d6675b
feat:make news page mobile view responsive and tweek model to display…
ayanchoudhary Dec 24, 2019
c071225
Minor changes
wryonik Dec 24, 2019
d7d907e
Fix News page event rendering error
wryonik Dec 25, 2019
ac3e024
feat:configure get requests for fetching specific events
ayanchoudhary Dec 25, 2019
3c5b303
fix:configure links in news feed
ayanchoudhary Dec 25, 2019
5a22e0f
fix:display order of feed in news page
ayanchoudhary Dec 25, 2019
16ea637
added masonry for news page layout and fixed minor spacing isses
ayanchoudhary Dec 25, 2019
7817dbc
feat: removed hardcoded values from event page
wryonik Dec 25, 2019
34632f1
fix:api request for fetching data for event page
ayanchoudhary Dec 25, 2019
33df7ee
feat: event page events rendering
wryonik Dec 25, 2019
167fa33
fix:label rendering in image page
ayanchoudhary Dec 25, 2019
c08ea60
fix:added timing field in eventUpdate and changed display in frontend
ayanchoudhary Dec 26, 2019
480be67
added masonry package for news feed rendering and removed redundant i…
ayanchoudhary Dec 26, 2019
74a8c30
feat: add is_visible to events and fix: change link label in small feed
ayanchoudhary Dec 27, 2019
d64e0e6
feat: made dynamic color rendering for feed link labels
ayanchoudhary Dec 27, 2019
db90bbe
[WIP] Basic components for Area of Interet and Timeline
wryonik Nov 30, 2019
0a95345
[WIP] Minor linting fixes
wryonik Nov 30, 2019
13f7de6
made basic compnents for what is sdslabs and what we do
ayanchoudhary Sep 23, 2019
544b36e
fixed gallery component width
ayanchoudhary Sep 23, 2019
b6e0662
fix size variations and linting issues
ayanchoudhary Nov 30, 2019
f8f401c
fix: inconsistencies in tailwind.js and minor spacing issues
ayanchoudhary Dec 1, 2019
7491309
refactor: add state to about us component
ayanchoudhary Dec 4, 2019
1ca9e9a
feat: completed gallery component
ayanchoudhary Dec 4, 2019
f391616
feat: made responsive for mobile view
ayanchoudhary Dec 13, 2019
60c4f2c
fix:side margin in about us page
ayanchoudhary Dec 13, 2019
6df5e70
fix:views breaking due to rebase
ayanchoudhary Dec 29, 2019
21da54d
fix: changes in project and news to accomodate rebase breaks
ayanchoudhary Dec 29, 2019
0a969ce
fix:label color
ayanchoudhary Dec 29, 2019
cce4866
fix:import backend for timeline
ayanchoudhary Dec 29, 2019
4a41462
fix:change navlink url for contact
ayanchoudhary Dec 29, 2019
9da293f
feat: added sister-groups component to aboutus page
ayanchoudhary Dec 29, 2019
ae7bd8c
fix: margin and spacing in sister-groups
ayanchoudhary Dec 29, 2019
05931f0
feat:integrated team component with about us page
ayanchoudhary Dec 29, 2019
9e28d9e
feat:integrated error_404 page
ayanchoudhary Dec 29, 2019
3d46452
fix:merge conflict'
ayanchoudhary Dec 29, 2019
76afc02
fonts fixed
wryonik Dec 31, 2019
31a326f
fix:news page link in mobile navbar
ayanchoudhary Dec 31, 2019
004698d
fix:key errors in news feeds
ayanchoudhary Dec 31, 2019
ebf6762
backend fixed
wryonik Jan 1, 2020
6d5ddb8
fix:timeline element width
ayanchoudhary Jan 1, 2020
8ae4562
fix:project underlay sizing issue
ayanchoudhary Jan 1, 2020
785f119
border fix
wryonik Jan 2, 2020
637fec2
Merge branch 'release' of github.com:sdslabs/portfolio into release
wryonik Jan 2, 2020
3c0b630
Minor area of interest component fix
wryonik Jan 2, 2020
8707638
feat:add vhosts
ayanchoudhary Jan 2, 2020
64f2aec
minor hr fix
wryonik Jan 2, 2020
a65292b
fixed borders in feedboxes
wryonik Jan 3, 2020
637b1f1
fixed responsive screen size
wryonik Jan 3, 2020
331bca2
fix:masonry view
ayanchoudhary Jan 3, 2020
5240c1a
merge changes
ayanchoudhary Jan 3, 2020
0412b7a
fix: masonry columnWidth made resonsive
ayanchoudhary Jan 4, 2020
506a18d
fix: made requested changes
ayanchoudhary Jan 4, 2020
05b63a1
Fixes minor review issues
wryonik Jan 4, 2020
5b9c0de
Merge branch 'release' of github.com:sdslabs/portfolio into release
wryonik Jan 4, 2020
5154e96
Fixes review issues
wryonik Jan 4, 2020
6c8de7e
change static data on homepage
ayanchoudhary Jan 6, 2020
a3e606b
rename variable names
wryonik Jan 6, 2020
2d6ad4d
Merge branch 'release' of github.com:sdslabs/portfolio into release
wryonik Jan 6, 2020
a56e338
fix:description display in news feed
ayanchoudhary Jan 6, 2020
6693ad0
update content in 'about us' page and 'back' button in 'event update'…
wryonik Jan 9, 2020
aa5118d
Merge branch 'release' of github.com:sdslabs/portfolio into release
wryonik Jan 9, 2020
6e276e5
fix: projects underlay display
ayanchoudhary Jan 9, 2020
432cc41
fix: project backdrop height
ayanchoudhary Jan 9, 2020
c8773f5
fix: project backdrop sizing and mobile view font size
ayanchoudhary Jan 10, 2020
4d4bb1b
fix: improve image load time in gallery and increased display time
ayanchoudhary Jan 10, 2020
6282d9c
fix:project backdrop sizing in mobile view
ayanchoudhary Jan 10, 2020
5c11fa3
add data for team page and sister groups
ayanchoudhary Jan 10, 2020
4ff1e74
updated confs
ayanchoudhary Jan 10, 2020
b57b783
fix:api url in events page
ayanchoudhary Jan 10, 2020
1431c2a
fix: image shadow on events page
ayanchoudhary Jan 10, 2020
aa9c2c3
fix:close nav on clicking link in nav
ayanchoudhary Jan 10, 2020
d0cece2
fix:landing page top padding in mobile view, separation between proje…
ayanchoudhary Jan 10, 2020
8056859
change logo, project arrow and hamburger icon
ayanchoudhary Jan 10, 2020
e9a62fe
added color field for projects background in backend
wryonik Jan 10, 2020
fb0a310
fix:changed text colors and button text alignment in navmobile
ayanchoudhary Jan 10, 2020
3df87ad
fix:project backdrop colors are made static
ayanchoudhary Jan 10, 2020
95411c8
feat: made sister group carousel swipe responsive
ayanchoudhary Jan 10, 2020
8c1cccf
fix: font weight of aboutus page and feat:enabled swipe feature for g…
ayanchoudhary Jan 10, 2020
e87a77f
feat: added slideIn animation to navmobile, sister-gallery and gallery
ayanchoudhary Jan 10, 2020
d9ae1db
fix:remove slideIn from gallery
ayanchoudhary Jan 10, 2020
0d6e8b8
fix:overflow due to slideIns
ayanchoudhary Jan 10, 2020
176ae28
fix:logo positioning
ayanchoudhary Jan 11, 2020
8ac2047
fix:added bidirectional swipe in sister-gallery
ayanchoudhary Jan 11, 2020
5c6dbc8
fix: sister-gallery carousel style
ayanchoudhary Jan 11, 2020
4c6a9e9
fix:gallery mobile view sliding
ayanchoudhary Jan 11, 2020
1e36b0b
fix:hamburger highlighting on click
ayanchoudhary Jan 11, 2020
1af8da5
Minor changes
wryonik Jan 12, 2020
7d05270
Merge branch 'release' of github.com:sdslabs/portfolio into release
wryonik Jan 12, 2020
d1705ca
fixed mobile-view fonts of news page
wryonik Jan 12, 2020
1929bee
fix: display parameters
ayanchoudhary Jan 12, 2020
be44d11
Replaces 'var' with 'let' and some lint fixes
wryonik Jan 12, 2020
946e748
fix merge conflicts
ayanchoudhary Jan 12, 2020
e5d8614
fix:full page scroll
ayanchoudhary Jan 12, 2020
56bbcc0
fix:scroll issue on other pages due to full page scroll
ayanchoudhary Jan 12, 2020
06e6568
fix:touch events on omepage
ayanchoudhary Jan 12, 2020
ed66813
fix: areas of interest arrangement
ayanchoudhary Jan 12, 2020
f876dbf
fix:scroll error on page change
ayanchoudhary Jan 12, 2020
1582b6b
fix: chat and blog opening in the same window
ayanchoudhary Jan 12, 2020
2e19d1c
fix about page fonts and close button in hamburger
wryonik Jan 13, 2020
e52b35c
fix:navbar slideout animation
ayanchoudhary Jan 13, 2020
f231eb7
fix fonts for event page
wryonik Jan 13, 2020
1bf7fd2
overflow fixed for event page
wryonik Jan 13, 2020
07f11d6
fixed mobile view hamburger
wryonik Jan 14, 2020
c779ebb
fixed hamburger in chrome
wryonik Jan 15, 2020
d1f2911
fix:landing top padding for mobile view, changed news page header tex…
ayanchoudhary Jan 18, 2020
96eadbf
mege refs from remote
ayanchoudhary Jan 18, 2020
1aa844c
reduce top padding from project arrow in mobile view and change landi…
ayanchoudhary Jan 19, 2020
4696a2f
fix:scroll move timing
ayanchoudhary Feb 5, 2020
4961bfc
fix:target for links
ayanchoudhary Feb 5, 2020
fe31614
font:Change font weight of 'about us' and landing page
wryonik Feb 5, 2020
a77dde2
Change title of a component
wryonik Feb 5, 2020
e0a53d9
removed carousal update function
wryonik Feb 6, 2020
147646a
fix landing page top margin
wryonik Feb 6, 2020
f37e713
fix hamburger in mobile view
wryonik Feb 6, 2020
662c634
fixed login button font-size in mobile view
wryonik Feb 6, 2020
1f223ed
feat: added footer component and fixed linting issues
ayanchoudhary Apr 27, 2020
3547853
Change "heart" from text to css icon.
wryonik Apr 29, 2020
782666f
Fix footer on projects page
wryonik Apr 29, 2020
19669ab
containerizes portfolio
wryonik May 1, 2020
6f542db
rename settings.sample.py to settings.py
wryonik May 1, 2020
eb8173d
fix: copy and run commands for requirements.txt in dockerfile
ayanchoudhary May 1, 2020
fdb422d
fix: command and port in docker-compose.yml file
wryonik May 1, 2020
dcf5423
fix: put db as host
ayanchoudhary May 1, 2020
ab8ea49
Merge pull request #45 from sdslabs/dockerize
ayanchoudhary May 1, 2020
2104997
Remove footer from error page
wryonik May 25, 2020
dc2c512
Remove footer from home page and project page.
wryonik May 25, 2020
84b9430
footer: Updated footer icons.
wryonik May 28, 2020
ba0d777
button: Add option to add image to button.
wryonik May 28, 2020
ecd72d4
route: Add contact page to router links.
wryonik May 28, 2020
89fc9b7
contactPage: Add dedicated contact page.
wryonik May 28, 2020
e4fcc2c
carousel: Make radial button clickable.
wryonik May 28, 2020
88edfdf
change contact page link
wryonik Jun 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.7-stretch

ENV PYTHONBUFFERED 1

RUN apt-get update \
&& apt-get install libexempi3 \
&& mkdir -p /var/log/portfolio.log

WORKDIR /portfolio

# Install Python dependency management tools
RUN pip install --upgrade pip \
&& pip install --upgrade setuptools

# Copy the requirements.txt into the container
COPY settings/requirements-common.txt /portfolio/
COPY settings/dev/requirements-dev.txt /portfolio/

# Install the dependencies system-wide
# TODO: Use build args to avoid installing dev dependencies in production
RUN pip install -r requirements-common.txt
RUN pip install -r requirements-dev.txt
6 changes: 6 additions & 0 deletions apps/base/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from django.contrib import admin

from .models import Timeline

# Register your models here.

# @admin.register(Timeline)
# class TimelineAdmin(admin.ModelAdmin):
# list_display = ('title', 'timing', 'description')
5 changes: 0 additions & 5 deletions apps/base/apps.py

This file was deleted.

3 changes: 0 additions & 3 deletions apps/base/models.py

This file was deleted.

5 changes: 0 additions & 5 deletions apps/base/views.py

This file was deleted.

10 changes: 10 additions & 0 deletions apps/news/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
from django.contrib import admin

from .models import Event, EventUpdate

# Register your models here.

@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
list_display = ('types', 'title', 'timing', 'shortDescription', 'fullDescription', 'url', 'image', 'is_visible' )

@admin.register(EventUpdate)
class EventUpdateAdmin(admin.ModelAdmin):
list_display = ('title', 'description', 'contactInfo', 'footNote', 'url', 'image', 'event')
51 changes: 51 additions & 0 deletions apps/news/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated by Django 2.2.4 on 2020-01-01 19:42

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


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('types', models.CharField(choices=[('upcoming event', 'upcoming'), ('app update', 'app'), ('online competition', 'online'), ('past event', 'past')], max_length=100)),
('priority', models.CharField(choices=[('large', 'large'), ('small', 'small')], max_length=50)),
('title', models.CharField(max_length=40)),
('timing', models.CharField(blank=True, max_length=50)),
('description', models.CharField(blank=True, max_length=500)),
('description1', models.CharField(blank=True, max_length=1000)),
('url', models.URLField()),
('image', models.ImageField(blank=True, upload_to='news')),
('is_visible', models.BooleanField(default=True)),
],
options={
'db_table': 'events',
},
),
migrations.CreateModel(
name='EventUpdate',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=40)),
('timing', models.CharField(blank=True, default='', max_length=50)),
('description', models.CharField(blank=True, max_length=500)),
('description1', models.CharField(blank=True, max_length=500)),
('description2', models.CharField(blank=True, max_length=500)),
('description3', models.CharField(blank=True, max_length=500)),
('url', models.URLField(blank=True)),
('image', models.ImageField(blank=True, upload_to='news')),
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Event')),
],
options={
'db_table': 'event updates',
},
),
]
38 changes: 38 additions & 0 deletions apps/news/migrations/0002_auto_20200106_1332.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 2.2.4 on 2020-01-06 13:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('news', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='event',
old_name='description1',
new_name='fullDescription',
),
migrations.RenameField(
model_name='event',
old_name='description',
new_name='shortDescription',
),
migrations.RenameField(
model_name='eventupdate',
old_name='description1',
new_name='contactInfo',
),
migrations.RenameField(
model_name='eventupdate',
old_name='description2',
new_name='footNote',
),
migrations.RenameField(
model_name='eventupdate',
old_name='description3',
new_name='greetings',
),
]
52 changes: 52 additions & 0 deletions apps/news/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
from django.db import models

# Create your models here.

TYPES = [
('upcoming event', 'upcoming'),
('app update', 'app'),
('online competition', 'online'),
('past event', 'past')
]

PRIORITY = [
('large', 'large'),
('small', 'small')
]


class Event(models.Model):
"""Model representing details of upcoming event"""
types = models.CharField(max_length=100, choices=TYPES)
priority = models.CharField(max_length=50, choices=PRIORITY)
title = models.CharField(max_length=40)
timing = models.CharField(max_length=50, blank=True)
shortDescription = models.CharField(max_length=500, blank=True)
fullDescription = models.CharField(max_length=1000, blank=True)
url = models.URLField(max_length=200)
image = models.ImageField(upload_to='news', blank=True)
is_visible = models.BooleanField(default=True)

class Meta:
app_label = 'news'
db_table = 'events'

def __str__(self):
return self.title


class EventUpdate(models.Model):
"""Model representing event update"""
title = models.CharField(max_length=40)
timing = models.CharField(max_length=50, blank=True, default='')
description = models.CharField(max_length=500, blank=True)
contactInfo = models.CharField(max_length=500, blank=True)
footNote = models.CharField(max_length=500, blank=True)
greetings = models.CharField(max_length=500, blank=True)
url = models.URLField(max_length=200, blank=True)
image = models.ImageField(upload_to='news', blank=True)
event = models.ForeignKey(Event, on_delete=models.CASCADE)

class Meta:
app_label = 'news'
db_table = 'event updates'

def __str__(self):
return self.title
17 changes: 17 additions & 0 deletions apps/news/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from rest_framework import serializers

from .models import Event, EventUpdate


class EventSerializer(serializers.ModelSerializer):

class Meta:
model = Event
fields = ('types', 'priority', 'title', 'timing', 'shortDescription', 'fullDescription', 'url', 'image', 'is_visible' )


class EventUpdateSerializer(serializers.ModelSerializer):

class Meta:
model = EventUpdate
fields = ('title', 'timing', 'description', 'contactInfo', 'footNote', 'greetings', 'image', 'event')
9 changes: 9 additions & 0 deletions apps/news/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.conf.urls import url

from .import views


urlpatterns = [
url(r'^$', views.get_events, name='get_events'),
url(r'updates', views.get_event_updates, name='get_news_updates')
]
60 changes: 58 additions & 2 deletions apps/news/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
from django.shortcuts import render
from rest_framework import permissions, status
from rest_framework.decorators import (
api_view,
permission_classes,
throttle_classes,
)
from rest_framework.response import Response
from rest_framework.throttling import AnonRateThrottle

# Create your views here.
from .models import Event, EventUpdate
from .serializers import EventSerializer, EventUpdateSerializer


@throttle_classes([
AnonRateThrottle,
])
@api_view(['GET'])
@permission_classes((permissions.AllowAny, ))
def get_events(request):
"""
Get a list of events
"""
event_requested = request.query_params.get('title')
if event_requested is not None:
event = Event.objects.filter(title=event_requested, is_visible=True)
event_update = EventUpdate.objects.filter(event=event[0])
event_serializer = EventSerializer(event, many=True, context={'request': request})
event_update_serializer = EventUpdateSerializer(event_update, many=True, context={'request': request})
response_data = {'event': event_serializer.data, 'event_update': event_update_serializer.data}
return Response(response_data, status=status.HTTP_200_OK)
else:
event_array = []
events = Event.objects.filter(is_visible=True)
for event in events:
event_update = EventUpdate.objects.filter(event=event)
event_serializer = EventSerializer(
event, many=False, context={'request': request})
event_update_serializer = EventUpdateSerializer(
event_update, many=True, context={'request': request}
)
response_data = {'event': event_serializer.data, 'event_update': event_update_serializer.data}
event_array.append(response_data)
return Response(event_array, status=status.HTTP_200_OK)


@throttle_classes([
AnonRateThrottle,
])
@api_view(['GET'])
@permission_classes((permissions.AllowAny, ))
def get_event_updates(request):
"""
Get a list of updates
"""
event_update = EventUpdate.objects.filter()
serializer = EventUpdateSerializer(
event_update, many=True, context={'request': request})
response_data = serializer.data
return Response(response_data, status=status.HTTP_200_OK)
2 changes: 1 addition & 1 deletion apps/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

@admin.register(Project)
class ProjectAdmin(admin.ModelAdmin):
list_display = ('title', 'permalink', 'url', 'is_visible',)
list_display = ('title', 'permalink', 'url', 'color', 'is_visible',)
list_filter = ('is_visible',)
search_fields = ('title',)
18 changes: 18 additions & 0 deletions apps/projects/migrations/0002_project_color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2020-01-10 18:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('projects', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='project',
name='color',
field=models.CharField(blank=True, max_length=15),
),
]
1 change: 1 addition & 0 deletions apps/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Project(models.Model):
description = models.CharField(max_length=500)
url = models.URLField(max_length=200)
image = models.ImageField(upload_to='projects')
color = models.CharField(max_length=15, blank=True)
is_visible = models.BooleanField(default=False)

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion apps/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class ProjectSerializer(serializers.ModelSerializer):

class Meta:
model = Project
fields = ('permalink', 'title', 'description', 'url', 'image')
fields = ('permalink', 'title', 'description', 'url', 'image', 'color')
File renamed without changes.
9 changes: 9 additions & 0 deletions apps/timeline/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.contrib import admin

from .models import Timeline

# Register your models here.

@admin.register(Timeline)
class TimelineAdmin(admin.ModelAdmin):
list_display = ('title', 'timing', 'description')
5 changes: 5 additions & 0 deletions apps/timeline/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class TimelineConfig(AppConfig):
name = 'timeline'
26 changes: 26 additions & 0 deletions apps/timeline/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 2.2.4 on 2019-12-29 11:24

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Timeline',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('timing', models.CharField(max_length=50)),
('title', models.CharField(max_length=40)),
('description', models.CharField(max_length=500)),
],
options={
'db_table': 'timeline',
},
),
]
Loading