Show More
@@ -1,229 +1,229 b'' | |||||
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="head_extra()"> |
|
12 | <%def name="head_extra()"> | |
13 | <link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" /> |
|
13 | <link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" /> | |
14 | <link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" /> |
|
14 | <link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" /> | |
15 | </%def> |
|
15 | </%def> | |
16 | <%def name="main()"> |
|
16 | <%def name="main()"> | |
17 |
|
17 | |||
18 | <div class="box box-left"> |
|
18 | <div class="box box-left"> | |
19 | <!-- box / title --> |
|
19 | <!-- box / title --> | |
20 | <div class="title"> |
|
20 | <div class="title"> | |
21 | <h5>${_('Journal')}</h5> |
|
21 | <h5>${_('Journal')}</h5> | |
22 | <ul class="links"> |
|
22 | <ul class="links"> | |
23 | <li> |
|
23 | <li> | |
24 | <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/></a></span> |
|
24 | <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/></a></span> | |
25 | </li> |
|
25 | </li> | |
26 | <li> |
|
26 | <li> | |
27 | <span><a href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('RSS feed')}" alt="${_('RSS feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span> |
|
27 | <span><a href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('RSS feed')}" alt="${_('RSS feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span> | |
28 | </li> |
|
28 | </li> | |
29 | <li> |
|
29 | <li> | |
30 | <span><a href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('ATOM feed')}" alt="${_('ATOM feed')}" src="${h.url('/images/icons/atom.png')}"/></a></span> |
|
30 | <span><a href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('ATOM feed')}" alt="${_('ATOM feed')}" src="${h.url('/images/icons/atom.png')}"/></a></span> | |
31 | </li> |
|
31 | </li> | |
32 | </ul> |
|
32 | </ul> | |
33 | </div> |
|
33 | </div> | |
34 | <div id="journal">${c.journal_data}</div> |
|
34 | <div id="journal">${c.journal_data}</div> | |
35 | </div> |
|
35 | </div> | |
36 | <div class="box box-right"> |
|
36 | <div class="box box-right"> | |
37 | <!-- box / title --> |
|
37 | <!-- box / title --> | |
38 | <div class="title"> |
|
38 | <div class="title"> | |
39 | <h5> |
|
39 | <h5> | |
40 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> |
|
40 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> | |
41 | <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a> |
|
41 | <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a> | |
42 | </h5> |
|
42 | </h5> | |
43 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
43 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
44 | <ul class="links"> |
|
44 | <ul class="links"> | |
45 | <li> |
|
45 | <li> | |
46 | <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> |
|
46 | <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> | |
47 | </li> |
|
47 | </li> | |
48 | </ul> |
|
48 | </ul> | |
49 | %endif |
|
49 | %endif | |
50 | </div> |
|
50 | </div> | |
51 | <!-- end box / title --> |
|
51 | <!-- end box / title --> | |
52 | <div id="my" class="table"> |
|
52 | <div id="my" class="table"> | |
53 | %if c.user_repos: |
|
53 | %if c.user_repos: | |
54 | <div id='repos_list_wrap' class="yui-skin-sam"> |
|
54 | <div id='repos_list_wrap' class="yui-skin-sam"> | |
55 | <table id="repos_list"> |
|
55 | <table id="repos_list"> | |
56 | <thead> |
|
56 | <thead> | |
57 | <tr> |
|
57 | <tr> | |
58 | <th></th> |
|
58 | <th></th> | |
59 | <th class="left">${_('Name')}</th> |
|
59 | <th class="left">${_('Name')}</th> | |
60 | <th class="left">${_('Revision')}</th> |
|
60 | <th class="left">${_('Revision')}</th> | |
61 | <th class="left">${_('Action')}</th> |
|
61 | <th class="left">${_('Action')}</th> | |
62 | <th class="left">${_('Action')}</th> |
|
62 | <th class="left">${_('Action')}</th> | |
63 | </thead> |
|
63 | </thead> | |
64 | <tbody> |
|
64 | <tbody> | |
65 | <%namespace name="dt" file="/data_table/_dt_elements.html"/> |
|
65 | <%namespace name="dt" file="/data_table/_dt_elements.html"/> | |
66 | %for repo in c.user_repos: |
|
66 | %for repo in c.user_repos: | |
67 | <tr> |
|
67 | <tr> | |
68 | ##QUICK MENU |
|
68 | ##QUICK MENU | |
69 | <td class="quick_repo_menu"> |
|
69 | <td class="quick_repo_menu"> | |
70 | ${dt.quick_menu(repo['name'])} |
|
70 | ${dt.quick_menu(repo['name'])} | |
71 | </td> |
|
71 | </td> | |
72 | ##REPO NAME AND ICONS |
|
72 | ##REPO NAME AND ICONS | |
73 | <td class="reponame"> |
|
73 | <td class="reponame"> | |
74 |
${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'] |
|
74 | ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],h.AttributeDict(repo['dbrepo_fork']))} | |
75 | </td> |
|
75 | </td> | |
76 | ##LAST REVISION |
|
76 | ##LAST REVISION | |
77 | <td> |
|
77 | <td> | |
78 | ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} |
|
78 | ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} | |
79 | </td> |
|
79 | </td> | |
80 | ## |
|
80 | ## | |
81 | <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> |
|
81 | <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> | |
82 | <td> |
|
82 | <td> | |
83 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} |
|
83 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} | |
84 | ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository')+"');")} |
|
84 | ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository')+"');")} | |
85 | ${h.end_form()} |
|
85 | ${h.end_form()} | |
86 | </td> |
|
86 | </td> | |
87 | </tr> |
|
87 | </tr> | |
88 | %endfor |
|
88 | %endfor | |
89 | </tbody> |
|
89 | </tbody> | |
90 | </table> |
|
90 | </table> | |
91 | </div> |
|
91 | </div> | |
92 | %else: |
|
92 | %else: | |
93 | <div style="padding:5px 0px 10px 0px;"> |
|
93 | <div style="padding:5px 0px 10px 0px;"> | |
94 | ${_('No repositories yet')} |
|
94 | ${_('No repositories yet')} | |
95 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
95 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
96 | ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")} |
|
96 | ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")} | |
97 | %endif |
|
97 | %endif | |
98 | </div> |
|
98 | </div> | |
99 | %endif |
|
99 | %endif | |
100 | </div> |
|
100 | </div> | |
101 |
|
101 | |||
102 | <div id="watched" class="table" style="display:none"> |
|
102 | <div id="watched" class="table" style="display:none"> | |
103 | %if c.following: |
|
103 | %if c.following: | |
104 | <table> |
|
104 | <table> | |
105 | <thead> |
|
105 | <thead> | |
106 | <tr> |
|
106 | <tr> | |
107 | <th class="left">${_('Name')}</th> |
|
107 | <th class="left">${_('Name')}</th> | |
108 | </thead> |
|
108 | </thead> | |
109 | <tbody> |
|
109 | <tbody> | |
110 | %for entry in c.following: |
|
110 | %for entry in c.following: | |
111 | <tr> |
|
111 | <tr> | |
112 | <td> |
|
112 | <td> | |
113 | %if entry.follows_user_id: |
|
113 | %if entry.follows_user_id: | |
114 | <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/> |
|
114 | <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/> | |
115 | ${entry.follows_user.full_contact} |
|
115 | ${entry.follows_user.full_contact} | |
116 | %endif |
|
116 | %endif | |
117 |
|
117 | |||
118 | %if entry.follows_repo_id: |
|
118 | %if entry.follows_repo_id: | |
119 | <div style="float:right;padding-right:5px"> |
|
119 | <div style="float:right;padding-right:5px"> | |
120 | <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}" |
|
120 | <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}" | |
121 | onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')"> |
|
121 | onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')"> | |
122 | </span> |
|
122 | </span> | |
123 | </div> |
|
123 | </div> | |
124 |
|
124 | |||
125 | %if h.is_hg(entry.follows_repository): |
|
125 | %if h.is_hg(entry.follows_repository): | |
126 | <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> |
|
126 | <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> | |
127 | %elif h.is_git(entry.follows_repository): |
|
127 | %elif h.is_git(entry.follows_repository): | |
128 | <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> |
|
128 | <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> | |
129 | %endif |
|
129 | %endif | |
130 |
|
130 | |||
131 | %if entry.follows_repository.private and c.visual.show_private_icon: |
|
131 | %if entry.follows_repository.private and c.visual.show_private_icon: | |
132 | <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/> |
|
132 | <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/> | |
133 | %elif not entry.follows_repository.private and c.visual.show_public_icon: |
|
133 | %elif not entry.follows_repository.private and c.visual.show_public_icon: | |
134 | <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/> |
|
134 | <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/> | |
135 | %endif |
|
135 | %endif | |
136 | <span class="watched_repo"> |
|
136 | <span class="watched_repo"> | |
137 | ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))} |
|
137 | ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))} | |
138 | </span> |
|
138 | </span> | |
139 | %endif |
|
139 | %endif | |
140 | </td> |
|
140 | </td> | |
141 | </tr> |
|
141 | </tr> | |
142 | %endfor |
|
142 | %endfor | |
143 | </tbody> |
|
143 | </tbody> | |
144 | </table> |
|
144 | </table> | |
145 | %else: |
|
145 | %else: | |
146 | <div style="padding:5px 0px 10px 0px;"> |
|
146 | <div style="padding:5px 0px 10px 0px;"> | |
147 | ${_('You are not following any users or repositories')} |
|
147 | ${_('You are not following any users or repositories')} | |
148 | </div> |
|
148 | </div> | |
149 | %endif |
|
149 | %endif | |
150 | </div> |
|
150 | </div> | |
151 | </div> |
|
151 | </div> | |
152 |
|
152 | |||
153 | <script type="text/javascript"> |
|
153 | <script type="text/javascript"> | |
154 |
|
154 | |||
155 | YUE.on('show_my','click',function(e){ |
|
155 | YUE.on('show_my','click',function(e){ | |
156 | YUD.setStyle('watched','display','none'); |
|
156 | YUD.setStyle('watched','display','none'); | |
157 | YUD.setStyle('my','display',''); |
|
157 | YUD.setStyle('my','display',''); | |
158 | var nodes = YUQ('#my tr td a.repo_name'); |
|
158 | var nodes = YUQ('#my tr td a.repo_name'); | |
159 | var target = 'q_filter'; |
|
159 | var target = 'q_filter'; | |
160 | var func = function(node){ |
|
160 | var func = function(node){ | |
161 | return node.parentNode.parentNode.parentNode.parentNode; |
|
161 | return node.parentNode.parentNode.parentNode.parentNode; | |
162 | } |
|
162 | } | |
163 | q_filter(target,nodes,func); |
|
163 | q_filter(target,nodes,func); | |
164 | YUE.preventDefault(e); |
|
164 | YUE.preventDefault(e); | |
165 | }) |
|
165 | }) | |
166 | YUE.on('show_watched','click',function(e){ |
|
166 | YUE.on('show_watched','click',function(e){ | |
167 | YUD.setStyle('my','display','none'); |
|
167 | YUD.setStyle('my','display','none'); | |
168 | YUD.setStyle('watched','display',''); |
|
168 | YUD.setStyle('watched','display',''); | |
169 | var nodes = YUQ('#watched .watched_repo a'); |
|
169 | var nodes = YUQ('#watched .watched_repo a'); | |
170 | var target = 'q_filter'; |
|
170 | var target = 'q_filter'; | |
171 | var func = function(node){ |
|
171 | var func = function(node){ | |
172 | return node.parentNode.parentNode; |
|
172 | return node.parentNode.parentNode; | |
173 | } |
|
173 | } | |
174 | q_filter(target,nodes,func); |
|
174 | q_filter(target,nodes,func); | |
175 | YUE.preventDefault(e); |
|
175 | YUE.preventDefault(e); | |
176 | }) |
|
176 | }) | |
177 | YUE.on('refresh','click',function(e){ |
|
177 | YUE.on('refresh','click',function(e){ | |
178 | ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();}); |
|
178 | ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();}); | |
179 | YUE.preventDefault(e); |
|
179 | YUE.preventDefault(e); | |
180 | }); |
|
180 | }); | |
181 |
|
181 | |||
182 |
|
182 | |||
183 | // main table sorting |
|
183 | // main table sorting | |
184 | var myColumnDefs = [ |
|
184 | var myColumnDefs = [ | |
185 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
|
185 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
186 | {key:"name",label:"${_('Name')}",sortable:true, |
|
186 | {key:"name",label:"${_('Name')}",sortable:true, | |
187 | sortOptions: { sortFunction: nameSort }}, |
|
187 | sortOptions: { sortFunction: nameSort }}, | |
188 | {key:"tip",label:"${_('Tip')}",sortable:true, |
|
188 | {key:"tip",label:"${_('Tip')}",sortable:true, | |
189 | sortOptions: { sortFunction: revisionSort }}, |
|
189 | sortOptions: { sortFunction: revisionSort }}, | |
190 | {key:"action1",label:"",sortable:false}, |
|
190 | {key:"action1",label:"",sortable:false}, | |
191 | {key:"action2",label:"",sortable:false}, |
|
191 | {key:"action2",label:"",sortable:false}, | |
192 | ]; |
|
192 | ]; | |
193 |
|
193 | |||
194 | var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list")); |
|
194 | var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list")); | |
195 |
|
195 | |||
196 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; |
|
196 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |
197 |
|
197 | |||
198 | myDataSource.responseSchema = { |
|
198 | myDataSource.responseSchema = { | |
199 | fields: [ |
|
199 | fields: [ | |
200 | {key:"menu"}, |
|
200 | {key:"menu"}, | |
201 | {key:"name"}, |
|
201 | {key:"name"}, | |
202 | {key:"tip"}, |
|
202 | {key:"tip"}, | |
203 | {key:"action1"}, |
|
203 | {key:"action1"}, | |
204 | {key:"action2"} |
|
204 | {key:"action2"} | |
205 | ] |
|
205 | ] | |
206 | }; |
|
206 | }; | |
207 |
|
207 | |||
208 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource, |
|
208 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource, | |
209 | { |
|
209 | { | |
210 | sortedBy:{key:"name",dir:"asc"}, |
|
210 | sortedBy:{key:"name",dir:"asc"}, | |
211 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
211 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
212 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
212 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
213 | MSG_EMPTY:"${_('No records found.')}", |
|
213 | MSG_EMPTY:"${_('No records found.')}", | |
214 | MSG_ERROR:"${_('Data error.')}", |
|
214 | MSG_ERROR:"${_('Data error.')}", | |
215 | MSG_LOADING:"${_('Loading...')}", |
|
215 | MSG_LOADING:"${_('Loading...')}", | |
216 | } |
|
216 | } | |
217 | ); |
|
217 | ); | |
218 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
218 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
219 | tooltip_activate(); |
|
219 | tooltip_activate(); | |
220 | quick_repo_menu(); |
|
220 | quick_repo_menu(); | |
221 | var func = function(node){ |
|
221 | var func = function(node){ | |
222 | return node.parentNode.parentNode.parentNode.parentNode; |
|
222 | return node.parentNode.parentNode.parentNode.parentNode; | |
223 | } |
|
223 | } | |
224 | q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); |
|
224 | q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); | |
225 | }); |
|
225 | }); | |
226 |
|
226 | |||
227 |
|
227 | |||
228 | </script> |
|
228 | </script> | |
229 | </%def> |
|
229 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now