view_gallery.naml

<subroutine name="view_gallery" requires="basic,nabble,servlet">
	<n.apply_app_namespace.view_gallery_page />
</subroutine>

<macro name="view_gallery_page">
	<n.set_app_rows_per_page rows_per_page="[n.gallery_topics_per_page/]"/>
	<n.app_html>
		<head>
			<n.app_title/>
			<n.gallery_table_stylesheet/>
		</head>
		<body>
			<n.column_layout.>
				<n.column. width="70%">
					<n.widget.>
						<n.gallery_table/>
						<n.app_topic_pagination margin=".5em .3em"/>
					</n.widget.>
				</n.column.>
				<n.column. width="30%">
					<n.sidebar_widget/>
				</n.column.>
			</n.column_layout.>
		</body>
	</n.app_html>
</macro>

<macro name="gallery_topics_per_page">
	16
</macro>

<macro name="gallery_table_stylesheet">
	<style type="text/css">
		table.gallery {
			margin-top:1em;
			width:100%;
		}
		table.gallery tr {
			vertical-align:top;
		}
		table.gallery td {
			padding: .5em;
			text-align:center;
		}
	</style>
</macro>

<macro name="gallery_table">
	<table class="gallery">
		<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_gallery/>
			<n.loop.>
				<n.gallery_table_row/>
			</n.loop.>
		</n.page_node.topics_list.>
	</table>
</macro>

<macro name="gallery_table_row" requires="app_namespace">
	<tr>
		<td style="width:33%">
			<n.current_node.gallery_cell/>
		</td>
		<td style="width:33%">
			<n.if.next_node>
				<then.current_node.gallery_cell/>
			</n.if.next_node>
		</td>
		<td style="width:33%">
			<n.if.next_node>
				<then.current_node.gallery_cell/>
			</n.if.next_node>
		</td>
	</tr>
</macro>

<macro name="gallery_table_row" requires="narrow_app_namespace">
	<tr>
		<td style="width:50%">
			<n.current_node.gallery_cell/>
		</td>
		<td style="width:50%">
			<n.if.next_node>
				<then.current_node.gallery_cell/>
			</n.if.next_node>
		</td>
	</tr>
</macro>


<macro name="handle_empty_gallery" requires="node_list,node_page,servlet">
	<n.if.not.has_more_elements>
		<then.empty_gallery_row/>
	</n.if.not.has_more_elements>
</macro>

<macro name="empty_gallery_row" requires="app_namespace">
	<tr>
		<td style="width:33%"><n.page_node.empty_gallery_cell/></td>
		<td style="width:33%"></td>
		<td style="width:33%"></td>
	</tr>
</macro>

<macro name="empty_gallery_row" requires="narrow_app_namespace">
	<tr>
		<td style="width:50%"><n.page_node.empty_gallery_cell/></td>
		<td style="width:50%"></td>
	</tr>
</macro>

<macro name="gallery_cell">
	<n.cell_thumbnail/>
	<n.cell_link_and_star/>
	<n.cell_details/>
</macro>

<macro name="cell_thumbnail">
	<n.if.is_pinned_in_loop>
		<then>
			<div class="pinned-box"></div>
		</then>
	</n.if.is_pinned_in_loop>
	<n.if.has_thumbnail>
		<then.thumbnail_box/>
		<else>
			<span class="weak-color box-text adbayes-content">
				<n.message.truncated size="100"/>
			</span>
		</else>
	</n.if.has_thumbnail>
</macro>

<macro name="cell_link_and_star">
	<div class="adbayes-content"><n.node_link/></div>
</macro>

<macro name="cell_details">
	<div class="weak-color" style="font-variant: small-caps;">
		<t>by <t.author.owner.name truncate="20"/></t>
	</div>

	<div class="weak-color" style="width:100%;font-size:80%;margin:.3em 0;font-variant: small-caps;">
		<n.if.not.is_locked_topic>
			<then>
				<n.if.has_replies>
					<then.comments_link/>
					<else>
						0 <t>comments</t>
					</else>
				</n.if.has_replies>
			</then>
		</n.if.not.is_locked_topic>
		&ndash;
		<n.views show_text="true"/>
		<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="thumbnail_box">
	<span class="box">
		<a href="[n.url/]"><img src="[n.thumbnail_url/]" style="border:none"/></a>
	</span>
</macro>

<macro name="empty_gallery_cell" requires="node">
	<span class="weak-color box-text">
		<div style="position:relative;top:30%">
			<n.new_topic_link text="[t]Click here to make your first post[/t]"/>
		</div>
	</span>
</macro>