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 dd1364cd6db4477962b8a79ac36170a8a647229f..809947c93161b70a8fd998e7637e5003fe72ddfb 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 31dc6e8bb6f155145dc9080f03d4650e1e1721ab..9119a5f8a316c327a6dc0c0b75b4b2b090c4871d 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 abf97a6920f742f17615e2748ad596b0ddb9581e..dbac7902ed21ecc4ebdf61ead883e0bba22125ab 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 31eadfd6a743d3606b09bd0006a27bc40c5334a7..43811aeba01dcedc62d8f69c93d73107a6047742 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 3d0650e6ea6817380328ae5e75901eae2bce15ab..71e359adc252d4736a765f3cbd5c1c3da1035303 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 3776234ff024c3413da45f20bcbd8647b91cabdc..4935829377b4d0b0351e9284806fb015dfbd605f 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@"