Skip to content

Commit ea9a901

Browse files
author
mapa
committed
fixes
1 parent ab54638 commit ea9a901

5 files changed

Lines changed: 41 additions & 6 deletions

File tree

app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ var redis = require('redis')
1616
, RedisStore = require('connect-redis')(express)
1717
, client = exports.client = redis.createClient();
1818

19+
setTimeout(function(){
20+
client.save();
21+
}, 5 * 60 * 1000);
22+
1923
/*
2024
* Auth
2125
*/

public/js/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$(function(){
22

3+
34
$('.projects').masonry({
45
itemSelector: '.project',
56
columnWidth: function( containerWidth ) {
@@ -8,6 +9,7 @@ $(function(){
89

910
});
1011

12+
$('#newProject').click(function(){if(!window.username.length) window.location="http://hackdash.hhba.info/auth/twitter"; })
1113

1214
$('.modal').modal({show: false});
1315

public/styles/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
.users { list-style: none; margin: 0; }
20-
.users li { display: inline; margin-right: 8px; width: 48px;}
20+
.users li { display: inline; margin-right: 2px; width: 48px;}
2121
.users li span { font-size: 0.9em; }
2222

2323
.more { display: none; }

routes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var isOwner = function(req, res, next){
1515
client.get('hhba:projects:' + req.params.id, function(err, project){
1616
project = JSON.parse(project);
1717
if(project && project.owner_id == req.user.id) next();
18+
else if(project && "blejman" == req.user.username) next();
1819
else res.redirect('back');
1920
});
2021
};

views/dashboard.jade

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ extends layout
22

33
block content
44

5+
.ulogin(style="float:right;")
6+
if(!user.username.length)
7+
| No estás conectado.
8+
a(href="/auth/twitter") Entrá con Twitter
9+
else
10+
| Bienvenido
11+
a(target="_blank",href="https://twitter.com/" + user.username) @#{user.username}
12+
a(href="/logout") Salir
13+
514
.row-fluid.header
615
.span3.logo
716
img(src="/images/logo.png", width="225")
@@ -13,15 +22,23 @@ block content
1322
button.btn(type="submit") Buscar
1423

1524
.span3
16-
a.span12.newProject(href="#newProject", data-toggle="modal")
17-
img.span12(src="/images/new-project.png")
25+
if(user.username.length)
26+
a.span12.newProject(href="#newProject", data-toggle="modal")
27+
img.span12(src="/images/new-project.png")
28+
else
29+
a.span12.newProject(href="/auth/twitter")
30+
img.span12(src="/images/new-project.png")
31+
1832

1933
.row-fluid.projects
2034
each project, index in projects
2135
.project.well
36+
if(user.username == "blejman")
37+
a(href="/projects/remove/"+project.id, style="float:right") x
2238
h3.title #{project.title}
2339
p
24-
strong (@#{project.owner_username})
40+
//strong
41+
a(href="https://twitter.com/" + project.owner_username, target="_blank") (@#{project.owner_username})
2542
- if(user && project.owner_id == user.id){
2643
a.edit(href="/projects/edit/" + project.id) Editar proyecto (#{project.pending.length})
2744
- } else if(user && project.contributors.indexOf(user.username) !== -1){
@@ -45,10 +62,14 @@ block content
4562

4663

4764
ul.users
48-
each contrib in project.contributors
65+
each contrib, i in project.contributors
4966
li
5067
a(href="https://twitter.com/" + contrib, target="_blank")
51-
span @#{contrib}
68+
if(i == 0)
69+
strong
70+
span @#{contrib}
71+
else
72+
span @#{contrib}
5273

5374
#newProject.modal.hide
5475
form.form-horizontal(action="/projects/new", method="POST")
@@ -75,5 +96,12 @@ block content
7596

7697
#editProject.modal.hide
7798

99+
.footer(style="text-align: left; margin-top: 80px;")
100+
a(href="http://meetupba.hackshackers.com", target="_blank")
101+
img(src="http://photos4.meetupstatic.com/photos/event/6/8/b/b/global_22346811.jpeg",width="75")
102+
a(href="https://github.com/hhba/hackdash", target="_blank")
103+
img(src="https://a248.e.akamai.net/assets.github.com/images/modules/about_page/github_logo.png?1338956357", width="75")
104+
105+
78106
script()
79107
window.username = '#{user.username}';

0 commit comments

Comments
 (0)