##// END OF EJS Templates
gists: fixed some small formatting of html
marcink -
r3763:e3c54f1d new-ui
parent child Browse files
Show More
@@ -1,147 +1,145 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 %if c.show_private:
6 ${_('Private Gists for user %s') % c.rhodecode_user.username}
6 ${_('Private Gists for user {}').format(c.rhodecode_user.username)}
7 7 %elif c.show_public:
8 ${_('Public Gists for user %s') % c.rhodecode_user.username}
8 ${_('Public Gists for user {}').format(c.rhodecode_user.username)}
9 9 %else:
10 10 ${_('Public Gists')}
11 11 %endif
12 12 %if c.rhodecode_name:
13 13 &middot; ${h.branding(c.rhodecode_name)}
14 14 %endif
15 15 </%def>
16 16
17 17 <%def name="breadcrumbs_links()"></%def>
18 18
19 19 <%def name="menu_bar_nav()">
20 20 ${self.menu_items(active='gists')}
21 21 </%def>
22 22
23
24
25 23 <%def name="main()">
26 24
27 25 <div class="box">
28 <div class="title">
26 <div class="title">
29 27
30 28 <ul class="button-links">
31 29 % if c.is_super_admin:
32 <li class="btn ${'active' if c.active=='all' else ''}"><a href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
30 <li class="btn ${('active' if c.active=='all' else '')}"><a href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
33 31 %endif
34 <li class="btn ${'active' if c.active=='public' else ''}"><a href="${h.route_path('gists_show')}">${_('All public')}</a></li>
32 <li class="btn ${('active' if c.active=='public' else '')}"><a href="${h.route_path('gists_show')}">${_('All public')}</a></li>
35 33 %if c.rhodecode_user.username != h.DEFAULT_USER:
36 <li class="btn ${'active' if c.active=='my_all' else ''}"><a href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
37 <li class="btn ${'active' if c.active=='my_private' else ''}"><a href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
38 <li class="btn ${'active' if c.active=='my_public' else ''}"><a href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
34 <li class="btn ${('active' if c.active=='my_all' else '')}"><a href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
35 <li class="btn ${('active' if c.active=='my_private' else '')}"><a href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
36 <li class="btn ${('active' if c.active=='my_public' else '')}"><a href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
39 37 %endif
40 38 </ul>
41 39
42 40 % if c.rhodecode_user.username != h.DEFAULT_USER:
43 41 <div class="pull-right">
44 42 <a class="btn btn-primary" href="${h.route_path('gists_new')}" >
45 43 ${_(u'Create New Gist')}
46 44 </a>
47 45 </div>
48 46 % endif
49 47
50 48 <div class="grid-quick-filter">
51 49 <ul class="grid-filter-box">
52 50 <li class="grid-filter-box-icon">
53 51 <i class="icon-search"></i>
54 52 </li>
55 53 <li class="grid-filter-box-input">
56 54 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/>
57 55 </li>
58 56 </ul>
59 57 </div>
60 58
61 59 </div>
62 60
63 61 <div class="main-content-full-width">
64 62 <div id="repos_list_wrap">
65 63 <table id="gist_list_table" class="display"></table>
66 64 </div>
67 65 </div>
68 66
69 67 </div>
70 68
71 69 <script type="text/javascript">
72 70 $(document).ready(function() {
73 71
74 72 var get_datatable_count = function(){
75 73 var api = $('#gist_list_table').dataTable().api();
76 74 $('#gists_count').text(api.page.info().recordsDisplay);
77 75 };
78 76
79 77
80 78 // custom filter that filters by access_id, description or author
81 79 $.fn.dataTable.ext.search.push(
82 80 function( settings, data, dataIndex ) {
83 81 var query = $('#q_filter').val();
84 82 var author = data[0].strip();
85 83 var access_id = data[2].strip();
86 84 var description = data[3].strip();
87 85
88 86 var query_str = (access_id + " " + author + " " + description).toLowerCase();
89 87
90 88 if(query_str.indexOf(query.toLowerCase()) !== -1){
91 89 return true;
92 90 }
93 91 return false;
94 92 }
95 93 );
96 94
97 95 // gists list
98 96 $('#gist_list_table').DataTable({
99 97 data: ${c.data|n},
100 98 dom: 'rtp',
101 99 pageLength: ${c.visual.dashboard_items},
102 100 order: [[ 4, "desc" ]],
103 101 columns: [
104 102 { data: {"_": "author",
105 103 "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" },
106 104 { data: {"_": "type",
107 105 "sort": "type"}, title: "${_("Type")}", width: "70px", className: "td-tags" },
108 106 { data: {"_": "access_id",
109 107 "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" },
110 108 { data: {"_": "description",
111 109 "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" },
112 110 { data: {"_": "created_on",
113 111 "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" },
114 112 { data: {"_": "expires",
115 113 "sort": "expires"}, title: "${_("Expires")}", className: "td-exp" }
116 114 ],
117 115 language: {
118 116 paginate: DEFAULT_GRID_PAGINATION,
119 117 emptyTable: _gettext("No gists available yet.")
120 118 },
121 119 "initComplete": function( settings, json ) {
122 120 timeagoActivate();
123 121 get_datatable_count();
124 122 }
125 123 });
126 124
127 125 // update the counter when things change
128 126 $('#gist_list_table').on('draw.dt', function() {
129 127 timeagoActivate();
130 128 get_datatable_count();
131 129 });
132 130
133 131 // filter, filter both grids
134 132 $('#q_filter').on( 'keyup', function () {
135 133 var repo_api = $('#gist_list_table').dataTable().api();
136 134 repo_api
137 135 .draw();
138 136 });
139 137
140 138 // refilter table if page load via back button
141 139 $("#q_filter").trigger('keyup');
142 140
143 141 });
144 142
145 143 </script>
146 144 </%def>
147 145
General Comments 0
You need to be logged in to leave comments. Login now