-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,391 additions
and
750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
language: python | ||
python: | ||
- "3.7" | ||
services: | ||
- "docker" | ||
|
||
install: | ||
- "pip install -r requirements.txt" | ||
- "curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash" | ||
- "nvm install" | ||
- "nvm use" | ||
- "npm install -g gulp" | ||
- "npm install" | ||
script: | ||
- "pylint --load-plugins pylint_quotes packet/routes packet" | ||
- "gulp lint" | ||
- "docker build -t packet ." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pre{ | ||
white-space: pre-wrap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from flask import render_template | ||
|
||
from packet import app | ||
from packet.models import Packet, Freshman | ||
from packet.routes.shared import packet_sort_key | ||
from packet.utils import before_request, packet_auth, admin_auth | ||
from packet.log_utils import log_cache, log_time | ||
|
||
|
||
@app.route('/admin/packets') | ||
@log_cache | ||
@packet_auth | ||
@admin_auth | ||
@before_request | ||
@log_time | ||
def admin_packets(info=None): | ||
open_packets = Packet.open_packets() | ||
|
||
# Pre-calculate and store the return values of did_sign(), signatures_received(), and signatures_required() | ||
for packet in open_packets: | ||
packet.did_sign_result = packet.did_sign(info['uid'], app.config['REALM'] == 'csh') | ||
packet.signatures_received_result = packet.signatures_received() | ||
packet.signatures_required_result = packet.signatures_required() | ||
|
||
open_packets.sort(key=packet_sort_key, reverse=True) | ||
|
||
return render_template('admin_packets.html', | ||
open_packets=open_packets, | ||
info=info) | ||
|
||
|
||
@app.route('/admin/freshmen') | ||
@log_cache | ||
@packet_auth | ||
@admin_auth | ||
@before_request | ||
@log_time | ||
def admin_freshmen(info=None): | ||
all_freshmen = Freshman.get_all() | ||
|
||
return render_template('admin_freshmen.html', | ||
all_freshmen=all_freshmen, | ||
info=info) |
Oops, something went wrong.