root/branches/release-35/tmpl/cms/list_template.tmpl @ 1898

Revision 1898, 5.5 kB (checked in by bsmith, 20 months ago)

bugzid:74897 - Template listing Quickfilters now js-based

  • Property svn:keywords set to Author Date Id Revision
Line 
1<mt:if name="blog_id"><mt:setvarblock name="page_title"><__trans phrase="Blog Templates"></mt:setvarblock><mt:else><mt:setvarblock name="page_title"><__trans phrase="Global Templates"></mt:setvarblock></mt:if>
2<mt:setvarblock name="related_content">
3    <mtapp:widget
4        id="quickfilters"
5        label="<__trans phrase="Quickfilters">">
6        <ul>
7            <li id="all-tab"><a href="#all" onclick="showTable('all-listing');">Show All</a></li>
8            <li id="index-tab"><a href="#index" onclick="showTable('index-listing');">Index Templates</a></li>
9            <li id="system-tab"><a href="#system"  onclick="showTable('system-listing');">System Templates</a></li>
10            <li id="archive-tab"><a href="#archive" onclick="showTable('archive-listing');">Archive Templates</a></li>
11            <li id="module-tab"><a href="#module"  onclick="showTable('module-listing');">Template Modules</a></li>
12        </ul>
13    </mtapp:widget>
14    <mtapp:widget
15        id="useful-links"
16        label="<__trans phrase="Useful links">">
17        <ul>
18            <li><a href="<mt:var name="script_url">?__mode=list&amp;_type=template&amp;filter_key=backup_templates&amp;blog_id=<mt:var name="blog_id">" class="icon-left icon-related"><__trans phrase="Template Backups"></a></li>
19        <mt:if name="can_edit_config">
20            <li><a href="<mt:var name="script_url">?__mode=cfg_archives&amp;blog_id=<mt:var name="blog_id">" class="icon-left icon-related"><__trans phrase="Blog Publishing Settings"></a></li>
21        </mt:if>
22        </ul>
23    </mtapp:widget>
24    <$MTApp:PageActions from="list_template"$>
25</mt:setvarblock>
26<mt:setvarblock name="html_head" append="1">
27<script type="text/javascript">
28/* <![CDATA[ */
29var tableList = ["index", "archive", "module", "system"];
30var tableSelect = [];
31function showTable(name) {
32    for (var i=0, len=tableList.length; i<len; i++) {
33        var el = tableList[i] + "-listing"
34        var elTab = tableList[i] + "-tab"
35        if (name == "all-listing") {
36            DOM.removeClassName ( el, "hidden");
37            DOM.removeClassName ( elTab, "current-filter");
38            DOM.addClassName( "all-tab", "current-filter" );
39        }
40        else if (name == el) {
41            DOM.removeClassName ( el, "hidden");
42            DOM.addClassName( elTab, "current-filter" );
43            DOM.removeClassName( "all-tab", "current-filter" );
44        }
45        else {
46            DOM.addClassName( el, "hidden" );
47            DOM.removeClassName( elTab, "current-filter" );
48            DOM.removeClassName( "all-tab", "current-filter" );
49        }
50    }
51}
52function init() {
53<mt:loop name="template_type_loop">
54    tableSelect.push(new TC.TableSelect( '<mt:var name="template_type">-listing-table' ));
55    tableSelect[tableSelect.length-1].rowSelect = true;
56</mt:loop>
57    var name = (window.location.hash && window.location.hash.match( /^#/ ) ) ? window.location.hash.substr(1) : "all";
58    showTable(name + "-listing");
59}
60TC.attachLoadEvent(init);
61/* ]]> */
62</script>
63</mt:setvarblock>
64<mt:setvarblock name="list_filter_form">
65<form id="filter-form" method="get" action="<mt:var name="mt_url">">
66    <input type="hidden" name="__mode" value="<mt:var name="mode">" />
67    <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
68    <input id="filter" type="hidden" name="filter" value="" />
69    <input id="filter_val" type="hidden" name="filter_val" value="" />
70</form>
71    <div class="listing-filter">
72        <div class="listing-filter-inner inner pkg">
73<form id="filter-select-form" method="get" onsubmit="return execFilter(this)">
74    <div class="filter">
75        <div id="filter-title">
76        <mt:if name="filter_key">
77            <strong><__trans phrase="Showing only: [_1]" params="<mt:var name="filter_label">"></strong>
78            <a class="filter-link" href="<mt:var name="script_url">?__mode=list&amp;_type=template<mt:if name="blog_id">&amp;blog_id=<mt:var name="blog_id"></mt:if>">[ <__trans phrase="Remove filter"> ]</a>
79        <mt:else>
80            <strong><__trans phrase="All Templates"></strong>
81        </mt:if>
82        </div>
83    </div>
84</form>
85    </div>
86</div>
87</mt:setvarblock>
88<mt:setvarblock name="system_msg">
89    <mt:if name="saved_deleted">
90        <mtapp:statusmsg
91            id="saved-deleted"
92            class="success">
93            <__trans phrase="You have successfully deleted the checked template(s).">
94        </mtapp:statusmsg>
95    </mt:if>
96    <mt:if name="refreshed">
97        <mtapp:statusmsg
98            id="refreshed"
99            class="success">
100            <__trans phrase="You have successfully refreshed your templates.">
101        </mtapp:statusmsg>
102    </mt:if>
103    <mt:if name="saved">
104        <mtapp:statusmsg
105            id="saved-settings"
106            class="success">
107            <__trans phrase="Your settings have been saved.">
108        </mtapp:statusmsg>
109    </mt:if>
110    <mt:if name="published">
111        <mtapp:statusmsg
112            id="published"
113            class="success">
114            <__trans phrase="Your templates have been published.">
115        </mtapp:statusmsg>
116    </mt:if>
117    <mt:if name="saved_copied">
118        <mtapp:statusmsg
119            id="saved-copied"
120            class="success">
121            <__trans phrase="Selected template(s) has been copied.">
122        </mtapp:statusmsg>
123    </mt:if>
124</mt:setvarblock>
125
126<mt:include name="include/header.tmpl">
127
128<mt:loop name="template_type_loop">
129<mt:if name="__first__">
130<$mt:var name="list_filter_form"$>
131</mt:if>
132<$mt:include name="include/template_table.tmpl"$>
133</mt:loop>
134
135<mt:include name="include/footer.tmpl">
Note: See TracBrowser for help on using the browser.