chiark / gitweb /
More web support for user rights:
authorrjk@greenend.org.uk <>
Sun, 23 Dec 2007 18:44:37 +0000 (18:44 +0000)
committerrjk@greenend.org.uk <>
Sun, 23 Dec 2007 18:44:37 +0000 (18:44 +0000)
 - choose/search greyed out if don't have RIGHT_PLAY
 - edit link in new/recent omitted if don't have RIGHT_PREFS
 - move buttons in manage greyed out if not movable

templates/disorder.css
templates/login.html
templates/new.html
templates/playing.html
templates/recent.html
templates/topbar.html

index dd1364c..809947c 100644 (file)
@@ -382,6 +382,14 @@ a.activemenu:active,a.inactivemenu:active {
   color: red
 }
 
+span.invalidmenu {
+  text-decoration: none;
+  color: grey;
+  font-family: sans-serif;
+  font-weight: bold;
+  font-size: 14pt
+}
+
 /* prefs **********************************************************************/
 
 p.prefs_new,p.prefs_head {
index 31dc6e8..9119a5f 100644 (file)
@@ -95,7 +95,7 @@ USA
        </tr>
        <tr>
          <td>@label:login.password@</td>
-         <td><input class=password name=password type=password value=""
+         <td><input class=password name=changepassword type=password value=""
                     size=32></td>
          <td>
            <button class=register name=action type=submit value=register>
index abf97a6..dbac790 100644 (file)
@@ -35,7 +35,8 @@ USA
      <th class=album>@label:heading.album@</th>
      <th class=title>@label:heading.title@</th>
      <th class=length>@label:heading.length@</th>
-      <th class=button>&nbsp;</th>
+@right{prefs}{
+     <th class=button>&nbsp;</th>}@
     </tr>
     @new{
     <tr class=@parity@>
@@ -52,12 +53,13 @@ USA
        class=file
        href="@url@?action=play&#38;file=@urlquote{@file@}@&#38;back=@urlquote{@thisurl@}@&#38;nonce=@nonce@">@part{short}{title}@</a></td>
      <td class=length>@length@</td>
+@right{prefs}{
      <td class=imgbutton><a class=imgbutton
       href="@url@?action=prefs&#38;nonce=@nonce@&#38;0_file=@urlquote{@file@}@"><img
        class=button src="@label:images.edit@"
        title="@label:choose.prefsverbose@"
        alt="@label:choose.prefs@"></a></td>
-    </tr>
+    </tr>}@
     }@
   </table>
 }@
index 31eadfd..43811ae 100644 (file)
@@ -190,17 +190,22 @@ USA
        class=button src="@label:images.noscratch@"
        title="@label:playing.removeverbose@"
        alt="@label:playing.remove@">}@</td>
