Skip to content

Commit

Permalink
attempt at CSS-ing.
Browse files Browse the repository at this point in the history
  • Loading branch information
eprochasson committed Jul 17, 2013
1 parent 1b93578 commit 6a6f27f
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 57 deletions.
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ spin
publish-with-relations
paginated-subscription
filepicker
less
9 changes: 6 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ Browse/search users
User geolocalisation.

Make sure logout users are redirected to the front page, always.
Make sure non login users don't get much subscription nor database insert.

Check user security: do not allow user to change all their profile.
Check filepicker secret/security thingy. Not sure it's cool.


Setting page

Thing needs serious design work.
Complete Lexicon...
Thing needs serious design work. Finish notification template (for single notification)
Complete Lexicon...

Subscription process + email validation.
Check input security (not too long, invalid characters, injection...).
11 changes: 11 additions & 0 deletions client/css/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

// Mixins
.border-box{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

body {
font-family: 'Karla', sans-serif;
}
4 changes: 4 additions & 0 deletions client/lexicon/lexicon.js → client/helpers/lexicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ Meteor.i18nMessages.messages = {

Meteor.i18nMessages.button = {
close: 'Close'
};

Meteor.i18nMessages.friends = {
friends_online: 'Friends online'
};
13 changes: 7 additions & 6 deletions client/helpers/presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Meteor.Presence = {
// Update last seen date.
Meteor.autorun(function(){
Session.get('last-presence-at'); // Just to hit the context.

Meteor.call('setUserPresence', function(err,res){
if(err){
console.log('setUserPresence: huho');
}
})
if(Meteor.userId()){
Meteor.call('setUserPresence', function(err,res){
if(err){
console.log('setUserPresence: huho');
}
})
}
});
1 change: 1 addition & 0 deletions client/main.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<head>
<title>Socialite</title>
<link href='http://fonts.googleapis.com/css?family=Karla:400,400italic,700' rel='stylesheet' type='text/css'>
</head>
<body>

Expand Down
37 changes: 21 additions & 16 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
Meteor.startup(function(){
// All my data
Meteor.subscribe('myData', function(){
Session.set('settings', Meteor.user().settings||{});
});
Meteor.subscribe('myPictures');
Meteor.subscribe('myNotifications');

Meteor.subscribe('myFriendList');
Deps.autorun(function(){
// All my data. Provide only to logged-in users.
if(!Meteor.loggingIn() && Meteor.userId()){
Meteor.subscribe('myData', function(){
Session.set('settings', Meteor.user().settings||{});
});
Meteor.subscribe('myPictures');
Meteor.subscribe('myNotifications');

Meteor.subscribe('myFriendList');
myNewsFeedHandle = Meteor.subscribeWithPagination('myNewsfeed', Newsfeed.activitiesPerPage);

myNewsFeedHandle = Meteor.subscribeWithPagination('myNewsfeed', Newsfeed.activitiesPerPage);
// My conversations
conversationsHandle = Meteor.subscribeWithPagination('myConversations', 3);

// My conversations
conversationsHandle = Meteor.subscribeWithPagination('myConversations', 3);
oneConversationHandle = Meteor.subscribeWithPagination('oneConversation', function(){
return Session.get('currentConversation') || null;
}, Messages.messagePerPage);

oneConversationHandle = Meteor.subscribeWithPagination('oneConversation', function(){
return Session.get('currentConversation') || null;
}, Messages.messagePerPage);
// Questions for the profile form.
Meteor.subscribe('questions');

}
});

// When visiting someone's profile
Deps.autorun(function () {
Expand All @@ -26,8 +34,5 @@ Meteor.startup(function(){
}, Activities.activitiesPerPage);
});

// Questions for the profile form.
Meteor.subscribe('questions');

// Meteor.subscribe('adminShowEveryone');
});
9 changes: 7 additions & 2 deletions client/views/home/home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template name="home">

{{> newsfeed}}
{{> online_friends}}

<div class="span9">
{{> newsfeed}}
</div>
<div class="span3 pull-right">{{> online_friends}}</div>



</template>
19 changes: 12 additions & 7 deletions client/views/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@
<li class="{{activeRouteClass 'profile'}}">
<a href="{{profilePath}}">Profile</a>
</li>
<li class="{{activeRouteClass 'settings'}}">
<a href="{{settingsPath}}">Settings</a>
<li class="{{activeRouteClass 'profile'}}">
<a href="{{searchPath}}"><i class="icon-search"> </i></a>
</li>

{{#if currentUser}}
</ul>
{{/if}}
<ul class="nav pull-right">
<li class="dropdown">
{{> mailbox_header}}
</li>
<li class="dropdown">
{{> notifications}}
</li>
{{/if}}
</ul>
{{/if}}
<ul class="nav pull-right">

<li>{{loginButtons}}</li>
{{#if currentUser}}
<li class="{{activeRouteClass 'settings'}}">
<a href="{{settingsPath}}"><i class="icon-cog"> </i></a>
</li>
{{/if}}
</ul>

</div>
</header>
</template>
18 changes: 10 additions & 8 deletions client/views/newsfeed/newsfeed.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<template name="newsfeed">
<h2>Newsfeed</h2>
<ul>
{{#each news}}
{{> news}}
{{else}}
Nothing to show here
{{/each}}
</ul>
<div class="newsfeed widget">
<h2>Newsfeed</h2>
<ul class="unstyled">
{{#each news}}
{{> news}}
{{else}}
Nothing to show here
{{/each}}
</ul>
</div>
</template>
33 changes: 18 additions & 15 deletions client/views/widgets/online_friends.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<template name="online_friends">

<h2>Online Users</h2>
{{#if count}}
You have {{count}} friend(s) online
<ul>
{{#with onlinefriends}}
{{#each friends}}
{{> online_friend}}
{{/each}}
{{/with}}
</ul>
{{else}}
No friend online
{{/if}}
<div class="online-user widget">
<h2>{{Lex 'friends.friends_online'}}</h2>
{{#if count}}
<ul class="unstyled">
{{#with onlinefriends}}
{{#each friends}}
{{> online_friend}}
{{/each}}
{{/with}}
</ul>
{{else}}
No friend online
{{/if}}
</div>
</template>

<template name="online_friend">
<li><img src="{{thumbnail profile.picture 100 100 'max'}}" /><a href="{{profilePath}}/{{_id}}">{{profile.name}}</a> is online (<a class="startChat" href="#">chat</a>)</a></li>
<li>
<img src="{{thumbnail profile.picture 30 30 'crop'}}" />
<a href="{{profilePath}}/{{_id}}">{{profile.name}}</a>
</li>
</template>
6 changes: 6 additions & 0 deletions server/publications.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ Meteor.publish('myNewsfeed', function(limit){
});

Meteor.publish("oneConversation", function(conversation, limit){
if(!this.userId){
return;
}
if(conversation){
var conv = Conversations.findOne(conversation);
if(conv.owner == this.userId){
Expand All @@ -98,6 +101,9 @@ Meteor.publish("oneConversation", function(conversation, limit){
Meteor.publish("myFriendList", function(limit){
// load a very light version of the friendlist
// Not very reactive.
if(!this.userId){
return;
}

if(this.userId){
Meteor.publishWithRelations({
Expand Down
Empty file added test/unit/client/message.js
Empty file.

0 comments on commit 6a6f27f

Please sign in to comment.