Use smarty template inheritance
authorJean-Michel Vourgère <jvourger@greenpeace.org>
Tue, 7 Mar 2017 17:38:19 +0000 (17:38 +0000)
committerJean-Michel Vourgère <jvourger@greenpeace.org>
Thu, 9 Mar 2017 18:06:30 +0000 (18:06 +0000)
Code factorisation

templates/admin.tpl
templates/index.tpl
templates/layout.tpl [new file with mode: 0644]
templates/login.tpl
templates/logs.tpl
templates/udmin.tpl
webroot/css/squasher.css

index 268e75d553a274388761d9c8604b1f9547a57444..1fac2b5f0338bff7e88f5205270707deaaf931a0 100644 (file)
@@ -1,46 +1,38 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel=stylesheet href="css/squasher.css">
-<title>Squasher</title>
-<style>
-{foreach item=style_row from=$style}
-{$style_row}
-{/foreach}
-</style>
-
-<div class="wrappercontainer">
-
-       <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div></div>
-
-       <div class="menucontainer">
-               <div class="menu">
-                       <div class="menuhead">users</div>
-                       {foreach item=user key=user_id from=$users}<a {if $user_id eq $edited_user}class="selected"{/if} href="?tools=access&amp;user={$user.id|escape:'url'}">{$user.name|escape}</a>{/foreach}
-               </div>
-       </div>
-
-<div class="content">
-{if $layout}
+{extends file='layout.tpl'}
 
-       <div class="legend">
-       <div class='sample_all'><!--input name='sample' value=2 type=radio /-->&nbsp; allow this and all underlying folders &nbsp;</div>
-       <div class='sample_allow'><!--input name='sample' value=1 type=radio /-->&nbsp; allow this folder &nbsp;</div>
-       <div class='sample_deny'><!--input name='sample' value=0 type=radio /-->&nbsp; deny access to this folder &nbsp;</div>
-       </div>
 
-       <form method='post'>
-       <input type='hidden' name='formtype' value='folderrights'>
-       <input type='hidden' name='edited_user' value='{$edited_user|escape}'>
-       {$layout}
+{block extra_head}
+       <style>
+       {foreach item=style_row from=$style}
+       {$style_row}
+       {/foreach}
+       </style>
+{/block}
 
-       <div style='float:left;'><input type='submit' value='Save'></div>
 
-       </form>
+{block menu}
+<div class="menu">
+       <div class="menuhead">users</div>
+       {foreach item=user key=user_id from=$users}<a {if $user_id eq $edited_user}class="selected"{/if} href="?tools=access&amp;user={$user.id|escape:'url'}">{$user.name|escape}</a>{/foreach}
+</div>
+{/block}
 
-{/if}  </div>
 
-       <div class="bottomimage"></div>
-       <div class="footer">&nbsp;</div>
+{block content}
+{if $layout}
+<div class="legend">
+       <div class='sample_all'>&nbsp; allow this and all underlying folders &nbsp;</div>
+       <div class='sample_allow'>&nbsp; allow this folder &nbsp;</div>
+       <div class='sample_deny'>&nbsp; deny access to this folder &nbsp;</div>
 </div>
-{if $debug}{debug}{/if}
+
+<form method='post'>
+       <input type='hidden' name='formtype' value='folderrights'>
+       <input type='hidden' name='edited_user' value='{$edited_user|escape}'>
+       {$layout}
+       <div style='float:left;'><input type='submit' value='Save'></div>
+</form>
+{/if}
+{/block}
+
 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