+
       @if{@arg:mgmt@}{
-      @if{@isfirst@}
-    {<td class=imgbutton>
+      @if{@or{@isfirst@}
+             {@not{@movable@}@}@}{
+     <!-- cannot move up -->
+     <td class=imgbutton>
       <img
        class=button src="@label:images.noupall@"
        title="@label:playing.upallverbose@" alt="">
      <td class=imgbutton>
       <img
        class=button src="@label:images.noup@"
-       title="@label:playing.upverbose@" alt="">}
-    {<td class=imgbutton>
+       title="@label:playing.upverbose@" alt="">
+         }{
+     <!-- can move up -->
+     <td class=imgbutton>
       <a class=imgbutton
         href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=2147483647&#38;mgmt=true"><img
        class=button src="@label:images.upall@"
@@ -210,26 +215,35 @@ USA
      <a class=imgbutton
         href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=1&#38;mgmt=true"><img
        class=button src="@label:images.up@"
-       title="@label:playing.upverbose@" alt="@label:playing.up@"></a>}@
-      @if{@islast@}
-    {<td class=imgbutton>
+       title="@label:playing.upverbose@" alt="@label:playing.up@"></a>
+         }@
+
+      @if{@or{@islast@}
+             {@not{@movable@}@}@}{
+     <!-- cannot move down -->
+     <td class=imgbutton>
+      <img
+       class=button src="@label:images.nodownall@"
+       title="@label:playing.downallverbose@" alt="">
+     <td class=imgbutton>
       <img
        class=button src="@label:images.nodown@"
        title="@label:playing.downverbose@" alt="">
+         }{
+     <!-- can move down -->
      <td class=imgbutton>
-     <img
-       class=button src="@label:images.nodownall@"
-       title="@label:playing.downallverbose@" alt="">}
-    {<td class=imgbutton>
-      <a class=imgbutton href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=-1&#38;mgmt=true"><img
-       class=button src="@label:images.down@"
-       title="@label:playing.downverbose@"
-       alt="@label:playing.down@">
-     <td class=imgbutton>
-     <a class=imgbutton href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=-2147483647&#38;mgmt=true"><img
+      <a class=imgbutton
+        href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=-2147483647&#38;mgmt=true"><img
        class=button src="@label:images.downall@"
        title="@label:playing.downallverbose@"
-       alt="@label:playing.downall@">}@</a>
+       alt="@label:playing.downall@"></a>
+     <td class=imgbutton>
+     <a class=imgbutton
+        href="@url@?action=move&#38;nonce=@nonce@&#38;id=@id@&#38;delta=-1&#38;mgmt=true"><img
+       class=button src="@label:images.down@"
+       title="@label:playing.downverbose@" alt="@label:playing.down@"></a>
+         }@
+
       }@
      </tr>
      }@}@
index 3d0650e..71e359a 100644 (file)
@@ -37,7 +37,8 @@ USA
      <th class=album>@label:heading.album@</th>
      <th class=title>@label:heading.title@</th>
      <th class=length>@label:heading.length@</th>
-      <th class=button>&nbsp;</th>
+@right{prefs}{
+     <th class=button>&nbsp;</th>}@
     </tr>
     @recent{
     <tr class=@parity@>
@@ -54,12 +55,13 @@ USA
      <td class=title><span
        title="@part{title}@">@part{short}{title}@</span></td>
      <td class=length>@length@</td>
+@right{prefs}{
      <td class=imgbutton><a class=imgbutton
       href="@url@?action=prefs&#38;nonce=@nonce@&#38;0_file=@urlquote{@file@}@"><img
        class=button src="@label:images.edit@"
        title="@label:choose.prefsverbose@"
        alt="@label:choose.prefs@"></a></td>
-    </tr>
+    </tr>}@
     }@
   </table>
 }@
index 3776234..4935829 100644 (file)
@@ -8,15 +8,21 @@
   <a class=@if{@eq{@action@}{new}@}{activemenu}{inactivemenu}@
  href="@url@?action=new&amp;nonce=@nonce@"
  title="@label:sidebar.newverbose@">@label:sidebar.new@</a>
+@right{play}{
   <a class=@if{@or{@eq{@action@}{choose}@}
                   {@eq{@action@}{choosealpha}@}@}
               {activemenu}
               {inactivemenu}@
  href="@url@?action=@label:sidebar.choosewhich@&amp;nonce=@nonce@"
- title="@label:sidebar.chooseverbose@">@label:sidebar.choose@</a>
+ title="@label:sidebar.chooseverbose@">@label:sidebar.choose@</a>}{
+  <span class=invalidmenu
+   title="@label:sidebar.chooseverbose@">@label:sidebar.choose@</span>}@
+@right{play}{
   <a class=@if{@eq{@action@}{search}@}{activemenu}{inactivemenu}@
  href="@url@?action=search&amp;nonce=@nonce@"
- title="@label:sidebar.searchverbose@">@label:sidebar.search@</a>
+ title="@label:sidebar.searchverbose@">@label:sidebar.search@</a>}{
+  <span class=invalidmenu
+   title="@label:sidebar.searchverbose@">@label:sidebar.search@</span>}@
 <!-- disabled by default since now available from 'manage'
   <a class=@if{@eq{@action@}{volume}@}{activemenu}{inactivemenu}@
  href="@url@?action=volume&amp;nonce=@nonce@"