mirror of
https://github.com/sstent/expressmongotest.git
synced 2026-01-25 16:42:00 +00:00
added private public view to profile -- todo : add same for article view
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
- });
|
||||
@@ -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
|
||||
@@ -1,14 +1,12 @@
|
||||
- if (session.user)
|
||||
p
|
||||
span Hello
|
||||
span
|
||||
b UserName
|
||||
span= session.user.name
|
||||
span !
|
||||
span
|
||||
b  UserID
|
||||
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 or
|
||||
a(href="/users/new") Register
|
||||
input(type="submit", value="Log out")
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user