Add links to follow and unfollow Sones from the “Known Sones” page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 20:22:49 +0000 (22:22 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 20:22:49 +0000 (22:22 +0200)
src/main/resources/i18n/sone.en.properties
src/main/resources/static/css/sone.css
src/main/resources/templates/knownSones.html

index b87b686..76d0a06 100644 (file)
@@ -132,6 +132,8 @@ Page.Logout.Title=Logout - Sone
 View.Head.ProfileLink.Text=Your Profile
 
 View.Sone.Label.LastUpdate=last update:
+View.Sone.Button.UnfollowSone=unfollow
+View.Sone.Button.FollowSone=follow
 View.Sone.Button.UnblockSone=unblock
 View.Sone.Button.BlockSone=block
 
index f198127..0014dd9 100644 (file)
        display: inline;
 }
 
-#sone #known-sones form.block button, #sone #known-sones form.unblock button {
+#sone #known-sones form.block button, #sone #known-sones form.unblock button, #sone #known-sones form.follow button, #sone #known-sones form.unfollow button {
        display: inline;
        color: rgb(28, 131, 191);
        background: none;
        padding: 0px;
 }
 
-#sone #known-sones form.block button:hover, #sone #known-sones form.unblock button:hover {
+#sone #known-sones form.block button:hover, #sone #known-sones form.unblock button:hover, #sone #known-sones form.follow button:hover, #sone #known-sones form.unfollow button:hover {
        display: inline;
        color: rgb(255, 172, 0);
 }
index 84b6a94..096bc19 100644 (file)
@@ -8,6 +8,19 @@
                                <div class="profile-link"><a href="viewSone.html?sone=<% sone.id>" title="<% sone.requestUri|html>"><% sone.niceName|html></a></div>
                                <div class="last-update">(<%= View.Sone.Label.LastUpdate|l10n|html> <% sone.time|date format="MMM d, yyyy, HH:mm:ss">)</div>
                                <%ifnull ! currentSone>
+                                       <%if sone.isFriend>
+                                               <form class="unfollow" action="unfollowSone.html" method="post">
+                                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                                       <input type="hidden" name="sone" value="<% sone.id>" />
+                                                       <button type="submit"><%= View.Sone.Button.UnfollowSone|l10n|html></button>
+                                               </form>
+                                       <%else>
+                                               <form class="follow" action="followSone.html" method="post">
+                                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                                       <input type="hidden" name="sone" value="<% sone.id>" />
+                                                       <button type="submit"><%= View.Sone.Button.FollowSone|l10n|html></button>
+                                               </form>
+                                       <%/if>
                                        <%if sone.isBlocked>
                                                <form class="unblock" action="unblockSone.html" method="post">
                                                        <input type="hidden" name="formPassword" value="<% formPassword|html>" />