Permalink
Browse files

Clean up some list-view stuff

  • Loading branch information...
1 parent f509621 commit 23ee5bd4086208af8282dc0f713a5bb4890c99cd @dave0 committed Feb 10, 2011
@@ -3,27 +3,5 @@
<form method="GET">
{html_options name="season" selected=$current_season->id options=$seasons onChange="form.submit()"}
</form>
- <table id="leagues">
- <thead>
- <tr>
- <th>Name</th>
- <th>&nbsp;</th>
- </tr>
- </thead>
- <tbody>
- {foreach from=$leagues item=l}
- <tr>
- <td><a href="{lr_url path="league/view/`$l->league_id`}">{$l->name}</a></td>
- <td>{if $l->schedule_type != 'none'}
- <a href="{lr_url path="schedule/view/`$l->league_id`}">schedule</a> &nbsp;
- <a href="{lr_url path="league/standings/`$l->league_id`}">standings</a> &nbsp;
- {/if}
- {if session_perm("league/delete/`$l->league_id`")}
- <a href="{lr_url path="league/delete/`$l->league_id`}">delete</a> &nbsp;
- {/if}
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
+ {include file="pages/season/components/league_list.tpl"}
{include file=footer.tpl}
@@ -0,0 +1,71 @@
+ <table id="leagues">
+ <thead>
+ <tr>
+ <th>League Name</th>
+ <th>Day</th>
+ <th>Ratio</th>
+ <th>Status</th>
+ <th>&nbsp;</th>
+ </tr>
+ </thead>
+ <tbody>
+ {foreach from=$leagues item=i}
+ <tr>
+ <td><a href="{lr_url path="league/view/`$i->league_id`}">{$i->fullname}</a></td>
+ <td>{$i->day}</td>
+ <td>{$i->ratio}</td>
+ <td>{$i->status}</td>
+ <td>{if $i->schedule_type != 'none'}
+ <a href="{lr_url path="schedule/view/`$i->league_id`}">schedule</a> &nbsp;
+ <a href="{lr_url path="league/standings/`$i->league_id`}">standings</a> &nbsp;
+ {/if}
+ {if session_perm("league/delete/`$i->league_id`")}
+ <a href="{lr_url path="league/delete/`$i->league_id`}">delete</a> &nbsp;
+ {/if}
+ </td>
+ </tr>
+ {/foreach}
+ </tbody>
+ </table>
+<script type="text/javascript">
+{literal}
+var daySort = {
+ 'Sunday' : 1,
+ 'Monday' : 2,
+ 'Tuesday' : 3,
+ 'Wednesday' : 4,
+ 'Thursday' : 5,
+ 'Friday' : 6,
+ 'Saturday' : 7,
+};
+jQuery.fn.dataTableExt.oSort['day-of-week-desc'] = function(a,b) {
+ var x = daySort[ a.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
+ var y = daySort[ b.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+};
+
+jQuery.fn.dataTableExt.oSort['day-of-week-asc'] = function(a,b) {
+ var x = daySort[ a.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
+ var y = daySort[ b.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+};
+$(document).ready(function() {
+ $('#leagues').dataTable( {
+ bPaginate: false,
+ bAutoWidth: false,
+ sDom: 'lfrtip',
+ bFilter: false,
+ bInfo: false,
+ bJQueryUI: true,
+ aaSorting: [[ 1, "asc" ]],
+ aoColumns: [
+ { "sType" : "html" },
+ { "sType" : "day-of-week" },
+ null,
+ null,
+ { bSortable : false }
+ ]
+ } );
+})
+{/literal}
+</script>
@@ -12,13 +12,6 @@
<tr>
<td><a href="{lr_url path="season/view/`$s->id`}">{$s->display_name}</a></td>
<td>
- {if session_perm("league/list")}
- <a href="{lr_url path="league/list?season=`$s->id`"}">list leagues</a> &nbsp;
- {/if}
- {if session_perm("season/delete/`$s->id`")}
- <a href="{lr_url path="season/delete/`$s->id`}">delete</a> &nbsp;
- {/if}
- </td>
</tr>
{/foreach}
</tbody>
@@ -6,65 +6,5 @@
<tr><td>Year:</td><td>{$season->year}</td></tr>
</table>
</div>
- <table id="leagues">
- <thead>
- <tr>
- <th>League Name</th>
- <th>Day</th>
- <th>Ratio</th>
- <th>Status</th>
- </tr>
- </thead>
- <tbody>
- {foreach from=$leagues item=i}
- <tr>
- <td><a href="{lr_url path="league/view/`$i->league_id`}">{$i->fullname}</a></td>
- <td>{$i->day}</td>
- <td>{$i->ratio}</td>
- <td>{$i->status}</td>
- </tr>
- {/foreach}
- </tbody>
- </table>
-<script type="text/javascript">
-{literal}
-var daySort = {
- 'Sunday' : 1,
- 'Monday' : 2,
- 'Tuesday' : 3,
- 'Wednesday' : 4,
- 'Thursday' : 5,
- 'Friday' : 6,
- 'Saturday' : 7,
-};
-jQuery.fn.dataTableExt.oSort['day-of-week-desc'] = function(a,b) {
- var x = daySort[ a.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
- var y = daySort[ b.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
-};
-
-jQuery.fn.dataTableExt.oSort['day-of-week-asc'] = function(a,b) {
- var x = daySort[ a.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
- var y = daySort[ b.replace(/^Sunday,/g,"").replace(/,Saturday$/,"")+'' ];
- return ((x < y) ? 1 : ((x > y) ? -1 : 0));
-};
-$(document).ready(function() {
- $('#leagues').dataTable( {
- bPaginate: false,
- bAutoWidth: false,
- sDom: 'lfrtip',
- bFilter: false,
- bInfo: false,
- bJQueryUI: true,
- aaSorting: [[ 1, "asc" ]],
- aoColumns: [
- { "sType" : "html" },
- { "sType" : "day-of-week" },
- null,
- null
- ]
- } );
-})
-{/literal}
-</script>
+ {include file="pages/season/components/league_list.tpl"}
{include file=footer.tpl}

0 comments on commit 23ee5bd

Please sign in to comment.