/
content.xml
304 lines (273 loc) · 12.1 KB
/
content.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!--
Content is a high level description of a page
-->
<moya xmlns="http://moyaproject.com"
xmlns:let="http://moyaproject.com/let"
xmlns:html="http://moyaproject.com/html"
xmlns:comments="http://moyaproject.com/comments"
xmlns:db="http://moyaproject.com/db"
xmlns:w="http://moyaproject.com/widgets"
xmlns:techblog="http://willmcgugan.com/techblog"
xmlns:imagelib="http://moyaproject.com/imagelib">
<!-- Most pages extend from this base content -->
<content libname="content.base" template="base.html" final="yes">
<include-css path="css/bootstrap.min.css" from="moya.twitter.bootstrap"/>
<include-css path="css/blog.css" from="willmcgugan.techblog"/>
<include-css path="highlight/styles/github-gist.css" />
<include-js path="js/bootstrap.js" from="moya.twitter.bootstrap" defer="yes"/>
<include-js path="highlight/highlight.pack.js" defer="yes"/>
<include-js path="js/techblog.js" defer="yes"/>
<include-js path="js/jsonrpc.js" from="moya.jsonrpc" defer="yes"/>
<db:query model="#Blog" let:promoted="yes" orderby="title" dst="promoted_blogs" />
</content>
<content libname="content.blog.base" extends="#content.base">
<db:query model="#Blog" orderby="title" dst="list_blogs"/>
<!-- Sections are top-level content areas -->
<!-- This section adds links for admin users -->
<section name="admin_links" merge="append" if=".permissions.admin">
<if test=".url.blog">
<w:link icon="edit" name="settings" let:blog=".url.blog">Blog Settings</w:link>
</if>
<if test=".url.channel">
<w:link icon="edit" name="channel_settings" let:blog=".url.channel">Channel Settings</w:link>
<w:link icon="plus" name="new_blog">New Blog</w:link>
</if>
<w:link if="list_blogs.count"/>
<for src="list_blogs" dst="b">
<w:link icon="${.url.blog==b.slug ? 'star' : 'star-empty'}" name="list" let:blog="b.slug">${b.title}</w:link>
</for>
</section>
</content>
<content libname="content.blog.new" extends="#content.blog.base">
<title>New Blog</title>
<section name="content">
<render src="form"/>
</section>
</content>
<content libname="content.list-posts" extends="#content.blog.base" template="list.html">
<title>${channel.title}</title>
<section name="content">
<w:paginate src="posts" pagesize=".app.settings.page_size.int" auto="no">
<let posts="list:pagination.objects"/>
<map src="posts" value="sub:'post-${id}'" dst="comment_objects" />
<comments:get-counts dst="comment_counts" namespace="app-${.app.name}" topics="comment_objects" />
<for src="posts" dst="post">
<techblog:post-summary post="post" numcomments="comment_counts[sub:'post-${post.id}']"/>
</for>
</w:paginate>
<html:div if="not posts" class="alert">No posts yet!</html:div>
</section>
</content>
<content libname="content.blog.posts" extends="#content.list-posts" template="blog_list.html">
<title>${blog.title}</title>
<section name="head">
<w:feed-link name="feed" let:blog="blog.slug"/>
</section>
<section name="admin_links" if=".permissions.admin">
<w:link/>
<w:link name="newpost" let:blog=".url.blog" icon="plus" if=".url.blog">New Post</w:link>
</section>
<section name="side">
<techblog:posts-by-month blog="blog"/>
</section>
</content>
<content libname="content.channel.posts" extends="#content.list-posts" template="channel_list.html">
<title>${channel.title}</title>
<let blog="channel"/>
<section name="head">
<w:feed-link name="channel_feed" let:channel="channel.slug" rel="alternate" />
</section>
<section name="side">
<techblog:posts-by-month blog="blog" urlname="channel_month"/>
</section>
</content>
<content libname="content.recent-posts" extends="#content.channel.posts">
<title>${channel.title} Recent Posts</title>
</content>
<content libname="content.list-posts-by-month" extends="#content.list-posts">
<title>Posts by Month</title>
<section name="header">
<html:h3>Posts in ${start % "MMMM, YYYY"}</html:h3>
</section>
<section name="side">
<techblog:posts-by-month blog="blog" year="start.year"/>
</section>
</content>
<content libname="content.channel.list-posts-by-month" extends="#content.list-posts">
<title>Posts by Month</title>
<section name="header">
<html:h3>Posts in ${start % "MMMM, YYYY"}</html:h3>
</section>
<section name="side">
<techblog:posts-by-month blog="channel" year="start.year" urlname="channel_month"/>
</section>
</content>
<content libname="content.new-post" extends="#content.base">
<title>New Post</title>
<section name="body">
<render src="form"/>
</section>
</content>
<content libname="content.edit-post" extends="#content.base" template="editor_base.html">
<title>Edit Post</title>
<include-js path="js/editpost.js"/>
<section name="body">
<node template="editor/draft.html" />
<render src="form"/>
<!--
<w:tab-panel active="edit" id="postedit">
<w:tab title="Edit Post" id="edit">
<render src="form"/>
</w:tab>
<w:tab title="Attatch Images" id="images" if="draft.images">
<imagelib:manager collection="draft.images" picker="yes" picker_text="insert"
on_pick="on_pick_post_images"
on_selection="on_images_change"/>
</w:tab>
<w:tab title="Preview" id="preview">
<html:div id="post-preview"/>
</w:tab>
</w:tab-panel>
-->
</section>
</content>
<content libname="content.delete-post" extends="#content.base">
<title>Delete Post</title>
<section name="body">
<if test="deleted">
<w:success>
<html:p>Post '${deleted}' has been deleted</html:p>
</w:success>
<w:button-link name="list" let:blog=".url.blog">Return to Posts</w:button-link>
</if>
<else>
<render src="form"/>
</else>
</section>
</content>
<content libname="content.post" extends="#content.blog.base" template="posts/${post.type}.html,posts/text.html">
<title>${post.title}</title>
<section name="head">
<w:feed-link name="feed" let:blog="post.blog.slug" rel="home"/>
</section>
<section name="content">
<comments:get-count namespace="app-${.app.name}" topic="post-${post.id}" dst="numcomments"/>
<techblog:post newer="newer" older="older" post="post" slug="url.slug" linktitle="no" solo="yes" numcomments="numcomments"/>
<comments:comments markup="markdown" namespace="app-${.app.name}" topic="post-${post.id}" url="${post_url}" />
</section>
<section name="side">
<techblog:related-posts post="post" count="6"/>
</section>
<section name="admin_links" merge="append" if=".permissions.admin and post">
<let slug="post.slug" />
<let id="post.id"/>
<w:link/>
<w:link name="newpost" app="${.app.name}" let:blog=".url.blog" icon="plus">New Post</w:link>
<w:link />
<w:link name="publish" let:blog=".url.blog" let:id="post.id" icon="share" if="not post.published">Publish post</w:link>
<w:link name="hide" let:blog=".url.blog" let:id="post.id" icon="eye-close" if="post.published">Hide post</w:link>
<w:link name="editpost" let:blog=".url.blog" let:slug="post.slug" icon="edit">Edit post</w:link>
<w:link name="deletepost" let:blog=".url.blog" let:slug="post.slug" icon="remove">Delete post</w:link>
</section>
</content>
<content libname="content.publish-post" extends="#content.base" >
<title>Publish post</title>
<section name="body">
<render src="form" />
</section>
</content>
<content libname="content.hide-post" extends="#content.base">
<title>Hide post</title>
<section name="body">
<render src="form" />
</section>
</content>
<content libname="content.search" extends="#content.base" template="search.html">
<title>Search</title>
<section name="results">
<node template="search_header.html" let:search="search"/>
<w:paginate src="posts" dst="post" auto="yes">
<techblog:post-summary post="post"/>
</w:paginate>
</section>
<section name="side">
<techblog:popular-tags count="20"/>
</section>
</content>
<content libname="content.tag" extends="#content.base" template="search.html">
<title>Tag ${tag.name}</title>
<section name="results">
<node template="tag_header.html" let:tag="tag" let:count="len:posts"/>
<w:paginate src="posts" dst="post" auto="yes">
<techblog:post-summary post="post"/>
</w:paginate>
</section>
<section name="side">
<techblog:popular-tags active="tag"/>
</section>
</content>
<content libname="content.base.settings" extends="#content.base" template="settings/base.html">
<section name="side">
<node template="settings/links.html"/>
</section>
</content>
<content libname="content.blog.settings" extends="#content.base.settings">
<title>Settings</title>
<section name="links">
<w:link name="list" let:blog="blog.slug">${blog.title}</w:link>
</section>
<section name="content">
<w:success if="success">Blog Settings were updated</w:success>
<render src="form" />
</section>
</content>
<content libname="content.blog.delete" extends="#content.blog.settings">
<title>Delete</title>
<section name="content">
<render src="form"/>
</section>
</content>
<content libname="content.blog.images" extends="#content.blog.settings">
<title>Images</title>
<section name="content">
<imagelib:manager collection="blog.images" />
</section>
</content>
<content libname="content.channel.settings" extends="#content.base.settings">
<title>Channel Settings</title>
<section name="links">
<w:link name="channel_list" let:channel="channel.slug">${channel.title}</w:link>
</section>
<section name="content">
<w:success if="success">Blog Settings were updated</w:success>
<render src="form" />
</section>
</content>
<content libname="content.channel.images" extends="#content.channel.settings">
<title>Channel Images</title>
<section name="content">
<imagelib:manager collection="channel.images" />
</section>
</content>
<content libname="content.drafts" extends="#content.base.settings">
<title>Drafts</title>
<section name="links">
<w:link name="list" let:blog="blog.slug">${blog.title}</w:link>
</section>
<section name="content">
<if test="not drafts">
<w:info>
<markdown>
**Drafts will appear here**
To edit a post, navigate to the post then click 'Edit' from the admin menu.
</markdown>
</w:info>
</if>
<else>
<w:paginate src="drafts" dst="draft" auto="no">
<node template="settings/drafts.html" let:drafts="pagination.objects"/>
</w:paginate>
</else>
</section>
</content>
</moya>