journal.html
206 lines
| 8.0 KiB
| text/html
|
HtmlLexer
r995 | ## -*- coding: utf-8 -*- | |||
<%inherit file="/base/base.html"/> | ||||
<%def name="title()"> | ||||
${_('Journal')} - ${c.rhodecode_name} | ||||
</%def> | ||||
<%def name="breadcrumbs()"> | ||||
${c.rhodecode_name} | ||||
</%def> | ||||
<%def name="page_nav()"> | ||||
${self.menu('home')} | ||||
</%def> | ||||
r2413 | <%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> | ||||
r995 | <%def name="main()"> | |||
r1888 | ||||
r995 | <div class="box box-left"> | |||
<!-- box / title --> | ||||
<div class="title"> | ||||
<h5>${_('Journal')}</h5> | ||||
r1746 | <ul class="links"> | |||
<li> | ||||
r2397 | <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> | |||
r1888 | </li> | |||
r2397 | <li> | |||
r2412 | <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> | |||
r2397 | </li> | |||
<li> | ||||
r2413 | <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> | |||
r2409 | </li> | |||
r1888 | </ul> | |||
</div> | ||||
r995 | <div id="journal">${c.journal_data}</div> | |||
</div> | ||||
<div class="box box-right"> | ||||
<!-- box / title --> | ||||
<div class="title"> | ||||
r1888 | <h5> | |||
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> | ||||
r2951 | <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a> / <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> | |||
r1741 | </h5> | |||
%if h.HasPermissionAny('hg.admin','hg.create.repository')(): | ||||
<ul class="links"> | ||||
<li> | ||||
r1770 | <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> | |||
r1888 | </li> | |||
</ul> | ||||
%endif | ||||
r1741 | </div> | |||
<!-- end box / title --> | ||||
r2951 | <div id="my" class="table" style="display:none"> | |||
## loaded via AJAX | ||||
${_('Loading...')} | ||||
r995 | </div> | |||
r1888 | ||||
r2951 | <div id="watched" class="table"> | |||
r1741 | %if c.following: | |||
r1746 | <table> | |||
<thead> | ||||
<tr> | ||||
<th class="left">${_('Name')}</th> | ||||
</thead> | ||||
<tbody> | ||||
%for entry in c.following: | ||||
<tr> | ||||
<td> | ||||
r1741 | %if entry.follows_user_id: | |||
<img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/> | ||||
${entry.follows_user.full_contact} | ||||
%endif | ||||
r1888 | ||||
r1741 | %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())}')"> | ||||
r1888 | </span> | |||
r1741 | </div> | |||
r1888 | ||||
r1959 | %if h.is_hg(entry.follows_repository): | |||
r1741 | <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> | |||
r1959 | %elif h.is_git(entry.follows_repository): | |||
r1741 | <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> | |||
r1888 | %endif | |||
r2674 | %if entry.follows_repository.private and c.visual.show_private_icon: | |||
r1741 | <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/> | |||
r2674 | %elif not entry.follows_repository.private and c.visual.show_public_icon: | |||
r1741 | <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 | ||||
r1746 | </td> | |||
</tr> | ||||
%endfor | ||||
</tbody> | ||||
</table> | ||||
r1741 | %else: | |||
r1746 | <div style="padding:5px 0px 10px 0px;"> | |||
r1741 | ${_('You are not following any users or repositories')} | |||
r1746 | </div> | |||
r1888 | %endif | |||
</div> | ||||
r1746 | </div> | |||
r1888 | ||||
r1741 | <script type="text/javascript"> | |||
r2951 | var show_my = function(e){ | |||
r1741 | YUD.setStyle('watched','display','none'); | |||
YUD.setStyle('my','display',''); | ||||
r2951 | ||||
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); | ||||
r1741 | }) | |||
r2951 | var show_watched = function(e){ | |||
YUD.setStyle('my','display','none'); | ||||
r1741 | YUD.setStyle('watched','display',''); | |||
var nodes = YUQ('#watched .watched_repo a'); | ||||
var target = 'q_filter'; | ||||
var func = function(node){ | ||||
return node.parentNode.parentNode; | ||||
} | ||||
r1888 | q_filter(target,nodes,func); | |||
r2951 | } | |||
YUE.on('show_watched','click',function(e){ | ||||
show_watched(e); | ||||
r1741 | }) | |||
r2951 | //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]; | ||||
tabs[tabHash](); | ||||
} | ||||
r1746 | YUE.on('refresh','click',function(e){ | |||
r1748 | ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();}); | |||
r1746 | YUE.preventDefault(e); | |||
r1779 | }); | |||
r1888 | ||||
r1779 | ||||
// 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")); | ||||
r1888 | ||||
r1779 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |||
r1888 | ||||
r1779 | myDataSource.responseSchema = { | |||
fields: [ | ||||
{key:"menu"}, | ||||
{key:"name"}, | ||||
{key:"tip"}, | ||||
{key:"action1"}, | ||||
{key:"action2"} | ||||
] | ||||
}; | ||||
var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource, | ||||
{ | ||||
r1780 | 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.')}", | ||||
r1888 | MSG_LOADING:"${_('Loading...')}", | |||
r1779 | } | |||
); | ||||
myDataTable.subscribe('postRenderEvent',function(oArgs) { | ||||
tooltip_activate(); | ||||
quick_repo_menu(); | ||||
var func = function(node){ | ||||
return node.parentNode.parentNode.parentNode.parentNode; | ||||
r1888 | } | |||
r1779 | q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); | |||
r1888 | }); | |||
</script> | ||||
</%def> | ||||