Skip to content
This repository was archived by the owner on Dec 28, 2018. It is now read-only.

Commit 0432211

Browse files
committed
finish?
1 parent 11ea88f commit 0432211

File tree

15 files changed

+280
-57
lines changed

15 files changed

+280
-57
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ To run this website, you will need to have installed `python 2.7` or higher, `vi
2626
```
2727

2828
5. Modify and update env.json with your sample data
29+
```bash
30+
$ vi env.json
31+
```
2932

3033
6. Run server
3134
To start the webserver type the following:
3235
```bash
3336
$ npm start
3437
```
3538

36-
The website should run on [localhost:5000](http://localhost:5000)
39+
The website should run on [localhost:4220](http://localhost:4220)
3740

3841
7. Cleanup
3942
Remember to deactivate your virtual environment when you are done

index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from src import app
2-
app.run(debug=True)
2+
app.run(debug=False)

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "This repository will store the transition website for HackMerced 2017F. It is written in Python with the Flask framewrork and will be used to server some basic files as well as enable a microservice to list jobs from our internal filesystem. This readme will be updated on the full uses of this website and how to use it.",
55
"main": "index.js",
66
"dependencies": {
7+
"jquery": "^3.2.1",
78
"normalize.css": "^5.0.0"
89
},
910
"devDependencies": {
@@ -19,8 +20,9 @@
1920
"scripts": {
2021
"test": "",
2122
"setup": "pip install -r py_deps.txt && npm install && npm run build && python ./tools/build.py",
22-
"build":"gulp production",
23+
"build": "gulp production",
2324
"start": "python index.py",
25+
"jobs": "python ./tools/pullJobs.py",
2426
"gulp": "gulp"
2527
},
2628
"repository": {

serve/css/general/index.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ aside{
2323
z-index: 1;
2424
}
2525

26-
.information{
26+
.information, .join{
2727
max-width: 600px;
2828
width: 100%;
2929
}

serve/css/general/join.scss

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.role--lower{
2+
display: inline;
3+
4+
* {
5+
display: inline;
6+
margin-right: 15px;
7+
font-size: 14px;
8+
color: $grey;
9+
}
10+
}
11+
12+
.role-title{
13+
font-size: 16px;
14+
font-weight: 600;
15+
line-height: 1;
16+
max-width: 350px;
17+
white-space: nowrap;
18+
overflow: hidden;
19+
text-overflow: ellipsis
20+
}
21+
22+
23+
button.role-filter{
24+
margin: 10px 20px 10px 0px;
25+
}
26+
27+
.role{
28+
display: flex;
29+
justify-content: space-between;
30+
margin: 10px 0px 20px;
31+
}
32+
33+
.join{
34+
h5{
35+
margin: 15px 0px 0px;
36+
}
37+
38+
p{
39+
margin:0px 0px;
40+
}
41+
}
42+
43+
.role-details{
44+
background: #1F2335;
45+
padding: 1px 20px 20px;
46+
margin-bottom: 20px;
47+
display: none;
48+
49+
li{
50+
margin-left: 30px;
51+
}
52+
53+
button{
54+
margin: 20px 0px 0px;
55+
padding: 10px 25px;
56+
width: 150px;
57+
}
58+
59+
}

serve/css/general/z_mobile.scss

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@media (max-width:600px) {
2+
header{
3+
display: block;
4+
}
5+
6+
.toTheRight{
7+
width: 100%;
8+
min-width: 250px;
9+
max-width: 100%;
10+
padding: 20px;
11+
}
12+
13+
nav{
14+
line-height: 40px;
15+
text-align: center;
16+
}
17+
18+
.logo{
19+
margin: 0 auto 20px;
20+
21+
}
22+
23+
h1{
24+
font-size: 32px;
25+
font-weight: 700;
26+
line-height: 1.2;
27+
28+
}
29+
30+
h4{
31+
margin: 25px 0px 15px;
32+
line-height: 1.5;
33+
}
34+
35+
aside{
36+
display: none;
37+
}
38+
39+
.role{
40+
display: block;
41+
}
42+
43+
nav{
44+
text-align: center;
45+
}
46+
47+
48+
.role--learn-more.slim {
49+
margin-top: 15px;
50+
}
51+
52+
button{
53+
width: 100%;
54+
}
55+
56+
.role-details button{
57+
width: 100%;
58+
}
59+
60+
}

serve/img/logo.png

2.92 KB
Loading

serve/js/app.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

22
document.addEventListener("DOMContentLoaded", function(event) {
33
imageSlider();
4+
findRoles();
45
});

serve/js/general/index.js

-1
This file was deleted.

serve/js/general/join.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
$(document).on("click", ".role--learn-more", function(){
2+
const $this = $(this);
3+
4+
$this.parent().parent().find(".role-details").toggle();
5+
});
6+
7+
let roles = {};
8+
function generateRole(role){
9+
role = $.trim(role);
10+
11+
if(!roles[role]){
12+
$("#filter-roles").append(`<button data-type='${role.replace(" ", "-")}' class='role-filter slim'>${role}</button>`);
13+
14+
roles[role] = true;
15+
}
16+
}
17+
18+
// load Roles
19+
function findRoles(){
20+
$(".role-type").each(function(){
21+
generateRole($(this).text());
22+
})
23+
}
24+
25+
26+
let filter = {};
27+
$(document).on("click", ".role-filter", function(){
28+
let type = $(this).data("type");
29+
filter[type] = (filter[type]) ? false : true;
30+
$(this).toggleClass("selected");
31+
updateFilter();
32+
});
33+
34+
function updateFilter(){
35+
let vis = 0;
36+
$(".role-container").css("display", "none");
37+
38+
for(let i in filter){
39+
if(filter[i]){
40+
$(".role--type-" + i).css("display", "block");
41+
vis++;
42+
}
43+
44+
}
45+
46+
if(vis === 0){
47+
$(".role-container").css("display", "block");
48+
}
49+
50+
51+
}

src/__init__.py

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
# do all the work here
2-
32
from flask import Flask, render_template
3+
import os
4+
import inspect
5+
import json
46
app = Flask(__name__)
57

8+
# get directory
9+
filename = inspect.getframeinfo(inspect.currentframe()).filename
10+
os.chdir(os.path.dirname(os.path.abspath(filename)))
11+
os.chdir("..")
12+
path = os.path.abspath(os.curdir)
13+
14+
15+
616
@app.route('/')
717
def index():
8-
return render_template('general/index.html', jobs = 0)
18+
return render_template('general/index.html')
19+
20+
21+
positions = open(path + "/src/static/jobs.json", "r").read()
22+
positions = json.loads(positions)
923

10-
@app.route('/work')
24+
@app.route('/join')
1125
def jobs():
12-
return render_template('general/work.html', jobs = 1)
26+
return render_template('general/join.html', jobs=positions )
1327

1428

1529
#hello
1630
if __name__ == "__main__":
17-
app.run()
31+
app.run(port=4220)

src/templates/general/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h4>HackMerced Leadership Information</h4>
1414
<p>
1515
HackMerced is looking for a talented group of individuals who want to build the future of our event. Come to our info-session on March 21, 2017 at COB2 130 at UC Merced to learn more. Anyone can help lead our event, as long as you are enrolled in a four-year university.
1616
</p>
17-
<a href="https://www.facebook.com/groups/580850972124303/?fref=nf">
17+
<a class='disable-hover' href="https://www.facebook.com/events/270082940100937/">
1818
<button>Join Event on Facebook</button> </a>
1919
</article>
2020
</section>

src/templates/general/work.html renamed to src/templates/general/join.html

+46-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "layout.html" %}
22
{% block body %}
3-
<div class='information'>
3+
<div class='join'>
44
<h1>Build HackMerced</h1>
55
<section>
66
<article>
@@ -11,12 +11,54 @@ <h4>We’re looking for people like you!</h4>
1111
We also have an FAQ for you below the job listings!
1212
</p>
1313
</article>
14-
<article>
14+
<article class='leadership-list'>
1515
<h4>HackMerced Leadership Information</h4>
1616
<h5>Filter Role</h5>
17-
<div id='filter-jobs'></div>
17+
<div id='filter-roles'></div>
1818
<h5>Role Listings</h5>
19-
<div id='job-listing'></div>
19+
<div id='role-listing'>
20+
{% for job in jobs['jobs'] %}
21+
<div class='role-container role--type-{{job.Division.replace(" ", "-")}}'>
22+
<div class='role'>
23+
<div class='role-left'>
24+
<div class='role-title'>
25+
{{ job.Role }}
26+
</div>
27+
<div class='role--lower'>
28+
<div class='role--lower-item role-type'>
29+
{{ job.Division }}
30+
</div>
31+
{% if job.Leadership == "Yes" %}
32+
<div class='role--lower-item'>
33+
Leadership
34+
</div>
35+
{% endif %}
36+
</div>
37+
</div>
38+
<button class='role--learn-more slim'>
39+
Learn More
40+
</button>
41+
</div>
42+
<div class='role-details'>
43+
<h5>Description</h5>
44+
<div class='role-description'>
45+
{{ job.Description }}
46+
</div>
47+
<h5>What we look for:</h5>
48+
{% for reqs in job.Requirements %}
49+
<li> {{ reqs }} </li>
50+
{% endfor %}
51+
<h5>Things that aren't required but will help your application:</h5>
52+
{% for opts in job.Optional %}
53+
<li> {{ opts }} </li>
54+
{% endfor %}
55+
<a target='_blank' class='disable-hover' href='https://docs.google.com/forms/d/e/1FAIpQLSe7WG24hMWQvsqNpeiEkJW78d3OjRsg0VO4Toxd4Y-I3RRzRw/viewform?usp=pp_url&entry.2139628244={{job.Role}}&entry.1781500597&entry.1640447617&entry.297979220&entry.2040870261'>
56+
<button>Apply now</button>
57+
</a>
58+
</div>
59+
</div>
60+
{% endfor %}
61+
</div>
2062
</article>
2163
<article>
2264
<h4>FAQ</h4>

src/templates/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class='logo'></div>
33
<nav>
44
<li><a fakelink href='/'>Home</a></li>
5-
<li><a fakelink href='/jobs'>Work with us!</a></li>
5+
<li><a fakelink href='/join'>Join us!</a></li>
66
<li><a href='https://github.com/HackMerced'>Open Source</a></li>
77
<li><a href='https://www.facebook.com/hackmerced/messages/?initialClientFilter=unanswered&threadid=1695866600&timestamp=1487195154514#'>Contact</a></li>
88
</nav>

0 commit comments

Comments
 (0)