index ff8fac77bc8ccecd17c023e3c7658b6a9c60246d..3e3407897ff9ba30c93f00854b4540e9591d7805 100644 (file)
@@ -1,8 +1,8 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel=stylesheet href="css/squasher.css">
-<title>Squasher</title>
-<script type="text/javascript" language="JavaScript">
+{extends file='layout.tpl'}
+
+
+{block extra_head}
+<script>
        {literal}
        function toggle_id(hideshow){
                if(document.getElementById(hideshow).style.visibility == 'visible') {
        }
        {/literal}
 </script>
+{/block}
+
+
+{block menu}
+<div class="menu">
+       <div class="menuhead">current folder</div>
+       {foreach item=crumb key=cookie from=$base}<a href="?path={$cookie|escape:'url'}">{$crumb|escape}</a>{/foreach}
+       {if $user_level > 99 AND count($base)>1 }
+               <form name=rmdir method=post>
+               <input type=hidden name=tools value=rmdir>
+               <a href="javascript:deleteFolder{if count($squashed)>0 || count($subfolders)>0}NotEmpty{/if}('{$currentfolder|escape:'javascript'|escape}');" class=tool>delete this folder</a>
+               </form>
+       {/if}
+</div>
+<div class="menu">
+       <div class="menuhead">subfolders</div>
+       {foreach item=folder key=folderpath from=$subfolders}<a href="?path={$folderpath|escape:'url'}">{$folder|escape}</a>{/foreach}
+       {if $user_level > 99}
+               <form name=mkdir method=post>
+               <input type=hidden name=tools value=mkdir>
+               <input type=hidden name=newname>
+               <a href="javascript:createFolder();" class=tool>new subfolder</a>
+               </form>
+       {/if}
+</div>
+{/block}
 
-<div class="wrappercontainer">
-
-       <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div></div>
-
-       <div class="menucontainer">
-               <div class="menu">
-                       <div class="menuhead">current folder</div>
-                       {foreach item=crumb key=cookie from=$base}<a href="?path={$cookie|escape:'url'}">{$crumb|escape}</a>{/foreach}
-                       {if $user_level > 99 AND count($base)>1 }
-                               <form name=rmdir method=post>
-                               <input type=hidden name=tools value=rmdir>
-                               <a href="javascript:deleteFolder{if count($squashed)>0 || count($subfolders)>0}NotEmpty{/if}('{$currentfolder|escape:'javascript'|escape}');" class=tool>delete this folder</a>
-                               </form>
-                       {/if}
-               </div>
-               <div class="menu">
-                       <div class="menuhead">subfolders</div>
-                       {foreach item=folder key=folderpath from=$subfolders}<a href="?path={$folderpath|escape:'url'}">{$folder|escape}</a>{/foreach}
-                       {if $user_level > 99}
-                               <form name=mkdir method=post>
-                               <input type=hidden name=tools value=mkdir>
-                               <input type=hidden name=newname>
-                               <a href="javascript:createFolder();" class=tool>new subfolder</a>
-                               </form>
-                       {/if}
-               </div>
-       </div>
-       
-       <div class="content">
+{block content}
 {assign var=mass_delete_size value=count($squashed)}
 {foreach item=item key=id from=$squashed}
 {if $item.squashed}{*These items are in chunks / uploaded by the squasher tool*}
 
 {if $item.hidden eq false OR $user_level > 99 }
-               <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
+<div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
 
-                       <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 100}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
+       <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 100}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
 
-                       <div class="status">status: {$item.status|escape}</div>
+       <div class="status">status: {$item.status|escape}</div>
 
-                       <div class="clear"></div>
+       <div class="clear"></div>
 
-                       <div class="added">added: {$item.date|escape}</div>
-               
-                       <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"}&nbsp;/&nbsp;{$item.size|escape}b{/if}({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
+       <div class="added">added: {$item.date|escape}</div>
 
-                       <div class="clear"></div>
+       <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"}&nbsp;/&nbsp;{$item.size|escape}b{/if}({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
 
-                       <div class="updated">last updated: {$item.lastchange|escape}</div>
+       <div class="clear"></div>
+
+       <div class="updated">last updated: {$item.lastchange|escape}</div>
 
 
 {if $item.finished==true}
-                       <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
+       <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
 {/if}
 {if $item.embedable eq true and $item.finished eq false}
        {if $item.mime=='video/mpeg'}
-                       <div class="stream"><a href='?f={$id|escape:'url'}'>download ({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_partial format="%.0f"}%)</a></div>
+       <div class="stream"><a href='?f={$id|escape:'url'}'>download ({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_partial format="%.0f"}%)</a></div>
        {/if}
 {/if}
 
