Skip to content

Commit 84a778b

Browse files
committed
topics, minor changes
1 parent 7fe492b commit 84a778b

File tree

9 files changed

+96
-52
lines changed

9 files changed

+96
-52
lines changed

pyhackers/controllers/discuss.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
from flask import request, jsonify, Blueprint, redirect
2+
from flask import request, jsonify, Blueprint, redirect, abort, make_response
33
from flask.ext.login import login_required, current_user
44
from pyhackers.cache import cache
55
from pyhackers.helpers import render_template, render_base_template, current_user_id
@@ -32,6 +32,10 @@ def discussion_ctrl(slug, id):
3232
related_discussions=related_discussions,
3333
)
3434

35+
@discuss_app.route('topic/<regex(".+"):slug>')
36+
def discuss_topic_ctrl(slug):
37+
response = make_response("ok")
38+
return response
3539

3640
@discuss_app.route('new', methods=('GET', 'POST'))
3741
@login_required

pyhackers/controllers/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ def new_message():
257257
def about():
258258
return render_base_template("about.html")
259259

260+
@main_app.route("/timeline")
261+
def timeline():
262+
return render_base_template("timeline.html")
260263

261264
@main_app.route("/coding")
262265
def coding():

pyhackers/static/coffee/app/main.coffee

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ Application = {
7878
## mixpanel.track("signup-popup")
7979
# )
8080

81-
$(document).on('click','a', (evt) =>
82-
href = $(evt.currentTarget).attr('href')
83-
84-
hashtag = href[0] == "#"
85-
86-
@dog.click(href, hashtag)
87-
88-
if hashtag
89-
return
90-
91-
evt.stopPropagation()
92-
evt.preventDefault()
93-
94-
window.setTimeout( =>
95-
document.location = href
96-
, 200)
97-
)
81+
# $(document).on('click','a', (evt) =>
82+
# href = $(evt.currentTarget).attr('href')
83+
#
84+
# hashtag = href[0] == "#"
85+
#
86+
# @dog.click(href, hashtag)
87+
#
88+
# if hashtag
89+
# return
90+
#
91+
# evt.stopPropagation()
92+
# evt.preventDefault()
93+
#
94+
# window.setTimeout( =>
95+
# document.location = href
96+
# , 200)
97+
# )
9898

9999

100100
_.defer( => do @dog.view )

pyhackers/static/css/app.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ div#page-wrap {
1515
.message{
1616
max-height: 69px;
1717
overflow-y:hidden;
18+
color:dimgray;
19+
font-size:13px;
1820
}
1921
.message-container{
2022
border-bottom: 1px solid #d3d3d3;
@@ -108,7 +110,7 @@ a:hover {
108110
}
109111

110112
.link-box {
111-
margin-bottom: 10px;
113+
margin-bottom: 0px;
112114
padding-bottom: 7px;
113115
padding-right: 0;
114116
margin-left: 65px;
@@ -155,6 +157,10 @@ h4 a {
155157
padding-top: 5px;
156158
}
157159

160+
.link-box i {
161+
margin-right:5px;
162+
}
163+
158164
.link-container .col-lg-10 {
159165
padding-right: 5px;
160166
}
@@ -221,9 +227,14 @@ h4 a {
221227
}
222228

223229
.front-action span.label {
224-
color: #3a3c3c;
230+
color: #d3d3d3;
225231
font-size: 12px;
226232
font-weight: bold;
233+
margin-left:4px;
234+
}
235+
236+
.message{
237+
227238
}
228239

229240
.links a.link {

pyhackers/static/js/app/main.js

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyhackers/templates/base.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,24 @@
101101
</div>
102102
{% include "modals.html" %}
103103
{% include "js_templates.html" %}
104-
105-
106-
107-
108-
109104
{% include "mailchimp_form.html" %}
110105

111106
<script src="http://code.jquery.com/jquery-2.0.3.min.js" type="text/javascript"></script>
112107

113-
<script>
114-
{% block scripts %}{% endblock %}
115-
</script>
108+
116109

117110
<script src="{{ static_route }}/js/underscore-min.js" type="text/javascript"></script>
118111
<script src="{{ static_route }}/js/bootstrap.min.js" type="text/javascript"></script>
112+
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js" type="text/javascript"></script>
119113
<script src="/static/js/app/main.js?_={{ cache_buster }}"></script>
120114
{% block script_links %}{% endblock %}
121115

122116
{% if PROD %}
123117
{% include "3rd_party.html" %}
124118
{% endif %}
125-
126-
127-
119+
<script>
120+
{% block scripts %}{% endblock %}
121+
</script>
128122
</div>
129123
</body>
130124
</html>

pyhackers/templates/js_templates.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@
4747
</div>
4848
</div>
4949
</div>
50-
<div class='row' style="padding-top:5px;">
50+
<div class='row'>
5151
<div class='col-lg-5'>
5252
<a href="#post" class="link-discuss">{{ ago }}</a>
53-
<a href="/user/{{ user.nick }}">@{{ user.nick }}</a>
53+
<a href="/user/{{ user.nick }}"> by @{{ user.nick }}</a>
54+
<a href="#post" class="link-discuss">{{ comment }} Comments</a>
5455
</div>
5556

5657
<div class="col-6" style="text-align: right">
57-
<a href="#/tag/flask" class='tag' style="">
58-
<span class="">#Flask</span>
59-
</a>
60-
<a href="#/tag/ajax" class='tag'><span class="">#AJAX</span></a>
6158
</div>
6259
</div>
6360
</div>

pyhackers/templates/project_frame.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,5 @@ <h4>Top 400 Python Projects in Github</h4>
7171

7272

7373
{% block script_links %}
74-
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js" type="text/javascript"></script>
7574
<script src="/static/js/app/sly.js?_={{ cache_buster }}" type="text/javascript"></script>
7675
{% endblock %}

pyhackers/templates/timeline.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
<div class="links container">
5+
<div id='timeline' class="col-lg-10 linklist row">
6+
7+
</div>
8+
</div>
9+
10+
{% endblock %}
11+
12+
{% block scripts %}
13+
$(function(){
14+
var $template = window.Handlebars.compile($("#message-template").html());
15+
var msgs = [
16+
{
17+
user: {nick: 'bcambel'},
18+
ago:'34m ago',
19+
html: '<i class="fa fa-file-text-o"></i>&nbsp;<a href="" class="link">Daniel Greenfield</a> wrote a blog post&nbsp;'+
20+
'<a class="link" href="http://pydanny.com/awesome-slugify-human-readable-url-slugs-from-any-string.html">awesome-slugify: Human-readable URL slugs from any string</a>',
21+
},{
22+
user: {nick: 'bcambel'},
23+
ago:'34m ago',
24+
html: '<i class="fa fa-github-alt"></i>&nbsp;<i class="fa fa-bullhorn"></i>&nbsp;<a class="link" href="">Django</a> has a new release&nbsp;' +
25+
'<a class="link" href="https://github.com/django/django/releases/tag/1.7a1">1.7a1: Tag 1.7a1</a>'
26+
},
27+
{
28+
user: {nick: 'progrium'},
29+
ago:'19h ago',
30+
html: '<i class="fa fa-twitter"></i>&nbsp;<a class="link" href="">Jeff Lindsay</a> SystemsLive podcast with @TimothyFitz talking about Flynn and any other topic you bring up <a href="http://mixlr.com/systemslive/chat" class="link">http://mixlr.com/systemslive/chat</a> '
31+
},
32+
{
33+
user: {nick: 'progrium'},
34+
ago:'19h ago',
35+
html: '<i class="fa fa-github-alt"></i>&nbsp;<i class="fa fa-plus"></i>&nbsp;<a class="link" href="">Jeff Lindsay</a> created a new repository. <a href="https://github.com/ipython/sloan-2013-reports" class="link">Sloan 2013 Reports</a> '
36+
},
37+
{
38+
user: {nick: 'bcambel'},
39+
ago:'34m ago',
40+
html: '<i class="fa fa-github-alt"></i>&nbsp;<i class="fa fa-star"></i>&nbsp;<a class="link" href="">jezdez</a> starred&nbsp;' +
41+
'<a class="link" href="https://github.com/mailgun/flanker">Mailgun / Flanker</a>'
42+
},
43+
{
44+
user: {nick: 'bcambel'},
45+
ago:'34m ago',
46+
html:'<i class="fa fa-file-text-o"></i>&nbsp;<a href="" class="link">Jesse Noller</a> wrote a blog post&nbsp;'+
47+
'<a class="link" href="http://jessenoller.com/blog/2013/4/15/joining-rackspace"> Joining Rackspace</a>'}]
48+
$('#timeline').append($template({message: msgs}));
49+
});
50+
{% endblock %}

0 commit comments

Comments
 (0)