comparison src/nabble/view/naml/view_blog.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 <subroutine name="view_blog" requires="basic,nabble,servlet">
2 <n.apply_app_namespace.view_blog_page />
3 </subroutine>
4
5 <macro name="view_blog_page">
6 <n.set_app_rows_per_page rows_per_page="[n.blog_topics_per_page/]"/>
7 <n.app_html>
8 <head>
9 <n.app_title/>
10 <n.blog_table_stylesheet/>
11 </head>
12 <body>
13 <n.blog_page_layout/>
14 </body>
15 </n.app_html>
16 </macro>
17
18 <macro name="blog_topics_per_page">
19 10
20 </macro>
21
22 <macro name="blog_table_stylesheet">
23 <style type="text/css">
24 div.pinned {
25 position:relative;
26 z-index:999;
27 background-image:url('/images/pin.png');
28 width:20px;
29 height:21px;
30 float:right;
31 }
32 div.blog-header {
33 padding:.3em;
34 -moz-border-radius: 6px;
35 -webkit-border-radius: 6px;
36 }
37 div.blog-date {
38 text-transform:uppercase;
39 letter-spacing:.2em;
40 font-size:70%;
41 margin-bottom:.2em;
42 padding: .2em;
43 }
44 div.blog-title {
45 font-size:150%;
46 font-weight:bold;
47 }
48 table.blog-details {
49 border-collapse:collapse;
50 margin-top:.2em;
51 font-variant: small-caps;
52 }
53 div.blog-text {
54 margin-top:.7em;
55 padding:.3em;
56 }
57 div.blog-footer {
58 padding:.3em;
59 clear:both;
60 }
61 </style>
62 </macro>
63
64 <macro name="blog_page_layout" requires="app_namespace">
65 <n.column_layout.>
66 <n.column. width="70%">
67 <n.widget.>
68 <n.blog_table/>
69 <n.app_topic_pagination margin=".5em .3em"/>
70 </n.widget.>
71 </n.column.>
72 <n.column. width="30%">
73 <n.sidebar_widget/>
74 </n.column.>
75 </n.column_layout.>
76 </macro>
77
78 <macro name="blog_page_layout" requires="narrow_app_namespace">
79 <n.new_topic_action_link text="[t]New Post[/t]"/>
80 <n.subapps_action_link text="[t]Subcategories[/t]"/>
81 <n.people_action_link/>
82 <n.options_action_menu/>
83
84 <div style="clear:both"/>
85 <n.widget.>
86 <n.blog_table/>
87 <n.app_topic_pagination margin=".5em .3em"/>
88 </n.widget.>
89 <n.forum_footer/>
90 </macro>
91
92 <macro name="blog_table">
93 <n.page_node.topics_list. sort="pinned-and-root-node-date" start="[n.app_index_record/]" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter/]" >
94 <n.handle_empty_blog/>
95 <n.loop.current_node.>
96 <div style="margin-bottom:2.5em;clear:both">
97 <n.blog_post_header/>
98 <div class="blog-text adbayes-content">
99 <n.node_message_as_html/>
100 </div>
101 <n.blog_post_footer/>
102 </div>
103 </n.loop.current_node.>
104 </n.page_node.topics_list.>
105 </macro>
106
107 <macro name="blog_post_header" requires="node">
108 <div class="blog-header shaded-bg-color">
109 <n.if.is_pinned_in_loop>
110 <then>
111 <div class="pinned"></div>
112 </then>
113 </n.if.is_pinned_in_loop>
114 <div class="blog-date weak-color">
115 <n.when_created.date_only/>
116 </div>
117 <div class="blog-title second-font adbayes-content">
118 <n.node_link/>
119 </div>
120 <table class="blog-details weak-color">
121 <tr>
122 <td class="nowrap">
123 <n.owner.avatar size="small" border_class="medium-border-color"/>
124 </td>
125 <td class="nowrap">
126 <t>by <t.author.owner.name truncate="20"/></t>
127 @
128 <n.when_created.time_only/>
129 <n.if.is_in_subapp>
130 <then><t>in <t.location.italic.subapp_link_on_hover/></t></then>
131 </n.if.is_in_subapp>
132 </td>
133 </tr>
134 </table>
135 </div>
136 </macro>
137
138 <macro name="blog_post_footer" requires="node">
139 <div class="blog-footer">
140 <n.if.not.is_locked_topic>
141 <then>
142 <n.permalink/>
143 &nbsp;
144 <img src="/images/icon_message.png" align="absmiddle" height="14" width="15"/>
145 <n.if.has_replies>
146 <then.comments_link/>
147 <else>
148 <a href="[n.new_post_path/]" rel="nofollow"><t>Leave a comment</t></a>
149 </else>
150 </n.if.has_replies>
151 </then>
152 </n.if.not.is_locked_topic>
153 </div>
154 </macro>
155
156 <macro name="handle_empty_blog" requires="node_list,node_page">
157 <n.if.not.has_more_elements>
158 <then>
159 <div class="rounded light-border-color" style="border-width:2px;border-style:solid;padding:1.5em .5em">
160 <n.page_node.>
161 <n.new_topic_link>
162 <text>
163 <div class="blog-title second-font weak-color" style="margin-bottom:.5em"><t>Write Your First Post</t></div>
164 <t>Click here to make your first post</t>
165 </text>
166 </n.new_topic_link>
167 </n.page_node.>
168 </div>
169 </then>
170 </n.if.not.has_more_elements>
171 </macro>