Only display the "add this interest?" message to users who don't have
it.
Patch by kareila.
diffs (27 lines):
diff -r b5f2f90a3c9a -r b2b1ca17e24d cgi-bin/DW/Controller/Search/Interests.pm
--- a/cgi-bin/DW/Controller/Search/Interests.pm Mon Dec 20 00:29:51 2010 +0800
+++ b/cgi-bin/DW/Controller/Search/Interests.pm Thu Dec 23 10:39:49 2010 -0600
@@ -330,6 +330,11 @@ sub interest_handler {
$rv->{int_users} = { count => scalar( @ul ), navbar => $navbar,
results => $results };
+
+ # check to see if the remote user already has the interest
+ $rv->{not_interested} = ! $remote->interests->{$interest}
+ if $remote;
+
return DW::Template->render_template( 'interests/int.tt', $rv );
}
diff -r b5f2f90a3c9a -r b2b1ca17e24d views/interests/int.tt
--- a/views/interests/int.tt Mon Dec 20 00:29:51 2010 +0800
+++ b/views/interests/int.tt Thu Dec 23 10:39:49 2010 -0600
@@ -61,7 +61,7 @@
[%- END -%]
<h1>[% ".users.header" | ml(interest = e_int) %]</h1>
<p class='interestinfo'>
- [%- IF remote -%]
+ [%- IF not_interested -%]
[%- '.addint2' | ml(aopts =
"href='$roots.site/interests?mode=add&intid=$intid'") -%]
[%- END -%]
[% '.morestuff2' | ml(aopts = "href='$roots.site/interests'") %]</p>
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog