-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
48 changed files
with
596 additions
and
464 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
extends ../layouts/default | ||
|
||
block main | ||
h1= title | ||
|
||
block content | ||
- var action = '/articles' | ||
- action += article.isNew? '' : '/' + article.id | ||
|
||
.row | ||
.col-md-8 | ||
form(method="post", action=action, enctype="multipart/form-data", role="form") | ||
|
||
input(type="hidden", name="_csrf", value="#{csrf_token}") | ||
|
||
- if (!article.isNew) | ||
input(type="hidden", name="_method", value="PUT") | ||
|
||
.form-group | ||
label(for='title') Title | ||
input.form-control#title(type='text', name="title", value=article.title, placeholder='Enter the title') | ||
|
||
.form-group | ||
label(for='file') Image | ||
input.form-control#file(type='file', name="image") | ||
|
||
.form-group | ||
label(for='desc') Body | ||
textarea.form-control#desc(rows="5", name="body", placeholder='Enter the article description')=article.body | ||
|
||
.form-group | ||
label(for='tags') Tags | ||
input.form-control#tags(type='text', name="tags", value=article.tags, placeholder='Enter the tags') | ||
|
||
.form-group | ||
.col-sm-offset-2.col-sm-10 | ||
button.btn.btn-primary(type='submit') Save | ||
| | ||
a.btn(href='/articles', title="cancel") Cancel | ||
|
||
.col-md-4 | ||
- if (!article.isNew && article.image && article.image.files && article.image.files.length) | ||
img(src=article.image.cdnUri + "/mini_" + article.image.files[0]) |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
script(src="http://code.jquery.com/jquery-1.10.2.min.js") | ||
script(src="/js/bootstrap.min.js") | ||
script(src="/js/jquery.tagsinput.min.js") | ||
script(src="/js/app.js") | ||
|
||
block foot |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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,25 @@ | ||
nav.navbar.navbar-expand-md.navbar-dark.fixed-top.bg-dark | ||
a.navbar-brand(href='/') Node.js Express Mongoose Demo | ||
button.navbar-toggler(type='button' data-toggle='collapse' data-target='#navbarCollapse' aria-controls='navbarCollapse' aria-expanded='false' aria-label='Toggle navigation') | ||
span.navbar-toggler-icon | ||
#navbarCollapse.collapse.navbar-collapse | ||
ul.navbar-nav.mr-auto | ||
li(class=isActive('/articles/new') ? 'active nav-item' : 'nav-item') | ||
a.nav-link(href="/articles/new", title="new article") New | ||
- if (req.isAuthenticated()) | ||
li.nav-item | ||
a.nav-link(href="/users/"+req.user.id, title="Profile") Profile | ||
li.nav-item | ||
a.nav-link(href="/logout", title="logout") Logout | ||
- else | ||
li(class=isActive('/login') ? 'active nav-item' : 'nav-item') | ||
a.nav-link(href="/login", title="Login") Login | ||
|
||
ul.nav.navbar-nav.navbar-right | ||
li.nav-item | ||
iframe(src="http://ghbtns.com/github-btn.html?user=madhums&repo=node-express-mongoose-demo&type=watch&count=true", allowtransparency="true", frameborder="0", scrolling="0", width="120", height="45", style="padding: 15px 0 0 15px;") | ||
li.nav-item | ||
iframe(src="http://ghbtns.com/github-btn.html?user=madhums&repo=node-express-mongoose-demo&type=fork&count=true", allowtransparency="true", frameborder="0", scrolling="0", width="120", height="45", style="padding: 15px 0 0 15px;") | ||
li.nav-item | ||
a.nav-link(href='https://travis-ci.org/madhums/node-express-mongoose-demo') | ||
img(src='https://img.shields.io/travis/madhums/node-express-mongoose-demo.svg?style=flat', alt='Build Status', data-canonical-src='https://img.shields.io/travis/madhums/node-express-mongoose-demo.svg?style=flat', style='max-width:100%;') |
16 changes: 8 additions & 8 deletions
16
app/views/includes/messages.jade → app/views/includes/messages.pug
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,27 +1,27 @@ | ||
- if (typeof info != 'undefined' && info.length) | ||
.fade.in.alert.alert-info | ||
.fade.show.alert.alert-info | ||
button.close(type='button', data-dismiss='alert') × | ||
ul | ||
- each inf in info | ||
each inf in info | ||
li!= inf | ||
|
||
- if (typeof errors != 'undefined' && errors.length) | ||
.fade.in.alert.alert-danger | ||
.fade.show.alert.alert-danger | ||
button.close(type='button', data-dismiss='alert') × | ||
ul | ||
- each error in errors | ||
each error in errors | ||
li!= error | ||
|
||
- if (typeof success != 'undefined' && success.length) | ||
.fade.in.alert.alert-success | ||
.fade.show.alert.alert-success | ||
button.close(type='button', data-dismiss='alert') × | ||
ul | ||
- each succ in success | ||
each succ in success | ||
li!= succ | ||
|
||
- if (typeof warning != 'undefined' && warning.length) | ||
.fade.in.alert.alert-warning | ||
.fade.show.alert.alert-warning | ||
button.close(type='button', data-dismiss='alert') × | ||
ul | ||
- each warn in warning | ||
each warn in warning | ||
li!= warn |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
doctype html | ||
html(lang="en") | ||
include ../includes/head.pug | ||
body | ||
include ../includes/header.pug | ||
.container | ||
.page-header | ||
block main | ||
.messages | ||
include ../includes/messages.pug | ||
.content | ||
block content | ||
include ../includes/footer.pug | ||
include ../includes/foot.pug |
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
Oops, something went wrong.