##// END OF EJS Templates
Journal refresh button
marcink -
r1746:753aeb4a beta
parent child Browse files
Show More
@@ -1,173 +1,177 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="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 </div>
18 <ul class="links">
19 <script type="text/javascript">
19 <li>
20 function show_more_event(){
20 <span><a href="#"><img id="refresh" class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
21 YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
21 </a></span>
22 var el = e.target;
22 </li>
23 YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
23 </ul>
24 YUD.setStyle(el.parentNode,'display','none');
24 </div>
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 <div class="box box-right">
27 <div class="box box-right">
31 <!-- box / title -->
28 <!-- box / title -->
32 <div class="title">
29 <div class="title">
33 <h5>
30 <h5>
34 <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...')}"/>
35 <a id="show_my" class="link-white" href="#my">${_('My repositories')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
32 <a id="show_my" class="link-white" href="#my">${_('My repositories')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
36 </h5>
33 </h5>
37 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
38 <ul class="links">
35 <ul class="links">
39 <li>
36 <li>
40 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
37 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
41 </li>
38 </li>
42 </ul>
39 </ul>
43 %endif
40 %endif
44 </div>
41 </div>
45 <!-- end box / title -->
42 <!-- end box / title -->
46 <div id="my" class="table">
43 <div id="my" class="table">
44 %if c.user_repos:
47 <table>
45 <table>
48 <thead>
46 <thead>
49 <tr>
47 <tr>
50 <th class="left">${_('Name')}</th>
48 <th class="left">${_('Name')}</th>
51 <th class="left">${_('revision')}</th>
49 <th class="left">${_('revision')}</th>
52 <th colspan="2" class="left">${_('action')}</th>
50 <th colspan="2" class="left">${_('action')}</th>
53 </thead>
51 </thead>
54 <tbody>
52 <tbody>
55 %if c.user_repos:
56 %for repo in c.user_repos:
53 %for repo in c.user_repos:
57 <tr>
54 <tr>
58 <td>
55 <td>
59 %if repo['dbrepo']['repo_type'] =='hg':
56 %if repo['dbrepo']['repo_type'] =='hg':
60 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
57 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
61 %elif repo['dbrepo']['repo_type'] =='git':
58 %elif repo['dbrepo']['repo_type'] =='git':
62 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
59 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
63 %else:
60 %else:
64
61
65 %endif
62 %endif
66 %if repo['dbrepo']['private']:
63 %if repo['dbrepo']['private']:
67 <img class="icon" alt="${_('private')}" src="${h.url('/images/icons/lock.png')}"/>
64 <img class="icon" alt="${_('private')}" src="${h.url('/images/icons/lock.png')}"/>
68 %else:
65 %else:
69 <img class="icon" alt="${_('public')}" src="${h.url('/images/icons/lock_open.png')}"/>
66 <img class="icon" alt="${_('public')}" src="${h.url('/images/icons/lock_open.png')}"/>
70 %endif
67 %endif
71
68
72 ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']),class_="repo_name")}
69 ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']),class_="repo_name")}
73 %if repo['dbrepo_fork']:
70 %if repo['dbrepo_fork']:
74 <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}">
71 <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}">
75 <img class="icon" alt="${_('public')}"
72 <img class="icon" alt="${_('public')}"
76 title="${_('Fork of')} ${repo['dbrepo_fork']['repo_name']}"
73 title="${_('Fork of')} ${repo['dbrepo_fork']['repo_name']}"
77 src="${h.url('/images/icons/arrow_divide.png')}"/></a>
74 src="${h.url('/images/icons/arrow_divide.png')}"/></a>
78 %endif
75 %endif
79 </td>
76 </td>
80 <td><span class="tooltip" title="${repo['last_change']}">${("r%s:%s") % (repo['rev'],h.short_id(repo['tip']))}</span></td>
77 <td><span class="tooltip" title="${repo['last_change']}">${("r%s:%s") % (repo['rev'],h.short_id(repo['tip']))}</span></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>
78 <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>
79 <td>
83 ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
80 ${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');")}
81 ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
85 ${h.end_form()}
82 ${h.end_form()}
86 </td>
83 </td>
87 </tr>
84 </tr>
88 %endfor
85 %endfor
86 </tbody>
87 </table>
89 %else:
88 %else:
90 <div style="padding:5px 0px 10px 0px;">
89 <div style="padding:5px 0px 10px 0px;">
91 ${_('No repositories yet')}
90 ${_('No repositories yet')}
92 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
91 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
93 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-button-small")}
92 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-button-small")}
94 %endif
93 %endif
95 </div>
94 </div>
96 %endif
95 %endif
97 </tbody>
98 </table>
99 </div>
96 </div>
100
97
101 <div id="watched" class="table" style="display:none">
98 <div id="watched" class="table" style="display:none">
102 <table>
103 <thead>
104 <tr>
105 <th class="left">${_('Name')}</th>
106 </thead>
107 <tbody>
108 %if c.following:
99 %if c.following:
109 %for entry in c.following:
100 <table>
110 <tr>
101 <thead>
111 <td>
102 <tr>
103 <th class="left">${_('Name')}</th>
104 </thead>
105 <tbody>
106 %for entry in c.following:
107 <tr>
108 <td>
112 %if entry.follows_user_id:
109 %if entry.follows_user_id:
113 <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
110 <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
114 ${entry.follows_user.full_contact}
111 ${entry.follows_user.full_contact}
115 %endif
112 %endif
116
113
117 %if entry.follows_repo_id:
114 %if entry.follows_repo_id:
118
119 <div style="float:right;padding-right:5px">
115 <div style="float:right;padding-right:5px">
120 <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}"
116 <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())}')">
117 onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')">
122 </span>
118 </span>
123 </div>
119 </div>
124
120
125 %if entry.follows_repository.repo_type == 'hg':
121 %if entry.follows_repository.repo_type == 'hg':
126 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
122 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
127 %elif entry.follows_repository.repo_type == 'git':
123 %elif entry.follows_repository.repo_type == 'git':
128 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
124 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
129 %endif
125 %endif
130
126
131 %if entry.follows_repository.private:
127 %if entry.follows_repository.private:
132 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
128 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
133 %else:
129 %else:
134 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
130 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
135 %endif
131 %endif
136 <span class="watched_repo">
132 <span class="watched_repo">
137 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
133 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
138 </span>
134 </span>
139 %endif
135 %endif
140 </td>
136 </td>
141 </tr>
137 </tr>
142 %endfor
138 %endfor
139 </tbody>
140 </table>
143 %else:
141 %else:
144 </tbody>
142 <div style="padding:5px 0px 10px 0px;">
145 ${_('You are not following any users or repositories')}
143 ${_('You are not following any users or repositories')}
146 %endif
144 </div>
147 </table>
145 %endif
148 </div>
146 </div>
147 </div>
148
149 <script type="text/javascript">
149 <script type="text/javascript">
150 YUE.on('show_my','click',function(e){
150 YUE.on('show_my','click',function(e){
151 YUD.setStyle('watched','display','none');
151 YUD.setStyle('watched','display','none');
152 YUD.setStyle('my','display','');
152 YUD.setStyle('my','display','');
153 var nodes = YUQ('#my tr td a.repo_name');
153 var nodes = YUQ('#my tr td a.repo_name');
154 var target = 'q_filter';
154 var target = 'q_filter';
155 var func = function(node){
155 var func = function(node){
156 return node.parentNode.parentNode;
156 return node.parentNode.parentNode;
157 }
157 }
158 q_filter(target,nodes,func);
158 q_filter(target,nodes,func);
159 YUE.preventDefault(e);
159 YUE.preventDefault(e);
160 })
160 })
161 YUE.on('show_watched','click',function(e){
161 YUE.on('show_watched','click',function(e){
162 YUD.setStyle('my','display','none');
162 YUD.setStyle('my','display','none');
163 YUD.setStyle('watched','display','');
163 YUD.setStyle('watched','display','');
164 var nodes = YUQ('#watched .watched_repo a');
164 var nodes = YUQ('#watched .watched_repo a');
165 var target = 'q_filter';
165 var target = 'q_filter';
166 var func = function(node){
166 var func = function(node){
167 return node.parentNode.parentNode;
167 return node.parentNode.parentNode;
168 }
168 }
169 q_filter(target,nodes,func);
169 q_filter(target,nodes,func);
170 YUE.preventDefault(e);
170 YUE.preventDefault(e);
171 })
171 })
172 YUE.on('refresh','click',function(e){
173 ypjax(e.target.href,"journal",function(){show_more_event();tooltip_activate();});
174 YUE.preventDefault(e);
175 })
172 </script>
176 </script>
173 </%def>
177 </%def>
@@ -1,47 +1,49 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 %if c.journal_day_aggreagate:
3 %if c.journal_day_aggreagate:
4 %for day,items in c.journal_day_aggreagate:
4 %for day,items in c.journal_day_aggreagate:
5 <div class="journal_day">${day}</div>
5 <div class="journal_day">${day}</div>
6 % for user,entries in items:
6 % for user,entries in items:
7 <div class="journal_container">
7 <div class="journal_container">
8 <div class="gravatar">
8 <div class="gravatar">
9 <img alt="gravatar" src="${h.gravatar_url(user.email,24)}"/>
9 <img alt="gravatar" src="${h.gravatar_url(user.email,24)}"/>
10 </div>
10 </div>
11 <div class="journal_user">${user.name} ${user.lastname}</div>
11 <div class="journal_user">${user.name} ${user.lastname}</div>
12 <div class="journal_action_container">
12 <div class="journal_action_container">
13 % for entry in entries:
13 % for entry in entries:
14 <div class="journal_icon"> ${h.action_parser_icon(entry)}</div>
14 <div class="journal_icon"> ${h.action_parser_icon(entry)}</div>
15 <div class="journal_action">${h.action_parser(entry)[0]}</div>
15 <div class="journal_action">${h.action_parser(entry)[0]}</div>
16 <div class="journal_repo">
16 <div class="journal_repo">
17 <span class="journal_repo_name">
17 <span class="journal_repo_name">
18 %if entry.repository is not None:
18 %if entry.repository is not None:
19 ${h.link_to(entry.repository.repo_name,
19 ${h.link_to(entry.repository.repo_name,
20 h.url('summary_home',repo_name=entry.repository.repo_name))}
20 h.url('summary_home',repo_name=entry.repository.repo_name))}
21 %else:
21 %else:
22 ${entry.repository_name}
22 ${entry.repository_name}
23 %endif
23 %endif
24 </span>
24 </span>
25 </div>
25 </div>
26 <div class="journal_action_params">${h.literal(h.action_parser(entry)[1]())}</div>
26 <div class="journal_action_params">${h.literal(h.action_parser(entry)[1]())}</div>
27 <div class="date"><span class="tooltip" title="${entry.action_date}">${h.age(entry.action_date)}</span></div>
27 <div class="date"><span class="tooltip" title="${entry.action_date}">${h.age(entry.action_date)}</span></div>
28 %endfor
28 %endfor
29 </div>
29 </div>
30 </div>
30 </div>
31 %endfor
31 %endfor
32 %endfor
32 %endfor
33
33
34 <div class="pagination-wh pagination-left">
34 <div class="pagination-wh pagination-left">
35 <script type="text/javascript">
35 <script type="text/javascript">
36 YUE.onDOMReady(function(){
36 YUE.onDOMReady(function(){
37 YUE.delegate("journal","click",function(e, matchedEl, container){
37 YUE.delegate("journal","click",function(e, matchedEl, container){
38 ypjax(e.target.href,"journal",function(){show_more_event();tooltip_activate();});
38 ypjax(e.target.href,"journal",function(){show_more_event();tooltip_activate();});
39 YUE.preventDefault(e);
39 YUE.preventDefault(e);
40 },'.pager_link');
40 },'.pager_link');
41 });
41 });
42 </script>
42 </script>
43 ${c.journal_pager.pager('$link_previous ~2~ $link_next')}
43 ${c.journal_pager.pager('$link_previous ~2~ $link_next')}
44 </div>
44 </div>
45 %else:
45 %else:
46 ${_('No entries yet')}
46 <div style="padding:5px 0px 10px 10px;">
47 ${_('No entries yet')}
48 </div>
47 %endif No newline at end of file
49 %endif
General Comments 0
You need to be logged in to leave comments. Login now