mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Merge branch 'master' of https://github.com/julien-c/Telescope
This commit is contained in:
commit
fd990ea5c1
9 changed files with 79 additions and 3 deletions
1
.meteor/.gitignore
vendored
1
.meteor/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
local
|
||||
meteorite
|
||||
|
|
|
@ -131,6 +131,7 @@ if (Meteor.is_client) {
|
|||
'users':'users',
|
||||
'account':'user_edit',
|
||||
'forgot_password':'forgot_password',
|
||||
'user/:id': 'user_profile',
|
||||
'users/:id/edit':'user_edit'
|
||||
},
|
||||
top: function() { this.goto('posts_top'); },
|
||||
|
@ -170,6 +171,12 @@ if (Meteor.is_client) {
|
|||
this.goto('comment_edit');
|
||||
window.newCommentTimestamp=new Date();
|
||||
},
|
||||
user_profile: function(id){
|
||||
if(typeof id !== undefined){
|
||||
window.selected_user_id=id;
|
||||
}
|
||||
this.goto('user_profile');
|
||||
},
|
||||
user_edit: function(id){
|
||||
if(typeof id !== undefined){
|
||||
window.selected_user_id=id;
|
||||
|
@ -216,7 +223,7 @@ getCurrentUserEmail = function(){
|
|||
|
||||
trackEvent = function(event, properties){
|
||||
var properties= (typeof properties === 'undefined') ? {} : properties;
|
||||
if(mixpanel){
|
||||
if(typeof mixpanel != 'undefined'){
|
||||
mixpanel.track(event, properties);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1163,6 +1163,17 @@ table tr td {
|
|||
table thead tr td {
|
||||
font-weight: bold; }
|
||||
|
||||
/* line 2, ../sass/modules/_user-profile.scss */
|
||||
.user-profile .user-avatar {
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
display: block;
|
||||
-webkit-border-radius: 80px;
|
||||
-moz-border-radius: 80px;
|
||||
-ms-border-radius: 80px;
|
||||
-o-border-radius: 80px;
|
||||
border-radius: 80px; }
|
||||
|
||||
/* line 1, ../sass/modules/_errors.scss */
|
||||
.error {
|
||||
margin-bottom: 10px;
|
||||
|
|
8
client/sass/modules/_user-profile.scss
Normal file
8
client/sass/modules/_user-profile.scss
Normal file
|
@ -0,0 +1,8 @@
|
|||
.user-profile {
|
||||
.user-avatar{
|
||||
height:80px;
|
||||
width:80px;
|
||||
display:block;
|
||||
@include border-radius(80px);
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@
|
|||
@import "modules/dialogs";
|
||||
@import "modules/settings";
|
||||
@import "modules/users";
|
||||
@import "modules/user-profile";
|
||||
@import "modules/errors";
|
||||
|
||||
@import "partials/mobile";
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="comment-meta">
|
||||
<a class="comment-username" href="#">{{author}}</a>
|
||||
<a class="comment-username" href="/user/{{user_id}}">{{author}}</a>
|
||||
<span class="comment-time">{{ago}},</span>
|
||||
<span class="points">{{votes}} <span class="unit">points </span>
|
||||
<a href="/comments/{{_id}}" class="comment-permalink icon-link goto-comment">link</a>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
{{/if}}
|
||||
{{#if url}}<span class="post-domain">{{domain}}</span>{{/if}}
|
||||
</h3>
|
||||
<p class="post-meta"><span class="points">{{votes}} <span class="unit">points </span></span>by <a class="post-author" href="#">{{author}}</a> <span class="post-time">{{ago}}</span><span class="comments">, <a class="go-to-comments" href="posts/{{_id}}">{{comments}} comments</a></span>
|
||||
<p class="post-meta"><span class="points">{{votes}} <span class="unit">points </span></span>by <a class="post-author" href="/user/{{user_id}}">{{author}}</a> <span class="post-time">{{ago}}</span><span class="comments">, <a class="go-to-comments" href="posts/{{_id}}">{{comments}} comments</a></span>
|
||||
{{#if can_edit}}
|
||||
| <a href="/posts/{{_id}}/edit" class="edit-link goto-edit">Edit</a>
|
||||
{{/if}}
|
||||
|
|
28
client/templates/user_profile.html
Normal file
28
client/templates/user_profile.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<template name="user_profile">
|
||||
<div class="grid">
|
||||
{{#with user}}
|
||||
<div class="user-profile grid-block">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2"><span class="user-avatar" style="background-image:url({{avatar_url}});"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name: </td>
|
||||
<td>{{username}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Member since: </td>
|
||||
<td>{{created_at_formatted}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bio: </td>
|
||||
<td>{{profile.bio}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{#if is_current_user}}
|
||||
<a href="/users/{{_id}}/edit">Edit profile</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/with}}
|
||||
</div>
|
||||
</template>
|
20
client/templates/user_profile.js
Normal file
20
client/templates/user_profile.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
|
||||
Template.user_profile.user = function(){
|
||||
if(window.selected_user_id){
|
||||
return Meteor.users.findOne(window.selected_user_id);
|
||||
}
|
||||
}
|
||||
|
||||
Template.user_profile.avatar_url = function(){
|
||||
return Gravatar.getGravatar(this, {
|
||||
d: 'http://telescope.herokuapp.com/img/default_avatar.png',
|
||||
s: 80
|
||||
});
|
||||
}
|
||||
|
||||
Template.user_profile.created_at_formatted = Template.user_item.created_at_formatted;
|
||||
|
||||
Template.user_profile.is_current_user = function(){
|
||||
return (window.selected_user_id === current_user_id);
|
||||
}
|
Loading…
Add table
Reference in a new issue