Skip to content

Commit fde2510

Browse files
author
Camilo QS
committed
Migrate to pug syntax
1 parent bfa2424 commit fde2510

8 files changed

+16
-18
lines changed

.pug-lintrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"disallowAttributeInterpolation": true,
23
"disallowClassAttributeWithStaticValue": true,
34
"disallowDuplicateAttributes": true,
45
"disallowIdAttributeWithStaticValue": true,

public/template/layout.pug

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ html(lang="en")
5555
b #{config.site}
5656
| brought to you by
5757
if config.ownerURL
58-
a(href="#{config.ownerURL}") #{config.owner}
58+
a(href=config.ownerURL) #{config.owner}
5959
else
6060
| #{config.owner}
6161
|.
@@ -114,7 +114,6 @@ html(lang="en")
114114
script(src="/javascript/libs/jquery-spin.js")
115115
script(src="/javascript/libs/bootstrap-wysihtml5.js")
116116
script(src="/javascript/libs/bootstrap-lightbox.min.js")
117-
//script(src="/shared/pug-runtime.js")
118117
script(src="/javascript/pump.js")
119118
script(src="/javascript/pump/auth.js")
120119
script(src="/javascript/pump/model.js")
@@ -123,7 +122,7 @@ html(lang="en")
123122
script(src="/javascript/pump/view.js")
124123

125124
each script in config.scripts
126-
script(src="#{script}")
125+
script(src=script)
127126

128127
script.
129128
/* @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt Apache-2.0 */

public/template/major-activity.pug

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
unless object.deleted
66
unless !headless && !author
7-
li.media.activity.major(class=headless ? 'headless' : undefined, data-activity-id="#{activity.id}")
7+
li.media.activity.major(class=headless ? 'headless' : undefined, data-activity-id=activity.id)
88
unless headless
9-
a.pull-left(href="#{author.url}")
9+
a.pull-left(href=author.url)
1010
if author.image && author.image.url
1111
img.img-rounded.media-object(src=(author.image.pump_io && author.image.pump_io.proxyURL) ? author.image.pump_io.proxyURL : author.image.url, width="64", height="64")
1212
else
@@ -18,7 +18,7 @@ unless object.deleted
1818
p.muted
1919
small
2020
if activity.verb === "share" && author
21-
a(href="#{author.url}")!= author.displayName
21+
a(href=author.url)!= author.displayName
2222
| shared by
2323
a(href=activity.actor.url)= activity.actor.displayName
2424
| at

public/template/member.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ li.media.person.major.member(data-person-id=person.id)
66
img.img-rounded.media-object(src="/images/default.png", width="64", height="64")
77
.media-body
88
if principal && principal.id === list.author.id
9-
button.close#remove-person(type="button", data-title="Remove #{person.displayName} from #{list.displayName}") ×
9+
button.close#remove-person(type="button", data-title=`Remove ${person.displayName} from ${list.displayName}`) ×
1010

1111
h4.media-heading
1212
a(href=person.url)!= person.displayName

public/template/nav-loggedin.pug

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
li.dropdown#fat-menu
1616
a.dropdown-toggle#profile-dropdown(href="#", role="button", data-toggle="dropdown")
1717
if _(principal).has("image")
18-
img.pull-left.img-rounded(src="#{principal.image.url}", width="24" height="24")
18+
img.pull-left.img-rounded(src=principal.image.url, width="24" height="24")
1919
else
2020
img.pull-left.img-rounded(src="/images/default.png", width="24", height="24")
2121
|  
@@ -24,15 +24,15 @@
2424

2525
ul.dropdown-menu(role="menu", aria-labelledby="profile-dropdown")
2626
li
27-
a(tabindex="-1", href="/#{principalUser.nickname}") Activity
27+
a(tabindex="-1", href=`/${principalUser.nickname}`) Activity
2828
li
29-
a(tabindex="-1", href="/#{principalUser.nickname}/favorites") Favorites
29+
a(tabindex="-1", href=`/${principalUser.nickname}/favorites`) Favorites
3030
li
31-
a(tabindex="-1", href="/#{principalUser.nickname}/followers") Followers
31+
a(tabindex="-1", href=`/${principalUser.nickname}/followers`) Followers
3232
li
33-
a(tabindex="-1", href="/#{principalUser.nickname}/following") Following
33+
a(tabindex="-1", href=`/${principalUser.nickname}/following`) Following
3434
li
35-
a(tabindex="-1", href="/#{principalUser.nickname}/lists") Lists
35+
a(tabindex="-1", href=`/${principalUser.nickname}/lists`) Lists
3636
li.divider
3737
li
3838
a(tabindex="-1", href="/main/settings") Profile

public/template/nav-remote.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
li#fat-menu.dropdown
1010
a.dropdown-toggle#profile-dropdown(href="#", role="button", data-toggle="dropdown")
1111
if _(principal).has("image")
12-
img.pull-left#img-rounded(src="#{principal.image.url}", width="24", height="24")
12+
img.pull-left#img-rounded(src=principal.image.url, width="24", height="24")
1313
|  
1414
| #{principal.displayName}
1515
b.caret

public/template/profile-block.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.media.h-card#profile-block(data-profile-id="#{profile.id}")
1+
.media.h-card#profile-block(data-profile-id=profile.id)
22
span.pull-left
33
if profile.image && profile.image.url
4-
img.img-rounded.media-object.u-photo(src="#{profile.image.url}", width="128", height="128")
4+
img.img-rounded.media-object.u-photo(src=profile.image.url, width="128", height="128")
55
else
66
img.img-rounded.media-object.u-photo(src="/images/default.png", width="128", height="128")
77
.media-body

routes/shared.js

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ var addRoutes = function(app, session) {
3535
app.get("/shared/showdown.js", sharedFile("showdown/src/showdown.js"));
3636
app.get("/shared/lodash.js", sharedFile("lodash/lodash.js"));
3737
app.get("/shared/lodash-min.js", sharedFile("lodash/lodash.min.js"));
38-
// TODO serve a minified version of this
39-
app.get("/shared/pug-runtime.js", sharedFile("pug-runtime/index.js"));
4038
};
4139

4240
var sharedFile = function(fname) {

0 commit comments

Comments
 (0)