mourningdove/views/mood/index.tt
2026-05-24 01:03:05 +00:00

109 lines
2.8 KiB
Text

[%# View a list of public mood themes.
#
# Authors:
# import r26.1 livejournal -- original page
# Jen Griffin <kareila@livejournal.com> -- TT conversion
#
# Copyright (c) 2008-2020 by Dreamwidth Studios, LLC.
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself. For a copy of the license, please
# reference 'perldoc perlartistic' or 'perldoc perlgpl'.
#
%]
[%- sections.title='.title' | ml( sitename = site.nameshort ) -%]
[%- sections.head = BLOCK %]
<style type="text/css">
#content select {
width: auto;
display: inline;
padding-right: 2rem;
font-size: 90%;
}
#content td {
text-align: center;
}
#content input {
margin-bottom: 1rem;
}
</style>
[% END %]
[%- CALL dw.active_resource_group( "foundation" ) -%]
<p>[% '.moods.intro' | ml( sitename = site.name ) %]</p>
<p>[% '.moods.howtochange' | ml( aopts = "href='${site.root}/customize/'" ) %]</p>
<form action='/moodlist' method='get'>
[% form.hidden( name = "page", value = pages.current ) %]
<table summary='' width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td><!-- empty column header --></td>
[%- # create alternate mood view selection form
n = 1;
FOREACH mname IN show_moods -%]
<td>
[% form.select( name = "theme$n", selected = mname,
items = mood_select ) %]
</td>
[%- n = n + 1;
END -%]
<td>[% form.submit( value = dw.ml( '.btn.switch' ) ) %]</td>
</tr>
[%- # build mood display rows
i = pages.first_item;
WHILE i <= pages.last_item;
theme = themes.$i;
i = i + 1 -%]
<tr>
<td>[% theme.name %]</td>
[%- FOREACH mood IN show_moods;
pic = load_image( theme.moodthemeid, mood ) -%]
<td>
[%- IF pic.keys.size -%]
<img align='absmiddle' alt="[% "${theme.name}: $mood" | html %]"
src="[% pic.pic %]" width='[% pic.w %]' height='[% pic.h %]'
hspace='2' vspace='2' />
[%- END -%]
</td>
[%- END -%]
<td>
[% link = dw.create_url( '/moodlist',
args => { moodtheme => theme.moodthemeid } );
text = dw.ml( '.nav.viewall' );
'Actionlink' | ml( link = "<a href='$link'>$text</a>" ) %]
</td>
</tr>
[%- END; # WHILE -%]
</table>
</form>
<div style="text-align: center; margin-top: 2.5em;">
<p style="margin-left: -.75rem; font-weight: bold;">
[% '.pagetext' | ml( pageon = pages.current, pagetot = pages.total_pages ) %]
</p>
[% INCLUDE components/pagination.tt
current => pages.current,
total_pages => pages.total_pages
%]
</div>