mourningdove/views/interests/int.tt
2026-05-24 01:03:05 +00:00

133 lines
4.7 KiB
Text

[%# Interest search, based on code from LiveJournal.
#
# Authors:
# Jen Griffin <kareila@livejournal.com>
#
# Copyright (c) 2010-2013 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'.
#
%]
[%- CALL dw.active_resource_group( "foundation" ) -%]
[%- sections.head = BLOCK %]
<style type='text/css'>
#content p { font-size: 85%; }
ul.contentlist { list-style-type: none; }
ul.contentlist li { padding-bottom: 1em; font-size: 115%; clear: both; }
ul.contentlist .userpic-img { border: 1px solid #000; }
.imgpos { float: left; width: 100px; min-height: 4em; text-align: right;
margin: 0 .5em .5em 0; }
.navbar { text-align: center; clear: both; }
.typefilter { font-weight: bold; font-size: 105%; margin: 1em 0; }
.lastupdated { color: #666; }
</style>
[% END -%]
[%- sections.title='.title' | ml -%]
[%- IF warn_toolong %]<p>[% warn_toolong %]</p>[% END -%]
<form method='get' action='interests'>
<div class="row">
<div class="small-6 medium-5 column">
<label for='int'>[% 'interests.interested.in' | ml %]</label>
<p>[% '/directory/index.tt.int_multiple' | ml %]</p>
</div>
<div class="small-4 medium-5 column">
[% form.textbox( name = 'int', value = interest, # escaped in the controller
size = 20 ) %]
</div>
<div class="small-2 medium-2 column">
[% form.submit( value = dw.ml( "interests.interested.btn" ) ) %]
</div>
</div>
</form>
<form method='get' action='interests'>
[% form.hidden( name = 'mode', value = 'enmasse' ) %]
<div class="row">
<div class="small-6 medium-5 column">
<label for='fromuser'>[% 'interests.enmasse.intro' | ml %]</label>
</div>
<div class="small-4 medium-5 column">
[% form.textbox( name = 'fromuser', size = 20 ) %]
</div>
<div class="small-2 medium-2 column">
[% form.submit( value = dw.ml( "interests.enmasse.btn" ) ) %]
</div>
</div>
</form>
<p style='margin-top: 1em;'>
[% '.morestuff2' | ml(aopts = "href='$site.root/interests'") %]</p>
<h2>[% ".header" | ml(interest = interest) %]</h2>
[%- IF allcount -%]
<div class='typefilter'>[% '.filterlink.label' | ml %]&nbsp;
[%- FOREACH type = type_list;
link = type_link(type);
IF type != 'none' ; '&nbsp;|&nbsp;' ; END;
IF link %]<a href="[% link | html %]">[% END;
".filterlink.$type" | ml;
IF link ; '</a>' ; END;
END -%]
</div>
[%- FOREACH not_interested -%]
<p>
[%- intadd = dw.create_url( '/interests', args =>
{ mode = 'add', intid = intid } ) -%]
[%- '.addint3' | ml(int = int, aopts = "href='${intadd}'") -%]</p>
[%- END -%]
[%- UNLESS comm_count -%]
<p>
[%- '.nocomms2' | ml(aopts = "href='$site.root/communities/new'", num = query_count) %]</p>
[%- END -%]
<h4>
[%- IF type_count.defined -%]
[% '.filtered' | ml(num = allcount, count = type_count) %]
[%- ELSE -%]
[% '.matches2' | ml(num = allcount) %]
[%- END -%]
</h4>
[%- IF data -%]
<div class='navbar'>[% navbar %]</div><br />
<ul class='contentlist'>
[%- FOREACH data -%]
<li><span class="imgpos">
<a href='[% u.allpics_base %]'>[% icon %]</a></span>
[% u.ljuser_display %] - [% u.name_html %]
[%- IF desc -%]
<br />&nbsp;&nbsp;&nbsp;<i>[% desclabel %]</i> [% desc %]
[%- END -%]
<br />&nbsp;&nbsp;&nbsp;<small class='lastupdated'>(
[%- IF updated; '.lastupdated.true' | ml(time = updated) -%]
[%- ELSE; '.lastupdated.false' | ml; END -%]
)</small></li>
[%- END -%]
</ul>
<div class='navbar'>[% navbar %]</div>
[%- ELSIF filtered -%]
<p>[% '.nomatch' | ml(link = type_link('none')) %]</p>
[%- ELSIF allcount && ! filtered -%]
<p>[% '.noshown' | ml %]</p>
[%- END -%]
[%- ELSE -%]
<p>
[%- '.nocomms2' | ml(aopts = "href='$site.root/communities/new'", num = query_count) %]</p>
<p>
[%- IF no_users -%]
[%- '.nousers3' | ml(aopts = "href='$site.root/interests?mode=addnew&amp;keyword=$no_users'", num = no_users_count, interests = no_users ) %]</p>
[%- ELSE -%]
[%- '.notall' | ml %]</p>
[%- FOREACH not_interested -%]
<p>
[%- intadd = dw.create_url( '/interests', args =>
{ mode = 'add', intid = intid } ) -%]
[%- '.addint3' | ml(int = int, aopts = "href='${intadd}'") -%]</p>
[%- END -%]
[%- END -%]
[%- END -%]