-                       <div class="clear"></div>
-               </div>
+       <div class="clear"></div>
+</div>
        
-               <div class="clear"></div>
+<div class="clear"></div>
 {/if}
 
 {else}{*These items are plain files / uploaded manually by the user via ftp*}
 
 {if $item.hidden eq false OR $user_level > 99 }
-               <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
+<div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
 
-                       <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
+       <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
 
-                       <div class="status">status: {$item.status|escape}</div>
+       <div class="status">status: {$item.status|escape}</div>
 
-                       <div class="clear"></div>
+       <div class="clear"></div>
 
-                       <div class="added">added: {$item.date|escape}</div>
+       <div class="added">added: {$item.date|escape}</div>
 
-                       <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size|escape}b{/if}</div>
+       <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size|escape}b{/if}</div>
 
-                       <div class="clear"></div>
+       <div class="clear"></div>
 
-                       <div class="updated">last updated: {$item.lastchange|escape}</div>
+       <div class="updated">last updated: {$item.lastchange|escape}</div>
 
 
 {if $item.finished==true}
-                       <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
+       <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
 {/if}
 {if $item.embedable eq true and $item.finished eq false}
        {if $item.mime=='video/mpeg'}
-                       <div class="stream"><a href='?f={$id|escape:'url'}'>download (partial)</a></div>
+       <div class="stream"><a href='?f={$id|escape:'url'}'>download (partial)</a></div>
        {/if}
 {/if}
 
-                       <div class="clear"></div>
-               </div>
+       <div class="clear"></div>
+</div>
        
-               <div class="clear"></div>
+<div class="clear"></div>
 {/if}
 {/if}
 {/foreach}
-       </div>
+{/block}
 
-       <div class="filler">
+
+{block filler}
+<div class="filler">
 {if $user_level > 100 and $mass_delete_size > 1}
-               <div class="massdelete"><br>
-                       <div class="deletebox" id="deletebox">
-                               <form name="deletetool" action="?tools=delete&amp;h=multiple" method="post" onSubmit='return confirm("Are you sure you want to delete the selected files? \nThis page may take a while to reload while the files are removed.");'>
-                                       <select multiple="" size="{$mass_delete_size|escape}" id="h" name="h[]" width="300px">
-                                               {foreach item=item key=id from=$squashed}
-                                               <option value="{$id|escape}" title="{$item.name|escape}">{$item.name|truncate:39|escape}</option>
-                                               {/foreach}
-                                       </select>
-                                       <input type="button" value="Select All" OnClick="selectAllList();" ><input type="reset" value="Clear"><input type="submit" value="Delete Selected Items">
-                               </form>
-                       </div>
+       <div class="massdelete"><br>
+               <div class="deletebox" id="deletebox">
+                       <form name="deletetool" action="?tools=delete&amp;h=multiple" method="post" onSubmit='return confirm("Are you sure you want to delete the selected files? \nThis page may take a while to reload while the files are removed.");'>
+                               <select multiple="" size="{$mass_delete_size|escape}" id="h" name="h[]" width="300px">
+                                       {foreach item=item key=id from=$squashed}
+                                       <option value="{$id|escape}" title="{$item.name|escape}">{$item.name|truncate:39|escape}</option>
+                                       {/foreach}
+                               </select>
+                               <input type="button" value="Select All" OnClick="selectAllList();" ><input type="reset" value="Clear"><input type="submit" value="Delete Selected Items">
+                       </form>
                </div>
-{/if}
        </div>
-
-       <div class="bottomimage"></div>
-       <div class="footer">&nbsp;</div>
+{/if}
 </div>
-{if $debug}{debug}{/if}
+{/block}
+
+
 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
