Mercurial > kallithea
comparison rhodecode/templates/journal/journal.html @ 2031:82a88013a3fd
merge 1.3 into stable
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 26 Feb 2012 17:25:09 +0200 |
parents | bf263968da47 7a7ffe24b82c |
children | dc2584ba5fbc |
comparison
equal
deleted
inserted
replaced
2005:ab0e122b38a7 | 2031:82a88013a3fd |
---|---|
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"> | |
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')}"/> | |
21 </a></span> | |
22 </li> | |
23 </ul> | |
18 </div> | 24 </div> |
19 <script type="text/javascript"> | |
20 function show_more_event(){ | |
21 YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){ | |
22 var el = e.target; | |
23 YUD.setStyle(YUD.get(el.id.substring(1)),'display',''); | |
24 YUD.setStyle(el.parentNode,'display','none'); | |
25 }); | |
26 } | |
27 </script> | |
28 <div id="journal">${c.journal_data}</div> | 25 <div id="journal">${c.journal_data}</div> |
29 </div> | 26 </div> |
30 | |
31 <div class="box box-right"> | 27 <div class="box box-right"> |
32 <!-- box / title --> | 28 <!-- box / title --> |
33 <div class="title"> | 29 <div class="title"> |
34 <h5>${_('Following')}</h5> | 30 <h5> |
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> | |
33 </h5> | |
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
35 <ul class="links"> | |
36 <li> | |
37 <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> | |
38 </li> | |
39 </ul> | |
40 %endif | |
35 </div> | 41 </div> |
36 <div> | 42 <!-- end box / title --> |
37 %if c.following: | 43 <div id="my" class="table"> |
38 %for entry in c.following: | 44 %if c.user_repos: |
39 <div class="currently_following"> | 45 <div id='repos_list_wrap' class="yui-skin-sam"> |
40 %if entry.follows_user_id: | 46 <table id="repos_list"> |
41 <img title="${_('following user')}" alt="${_('user')}" src="${h.url("/images/icons/user.png")}"/> | 47 <thead> |
42 ${entry.follows_user.full_contact} | 48 <tr> |
43 %endif | 49 <th></th> |
44 | 50 <th class="left">${_('Name')}</th> |
45 %if entry.follows_repo_id: | 51 <th class="left">${_('Tip')}</th> |
46 | 52 <th class="left">${_('Action')}</th> |
47 <div style="float:left;padding-right:5px"> | 53 <th class="left">${_('Action')}</th> |
48 <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}" | 54 </thead> |
49 onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')"> | 55 <tbody> |
50 </span> | 56 <%namespace name="dt" file="/_data_table/_dt_elements.html"/> |
51 </div> | 57 %for repo in c.user_repos: |
52 %if entry.follows_repository.private: | 58 <tr> |
53 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/> | 59 ##QUICK MENU |
54 %else: | 60 <td class="quick_repo_menu"> |
55 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/> | 61 ${dt.quick_menu(repo['name'])} |
56 %endif | 62 </td> |
57 | 63 ##REPO NAME AND ICONS |
58 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home', | 64 <td class="reponame"> |
59 repo_name=entry.follows_repository.repo_name))} | 65 ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))} |
60 | 66 </td> |
61 %endif | 67 ##LAST REVISION |
62 </div> | 68 <td> |
63 %endfor | 69 ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} |
64 %else: | 70 </td> |
65 ${_('You are not following any users or repositories')} | 71 ## |
66 %endif | 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> | |
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');")} | |
76 ${h.end_form()} | |
77 </td> | |
78 </tr> | |
79 %endfor | |
80 </tbody> | |
81 </table> | |
82 </div> | |
83 %else: | |
84 <div style="padding:5px 0px 10px 0px;"> | |
85 ${_('No repositories yet')} | |
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")} | |
88 %endif | |
89 </div> | |
90 %endif | |
67 </div> | 91 </div> |
68 </div> | 92 |
69 </%def> | 93 <div id="watched" class="table" style="display:none"> |
94 %if c.following: | |
95 <table> | |
96 <thead> | |
97 <tr> | |
98 <th class="left">${_('Name')}</th> | |
99 </thead> | |
100 <tbody> | |
101 %for entry in c.following: | |
102 <tr> | |
103 <td> | |
104 %if entry.follows_user_id: | |
105 <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/> | |
106 ${entry.follows_user.full_contact} | |
107 %endif | |
108 | |
109 %if entry.follows_repo_id: | |
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')}" | |
112 onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')"> | |
113 </span> | |
114 </div> | |
115 | |
116 %if h.is_hg(entry.follows_repository): | |
117 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> | |
118 %elif h.is_git(entry.follows_repository): | |
119 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> | |
120 %endif | |
121 | |
122 %if entry.follows_repository.private: | |
123 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/> | |
124 %else: | |
125 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/> | |
126 %endif | |
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))} | |
129 </span> | |
130 %endif | |
131 </td> | |
132 </tr> | |
133 %endfor | |
134 </tbody> | |
135 </table> | |
136 %else: | |
137 <div style="padding:5px 0px 10px 0px;"> | |
138 ${_('You are not following any users or repositories')} | |
139 </div> | |
140 %endif | |
141 </div> | |
142 </div> | |
143 | |
144 <script type="text/javascript"> | |
145 | |
146 YUE.on('show_my','click',function(e){ | |
147 YUD.setStyle('watched','display','none'); | |
148 YUD.setStyle('my','display',''); | |
149 var nodes = YUQ('#my tr td a.repo_name'); | |
150 var target = 'q_filter'; | |
151 var func = function(node){ | |
152 return node.parentNode.parentNode.parentNode.parentNode; | |
153 } | |
154 q_filter(target,nodes,func); | |
155 YUE.preventDefault(e); | |
156 }) | |
157 YUE.on('show_watched','click',function(e){ | |
158 YUD.setStyle('my','display','none'); | |
159 YUD.setStyle('watched','display',''); | |
160 var nodes = YUQ('#watched .watched_repo a'); | |
161 var target = 'q_filter'; | |
162 var func = function(node){ | |
163 return node.parentNode.parentNode; | |
164 } | |
165 q_filter(target,nodes,func); | |
166 YUE.preventDefault(e); | |
167 }) | |
168 YUE.on('refresh','click',function(e){ | |
169 ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();}); | |
170 YUE.preventDefault(e); | |
171 }); | |
172 | |
173 | |
174 // main table sorting | |
175 var myColumnDefs = [ | |
176 {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
177 {key:"name",label:"${_('Name')}",sortable:true, | |
178 sortOptions: { sortFunction: nameSort }}, | |
179 {key:"tip",label:"${_('Tip')}",sortable:true, | |
180 sortOptions: { sortFunction: revisionSort }}, | |
181 {key:"action1",label:"",sortable:false}, | |
182 {key:"action2",label:"",sortable:false}, | |
183 ]; | |
184 | |
185 var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list")); | |
186 | |
187 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |
188 | |
189 myDataSource.responseSchema = { | |
190 fields: [ | |
191 {key:"menu"}, | |
192 {key:"name"}, | |
193 {key:"tip"}, | |
194 {key:"action1"}, | |
195 {key:"action2"} | |
196 ] | |
197 }; | |
198 | |
199 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource, | |
200 { | |
201 sortedBy:{key:"name",dir:"asc"}, | |
202 MSG_SORTASC:"${_('Click to sort ascending')}", | |
203 MSG_SORTDESC:"${_('Click to sort descending')}", | |
204 MSG_EMPTY:"${_('No records found.')}", | |
205 MSG_ERROR:"${_('Data error.')}", | |
206 MSG_LOADING:"${_('Loading...')}", | |
207 } | |
208 ); | |
209 myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
210 tooltip_activate(); | |
211 quick_repo_menu(); | |
212 var func = function(node){ | |
213 return node.parentNode.parentNode.parentNode.parentNode; | |
214 } | |
215 q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); | |
216 }); | |
217 | |
218 | |
219 </script> | |
220 </%def> |