-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
517 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
aldeed:[email protected] | ||
aldeed:[email protected] | ||
anti:[email protected] | ||
[email protected] | ||
[email protected] | ||
|
@@ -57,6 +59,7 @@ [email protected] | |
[email protected] | ||
mizzao:[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
mquandalle:[email protected] | ||
[email protected] | ||
|
@@ -71,6 +74,7 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
sergeyt:[email protected]_7 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//- client/components/board_card/board_card.jade | ||
template(name='boardCard') | ||
.panel.panel-default | ||
.panel-heading.board-card-heading | ||
+linkTo route='boards_show' data=urlData | ||
= name | ||
.panel-body.board-card-description | ||
= description | ||
.panel-footer.board-card-footer | ||
+with getOwner | ||
+userAvatar user=this size=20 | ||
+linkTo route='users_show' data=urlData | ||
| @ | ||
= getUsername | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# client/lib/base_profile_controller.coffee | ||
class @BaseProfileController extends PagableRouteController | ||
|
||
# используем уже готовый шаблон | ||
template: 'profile' | ||
|
||
currentUserId: -> | ||
false | ||
|
||
# подписываемся на доски текущего пользователя | ||
subscriptions: -> | ||
if @currentUserId() | ||
[ | ||
@subscribe 'user', @currentUserId() | ||
@subscribe 'boards', @currentUserId(), @limit('boards') | ||
] | ||
|
||
# возвращаем данные о текущем пользователе, если такой имеется | ||
data: -> | ||
if @currentUserId() | ||
{ | ||
user: UsersCollection.findOne @currentUserId() | ||
boards: BoardsCollection.findByUser @currentUserId(), {sort: { createdAt: -1 }} | ||
} | ||
|
||
loaded: (name) -> | ||
switch name | ||
when 'boards' then @limit('boards') > @data().boards.count() | ||
else false | ||
|
||
onRun: -> | ||
if @currentUserId() | ||
@resetLimit('boards') | ||
@next() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
# client/routers/home.coffee | ||
Router.route '/', name: 'home' | ||
class @HomeController extends PagableRouteController | ||
class @HomeController extends BaseProfileController | ||
|
||
# авторизован ли пользователь? | ||
isUserPresent: -> | ||
!!Meteor.userId() | ||
|
||
# подписываемся на профайл если пользователь авторизован | ||
# на сайте | ||
waitOn: -> | ||
if @isUserPresent() | ||
@subscribe 'profile' | ||
|
||
# возвращаем данные о текущем пользователе, если такой имеется | ||
data: -> | ||
if @isUserPresent() | ||
{ user: UsersCollection.findOne Meteor.userId() } | ||
# ищем пользователя | ||
currentUserId: -> | ||
Meteor.userId() | ||
|
||
# рендерим шаблон профайла если пользователь авторизован | ||
# и домашнюю страницу в противном случае | ||
action: -> | ||
if @isUserPresent() | ||
@render 'profile' | ||
else | ||
super() | ||
@render 'home' |
Oops, something went wrong.