diff src/nabble/view/naml/view_news.naml @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/nabble/view/naml/view_news.naml	Thu Mar 21 19:15:52 2019 -0600
@@ -0,0 +1,227 @@
+<subroutine name="view_news" requires="basic,nabble,servlet">
+	<n.apply_app_namespace.view_news_page />
+</subroutine>
+
+<macro name="view_news_page">
+	<n.set_app_rows_per_page rows_per_page="[n.news_topics_per_page/]"/>
+	<n.app_html>
+		<head>
+			<n.app_title/>
+			<n.news_table_stylesheet/>
+		</head>
+		<body>
+			<n.news_page_layout/>
+		</body>
+	</n.app_html>
+</macro>
+
+<macro name="news_topics_per_page">
+	25
+</macro>
+
+<macro name="news_table_stylesheet">
+	<style type="text/css">
+		span.topic-count {
+			font-size:80%;
+			margin-right:1.7em;
+		}
+		h2.news-header {
+			margin:0;
+			padding:0;
+		}
+		table.news-table {
+			width:100%;
+			border-collapse:collapse;
+		}
+		table.news-table td.header {
+			padding: .2em .3em;
+			border-bottom-width: 1px;
+			border-bottom-style: solid;
+		}
+		td.news-row {
+			padding:.7em .1em .6em .5em;
+			border-width: 1px;
+			border-style: solid;
+			border-left: none;
+			border-right: none;
+			border-top: none;
+		}
+		td.thumbnail-cell {
+			width:140px;
+			text-align:center;
+			padding-top:1em;
+			vertical-align:top;
+		}
+		div.news-details {
+			text-align:right;
+			clear:both;
+			font-variant: small-caps;
+			padding:.5em 0 0 0;
+		}
+		div.news-title h2 {
+			display:inline;
+		}
+	</style>
+</macro>
+
+<macro name="news_page_layout" requires="app_namespace">
+	<n.column_layout.>
+		<n.column. width="70%">
+			<n.news_sidebar_widget/>
+		</n.column.>
+		<n.column. width="30%">
+			<n.sidebar_widget/>
+	   </n.column.>
+	</n.column_layout.>
+</macro>
+
+<macro name="news_page_layout" requires="narrow_app_namespace">
+	<n.new_topic_action_link text="[t]New Post[/t]"/>
+	<n.subapps_action_link text="[t]Subcategories[/t]"/>
+	<n.people_action_link/>
+	<n.options_action_menu/>
+
+	<div style="clear:both"/>
+	<n.widget.>
+		<div class="sidebar-section shaded-bg-color">
+			<n.app_topic_pagination margin=".2em .5em"/>
+			<h2 class="news-header">
+				<t>Topics</t>
+				<span class="weak-color topic-count">
+					(<n.app_topic_count/>)
+				</span>
+			</h2>
+		</div>
+		<n.news_table/>
+		<n.app_topic_pagination margin=".5em .3em"/>
+	</n.widget.>
+	<n.forum_footer/>
+</macro>
+
+<macro name="news_sidebar_widget">
+	<n.widget.>
+		<div class="sidebar-section shaded-bg-color">
+			<n.app_topic_pagination margin=".2em .5em"/>
+			<h2 class="news-header">
+				<t>Topics</t>
+				<span class="weak-color topic-count">
+					(<n.app_topic_count/>)
+				</span>
+			</h2>
+		</div>
+		<n.news_table/>
+		<n.app_topic_pagination margin=".5em .3em"/>
+	</n.widget.>
+</macro>
+
+<macro name="news_table">
+	<table id="news-table" class="news-table medium-border-color">
+		<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/]"
+		>
+			<n.handle_empty_newspaper/>
+			<n.loop.current_node.>
+				<tr>
+					<n.if.has_thumbnail>
+						<then>
+							<td class="news-row thumbnail-cell light-border-color">
+								<n.thumbnail_box/>
+							</td>
+							<td class="news-row light-border-color" style="vertical-align:top">
+								<n.news_text_cell/>
+							</td>
+						</then>
+						<else>
+							<td class="news-row light-border-color" style="vertical-align:top" colspan="2">
+								<n.news_text_cell/>
+							</td>
+						</else>
+					</n.if.has_thumbnail>
+				</tr>
+			</n.loop.current_node.>
+		</n.page_node.topics_list.>
+	</table>
+</macro>
+
+<macro name="news_text_cell" requires="node">
+	<n.news_title_row/>
+	<n.news_details_row/>
+	<n.news_snippet_row/>
+</macro>
+
+<macro name="news_title_row" requires="node">
+	<div class="news-title">
+		<h2 class="news-title adbayes-content">
+			<n.node_link/>
+		</h2>
+		<n.if.is_in_subapp>
+			<then>
+				<t>in <t.location.italic.subapp_link_on_hover/></t>
+			</then>
+		</n.if.is_in_subapp>
+	</div>
+</macro>
+
+<macro name="news_snippet_row" requires="node">
+	<div class="node-snippet adbayes-content" style="padding:1em 0 .5em;clear:both">
+		<n.truncate size="300">
+			<text><n.remove_html_tags.message.as_text/></text>
+			<if_truncated>
+				<n.news_snippet_read_more_link/>
+			</if_truncated>
+		</n.truncate>
+	</div>
+</macro>
+
+<macro name="news_snippet_read_more_link" requires="node">
+	<n.node_link text="[t]read more[/t]"/>
+</macro>
+
+<macro name="news_details_row" requires="node">
+	<div class="news-details weak-color">
+		<span class="nowrap">
+			<t>by <t.author.owner.name truncate="20"/></t>
+			&bull;
+		</span>
+		<span class="nowrap"><n.when_created.short_format/></span>
+		<span>|</span>
+		<span class="nowrap"><n.views show_text="true"/></span>
+		<n.if.not.is_locked_topic>
+			<then>
+				<span>|</span>
+				<span class="nowrap">
+					<img src="/images/icon_message.png" align="absmiddle" height="14" width="15"/>
+					<n.if.has_replies>
+						<then><n.comments_link/></then>
+						<else>0 <t>comments</t></else>
+					</n.if.has_replies>
+				</span>
+			</then>
+		</n.if.not.is_locked_topic>
+		<n.if.is_pinned_in_loop>
+			<then><span><img src="/images/pin.png" width="20" height="21" style="margin:0 .5em" align="absmiddle"/></span></then>
+		</n.if.is_pinned_in_loop>
+	</div>
+</macro>
+
+<macro name="handle_empty_newspaper" requires="node_list,node_page">
+	<n.if.not.has_more_elements>
+		<then>
+			<div class="light-border-color" style="border-width:2px;border-style:solid;padding:1.5em .5em">
+				<n.page_node.>
+					<n.new_topic_link>
+						<text>
+							<div class="second-font weak-color" style="font-size:150%;font-weight:bold;margin-bottom:.5em">
+								<t>Write Your First Headline</t>
+							</div>
+							<t>Click here to make your first post</t>
+						</text>
+					</n.new_topic_link>
+				</n.page_node.>
+			</div>
+		</then>
+	</n.if.not.has_more_elements>
+</macro>
\ No newline at end of file