Files
@ b31984972e95
Branch filter:
Location: kallithea/rhodecode/templates/journal/journal.html
b31984972e95
9.3 KiB
text/html
Migration upgrades cache for lightweight dashboard
Fixed some migration issues
Fixed some migration issues
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${_('Journal')} - ${c.rhodecode_name}
</%def>
<%def name="breadcrumbs()">
<h5>
<form id="filter_form">
<input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/>
<span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span>
<input type='submit' value="${_('filter')}" class="ui-btn" style="padding:0px 2px 0px 2px;margin:0px"/>
${_('journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
</form>
${h.end_form()}
</h5>
</%def>
<%def name="page_nav()">
${self.menu('home')}
</%def>
<%def name="head_extra()">
<link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
<link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
</%def>
<%def name="main()">
<div class="box box-left">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
<ul class="links">
<li>
<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>
</li>
<li>
<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>
</li>
<li>
<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>
</li>
</ul>
</div>
<div id="journal">${c.journal_data}</div>
</div>
<div class="box box-right">
<!-- box / title -->
<div class="title">
<h5>
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
<a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a> / <a id="show_my" class="link-white" href="#my">${_('My repos')}</a>
</h5>
%if h.HasPermissionAny('hg.admin','hg.create.repository')():
<ul class="links">
<li>
<span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span>
</li>
</ul>
%endif
</div>
<!-- end box / title -->
<div id="my" class="table" style="display:none">
## loaded via AJAX
${_('Loading...')}
</div>
<div id="watched" class="table">
%if c.following:
<table>
<thead>
<tr>
<th class="left">${_('Name')}</th>
</thead>
<tbody>
%for entry in c.following:
<tr>
<td>
%if entry.follows_user_id:
<img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
${entry.follows_user.full_contact}
%endif
%if entry.follows_repo_id:
<div style="float:right;padding-right:5px">
<span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}"
onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')">
</span>
</div>
%if h.is_hg(entry.follows_repository):
<img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
%elif h.is_git(entry.follows_repository):
<img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
%endif
%if entry.follows_repository.private and c.visual.show_private_icon:
<img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
%elif not entry.follows_repository.private and c.visual.show_public_icon:
<img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
%endif
<span class="watched_repo">
${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
</span>
%endif
</td>
</tr>
%endfor
</tbody>
</table>
%else:
<div style="padding:5px 0px 10px 0px;">
${_('You are not following any users or repositories')}
</div>
%endif
</div>
</div>
<script type="text/javascript">
YUE.on('j_filter','click',function(){
var jfilter = YUD.get('j_filter');
if(YUD.hasClass(jfilter, 'initial')){
jfilter.value = '';
}
});
var fix_j_filter_width = function(len){
YUD.setStyle(YUD.get('j_filter'),'width',Math.max(80, len*6.50)+'px');
}
YUE.on('j_filter','keyup',function(){
fix_j_filter_width(YUD.get('j_filter').value.length);
});
YUE.on('filter_form','submit',function(e){
YUE.preventDefault(e)
var val = YUD.get('j_filter').value;
window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val);
});
fix_j_filter_width(YUD.get('j_filter').value.length);
var show_my = function(e){
YUD.setStyle('watched','display','none');
YUD.setStyle('my','display','');
var url = "${h.url('admin_settings_my_repos')}";
ypjax(url, 'my', function(){
tooltip_activate();
quick_repo_menu();
var nodes = YUQ('#my tr td a.repo_name');
var func = function(node){
return node.parentNode.parentNode.parentNode;
}
q_filter('q_filter',nodes,func);
});
}
YUE.on('show_my','click',function(e){
show_my(e);
})
var show_watched = function(e){
YUD.setStyle('my','display','none');
YUD.setStyle('watched','display','');
var nodes = YUQ('#watched .watched_repo a');
var target = 'q_filter';
var func = function(node){
return node.parentNode.parentNode;
}
q_filter(target,nodes,func);
}
YUE.on('show_watched','click',function(e){
show_watched(e);
})
//init watched
show_watched();
var tabs = {
'watched': show_watched,
'my': show_my,
}
var url = location.href.split('#');
if (url[1]) {
//We have a hash
var tabHash = url[1];
var func = tabs[tabHash]
if (func){
func();
}
}
YUE.on('refresh','click',function(e){
ypjax("${h.url.current(filter=c.search_term)}","journal",function(){
show_more_event();
tooltip_activate();
show_changeset_tooltip();
});
YUE.preventDefault(e);
});
// main table sorting
var myColumnDefs = [
{key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
{key:"name",label:"${_('Name')}",sortable:true,
sortOptions: { sortFunction: nameSort }},
{key:"tip",label:"${_('Tip')}",sortable:true,
sortOptions: { sortFunction: revisionSort }},
{key:"action1",label:"",sortable:false},
{key:"action2",label:"",sortable:false},
];
var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
myDataSource.responseSchema = {
fields: [
{key:"menu"},
{key:"name"},
{key:"tip"},
{key:"action1"},
{key:"action2"}
]
};
var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,
{
sortedBy:{key:"name",dir:"asc"},
MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
tooltip_activate();
quick_repo_menu();
var func = function(node){
return node.parentNode.parentNode.parentNode.parentNode;
}
q_filter('q_filter',YUQ('#my tr td a.repo_name'),func);
});
</script>
</%def>
|