Basic Profiles [#184]

This commit is contained in:
Sam Nicholls 2013-01-23 19:13:10 +00:00
parent 098f19078d
commit f3771240a3
5 changed files with 41 additions and 9 deletions

View File

@ -17,7 +17,13 @@ var commands = function(dbot){
"~test_setprop": function(event){ "~test_setprop": function(event){
if(event.params[1] && event.params[2]){ if(event.params[1] && event.params[2]){
dbot.db.profiles[event.server][event.user.toLowerCase()].profile[event.params[1]] = event.params[2]; if(_.has(this.config.schema.profile, event.params[1])){
dbot.db.profiles[event.server][event.user.toLowerCase()].profile[event.params[1]] = event.params[2];
event.reply("Property set, maybe?");
}
else{
event.reply("Invalid property. Go home.");
}
} }
} }
} }

View File

@ -7,6 +7,8 @@
"primary": null, "primary": null,
"name": null, "name": null,
"tagline": null, "tagline": null,
"avatar": null,
"bio": null,
"favourites": { "favourites": {
"colour": null "colour": null
} }

View File

@ -31,7 +31,6 @@ p {
} }
div#page { div#page {
width: 90%;
margin: 0 auto 0 auto; margin: 0 auto 0 auto;
} }
@ -55,9 +54,8 @@ div#title a {
} }
div#main { div#main {
position: relative; position: relative;
padding: 15px 5px; padding: 10px 5px;
margin: 0px;
font-size: 21px; font-size: 21px;
text-align:center; text-align:center;
background: #FFF; background: #FFF;
@ -183,3 +181,15 @@ li.option-votes {
.sorting_asc_disabled { background: url('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/images/sort_asc_disabled.png') no-repeat center right; } .sorting_asc_disabled { background: url('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/images/sort_asc_disabled.png') no-repeat center right; }
.sorting_desc_disabled { background: url('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/images/sort_desc_disabled.png') no-repeat center right; } .sorting_desc_disabled { background: url('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/images/sort_desc_disabled.png') no-repeat center right; }
/**
* Bootstrap Overrides
*/
.profile_page-header{
margin: 5px 0 10px 0;
}
.profile_row{
text-align: left;
margin-bottom: 10px;
}

View File

@ -12,7 +12,7 @@ html(lang='en')
div#page div#page
div#title div#title
a(href='/') #{name} web interface a(href='/') #{name} web interface
div#main div.container#main
block content block content
script(type="text/javascript", src="/bootstrap/js/bootstrap.min.js") script(type="text/javascript", src="/bootstrap/js/bootstrap.min.js")
script(type="text/javascript", src="/d3/d3.v3.min.js") script(type="text/javascript", src="/d3/d3.v3.min.js")

View File

@ -39,11 +39,25 @@ block content
}); });
}); });
div.page-header div.page-header.profile_page-header
h1 h1
#{primary} #{primary}
small
div#row "#{profile.tagline}"
div.row.profile_row#profile_data
div.span3
if profile.avatar
img.profile_avatar(src="#{profile.avatar}")
else
img.profile_avatar(src="http://placehold.it/270x180&text=Hello,%20World")
div.span9
h4 Bio
p #{profile.bio}
hr
h3 Channel Statistics
div#profile_datatable
table.table.table-hover.data table.table.table-hover.data
thead thead
tr tr