diff --git a/templates/layout.tpl b/templates/layout.tpl
new file mode 100644 (file)
index 0000000..417be38
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel=stylesheet href="css/squasher.css">
+<title>Squasher</title>
+{block extra_head}{/block}
+<div class="wrappercontainer {block extra_wrappercontainer_class}{/block}">
+
+       <div class="banner">{block banner}&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div>{/block}</div>
+
+       <div class="menucontainer">
+       {block menu}
+       {/block}
+       </div>
+       
+       <div class="content {block extra_content_class}{/block}">
+       {block content}
+       {/block}
+       </div>
+
+       {block filler}{/block}
+
+       <div class="bottomimage"></div>
+       <div class="footer">&nbsp;</div>
+</div>
+{if $debug}{debug}{/if}
+{* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
index 559f27abe07d7a1e86267968e43de6c9a2b40ad7..61d949852a423c81be0f85c2f9d8dc0456339fab 100644 (file)
@@ -1,35 +1,38 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel=stylesheet href="css/squasher.css">
-<title>Squasher</title>
-<script type="text/javascript" src="js/md5.js"></script>
-<script language="javascript">
-function hasher(){ldelim}
-       var salt = '{$salt|escape:'quotes'}';
-       document.loginform.pass.value=hex_md5(hex_md5(document.loginform.pass.value)+salt);
-{rdelim}
+{extends file='layout.tpl'}
+
+
+{block extra_head}
+<script src="js/md5.js"></script>
+<script>
+       function hasher(){ldelim}
+               var salt = '{$salt|escape:'quotes'}';
+               document.loginform.pass.value=hex_md5(hex_md5(document.loginform.pass.value)+salt);
+       {rdelim}
 </script>
+{/block}
+
+
+{block extra_wrappercontainer_class}loginwrappercontainer{/block}
+{block extra_content_class}login{/block}
+
 
-<div class="wrappercontainer" style="text-align:center;">
+{* We hide the top-right control menu *}
+{block banner}&nbsp;{/block}
 
-       <div class="banner">&nbsp;</div>
 
-       <div class="content login">
-       <form name="loginform" onSubmit="hasher();" method="post">
-               <table align=center>
-               <tr>
-                       <td>Username :
-                       <td><input name="user" type=text value="">
-               <tr>
-                       <td>Password :
-                       <td><input name="pass" type=password value="">
-               </table>
-               <button class="submit" type=submit>Sign in</button>
-       </form>
-       </div>
+{block content}
+<form name="loginform" onSubmit="hasher();" method="post">
+       <table align=center>
+       <tr>
+               <td>Username :
+               <td><input name="user" type=text value="">
+       <tr>
+               <td>Password :
+               <td><input name="pass" type=password value="">
+       </table>
+       <button class="submit" type=submit>Sign in</button>
+</form>
+{/block}
 
-       <div class="footer">&nbsp;</div>
 
-</div>
-{if $debug}{debug}{/if}
 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
index 67433eabc5351693955d5f76de478277387fe342..cf74d476962d1eb802eeeab4ae9f6392d83aa7ee 100644 (file)
@@ -1,97 +1,88 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel=stylesheet href="css/squasher.css">
-<title>Squasher</title>
+{extends file='layout.tpl'}
 
-<div class="wrappercontainer">
 
-       <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div></div>
+{block menu}
+<div class="menu">
+       <div class="menuhead">logs</div>
+       <a {if $logtype eq "all"     }class="selected"{/if} href="?tools=logs&amp;logtype=all"     >all</a>
+       <a {if $logtype eq "delete"  }class="selected"{/if} href="?tools=logs&amp;logtype=delete"  >delete</a>
+       <a {if $logtype eq "download"}class="selected"{/if} href="?tools=logs&amp;logtype=download">download</a>
+       <a {if $logtype eq "login"   }class="selected"{/if} href="?tools=logs&amp;logtype=login"   >login</a>
+       <a {if $logtype eq "debug"   }class="selected"{/if} href="?tools=logs&amp;logtype=debug"   >squasher</a>
+</div>
+{/block}
 
-       <div class="menucontainer">
-               <div class="menu">
-                       <div class="menuhead">logs</div>
-                       <a {if $logtype eq "all"     }class="selected"{/if} href="?tools=logs&amp;logtype=all"     >all</a>
-                       <a {if $logtype eq "delete"  }class="selected"{/if} href="?tools=logs&amp;logtype=delete"  >delete</a>
-                       <a {if $logtype eq "download"}class="selected"{/if} href="?tools=logs&amp;logtype=download">download</a>
-                       <a {if $logtype eq "login"   }class="selected"{/if} href="?tools=logs&amp;logtype=login"   >login</a>
-                       <a {if $logtype eq "debug"   }class="selected"{/if} href="?tools=logs&amp;logtype=debug"   >squasher</a>
-               </div>
-       </div>
+{block content}
+<table class="log">
 
-<div class="content">
-  <table class="log">
+       <tr class="logentry_header">
+               <td width='*' colspan="5">Today
 
-   <tr class="logentry_header">
-    <td width='*' colspan="5">Today
+       {foreach item=entry from=$logs.today key=id}
+       <tr class="logentry_{$entry.action|escape}" align="left">
+               <td width='160px'>&nbsp;{$entry.date|escape}
+               <td width='40px' >&nbsp;{$entry.user_name|escape}
+               <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
+               <td width='80px' >&nbsp;{$entry.action|escape}
+               <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
+       {foreachelse}
+       <tr class="logentry_empty">
+               <td width='*' colspan="3"><hr>
+               <td width='120px'>Log is empty
+               <td width='*'><hr>
+       {/foreach}
 
-{foreach item=entry from=$logs.today key=id}
-   <tr class="logentry_{$entry.action|escape}" align="left">
-    <td width='160px'>&nbsp;{$entry.date|escape}
-    <td width='40px' >&nbsp;{$entry.user_name|escape}
-    <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
-    <td width='80px' >&nbsp;{$entry.action|escape}
-    <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
-{foreachelse}
-   <tr class="logentry_empty">
-    <td width='*' colspan="3"><hr>
-    <td width='120px'>Log is empty
-    <td width='*'><hr>
-{/foreach}
+       <tr class="logentry_header">
+               <td width='*' colspan="5">Yesterday
 
-   <tr class="logentry_header">
-    <td width='*' colspan="5">Yesterday
+       {foreach item=entry from=$logs.yesterday key=id}   <tr class="logentry_{$entry.action|escape}" align="left">
+               <td width='160px'>&nbsp;{$entry.date|escape}
+               <td width='40px' >&nbsp;{$entry.user_name|escape}
+               <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
+               <td width='80px'>&nbsp;{$entry.action|escape}
+               <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
+       {foreachelse}
+       <tr class="logentry_empty">
+               <td width='*' colspan="3"><hr>
+               <td width='120px'>Log is empty
+               <td width='*'><hr>
+       {/foreach}
 
-{foreach item=entry from=$logs.yesterday key=id}   <tr class="logentry_{$entry.action|escape}" align="left">
-    <td width='160px'>&nbsp;{$entry.date|escape}
-    <td width='40px' >&nbsp;{$entry.user_name|escape}
-    <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
-    <td width='80px'>&nbsp;{$entry.action|escape}
-    <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
-{foreachelse}
-   <tr class="logentry_empty">
-    <td width='*' colspan="3"><hr>
-    <td width='120px'>Log is empty
-    <td width='*'><hr>
-{/foreach}
+       <tr class="logentry_header">
+               <td width='*' colspan="5">Last week
 
-   <tr class="logentry_header">
-    <td width='*' colspan="5">Last week
+       {foreach item=entry from=$logs.lastweek key=id}
+       <tr class="logentry_{$entry.action|escape}" align="left">
+               <td width='160px'>&nbsp;{$entry.date|escape}
+               <td width='40px' >&nbsp;{$entry.user_name|escape}
+               <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
+               <td width='80px'>&nbsp;{$entry.action|escape}
+               <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
+       {foreachelse}
+       <tr class="logentry_empty">
+               <td width='*' colspan="3"><hr>
+               <td width='120px'>Log is empty
+               <td width='*'><hr>
+       {/foreach}
 
-{foreach item=entry from=$logs.lastweek key=id}
-   <tr class="logentry_{$entry.action|escape}" align="left">
-    <td width='160px'>&nbsp;{$entry.date|escape}
-    <td width='40px' >&nbsp;{$entry.user_name|escape}
-    <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
-    <td width='80px'>&nbsp;{$entry.action|escape}
-    <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
-{foreachelse}
-   <tr class="logentry_empty">
-    <td width='*' colspan="3"><hr>
-    <td width='120px'>Log is empty
-    <td width='*'><hr>
-{/foreach}
+       <tr class="logentry_header">
+               <td width='*' colspan="5">Older
 
-   <tr class="logentry_header">
-    <td width='*' colspan="5">Older
+       {foreach item=entry from=$logs.older key=id}
+       <tr class="logentry_{$entry.action|escape}" align="left">
+               <td width='160px'>&nbsp;{$entry.date|escape}
+               <td width='40px' >&nbsp;{$entry.user_name|escape}
+               <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
+               <td width='80px'>&nbsp;{$entry.action|escape}
+               <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
+       {foreachelse}
+       <tr class="logentry_empty">
+               <td width='*' colspan="3"><hr>
+               <td width='120px'>Log is empty
+               <td width='*'><hr>
+       {/foreach}
 
-{foreach item=entry from=$logs.older key=id}
-   <tr class="logentry_{$entry.action|escape}" align="left">
-    <td width='160px'>&nbsp;{$entry.date|escape}
-    <td width='40px' >&nbsp;{$entry.user_name|escape}
-    <td width='120px' title="{$entry.users_from_ip|escape}">&nbsp;{$entry.ip|escape}
-    <td width='80px'>&nbsp;{$entry.action|escape}
-    <td width='*' title="{$entry.file|substr:10|escape}{if $entry.ip eq 'retry'}\n : This file did not pass validation. A request was mailed to the RO to restart the upload.{/if}{if $entry.ip eq 'cleanup'}\n : This file entry was missing all chunks. This entry was removed.{/if}">&nbsp;{$entry.file|substr:10:64|escape}
-{foreachelse}
-   <tr class="logentry_empty">
-    <td width='*' colspan="3"><hr>
-    <td width='120px'>Log is empty
-    <td width='*'><hr>
-{/foreach}
-  </table>
-</div>
+</table>
+{/block}
 
-       <div class="bottomimage"></div>
-       <div class="footer">&nbsp;</div>
-</div>
-{if $debug}{debug}{/if}
 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
index 2a20a9a074e92f68933a88882e4f85c5f3043ed7..639ecbf483079840409bd8290cb3d9473a53e1e0 100644 (file)
@@ -1,7 +1,7 @@
-<html>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel=stylesheet href="css/squasher.css">
-<title>Squasher</title>
+{extends file='layout.tpl'}
+
+
+{block extra_head}
 <script>
    {literal}
    function confirm_delete(formID) {
    }
    {/literal}
 </script>
+{/block}
 
-<div class="wrappercontainer">
-
-       <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div></div>
-
-       <div class="content">
 
+{block content}
 {foreach item=user key=user_id from=$users}
 <div class="white_border">
        <form method='post' name='user_{$user.id|escape}' id='user_{$user.id|escape}'>
                | <a onClick="document.user_new.type.value='new';document.user_new.submit();" style="cursor:pointer" >add</a>
        </form>
 </div>
+{/block}
 
-       </div>
-
-       <div class="bottomimage"></div>
-       <div class="footer">&nbsp;</div>
 
-</div>
-{if $debug}{debug}{/if}
 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}
index 52a7ebec6f56b57c2987a55ab14d58478849a642..f993ea713058bf4db9fd9199963207245fe86c75 100644 (file)
@@ -285,6 +285,10 @@ tr.logentry_download:hover, tr.logentry_delete:hover, tr.logentry_login:hover {
 
 /* login page */
 
+.loginwrappercontainer {
+       text-align:center;
+}
+
 .login {
        width:480px;
        float:none;