Skip to content

Commit 6dedc00

Browse files
authored
Merge pull request #162 from ComputerScienceHouse/develop
Packet 3.3 - Fall Packet MVP
2 parents 822a75d + 9116cbc commit 6dedc00

38 files changed

+1614
-646
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ config.py
110110
node_modules
111111

112112
# Generated Assets
113-
packet/static/css/packet.css
114-
*.min.css
113+
packet/static/css/**/*.css
114+
packet/static/js/*.min.js
115115
packet/static/android-chrome-192x192.png
116116
packet/static/android-chrome-512x512.png
117117
packet/static/apple-touch-icon.png

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6
1+
10

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get -yq update && \
1414

1515
ADD . /opt/packet
1616

17-
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
17+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
1818
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
1919
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
2020
apt-get -yq update && \

config.env.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
Default configuration settings and environment variable based configuration logic
33
See the readme for more information
44
"""
5-
5+
from distutils.util import strtobool
66
from os import environ
77

88
# Flask config
99
DEBUG = False
1010
IP = environ.get("PACKET_IP", "localhost")
1111
PORT = environ.get("PACKET_PORT", "8000")
12+
PROTOCOL = environ.get("PACKET_PROTOCOL", "https://")
1213
SERVER_NAME = environ.get("PACKET_SERVER_NAME", IP + ":" + PORT)
1314
SECRET_KEY = environ.get("PACKET_SECRET_KEY", "PLEASE_REPLACE_ME")
1415

@@ -31,5 +32,23 @@
3132
LDAP_BIND_DN = environ.get("PACKET_LDAP_BIND_DN", None)
3233
LDAP_BIND_PASS = environ.get("PACKET_LDAP_BIND_PASS", None)
3334

35+
# Mail Config
36+
MAIL_PROD = strtobool(environ.get("PACKET_MAIL_PROD", "False"))
37+
MAIL_SERVER = environ.get("PACKET_MAIL_SERVER", "thoth.csh.rit.edu")
38+
MAIL_USERNAME = environ.get("PACKET_MAIL_USERNAME", "[email protected]")
39+
MAIL_PASSWORD = environ.get("PACKET_MAIL_PASSWORD", None)
40+
MAIL_USE_TLS = strtobool(environ.get("PACKET_MAIL_TLS", "True"))
41+
42+
# OneSignal Config
43+
ONESIGNAL_USER_AUTH_KEY = environ.get("PACKET_ONESIGNAL_USER_AUTH_KEY", None)
44+
ONESIGNAL_CSH_APP_AUTH_KEY = environ.get("PACKET_ONESIGNAL_CSH_APP_AUTH_KEY", None)
45+
ONESIGNAL_CSH_APP_ID = environ.get("PACKET_ONESIGNAL_CSH_APP_ID", "6eff123a-0852-4027-804e-723044756f00")
46+
ONESIGNAL_INTRO_APP_AUTH_KEY = environ.get("PACKET_ONESIGNAL_INTRO_APP_AUTH_KEY", None)
47+
ONESIGNAL_INTRO_APP_ID = environ.get("PACKET_ONESIGNAL_INTRO_APP_ID", "6eff123a-0852-4027-804e-723044756f00")
48+
3449
# Slack URL for pushing to #general
3550
SLACK_WEBHOOK_URL = environ.get("PACKET_SLACK_URL", None)
51+
52+
# Packet Config
53+
PACKET_UPPER = environ.get("PACKET_UPPER", "packet.csh.rit.edu")
54+
PACKET_INTRO = environ.get("PACKET_INTRO", "freshmen-packet.csh.rit.edu")

frontend/scss/components/buttons.scss

+6
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ button {
1111
&.signed-button {
1212
float: right;
1313
}
14+
15+
@media screen and (min-width: 992px) {
16+
&.report-button {
17+
margin-top: 0.5rem !important;
18+
}
19+
}
1420
}

gulpfile.js/index.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@
1111
when you run `gulp`.
1212
*/
1313

14-
var requireDir = require('require-dir');
15-
var gulp = require('gulp');
14+
const requireDir = require('require-dir');
15+
const gulp = require('gulp');
1616

1717
// Require all tasks in gulpfile.js/tasks, including subfolders
1818
requireDir('./tasks', {recurse: true});
1919

20-
// CSS
21-
gulp.task('css', ['sass:compile', 'css:minify']);
22-
2320
// Default task
24-
gulp.task('default', ['css']);
25-
gulp.task('production', ['css', 'generate-favicon', 'pylint']);
21+
gulp.task('default', gulp.parallel('css', 'js'));
22+
gulp.task('production', gulp.parallel('css', 'js', 'generate-favicon', 'pylint'));

