Create Sone view.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 20:31:50 +0000 (22:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Oct 2010 20:31:50 +0000 (22:31 +0200)
src/main/resources/static/css/sone.css
src/main/resources/templates/include/viewSone.html [new file with mode: 0644]
src/main/resources/templates/knownSones.html
src/main/resources/templates/viewSone.html

index 0014dd9..0ae0e32 100644 (file)
        display: none;
 }
 
        display: none;
 }
 
-#sone #known-sones .profile-link {
+#sone .sone .profile-link {
        display: inline;
 }
 
        display: inline;
 }
 
-#sone #known-sones .request-uri {
+#sone .sone .request-uri {
        display: inline;
 }
 
        display: inline;
 }
 
-#sone #known-sones .last-update {
+#sone .sone .last-update {
        display: inline;
 }
 
        display: inline;
 }
 
-#sone #known-sones form.block button, #sone #known-sones form.unblock button, #sone #known-sones form.follow button, #sone #known-sones form.unfollow button {
+#sone .sone form.block button, #sone .sone form.unblock button, #sone .sone form.follow button, #sone .sone form.unfollow button {
        display: inline;
        color: rgb(28, 131, 191);
        background: none;
        display: inline;
        color: rgb(28, 131, 191);
        background: none;
        padding: 0px;
 }
 
        padding: 0px;
 }
 
-#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 {
+#sone .sone form.block button:hover, #sone .sone form.unblock button:hover, #sone .sone form.follow button:hover, #sone .sone form.unfollow button:hover {
        display: inline;
        color: rgb(255, 172, 0);
 }
 
        display: inline;
        color: rgb(255, 172, 0);
 }
 
-#sone #known-sones form {
+#sone .sone form {
        display: inline;
 }
 
        display: inline;
 }
 
diff --git a/src/main/resources/templates/include/viewSone.html b/src/main/resources/templates/include/viewSone.html
new file mode 100644 (file)
index 0000000..cecbb33
--- /dev/null
@@ -0,0 +1,34 @@
+<div class="sone">
+       <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.isCurrent>
+                       <%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>" />
+                                       <input type="hidden" name="sone" value="<% sone.id>" />
+                                       <button type="submit"><%= View.Sone.Button.UnblockSone|l10n|html></button>
+                               </form>
+                       <%else>
+                               <form class="block" action="blockSone.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.BlockSone|l10n|html></button>
+                               </form>
+                       <%/if>
+               <%/if>
+       <%/if>
+</div>
index 3f22405..4364cb1 100644 (file)
@@ -4,40 +4,7 @@
 
        <div id="known-sones">
                <%foreach knownSones sone>
 
        <div id="known-sones">
                <%foreach knownSones sone>
-                       <div>
-                               <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.isCurrent>
-                                               <%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>" />
-                                                               <input type="hidden" name="sone" value="<% sone.id>" />
-                                                               <button type="submit"><%= View.Sone.Button.UnblockSone|l10n|html></button>
-                                                       </form>
-                                               <%else>
-                                                       <form class="block" action="blockSone.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.BlockSone|l10n|html></button>
-                                                       </form>
-                                               <%/if>
-                                       <%/if>
-                               <%/if>
-                       </div>
+                       <%include include/viewSone.html>
                <%foreachelse>
                        <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
                <%/foreach>
                <%foreachelse>
                        <div><%= Page.KnownSones.Text.NoKnownSones|l10n|html></div>
                <%/foreach>
index dea7f53..7b0647f 100644 (file)
                <h1><%= Page.ViewSone.Following.Title|l10n|html></h1>
 
                <div id="following">
                <h1><%= Page.ViewSone.Following.Title|l10n|html></h1>
 
                <div id="following">
-                       <%foreach sone.friends friend>
-                               <%first>
-                                       <ul>
-                               <%/first>
-                                       <li><a href="viewSone.html?sone=<% friend.id>"><% friend.niceName|html></a> (<% friend.requestUri|html>)</li>
-                               <%last>
-                                       </ul>
-                               <%/last>
-                       <%foreachelse>
-                               <div><%= Page.ViewSone.Following.FollowingNone.Text|l10n|html></div>
+                       <%foreach sone.friends sone>
+                               <%include include/viewSone.html>
                        <%/foreach>
                </div>
 
                        <%/foreach>
                </div>