comparison src/nabble/view/naml/feeds.naml @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1 <macro name="feeds" requires="servlet">
2 <n.node_page.>
3 <n.html>
4 <head>
5 <n.title.><t>Atom feeds for <t.location.page_node.subject/></t></n.title.>
6 </head>
7 <body>
8 <h1><t>Atom feeds for <t.location.page_node.subject/></t></h1>
9 <div style="margin-top:1.5em">
10 <div class="big-title second-font">
11 <img src="/images/feeds.png" width="16" height="16" align="absmiddle" alt="feeds"/>
12 <t>Topics only</t>
13 </div>
14 <a href="[n.page_node.feeds_topics_path/]"><n.request_base_url/><n.page_node.feeds_topics_path/></a>
15 </div>
16 <div style="margin-top:1.5em">
17 <div class="big-title second-font">
18 <img src="/images/feeds.png" width="16" height="16" align="absmiddle" alt="feeds"/>
19 <t>Topics and replies</t>
20 </div>
21 <a href="[n.page_node.feeds_posts_path/]"><n.request_base_url/><n.page_node.feeds_posts_path/></a>
22 </div>
23 </body>
24 </n.html>
25 </n.node_page.>
26 </macro>
27
28 <macro name="feeds_topics_path" requires="node">
29 <n.encode_url.>
30 /<n.url_encoded_subject/>-ft<n.id/>.xml
31 </n.encode_url.>
32 </macro>
33
34 <macro name="feeds_posts_path" requires="node">
35 <n.encode_url.>
36 /<n.url_encoded_subject/>-f<n.id/>.xml
37 </n.encode_url.>
38 </macro>
39
40 <static>
41 feed
42 id
43 subtitle
44 entry
45 published
46 updated
47 author
48 name
49 content
50 thr:in-reply-to
51 </static>
52
53 <macro name="as_atom_feeds" dot_parameter="do" requires="node">
54 <n.use_html_encoder.>
55 <![CDATA[<?xml version="1.0" encoding="utf-8"?>]]>
56 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
57 <n.xml_response/>
58 <id>tag:<n.server_name/>,2006:forum-<n.id/></id>
59 <title>Nabble - <n.subject/></title>
60 <updated><n.now.as_atom_date_format/></updated>
61 <link rel="self" type="application/atom+xml" href="[n.current_url/]" />
62 <link rel="alternate" type="text/html" href="[n.url/]" />
63 <subtitle type="html"><n.encode.message.message_as_html/></subtitle>
64 <n.do/>
65 </feed>
66 </n.use_html_encoder.>
67 </macro>
68
69 <macro name="as_atom_entry" requires="node, node_page">
70 <n.nop/>
71 <entry>
72 <id>tag:<n.server_name/>,2006:post-<n.id/></id>
73 <title><n.subject/></title>
74 <published><n.when_created.as_atom_date_format/></published>
75 <updated><n.atom_entry_updated_value/></updated>
76 <author>
77 <name><n.owner.name/></name>
78 </author>
79 <content type="html">
80 <n.encode.message_with_signature/>
81 <n.if.not.this_node.get_app_node.equals.page_node>
82 <then.encode.>
83 <p>Posted in <n.get_app_node.node_link/></p>
84 </then.encode.>
85 </n.if.not.this_node.get_app_node.equals.page_node>
86 </content>
87 <link rel="alternate" type="text/html" href="[n.url/]" />
88 <n.if.parent_node.is_post>
89 <then><thr:in-reply-to ref="tag:[n.server_name/],2006:post-[n.parent_node.id/]"/></then>
90 </n.if.parent_node.is_post>
91 </entry>
92 </macro>
93
94 <macro name="atom_entry_updated_value" requires="node">
95 <n.if.was_updated>
96 <then.when_updated.as_atom_date_format/>
97 <else.when_created.as_atom_date_format/>
98 </n.if.was_updated>
99 </macro>
100
101 <macro name="as_atom_date_format" requires="date">
102 <n.custom_format format="yyyy-MM-dd'T'HH:mm:ss'Z'"/>
103 </macro>
104
105 <macro name="atom_topics_by_date" requires="servlet" unindent="true">
106 <n.node_page.>
107 <n.app_caching/>
108 <n.page_node.as_atom_feeds.>
109 <n.page_node.topics_list.
110 start="0"
111 length="[n.atom_length/]"
112 sort="last-node-date"
113 >
114 <n.loop.current_node.as_atom_entry/>
115 </n.page_node.topics_list.>
116 </n.page_node.as_atom_feeds.>
117 </n.node_page.>
118 </macro>
119
120 <macro name="atom_posts_by_date" requires="servlet" unindent="true">
121 <n.node_page.>
122 <n.app_caching/>
123 <n.page_node.as_atom_feeds.>
124 <n.page_node.post_list.
125 start="0"
126 length="[n.atom_length/]"
127 sort="date-descending"
128 >
129 <n.loop.current_node.as_atom_entry/>
130 </n.page_node.post_list.>
131 </n.page_node.as_atom_feeds.>
132 </n.node_page.>
133 </macro>
134
135 <macro name="atom_length">
136 <n.default. to="35">
137 <n.get_parameter name="length"/>
138 </n.default.>
139 </macro>