diff --git a/app/Calendar.js b/app/Calendar.js index 7be56a4..88a876c 100644 --- a/app/Calendar.js +++ b/app/Calendar.js @@ -38,9 +38,9 @@ export const EventInfo = ({route}) => { const itemDate = new Date(item.event_date) const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] const months = ['January','February','March','April','May','June','July','August','September','October','November','December',] - const dayOfWeek = days[itemDate.getDay()] + const dayOfWeek = days[itemDate.getDay()+1] const month = months[itemDate.getMonth()] - const date = itemDate.getDate() + const date = itemDate.getDate()+1 console.log(itemDate.getDate()) @@ -83,7 +83,7 @@ const Event = (props) => { return ( - props.navigation.navigate('EventInfo', {data:props.data, title: item.item.title,text:item.item.text,location:item.item.location,date:item.item.event_date, name:item.item.name, emails: item.item.emails})} activeOpacity={0.8}> + props.navigation.navigate('EventInfo', {data:props.data, title: item.item.title,text:item.item.text,location:item.item.location,event_date:item.item.event_date, name:item.item.name, emails: item.item.emails})} activeOpacity={0.8}> @@ -209,10 +209,7 @@ class Calendar extends React.Component { if (this.state.data.length >0) { try { for (var i =0; i < this.state.data.length; i++) { - console.log(String(this.state.data[i].event_date)) const itemDate = new Date(parseInt(String(this.state.data[i].event_date).split('-')[0]), parseInt(String(this.state.data[i].event_date).split('-')[1])-1, parseInt(String(this.state.data[i].event_date).split('-')[2])) - console.log(itemDate) - console.log('he') if (itemDate.getTime() == todayDate.getTime()) { today.push(this.state.data[i]) } @@ -226,8 +223,6 @@ class Calendar extends React.Component { } } catch {null} - - } if (today.length === 0) todayBoolean = false diff --git a/cms/migrations/setup/up.sql b/cms/migrations/setup/up.sql index b1c884a..c52e53d 100644 --- a/cms/migrations/setup/up.sql +++ b/cms/migrations/setup/up.sql @@ -21,9 +21,51 @@ CREATE TABLE teachers ( id SERIAL PRIMARY KEY, lang VARCHAR, name VARCHAR NOT NULL, - emails VARCHAR[] + emails VARCHAR NOT NULL ); +CREATE TABLE announcements ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + message VARCHAR NOT NULL, + teacher VARCHAR NOT NULL, + date DATE, + time TIME +); + +CREATE TABLE clubs ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + name VARCHAR NOT NULL, + meeting VARCHAR NOT NULL, + link VARCHAR NOT NULL, + sponsor VARCHAR NOT NULL +); + +CREATE TABLE lunch_events ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + title VARCHAR NOT NULL, + text VARCHAR NOT NULL, + location VARCHAR NOT NULL, + time TIME +); + +CREATE TABLE ssl_opps ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + title VARCHAR NOT NULL, + text VARCHAR NOT NULL, + location VARCHAR NOT NULL, + teacher VARCHAR NOT NULL, + time TIME +); + +CREATE TABLE polls ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + url VARCHAR NOT NULL +); CREATE TABLE new ( id SERIAL PRIMARY KEY, @@ -32,3 +74,10 @@ CREATE TABLE new ( name VARCHAR NOT NULL, new_date DATE ); + +CREATE TABLE important ( + id SERIAL PRIMARY KEY, + lang VARCHAR, + image VARCHAR, + text VARCHAR NOT NULL +) diff --git a/cms/src/data/mod.rs b/cms/src/data/mod.rs index fab0a59..8d7e77d 100644 --- a/cms/src/data/mod.rs +++ b/cms/src/data/mod.rs @@ -158,7 +158,7 @@ api_route! { api_route! { teachers { name: (Text, String, String), - emails: (Array, Vec, EmailList), + emails: (Text, String, String), } } @@ -171,6 +171,15 @@ api_route! { } } +api_route! { + student { + name: (Text, String, String), + meeting: (Text, String, String), + link: (Text, String, String), + sponsor: (Text, String, String), + } +} + api_route! { clubs { name: (Text, String, String), diff --git a/cms/templates/announcements.html.hbs b/cms/templates/announcements.html.hbs new file mode 100644 index 0000000..cea3483 --- /dev/null +++ b/cms/templates/announcements.html.hbs @@ -0,0 +1,174 @@ +{{! vim: set ft=html: }} + + + + + + + + + + +
+

+ Admin Panel +

+
+ +
+ +
+

Announcements

+ +
+ {{#each ctx}} +
+ ID: {{id}} | LANG: {{lang}} +

{{teacher}}

+

{{message}}

+ {{date}} at time {{time}} +
+
+ +
+ +
+
+ {{/each}} +
+
+ + +
+

Announcements Actions

+ +
+ +
+

Add Event

+
+
+
+

Lang

+ +
+
+ +
+
+ +
+
+

Teacher

+
+
+ +
+
+ +
+
+

Message

+
+
+ +
+
+ +
+
+

Date

+
+
+ +
+
+ +
+
+

Time of Submission

+
+
+ +
+
+ + +
+
+ +
+

Update Event

+
+
+
+

ID of event to update

+
+
+ +
+
+ +
+
+

Lang

+ +
+
+ +
+
+ +
+
+

Teacher

+
+
+ +
+
+ +
+
+

Message

+
+
+ +
+
+ +
+
+

Date

+
+
+ +
+
+ +
+
+

Time of Submission

+
+
+ +
+
+ +
+
+

Teacher/Organizer Email

+
+
+ +
+
+ +
+
+ +
+
+
+ + \ No newline at end of file diff --git a/cms/templates/clubs.html.hbs b/cms/templates/clubs.html.hbs new file mode 100644 index 0000000..2c266a2 --- /dev/null +++ b/cms/templates/clubs.html.hbs @@ -0,0 +1,175 @@ +{{! vim: set ft=html: }} + + + + + + + + + + +
+

+ Admin Panel +

+
+ +
+ +
+

Clubs

+ +
+ {{#each ctx}} +
+ ID: {{id}} | LANG: {{lang}} +

{{name}}

+

{{meeting}}

+ {{link}} +

Sponsor: {{sponsor}}

+
+
+ +
+ +
+
+ {{/each}} +
+
+ + +
+

Clubs Actions

+ +
+ +
+

Add Event

+
+
+
+

Lang

+ +
+
+ +
+
+ +
+
+

Teacher

+
+
+ +
+
+ +
+
+

Message

+
+
+ +
+
+ +
+
+

Date

+
+
+ +
+
+ +
+
+

Time of Submission

+
+
+ +
+
+ + +
+
+ +
+

Update Event

+
+
+
+

ID of event to update

+
+
+ +
+
+ +
+
+

Lang

+ +
+
+ +
+
+ +
+
+

Teacher

+
+
+ +
+
+ +
+
+

Message

+
+
+ +
+
+ +
+
+

Date

+
+
+ +
+
+ +
+
+

Time of Submission

+
+
+ +
+
+ +
+
+

Teacher/Organizer Email

+
+
+ +
+
+ +
+
+ +
+
+
+ + \ No newline at end of file diff --git a/cms/templates/events.html.hbs b/cms/templates/events.html.hbs index f3c63ef..94c0826 100644 --- a/cms/templates/events.html.hbs +++ b/cms/templates/events.html.hbs @@ -28,6 +28,12 @@

{{text}}

{{event_date}} at {{location}}

Organizer: {{name}} | Organizer Email: {{emails}}

+
+
+ +
+ +
{{/each}} @@ -110,25 +116,6 @@ -
- -
-

Delete Event

-
-
-
-

ID of event to delete

-
-
- -
-
- -
-
- -
-

Update Event

@@ -212,10 +199,4 @@
- - -