added private public view to profile -- todo : add same for article view

This commit is contained in:
2013-01-17 17:30:16 -05:00
parent 89308a0c3e
commit 7b6a0df4a5
13 changed files with 42 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ block content
p
span Author:
 
a(href="/users/" + encodeURIComponent(article.author.username))= article.author.full_name
a(href="/users/" + encodeURIComponent(article.author.name))= article.author.name
p
a(href="/articles") Back to all articles

View File

@@ -1,8 +1,5 @@
extends ../layout
block content
ul
- articles.forEach(function(article) {
li
a(href="/articles/" + encodeURIComponent(article.title))= article.title
- });
ul
- articles.forEach(function(article) {
li
a(href="/articles/" + encodeURIComponent(article._id))= article.title
- });

View File

@@ -11,4 +11,7 @@ block content
label(for="password") Password:<br />
input#password(type="password", name="password")
p
input(type="submit", value="Log in");
input(type="submit", value="Log in");
p
a(href="/users/new") Register New User

View File

@@ -1,14 +1,12 @@
- if (session.user)
p
span Hello&nbsp;
span
b UserName&nbsp;
span= session.user.name
span !
span
b &nbspUserID&nbsp;
span= session.user._id
p
form(method="POST", action="/session")
input(type="hidden", name="_method", value="DELETE")
input(type="submit", value="Log out")
- else
p
a(href="/session/new") Login
span &nbsp;or&nbsp;
a(href="/users/new") Register
input(type="submit", value="Log out")

View File

@@ -2,8 +2,17 @@ extends ../layout
block content
h1= user.name
- if (session.user)
h1 Private View
- else
h1 Public View
h2 Recent Articles:
p!= partial('articles/list', {articles: recentArticles })
ul
- recentArticles.forEach(function(article) {
li
a(href="/articles/" + encodeURIComponent(article._id))= article.title
- });
form(action="/users/" + encodeURIComponent(user.username), method="POST")