gulpfile.js/tasks/favicon.js

+66-66
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
var gulp = require('gulp');
2-
var realFavicon = require ('gulp-real-favicon');
3-
var fs = require('fs');
1+
const gulp = require('gulp');
2+
const realFavicon = require('gulp-real-favicon');
3+
const fs = require('fs');
44

55
// File where the favicon markups are stored
6-
var FAVICON_DATA_FILE = 'faviconData.json';
6+
const FAVICON_DATA_FILE = 'faviconData.json';
77

88
// Generate the icons. This task takes a few seconds to complete.
99
// You should run it at least once to create the icons. Then,
1010
// you should run it whenever RealFaviconGenerator updates its
1111
// package (see the check-for-favicon-update task below).
12-
gulp.task('generate-favicon', function(done) {
13-
realFavicon.generateFavicon({
14-
masterPicture: 'packet/static/assets/logo.svg',
15-
dest: 'packet/static',
16-
iconsPath: '/',
17-
design: {
18-
ios: {
19-
pictureAspect: 'backgroundAndMargin',
20-
backgroundColor: '#ffffff',
21-
margin: '35%',
22-
assets: {
23-
ios6AndPriorIcons: false,
24-
ios7AndLaterIcons: false,
25-
precomposedIcons: false,
26-
declareOnlyDefaultIcon: true
27-
}
28-
},
29-
desktopBrowser: {},
30-
windows: {
31-
pictureAspect: 'whiteSilhouette',
32-
backgroundColor: '#b0197e',
33-
onConflict: 'override',
34-
assets: {
35-
windows80Ie10Tile: true,
36-
windows10Ie11EdgeTiles: {
37-
small: true,
38-
medium: true,
39-
big: true,
40-
rectangle: true
41-
}
42-
}
43-
},
44-
androidChrome: {
45-
pictureAspect: 'noChange',
46-
themeColor: '#b0197e',
47-
manifest: {
48-
display: 'standalone',
49-
orientation: 'notSet',
50-
onConflict: 'override',
51-
declared: true
52-
},
53-
assets: {
54-
legacyIcon: false,
55-
lowResolutionIcons: false
56-
}
57-
},
58-
safariPinnedTab: {
59-
pictureAspect: 'silhouette',
60-
themeColor: '#b0197e'
61-
}
62-
},
63-
settings: {
64-
scalingAlgorithm: 'Mitchell',
65-
errorOnImageTooSmall: false,
66-
readmeFile: false,
67-
htmlCodeFile: false,
68-
usePathAsIs: false
69-
},
70-
markupFile: FAVICON_DATA_FILE
71-
}, function() {
72-
done();
73-
});
12+
gulp.task('generate-favicon', (done) => {
13+
realFavicon.generateFavicon({
14+
masterPicture: 'packet/static/assets/logo.svg',
15+
dest: 'packet/static',
16+
iconsPath: '/',
17+
design: {
18+
ios: {
19+
pictureAspect: 'backgroundAndMargin',
20+
backgroundColor: '#ffffff',
21+
margin: '35%',
22+
assets: {
23+
ios6AndPriorIcons: false,
24+
ios7AndLaterIcons: false,
25+
precomposedIcons: false,
26+
declareOnlyDefaultIcon: true
27+
}
28+
},
29+
desktopBrowser: {},
30+
windows: {
31+
pictureAspect: 'whiteSilhouette',
32+
backgroundColor: '#b0197e',
33+
onConflict: 'override',
34+
assets: {
35+
windows80Ie10Tile: true,
36+
windows10Ie11EdgeTiles: {
37+
small: true,
38+
medium: true,
39+
big: true,
40+
rectangle: true
41+
}
42+
}
43+
},
44+
androidChrome: {
45+
pictureAspect: 'noChange',
46+
themeColor: '#b0197e',
47+
manifest: {
48+
display: 'standalone',
49+
orientation: 'notSet',
50+
onConflict: 'override',
51+
declared: true
52+
},
53+
assets: {
54+
legacyIcon: false,
55+
lowResolutionIcons: false
56+
}
57+
},
58+
safariPinnedTab: {
59+
pictureAspect: 'silhouette',
60+
themeColor: '#b0197e'
61+
}
62+
},
63+
settings: {
64+
scalingAlgorithm: 'Mitchell',
65+
errorOnImageTooSmall: false,
66+
readmeFile: false,
67+
htmlCodeFile: false,
68+
usePathAsIs: false
69+
},
70+
markupFile: FAVICON_DATA_FILE
71+
}, function () {
72+
done();
73+
});
7474
});

gulpfile.js/tasks/javascript.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const gulp = require('gulp');
2+
const minify = require('gulp-minify');
3+
4+
gulp.task('js:minify', (done) => {
5+
gulp.src([
6+
'packet/static/js/*.js',
7+
'!packet/static/js/*.min.js'
8+
])
9+
.pipe(minify({
10+
ext: {
11+
src: '.js',
12+
min: '.min.js'
13+
},
14+
ignoreFiles: ['.min.js']
15+
}))
16+
.pipe(gulp.dest('packet/static/js'));
17+
done();
18+
});
19+
20+
// JS
21+
gulp.task('js', gulp.series('js:minify'));

gulpfile.js/tasks/minify.js

-16
This file was deleted.

gulpfile.js/tasks/pylint.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
var gulp = require('gulp');
2-
var exec = require('child_process').exec;
1+
const gulp = require('gulp');
2+
const exec = require('child_process').exec;
33

4-
var pylintTask = function (cb) {
4+
let pylintTask = (cb) => {
55
exec('pylint packet', function (err, stdout, stderr) {
66
console.log(stdout);
77
console.log(stderr);
88
cb(err);
99
});
10-
}
10+
};
1111

1212
gulp.task('pylint', pylintTask);

gulpfile.js/tasks/sass.js

-11
This file was deleted.

gulpfile.js/tasks/stylesheets.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const gulp = require('gulp');
2+
const sass = require('gulp-sass');
3+
const cleanCSS = require('gulp-clean-css');
4+
const rename = require("gulp-rename");
5+
6+
// Compile SCSS
7+
gulp.task('sass:compile', () => {
8+
return gulp.src('frontend/scss/**/*.scss')
9+
.pipe(sass.sync({
10+
outputStyle: 'expanded'
11+
}).on('error', sass.logError))
12+
.pipe(gulp.dest('packet/static/css'))
13+
});
14+
15+
// Minify CSS
16+
gulp.task('css:minify', () => {
17+
return gulp.src([
18+
'packet/static/css/*.css',
19+
'!packet/static/css/*.min.css'
20+
])
21+
.pipe(cleanCSS())
22+
.pipe(rename({
23+
suffix: '.min'
24+
}))
25+
.pipe(gulp.dest('packet/static/css'));
26+
});
27+
28+
// CSS
29+
gulp.task('css', gulp.series('sass:compile', 'css:minify'));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""notifications
2+
3+
Revision ID: 53768f0a4850
4+
Revises: eecf30892d0e
5+
Create Date: 2019-08-06 22:15:04.400982
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '53768f0a4850'
14+
down_revision = 'eecf30892d0e'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.create_table('notification_subscriptions',
22+
sa.Column('member', sa.String(length=36), nullable=True),
23+
sa.Column('freshman_username', sa.String(length=10), nullable=True),
24+
sa.Column('token', sa.String(length=256), nullable=False),
25+
sa.ForeignKeyConstraint(['freshman_username'], ['freshman.rit_username'], ),
26+
sa.PrimaryKeyConstraint('token')
27+
)
28+
# ### end Alembic commands ###
29+
30+
31+
def downgrade():
32+
# ### commands auto generated by Alembic - please adjust! ###
33+
op.drop_table('notification_subscriptions')
34+
# ### end Alembic commands ###
35+

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "CSH Packet",
33
"name": "csh-packet",
4-
"version": "3.2",
4+
"version": "3.3.0",
55
"description": "A web app implementation of the CSH introductory packet.",
66
"bugs": {
77
"url": "https://github.com/ComputerScienceHouse/packet/issues",
@@ -17,11 +17,12 @@
1717
"url": "https://github.com/ComputerScienceHouse/packet.git"
1818
},
1919
"devDependencies": {
20-
"gulp": "^3.9.1",
21-
"gulp-clean-css": "^3.9.2",
22-
"gulp-real-favicon": "^0.2.2",
23-
"gulp-rename": "^1.2.2",
24-
"gulp-sass": "^3.1.0",
25-
"require-dir": "^1.0.0"
20+
"gulp": "^4.0.2",
21+
"gulp-clean-css": "^4.2.0",
22+
"gulp-real-favicon": "^0.3.2",
23+
"gulp-rename": "^1.4.0",
24+
"gulp-sass": "^4.0.2",
25+
"gulp-minify": "^3.1.0",
26+
"require-dir": "^1.2.0"
2627
}
2728
}

0 commit comments

Comments
 (0)