Skip to content

Commit 41e2dc5

Browse files
committed
Restructure site and bug fixes
Fixes coala#44 Closes coala#1
1 parent 3080184 commit 41e2dc5

15 files changed

+312
-63
lines changed

activity/views.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.shortcuts import render
2+
3+
4+
def index(request):
5+
org_name = open('org_name.txt').readline()
6+
return render(request, 'activity.html', {'org_name': org_name})
7+
8+
9+
def return_org_name(request):
10+
org_name = open('org_name.txt').readline()
11+
return {'org_name': org_name}

community/context_processors.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def get_org_name(request):
2+
org_name = open('org_name.txt').readline()
3+
return {'org_name': org_name}

community/settings.py

+2
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@
8989
MEDIA_URL = '/media/'
9090
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
9191
STATICFILES_DIRS = ['static/']
92+
TEMPLATES[0]['OPTIONS']['context_processors'].append(
93+
'community.context_processors.get_org_name')

community/urls.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from gci.views import index as gci_index
1111
from twitter.view_twitter import index as twitter_index
12+
from activity.views import index as activity_index
1213

1314

1415
def get_index():
@@ -25,7 +26,7 @@ def get_index():
2526
distill_file='index.html',
2627
),
2728
distill_url(
28-
r'activity/', TemplateView.as_view(template_name='activity.html'),
29+
r'activity/', activity_index,
2930
name='activity',
3031
distill_func=get_index,
3132
distill_file='activity/index.html',

static/css/main.css

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.student {
2+
padding-bottom: 20px;
3+
}
4+
5+
.students {
6+
list-style: none;
7+
}
8+
nav {
9+
background-color: #38474e !important;
10+
}
11+
12+
.page-footer {
13+
background-color: #37474f !important;
14+
}
15+
16+
canvas {
17+
-moz-user-select: none;
18+
-webkit-user-select: none;
19+
-ms-user-select: none;
20+
}
File renamed without changes.
File renamed without changes.

static/main.css

-7
This file was deleted.

templates/activity.html

+47-36
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,52 @@
1-
<!doctype html>
2-
<html>
1+
{% extends 'includes.html' %}
2+
{% block content %}
3+
<div class="section no-pad-bot" id="index-banner">
4+
<div class="container">
5+
<h1 class="header center col-test">Welcome</h1>
6+
<div class="row center">
7+
<h5 class="header col s12 light">Hello, world. You are at the {{ org_name }} community GCI website.</h5>
8+
</div>
9+
</div>
310

4-
<head>
5-
<title>Community Activity</title>
6-
<style>
7-
canvas {
8-
-moz-user-select: none;
9-
-webkit-user-select: none;
10-
-ms-user-select: none;
11-
}
12-
</style>
13-
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
14-
</head>
1511

16-
<body>
17-
<h1>Community Activity</h1>
18-
<br>
19-
<br>
20-
<div style="width:75%;">
21-
<canvas id="canvas"></canvas>
12+
<div class="row center">
13+
<div class="input-field col s4">
14+
<select id="chartType">
15+
<option value="Month" selected>Year</option>
16+
<option value="Week">Month</option>
17+
<option value="Day">Week</option>
18+
</select>
19+
<label>Time Interval</label>
20+
</div>
21+
<div class="col s12 center">
22+
23+
<div class="card white darken-1">
24+
<div class="card-content black-text">
25+
<span class="card-title">Issues</span>
26+
27+
<div>
28+
<canvas id="canvas"></canvas>
29+
</div>
30+
</div>
31+
32+
</div>
33+
</div>
34+
</div>
2235
</div>
23-
<select id="chartType">
24-
<option value="Month">Year</option>
25-
<option value="Week">Month</option>
26-
<option value="Day">Week</option>
27-
</select>
28-
<br>
29-
<br>
30-
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js"></script>
31-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
32-
<script src="/static/charts.js"></script>
33-
<script>
34-
$('#chartType').on('change', function(){
35-
updateChart($('#chartType').val())
36-
});
37-
updateChart($('#chartType').val());
38-
</script>
39-
</body>
4036

37+
{% include 'footer.html' %}
38+
<!--Import jQuery before materialize.js-->
39+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js"></script>
40+
<script src="../static/js/charts.js"></script>
41+
<script>
42+
$(document).ready(function() {
43+
$('select').material_select();
44+
});
45+
$('#chartType').on('change', function(){
46+
updateChart($('#chartType').val())
47+
});
48+
updateChart($('#chartType').val());
49+
</script>
50+
{% endblock %}
51+
</body>
4152
</html>

templates/footer.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<footer class="page-footer">
2+
<div class="container">
3+
<div class="row">
4+
<div class="col m3 s12">
5+
<h5 class="white-text fine">{{ org_name }}</h5>
6+
<ul>
7+
<li><a class="grey-text text-lighten-3" href="http://{{ org_name }}.io/docs">Documentation</a></li>
8+
<li><a class="grey-text text-lighten-3" href="http://{{ org_name }}.io/newcomer">Newcomer Docs</a></li>
9+
<li><a class="grey-text text-lighten-3" href="http://{{ org_name }}.io/coc">Code of Conduct</a></li>
10+
<li><a class="grey-text text-lighten-3" href="http://blog.{{ org_name }}.io/">Blog</a></li>
11+
<li><a class="grey-text text-lighten-3" href="mailto:sponsoring@{{ org_name }}.io">Donate</a></li>
12+
</ul>
13+
</div>
14+
<div class="col m9 s12">
15+
<div class="row footer-btn-row">
16+
<div class="col m6 s12 center">
17+
<div class="twitter-btn center">
18+
<a href="https://twitter.com/{{ org_name }}_io" class="waves-effect waves-light btn-large"><i class="fa fa-twitter" aria-hidden="true"></i><span class="footer-btn-text">Follow Us On Twitter</span></a>
19+
</div>
20+
<br>
21+
</div>
22+
<div class="col m6 s12 center">
23+
<div class="gitter-btn center">
24+
<a class="waves-effect waves-light btn-large"><i class="fa fa-commenting-o" aria-hidden="true"></i><span class="footer-btn-text">Join Chat On Gitter</span></a>
25+
</div>
26+
<br>
27+
</div>
28+
</div>
29+
</div>
30+
</div>
31+
</div>
32+
<div class="footer-copyright">
33+
<div class="container">
34+
<span class="left">© 2017 {{ org_name }}</span>
35+
<a class="grey-text text-lighten-4 right" href="#!">GNU AGPL v3.0</a>
36+
</div>
37+
</div>
38+
</footer>

templates/includes.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<!--Import Google Icon Font-->
5+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
6+
<!--Import materialize.css-->
7+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
8+
<link rel="stylesheet" href="../static/css/main.css">
9+
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
10+
<!--Let browser know website is optimized for mobile-->
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
12+
</head>
13+
<body>
14+
15+
<nav>
16+
<div class="nav-wrapper">
17+
<a href="#" class="brand-logo">&nbsp;<img
18+
src="https://api.{{ org_name }}.io/en/latest/_static/images/{{ org_name }}_logo.svg"></a>
19+
<ul id="nav-mobile" class="right hide-on-med-and-down">
20+
<li><a href="/gci">GCI</a></li>
21+
<li><a href="/activity">Github Activity</a></li>
22+
<li><a href="/twitter">Twitter Feed</a></li>
23+
</ul>
24+
</div>
25+
</nav>
26+
27+
{% block content %}
28+
{% endblock %}
29+
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>

templates/index.html

+119-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,120 @@
1-
<title>Community website</title>
2-
<body>
3-
<ul>
4-
<li><a href="/gci/">Google Code-in</a>
5-
<li><a href="/activity/">GitHub activity</a>
6-
<li><a href="/twitter/">Twitter Feed</a>
7-
</ul>
1+
{% extends 'includes.html' %}
2+
3+
{% block content %}
4+
<div class="section no-pad-bot" id="index-banner">
5+
<div class="container">
6+
<h1 class="header center col-test">Welcome</h1>
7+
<div class="row center">
8+
<h5 class="header col s12 light">Hello, world. You are at the {{ org_name }} community GCI website.</h5>
9+
<h4 class="header col s12 light">Meet awesome mentors</h4>
10+
11+
</div>
12+
<div class="row">
13+
14+
<div class="col s4">
15+
<div class="card" style="overflow: visible;">
16+
<div class="card-image waves-effect waves-block waves-light">
17+
<img class="activator" src="https://api.{{ org_name }}.io/en/latest/_static/images/{{ org_name }}_logo.svg">
18+
</div>
19+
<div class="card-content">
20+
<span class="card-title activator grey-text text-darken-4">Mentor Name<i class="material-icons right">more_vert</i></span>
21+
22+
</div>
23+
<div class="card-reveal" style="display: none; transform: translateY(0px);">
24+
<span class="card-title grey-text text-darken-4">Card Title<i class="material-icons right">close</i></span>
25+
<p>Here is some more information about this product that is only revealed once clicked on.</p>
26+
</div>
27+
28+
<div class="card-action">
29+
<a href="#">Github</a>
30+
<a href="#">Twitter</a>
31+
</div>
32+
</div></div>
33+
<div class="col s4">
34+
<div class="card" style="overflow: visible;">
35+
<div class="card-image waves-effect waves-block waves-light">
36+
<img class="activator" src="https://api.{{ org_name }}.io/en/latest/_static/images/{{ org_name }}_logo.svg">
37+
</div>
38+
<div class="card-content">
39+
<span class="card-title activator grey-text text-darken-4">Mentor Name<i class="material-icons right">more_vert</i></span>
40+
41+
</div>
42+
<div class="card-reveal" style="display: none; transform: translateY(0px);">
43+
<span class="card-title grey-text text-darken-4">Card Title<i class="material-icons right">close</i></span>
44+
<p>Here is some more information about this product that is only revealed once clicked on.</p>
45+
</div>
46+
47+
<div class="card-action">
48+
<a href="#">Github</a>
49+
<a href="#">Twitter</a>
50+
</div>
51+
</div></div>
52+
<div class="col s4">
53+
<div class="card" style="overflow: visible;">
54+
<div class="card-image waves-effect waves-block waves-light">
55+
<img class="activator" src="https://api.{{ org_name }}.io/en/latest/_static/images/{{ org_name }}_logo.svg">
56+
</div>
57+
<div class="card-content">
58+
<span class="card-title activator grey-text text-darken-4">Mentor Name<i class="material-icons right">more_vert</i></span>
59+
60+
</div>
61+
<div class="card-reveal" style="display: none; transform: translateY(0px);">
62+
<span class="card-title grey-text text-darken-4">Card Title<i class="material-icons right">close</i></span>
63+
<p>Here is some more information about this product that is only revealed once clicked on.</p>
64+
</div>
65+
66+
<div class="card-action">
67+
<a href="#">Github</a>
68+
<a href="#">Twitter</a>
69+
</div>
70+
</div></div>
71+
</div>
72+
<h4 class="header col s12 light center">Recent Activity</h4>
73+
<div class="section no-pad-bot" id="index-banner">
74+
75+
76+
77+
<div class="row center">
78+
<div class="input-field col s4">
79+
<select id="chartType">
80+
<option value="Month" selected>Year</option>
81+
<option value="Week">Month</option>
82+
<option value="Day">Week</option>
83+
</select>
84+
<label>Time Interval</label>
85+
</div>
86+
<div class="col s12 center">
87+
88+
<div class="card white darken-1">
89+
<div class="card-content black-text">
90+
<span class="card-title">Issues</span>
91+
92+
<div>
93+
<canvas id="canvas"></canvas>
94+
</div>
95+
</div>
96+
97+
</div>
98+
</div>
99+
</div>
100+
</div>
101+
<!--Import jQuery before materialize.js-->
102+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js"></script>
103+
<script src="../static/js/charts.js"></script>
104+
<script>
105+
$(document).ready(function() {
106+
$('select').material_select();
107+
});
108+
$('#chartType').on('change', function(){
109+
updateChart($('#chartType').val())
110+
});
111+
updateChart($('#chartType').val());
112+
</script>
113+
</div>
114+
</div>
115+
116+
{% include 'footer.html' %}
117+
{% endblock %}
8118
</body>
119+
</html>
120+

templates/issues_graph.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="row center">
2+
<div class="input-field col s4">
3+
<select id="chartType">
4+
<option value="Month" selected>Year</option>
5+
<option value="Week">Month</option>
6+
<option value="Day">Week</option>
7+
</select>
8+
<label>Time Interval</label>
9+
</div>
10+
<div class="col s12 center">
11+
12+
<div class="card white darken-1">
13+
<div class="card-content black-text">
14+
<span class="card-title">Issues</span>
15+
16+
<div>
17+
<canvas id="canvas"></canvas>
18+
</div>
19+
</div>
20+
</div>
21+
</div>
22+
</div>

templates/twitter_feed.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends 'includes.html' %}
2+
{% block content %}
3+
<div class="section no-pad-bot" id="index-banner">
4+
<div class="container">
5+
<a class="twitter-timeline" href="https://twitter.com/{{ twitter_handle }}">Tweets by {{ twitter_handle }}
6+
</a>
7+
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div></div>
8+
9+
{% include 'footer.html' %}
10+
{% endblock %}
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)