##// END OF EJS Templates
Translations fixes for Data table
marcink -
r1780:b9539c4d beta
parent child Browse files
Show More
@@ -1,121 +1,124
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Repositories administration')} - ${c.rhodecode_name}
5 ${_('Repositories administration')} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8
8
9 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
10 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; ${_('Repositories')}
10 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; ${_('Repositories')}
11 </%def>
11 </%def>
12 <%def name="page_nav()">
12 <%def name="page_nav()">
13 ${self.menu('admin')}
13 ${self.menu('admin')}
14 </%def>
14 </%def>
15 <%def name="main()">
15 <%def name="main()">
16 <div class="box">
16 <div class="box">
17
17
18 <div class="title">
18 <div class="title">
19 ${self.breadcrumbs()}
19 ${self.breadcrumbs()}
20 <ul class="links">
20 <ul class="links">
21 <li>
21 <li>
22 <span>${h.link_to(_(u'ADD REPOSITORY'),h.url('new_repo'))}</span>
22 <span>${h.link_to(_(u'ADD REPOSITORY'),h.url('new_repo'))}</span>
23 </li>
23 </li>
24 </ul>
24 </ul>
25 </div>
25 </div>
26
26
27 <div class="table">
27 <div class="table">
28 <div id='repos_list_wrap' class="yui-skin-sam">
28 <div id='repos_list_wrap' class="yui-skin-sam">
29 <%cnt=0%>
29 <%cnt=0%>
30 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
30 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
31
31
32 <table id="repos_list">
32 <table id="repos_list">
33 <thead>
33 <thead>
34 <tr>
34 <tr>
35 <th class="left"></th>
35 <th class="left"></th>
36 <th class="left">${_('Name')}</th>
36 <th class="left">${_('Name')}</th>
37 <th class="left">${_('Description')}</th>
37 <th class="left">${_('Description')}</th>
38 <th class="left">${_('Last change')}</th>
38 <th class="left">${_('Last change')}</th>
39 <th class="left">${_('Tip')}</th>
39 <th class="left">${_('Tip')}</th>
40 <th class="left">${_('Contact')}</th>
40 <th class="left">${_('Contact')}</th>
41 <th class="left">${_('Action')}</th>
41 <th class="left">${_('Action')}</th>
42 </tr>
42 </tr>
43 </thead>
43 </thead>
44
44
45 %for cnt,repo in enumerate(c.repos_list,1):
45 %for cnt,repo in enumerate(c.repos_list,1):
46 <tr class="parity${cnt%2}">
46 <tr class="parity${cnt%2}">
47 <td class="quick_repo_menu">
47 <td class="quick_repo_menu">
48 ${dt.quick_menu(repo['name'])}
48 ${dt.quick_menu(repo['name'])}
49 </td>
49 </td>
50 <td class="reponame">
50 <td class="reponame">
51 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
51 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
52 </td>
52 </td>
53 ##DESCRIPTION
53 ##DESCRIPTION
54 <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
54 <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
55 ${h.truncate(repo['description'],60)}</span>
55 ${h.truncate(repo['description'],60)}</span>
56 </td>
56 </td>
57 ##LAST CHANGE
57 ##LAST CHANGE
58 <td>
58 <td>
59 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
59 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
60 </td>
60 </td>
61 ##LAST REVISION
61 ##LAST REVISION
62 <td>
62 <td>
63 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
63 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
64 </td>
64 </td>
65 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
65 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
66 <td>
66 <td>
67 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
67 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
68 ${h.submit('remove_%s' % repo['name'],_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository')+"');")}
68 ${h.submit('remove_%s' % repo['name'],_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository')+"');")}
69 ${h.end_form()}
69 ${h.end_form()}
70 </td>
70 </td>
71 </tr>
71 </tr>
72 %endfor
72 %endfor
73 </table>
73 </table>
74 </div>
74 </div>
75 </div>
75 </div>
76 </div>
76 </div>
77 <script>
77 <script>
78
78
79 // main table sorting
79 // main table sorting
80 var myColumnDefs = [
80 var myColumnDefs = [
81 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
81 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
82 {key:"name",label:"${_('Name')}",sortable:true,
82 {key:"name",label:"${_('Name')}",sortable:true,
83 sortOptions: { sortFunction: nameSort }},
83 sortOptions: { sortFunction: nameSort }},
84 {key:"desc",label:"${_('Description')}",sortable:true},
84 {key:"desc",label:"${_('Description')}",sortable:true},
85 {key:"last_change",label:"${_('Last Change')}",sortable:true,
85 {key:"last_change",label:"${_('Last Change')}",sortable:true,
86 sortOptions: { sortFunction: ageSort }},
86 sortOptions: { sortFunction: ageSort }},
87 {key:"tip",label:"${_('Tip')}",sortable:true,
87 {key:"tip",label:"${_('Tip')}",sortable:true,
88 sortOptions: { sortFunction: revisionSort }},
88 sortOptions: { sortFunction: revisionSort }},
89 {key:"owner",label:"${_('Owner')}",sortable:true},
89 {key:"owner",label:"${_('Owner')}",sortable:true},
90 {key:"action",label:"${_('Action')}",sortable:false},
90 {key:"action",label:"${_('Action')}",sortable:false},
91 ];
91 ];
92
92
93 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
93 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
94
94
95 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
95 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
96
96
97 myDataSource.responseSchema = {
97 myDataSource.responseSchema = {
98 fields: [
98 fields: [
99 {key:"menu"},
99 {key:"menu"},
100 {key:"name"},
100 {key:"name"},
101 {key:"desc"},
101 {key:"desc"},
102 {key:"last_change"},
102 {key:"last_change"},
103 {key:"tip"},
103 {key:"tip"},
104 {key:"owner"},
104 {key:"owner"},
105 {key:"action"},
105 {key:"action"},
106 ]
106 ]
107 };
107 };
108
108
109 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
109 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
110 {
110 {
111 sortedBy:{key:"name",dir:"asc"},
111 sortedBy:{key:"name",dir:"asc"},
112 MSG_SORTASC:"${_('Click to sort ascending')}",
112 MSG_SORTASC:"${_('Click to sort ascending')}",
113 MSG_SORTDESC:"${_('Click to sort descending')}"
113 MSG_SORTDESC:"${_('Click to sort descending')}",
114 MSG_EMPTY:"${_('No records found.')}",
115 MSG_ERROR:"${_('Data error.')}",
116 MSG_LOADING:"${_('Loading...')}",
114 }
117 }
115 );
118 );
116 myDataTable.subscribe('postRenderEvent',function(oArgs) {
119 myDataTable.subscribe('postRenderEvent',function(oArgs) {
117 tooltip_activate();
120 tooltip_activate();
118 quick_repo_menu();
121 quick_repo_menu();
119 });
122 });
120 </script>
123 </script>
121 </%def>
124 </%def>
@@ -1,192 +1,195
1 <%page args="parent" />
1 <%page args="parent" />
2 <div class="box">
2 <div class="box">
3 <!-- box / title -->
3 <!-- box / title -->
4 <div class="title">
4 <div class="title">
5 <h5>
5 <h5>
6 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> ${parent.breadcrumbs()} <span id="repo_count">0</span> ${_('repositories')}
6 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> ${parent.breadcrumbs()} <span id="repo_count">0</span> ${_('repositories')}
7 </h5>
7 </h5>
8 %if c.rhodecode_user.username != 'default':
8 %if c.rhodecode_user.username != 'default':
9 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
9 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
10 <ul class="links">
10 <ul class="links">
11 <li>
11 <li>
12 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
12 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
13 </li>
13 </li>
14 </ul>
14 </ul>
15 %endif
15 %endif
16 %endif
16 %endif
17 </div>
17 </div>
18 <!-- end box / title -->
18 <!-- end box / title -->
19 <div class="table">
19 <div class="table">
20 % if c.groups:
20 % if c.groups:
21 <div id='groups_list_wrap' class="yui-skin-sam">
21 <div id='groups_list_wrap' class="yui-skin-sam">
22 <table id="groups_list">
22 <table id="groups_list">
23 <thead>
23 <thead>
24 <tr>
24 <tr>
25 <th class="left"><a href="#">${_('Group name')}</a></th>
25 <th class="left"><a href="#">${_('Group name')}</a></th>
26 <th class="left"><a href="#">${_('Description')}</a></th>
26 <th class="left"><a href="#">${_('Description')}</a></th>
27 ##<th class="left"><a href="#">${_('Number of repositories')}</a></th>
27 ##<th class="left"><a href="#">${_('Number of repositories')}</a></th>
28 </tr>
28 </tr>
29 </thead>
29 </thead>
30
30
31 ## REPO GROUPS
31 ## REPO GROUPS
32 % for gr in c.groups:
32 % for gr in c.groups:
33 <tr>
33 <tr>
34 <td>
34 <td>
35 <div style="white-space: nowrap">
35 <div style="white-space: nowrap">
36 <img class="icon" alt="${_('Repositories group')}" src="${h.url('/images/icons/database_link.png')}"/>
36 <img class="icon" alt="${_('Repositories group')}" src="${h.url('/images/icons/database_link.png')}"/>
37 ${h.link_to(gr.name,url('repos_group_home',group_name=gr.group_name))}
37 ${h.link_to(gr.name,url('repos_group_home',group_name=gr.group_name))}
38 </div>
38 </div>
39 </td>
39 </td>
40 <td>${gr.group_description}</td>
40 <td>${gr.group_description}</td>
41 ##<td><b>${gr.repositories.count()}</b></td>
41 ##<td><b>${gr.repositories.count()}</b></td>
42 </tr>
42 </tr>
43 % endfor
43 % endfor
44
44
45 </table>
45 </table>
46 </div>
46 </div>
47 <div style="height: 20px"></div>
47 <div style="height: 20px"></div>
48 % endif
48 % endif
49 <div id="welcome" style="display:none;text-align:center">
49 <div id="welcome" style="display:none;text-align:center">
50 <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
50 <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
51 </div>
51 </div>
52 <div id='repos_list_wrap' class="yui-skin-sam">
52 <div id='repos_list_wrap' class="yui-skin-sam">
53 <%cnt=0%>
53 <%cnt=0%>
54 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
54 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
55
55
56 <table id="repos_list">
56 <table id="repos_list">
57 <thead>
57 <thead>
58 <tr>
58 <tr>
59 <th class="left"></th>
59 <th class="left"></th>
60 <th class="left">${_('Name')}</th>
60 <th class="left">${_('Name')}</th>
61 <th class="left">${_('Description')}</th>
61 <th class="left">${_('Description')}</th>
62 <th class="left">${_('Last change')}</th>
62 <th class="left">${_('Last change')}</th>
63 <th class="left">${_('Tip')}</th>
63 <th class="left">${_('Tip')}</th>
64 <th class="left">${_('Owner')}</th>
64 <th class="left">${_('Owner')}</th>
65 <th class="left">${_('RSS')}</th>
65 <th class="left">${_('RSS')}</th>
66 <th class="left">${_('Atom')}</th>
66 <th class="left">${_('Atom')}</th>
67 </tr>
67 </tr>
68 </thead>
68 </thead>
69 <tbody>
69 <tbody>
70 %for cnt,repo in enumerate(c.repos_list,1):
70 %for cnt,repo in enumerate(c.repos_list,1):
71 <tr class="parity${cnt%2}">
71 <tr class="parity${cnt%2}">
72 ##QUICK MENU
72 ##QUICK MENU
73 <td class="quick_repo_menu">
73 <td class="quick_repo_menu">
74 ${dt.quick_menu(repo['name'])}
74 ${dt.quick_menu(repo['name'])}
75 </td>
75 </td>
76 ##REPO NAME AND ICONS
76 ##REPO NAME AND ICONS
77 <td class="reponame">
77 <td class="reponame">
78 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
78 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
79 </td>
79 </td>
80 ##DESCRIPTION
80 ##DESCRIPTION
81 <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
81 <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
82 ${h.truncate(repo['description'],60)}</span>
82 ${h.truncate(repo['description'],60)}</span>
83 </td>
83 </td>
84 ##LAST CHANGE DATE
84 ##LAST CHANGE DATE
85 <td>
85 <td>
86 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
86 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
87 </td>
87 </td>
88 ##LAST REVISION
88 ##LAST REVISION
89 <td>
89 <td>
90 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
90 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
91 </td>
91 </td>
92 ##
92 ##
93 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
93 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
94 <td>
94 <td>
95 %if c.rhodecode_user.username != 'default':
95 %if c.rhodecode_user.username != 'default':
96 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
96 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
97 %else:
97 %else:
98 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
98 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
99 %endif:
99 %endif:
100 </td>
100 </td>
101 <td>
101 <td>
102 %if c.rhodecode_user.username != 'default':
102 %if c.rhodecode_user.username != 'default':
103 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
103 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'],api_key=c.rhodecode_user.api_key)}"></a>
104 %else:
104 %else:
105 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
105 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
106 %endif:
106 %endif:
107 </td>
107 </td>
108 </tr>
108 </tr>
109 %endfor
109 %endfor
110 </tbody>
110 </tbody>
111 </table>
111 </table>
112 </div>
112 </div>
113 </div>
113 </div>
114 </div>
114 </div>
115 <script>
115 <script>
116 YUD.get('repo_count').innerHTML = ${cnt};
116 YUD.get('repo_count').innerHTML = ${cnt};
117 var func = function(node){
117 var func = function(node){
118 return node.parentNode.parentNode.parentNode.parentNode;
118 return node.parentNode.parentNode.parentNode.parentNode;
119 }
119 }
120
120
121
121
122 // groups table sorting
122 // groups table sorting
123 var myColumnDefs = [
123 var myColumnDefs = [
124 {key:"name",label:"${_('Group Name')}",sortable:true,
124 {key:"name",label:"${_('Group Name')}",sortable:true,
125 sortOptions: { sortFunction: groupNameSort }},
125 sortOptions: { sortFunction: groupNameSort }},
126 {key:"desc",label:"${_('Description')}",sortable:true},
126 {key:"desc",label:"${_('Description')}",sortable:true},
127 ];
127 ];
128
128
129 var myDataSource = new YAHOO.util.DataSource(YUD.get("groups_list"));
129 var myDataSource = new YAHOO.util.DataSource(YUD.get("groups_list"));
130
130
131 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
131 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
132 myDataSource.responseSchema = {
132 myDataSource.responseSchema = {
133 fields: [
133 fields: [
134 {key:"name"},
134 {key:"name"},
135 {key:"desc"},
135 {key:"desc"},
136 ]
136 ]
137 };
137 };
138
138
139 var myDataTable = new YAHOO.widget.DataTable("groups_list_wrap", myColumnDefs, myDataSource,
139 var myDataTable = new YAHOO.widget.DataTable("groups_list_wrap", myColumnDefs, myDataSource,
140 {
140 {
141 sortedBy:{key:"name",dir:"asc"},
141 sortedBy:{key:"name",dir:"asc"},
142 MSG_SORTASC:"${_('Click to sort ascending')}",
142 MSG_SORTASC:"${_('Click to sort ascending')}",
143 MSG_SORTDESC:"${_('Click to sort descending')}"
143 MSG_SORTDESC:"${_('Click to sort descending')}"
144 }
144 }
145 );
145 );
146
146
147 // main table sorting
147 // main table sorting
148 var myColumnDefs = [
148 var myColumnDefs = [
149 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
149 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
150 {key:"name",label:"${_('Name')}",sortable:true,
150 {key:"name",label:"${_('Name')}",sortable:true,
151 sortOptions: { sortFunction: nameSort }},
151 sortOptions: { sortFunction: nameSort }},
152 {key:"desc",label:"${_('Description')}",sortable:true},
152 {key:"desc",label:"${_('Description')}",sortable:true},
153 {key:"last_change",label:"${_('Last Change')}",sortable:true,
153 {key:"last_change",label:"${_('Last Change')}",sortable:true,
154 sortOptions: { sortFunction: ageSort }},
154 sortOptions: { sortFunction: ageSort }},
155 {key:"tip",label:"${_('Tip')}",sortable:true,
155 {key:"tip",label:"${_('Tip')}",sortable:true,
156 sortOptions: { sortFunction: revisionSort }},
156 sortOptions: { sortFunction: revisionSort }},
157 {key:"owner",label:"${_('Owner')}",sortable:true},
157 {key:"owner",label:"${_('Owner')}",sortable:true},
158 {key:"rss",label:"",sortable:false},
158 {key:"rss",label:"",sortable:false},
159 {key:"atom",label:"",sortable:false},
159 {key:"atom",label:"",sortable:false},
160 ];
160 ];
161
161
162 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
162 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
163
163
164 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
164 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
165
165
166 myDataSource.responseSchema = {
166 myDataSource.responseSchema = {
167 fields: [
167 fields: [
168 {key:"menu"},
168 {key:"menu"},
169 {key:"name"},
169 {key:"name"},
170 {key:"desc"},
170 {key:"desc"},
171 {key:"last_change"},
171 {key:"last_change"},
172 {key:"tip"},
172 {key:"tip"},
173 {key:"owner"},
173 {key:"owner"},
174 {key:"rss"},
174 {key:"rss"},
175 {key:"atom"},
175 {key:"atom"},
176 ]
176 ]
177 };
177 };
178
178
179 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
179 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
180 {
180 {
181 sortedBy:{key:"name",dir:"asc"},
181 sortedBy:{key:"name",dir:"asc"},
182 MSG_SORTASC:"${_('Click to sort ascending')}",
182 MSG_SORTASC:"${_('Click to sort ascending')}",
183 MSG_SORTDESC:"${_('Click to sort descending')}"
183 MSG_SORTDESC:"${_('Click to sort descending')}",
184 MSG_EMPTY:"${_('No records found.')}",
185 MSG_ERROR:"${_('Data error.')}",
186 MSG_LOADING:"${_('Loading...')}",
184 }
187 }
185 );
188 );
186 myDataTable.subscribe('postRenderEvent',function(oArgs) {
189 myDataTable.subscribe('postRenderEvent',function(oArgs) {
187 tooltip_activate();
190 tooltip_activate();
188 quick_repo_menu();
191 quick_repo_menu();
189 q_filter('q_filter',YUQ('div.table tr td a.repo_name'),func);
192 q_filter('q_filter',YUQ('div.table tr td a.repo_name'),func);
190 });
193 });
191
194
192 </script> No newline at end of file
195 </script>
@@ -1,217 +1,220
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Journal')} - ${c.rhodecode_name}
4 ${_('Journal')} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6 <%def name="breadcrumbs()">
6 <%def name="breadcrumbs()">
7 ${c.rhodecode_name}
7 ${c.rhodecode_name}
8 </%def>
8 </%def>
9 <%def name="page_nav()">
9 <%def name="page_nav()">
10 ${self.menu('home')}
10 ${self.menu('home')}
11 </%def>
11 </%def>
12 <%def name="main()">
12 <%def name="main()">
13
13
14 <div class="box box-left">
14 <div class="box box-left">
15 <!-- box / title -->
15 <!-- box / title -->
16 <div class="title">
16 <div class="title">
17 <h5>${_('Journal')}</h5>
17 <h5>${_('Journal')}</h5>
18 <ul class="links">
18 <ul class="links">
19 <li>
19 <li>
20 <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
20 <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
21 </a></span>
21 </a></span>
22 </li>
22 </li>
23 </ul>
23 </ul>
24 </div>
24 </div>
25 <div id="journal">${c.journal_data}</div>
25 <div id="journal">${c.journal_data}</div>
26 </div>
26 </div>
27 <div class="box box-right">
27 <div class="box box-right">
28 <!-- box / title -->
28 <!-- box / title -->
29 <div class="title">
29 <div class="title">
30 <h5>
30 <h5>
31 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
31 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
32 <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
32 <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
33 </h5>
33 </h5>
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
35 <ul class="links">
35 <ul class="links">
36 <li>
36 <li>
37 <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span>
37 <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span>
38 </li>
38 </li>
39 </ul>
39 </ul>
40 %endif
40 %endif
41 </div>
41 </div>
42 <!-- end box / title -->
42 <!-- end box / title -->
43 <div id="my" class="table">
43 <div id="my" class="table">
44 %if c.user_repos:
44 %if c.user_repos:
45 <div id='repos_list_wrap' class="yui-skin-sam">
45 <div id='repos_list_wrap' class="yui-skin-sam">
46 <table id="repos_list">
46 <table id="repos_list">
47 <thead>
47 <thead>
48 <tr>
48 <tr>
49 <th></th>
49 <th></th>
50 <th class="left">${_('Name')}</th>
50 <th class="left">${_('Name')}</th>
51 <th class="left">${_('Tip')}</th>
51 <th class="left">${_('Tip')}</th>
52 <th class="left">${_('Action')}</th>
52 <th class="left">${_('Action')}</th>
53 <th class="left">${_('Action')}</th>
53 <th class="left">${_('Action')}</th>
54 </thead>
54 </thead>
55 <tbody>
55 <tbody>
56 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
56 <%namespace name="dt" file="/_data_table/_dt_elements.html"/>
57 %for repo in c.user_repos:
57 %for repo in c.user_repos:
58 <tr>
58 <tr>
59 ##QUICK MENU
59 ##QUICK MENU
60 <td class="quick_repo_menu">
60 <td class="quick_repo_menu">
61 ${dt.quick_menu(repo['name'])}
61 ${dt.quick_menu(repo['name'])}
62 </td>
62 </td>
63 ##REPO NAME AND ICONS
63 ##REPO NAME AND ICONS
64 <td class="reponame">
64 <td class="reponame">
65 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
65 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
66 </td>
66 </td>
67 ##LAST REVISION
67 ##LAST REVISION
68 <td>
68 <td>
69 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
69 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
70 </td>
70 </td>
71 ##
71 ##
72 <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td>
72 <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td>
73 <td>
73 <td>
74 ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
74 ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
75 ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
75 ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
76 ${h.end_form()}
76 ${h.end_form()}
77 </td>
77 </td>
78 </tr>
78 </tr>
79 %endfor
79 %endfor
80 </tbody>
80 </tbody>
81 </table>
81 </table>
82 </div>
82 </div>
83 %else:
83 %else:
84 <div style="padding:5px 0px 10px 0px;">
84 <div style="padding:5px 0px 10px 0px;">
85 ${_('No repositories yet')}
85 ${_('No repositories yet')}
86 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
86 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
87 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")}
87 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")}
88 %endif
88 %endif
89 </div>
89 </div>
90 %endif
90 %endif
91 </div>
91 </div>
92
92
93 <div id="watched" class="table" style="display:none">
93 <div id="watched" class="table" style="display:none">
94 %if c.following:
94 %if c.following:
95 <table>
95 <table>
96 <thead>
96 <thead>
97 <tr>
97 <tr>
98 <th class="left">${_('Name')}</th>
98 <th class="left">${_('Name')}</th>
99 </thead>
99 </thead>
100 <tbody>
100 <tbody>
101 %for entry in c.following:
101 %for entry in c.following:
102 <tr>
102 <tr>
103 <td>
103 <td>
104 %if entry.follows_user_id:
104 %if entry.follows_user_id:
105 <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
105 <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
106 ${entry.follows_user.full_contact}
106 ${entry.follows_user.full_contact}
107 %endif
107 %endif
108
108
109 %if entry.follows_repo_id:
109 %if entry.follows_repo_id:
110 <div style="float:right;padding-right:5px">
110 <div style="float:right;padding-right:5px">
111 <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}"
111 <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}"
112 onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')">
112 onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')">
113 </span>
113 </span>
114 </div>
114 </div>
115
115
116 %if entry.follows_repository.repo_type == 'hg':
116 %if entry.follows_repository.repo_type == 'hg':
117 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
117 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
118 %elif entry.follows_repository.repo_type == 'git':
118 %elif entry.follows_repository.repo_type == 'git':
119 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
119 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
120 %endif
120 %endif
121
121
122 %if entry.follows_repository.private:
122 %if entry.follows_repository.private:
123 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
123 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
124 %else:
124 %else:
125 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
125 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
126 %endif
126 %endif
127 <span class="watched_repo">
127 <span class="watched_repo">
128 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
128 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
129 </span>
129 </span>
130 %endif
130 %endif
131 </td>
131 </td>
132 </tr>
132 </tr>
133 %endfor
133 %endfor
134 </tbody>
134 </tbody>
135 </table>
135 </table>
136 %else:
136 %else:
137 <div style="padding:5px 0px 10px 0px;">
137 <div style="padding:5px 0px 10px 0px;">
138 ${_('You are not following any users or repositories')}
138 ${_('You are not following any users or repositories')}
139 </div>
139 </div>
140 %endif
140 %endif
141 </div>
141 </div>
142 </div>
142 </div>
143
143
144 <script type="text/javascript">
144 <script type="text/javascript">
145
145
146 YUE.on('show_my','click',function(e){
146 YUE.on('show_my','click',function(e){
147 YUD.setStyle('watched','display','none');
147 YUD.setStyle('watched','display','none');
148 YUD.setStyle('my','display','');
148 YUD.setStyle('my','display','');
149 var nodes = YUQ('#my tr td a.repo_name');
149 var nodes = YUQ('#my tr td a.repo_name');
150 var target = 'q_filter';
150 var target = 'q_filter';
151 var func = function(node){
151 var func = function(node){
152 return node.parentNode.parentNode.parentNode.parentNode;
152 return node.parentNode.parentNode.parentNode.parentNode;
153 }
153 }
154 q_filter(target,nodes,func);
154 q_filter(target,nodes,func);
155 YUE.preventDefault(e);
155 YUE.preventDefault(e);
156 })
156 })
157 YUE.on('show_watched','click',function(e){
157 YUE.on('show_watched','click',function(e){
158 YUD.setStyle('my','display','none');
158 YUD.setStyle('my','display','none');
159 YUD.setStyle('watched','display','');
159 YUD.setStyle('watched','display','');
160 var nodes = YUQ('#watched .watched_repo a');
160 var nodes = YUQ('#watched .watched_repo a');
161 var target = 'q_filter';
161 var target = 'q_filter';
162 var func = function(node){
162 var func = function(node){
163 return node.parentNode.parentNode;
163 return node.parentNode.parentNode;
164 }
164 }
165 q_filter(target,nodes,func);
165 q_filter(target,nodes,func);
166 YUE.preventDefault(e);
166 YUE.preventDefault(e);
167 })
167 })
168 YUE.on('refresh','click',function(e){
168 YUE.on('refresh','click',function(e){
169 ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();});
169 ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();});
170 YUE.preventDefault(e);
170 YUE.preventDefault(e);
171 });
171 });
172
172
173
173
174 // main table sorting
174 // main table sorting
175 var myColumnDefs = [
175 var myColumnDefs = [
176 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
176 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
177 {key:"name",label:"${_('Name')}",sortable:true,
177 {key:"name",label:"${_('Name')}",sortable:true,
178 sortOptions: { sortFunction: nameSort }},
178 sortOptions: { sortFunction: nameSort }},
179 {key:"tip",label:"${_('Tip')}",sortable:true,
179 {key:"tip",label:"${_('Tip')}",sortable:true,
180 sortOptions: { sortFunction: revisionSort }},
180 sortOptions: { sortFunction: revisionSort }},
181 {key:"action1",label:"",sortable:false},
181 {key:"action1",label:"",sortable:false},
182 {key:"action2",label:"",sortable:false},
182 {key:"action2",label:"",sortable:false},
183 ];
183 ];
184
184
185 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
185 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
186
186
187 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
187 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
188
188
189 myDataSource.responseSchema = {
189 myDataSource.responseSchema = {
190 fields: [
190 fields: [
191 {key:"menu"},
191 {key:"menu"},
192 {key:"name"},
192 {key:"name"},
193 {key:"tip"},
193 {key:"tip"},
194 {key:"action1"},
194 {key:"action1"},
195 {key:"action2"}
195 {key:"action2"}
196 ]
196 ]
197 };
197 };
198
198
199 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
199 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
200 {
200 {
201 sortedBy:{key:"name",dir:"asc"},
201 sortedBy:{key:"name",dir:"asc"},
202 MSG_SORTASC:"${_('Click to sort ascending')}",
202 MSG_SORTASC:"${_('Click to sort ascending')}",
203 MSG_SORTDESC:"${_('Click to sort descending')}"
203 MSG_SORTDESC:"${_('Click to sort descending')}",
204 MSG_EMPTY:"${_('No records found.')}",
205 MSG_ERROR:"${_('Data error.')}",
206 MSG_LOADING:"${_('Loading...')}",
204 }
207 }
205 );
208 );
206 myDataTable.subscribe('postRenderEvent',function(oArgs) {
209 myDataTable.subscribe('postRenderEvent',function(oArgs) {
207 tooltip_activate();
210 tooltip_activate();
208 quick_repo_menu();
211 quick_repo_menu();
209 var func = function(node){
212 var func = function(node){
210 return node.parentNode.parentNode.parentNode.parentNode;
213 return node.parentNode.parentNode.parentNode.parentNode;
211 }
214 }
212 q_filter('q_filter',YUQ('#my tr td a.repo_name'),func);
215 q_filter('q_filter',YUQ('#my tr td a.repo_name'),func);
213 });
216 });
214
217
215
218
216 </script>
219 </script>
217 </%def>
220 </%def>
General Comments 0
You need to be logged in to leave comments. Login now