##// END OF EJS Templates
in case of empty directory don't redirect to changelog, it causes an redirection loop
in case of empty directory don't redirect to changelog, it causes an redirection loop

File last commit:

r3776:13241a40 beta
r3794:222e9432 beta
Show More
journal.html
339 lines | 12.1 KiB | text/html | HtmlLexer
fixes for journal, added paging now it's possible to view whole journal...
r995 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
improved title consistency...
r3582 ${_('Journal')} &middot; ${c.rhodecode_name}
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
<%def name="breadcrumbs()">
final implementation of #210 journal filtering.
r3070 <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>
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
<%def name="page_nav()">
Set current pages indication for search and journal
r3208 ${self.menu('journal')}
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
added discoverable rss/atom links in pages
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>
fixes for journal, added paging now it's possible to view whole journal...
r995 <%def name="main()">
White-space cleanup
r1888
fixes for journal, added paging now it's possible to view whole journal...
r995 <div class="box box-left">
Mads Kiilerich
html: don't use tabs
r3197 <!-- box / title -->
<div class="title">
final implementation of #210 journal filtering.
r3070 ${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>
Mads Kiilerich
don't show rss links - atom is the present and the future...
r3295 <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/rss_16.png')}"/></a></span>
final implementation of #210 journal filtering.
r3070 </li>
</ul>
Mads Kiilerich
html: don't use tabs
r3197 </div>
<div id="journal">${c.journal_data}</div>
fixes for journal, added paging now it's possible to view whole journal...
r995 </div>
<div class="box box-right">
<!-- box / title -->
whitespace cleanup
r3168
fixes for journal, added paging now it's possible to view whole journal...
r995 <div class="title">
White-space cleanup
r1888 <h5>
use placeholders in qfilter, not the ugly JS logic
r3665 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/>
<input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/>
personal Journal UI...
r1741 </h5>
Use common function for generation of grid data...
r3154 <ul class="links" style="color:#DADADA">
personal Journal UI...
r1741 <li>
Use common function for generation of grid data...
r3154 <span><a id="show_watched" class="link-white current" href="#watched">${_('Watched')}</a> </span>
</li>
<li>
<span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span>
White-space cleanup
r1888 </li>
</ul>
whitespace cleanup
r3168 </div>
personal Journal UI...
r1741 <!-- end box / title -->
Use common function for generation of grid data...
r3154 <div id="my_container" style="display:none">
<div class="table yui-skin-sam" id="repos_list_wrap"></div>
<div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
fixes for journal, added paging now it's possible to view whole journal...
r995 </div>
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 <div id="watched_container">
<div class="table yui-skin-sam" id="watched_repos_list_wrap"></div>
<div id="watched-user-paginator" style="padding: 0px 0px 0px 20px"></div>
White-space cleanup
r1888 </div>
Journal refresh button
r1746 </div>
White-space cleanup
r1888
personal Journal UI...
r1741 <script type="text/javascript">
white space cleanup
r3149
final implementation of #210 journal filtering.
r3070 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);
});
white space cleanup
r3149 fix_j_filter_width(YUD.get('j_filter').value.length);
Use common function for generation of grid data...
r3154 YUE.on('refresh','click',function(e){
ypjax("${h.url.current(filter=c.search_term)}","journal",function(){
show_more_event();
Lazy loading on my journal page
r2951 tooltip_activate();
Use common function for generation of grid data...
r3154 show_changeset_tooltip();
});
YUE.preventDefault(e);
whitespace cleanup
r3168 });
Use common function for generation of grid data...
r3154 var show_my = function(e){
YUD.setStyle('watched_container','display','none');
YUD.setStyle('my_container','display','');
YUD.setStyle('q_filter','display','');
YUD.setStyle('q_filter_watched','display','none');
whitespace cleanup
r2973
Use common function for generation of grid data...
r3154 YUD.addClass('show_my', 'current');
YUD.removeClass('show_watched','current');
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 if(!YUD.hasClass('show_my', 'loaded')){
table_renderer(${c.data |n});
YUD.addClass('show_my', 'loaded');
}
Lazy loading on my journal page
r2951 }
YUE.on('show_my','click',function(e){
show_my(e);
personal Journal UI...
r1741 })
Lazy loading on my journal page
r2951 var show_watched = function(e){
Mads Kiilerich
html: don't use tabs
r3197 YUD.setStyle('my_container','display','none');
Use common function for generation of grid data...
r3154 YUD.setStyle('watched_container','display','');
YUD.setStyle('q_filter_watched','display','');
YUD.setStyle('q_filter','display','none');
YUD.addClass('show_watched', 'current');
YUD.removeClass('show_my','current');
if(!YUD.hasClass('show_watched', 'loaded')){
Mads Kiilerich
html: don't use tabs
r3197 watched_renderer(${c.watched_data |n});
Use common function for generation of grid data...
r3154 YUD.addClass('show_watched', 'loaded');
whitespace cleanup
r3168 }
Use common function for generation of grid data...
r3154 return
var nodes = YUQ('#watched_container .watched_repo a');
personal Journal UI...
r1741 var target = 'q_filter';
var func = function(node){
return node.parentNode.parentNode;
}
White-space cleanup
r1888 q_filter(target,nodes,func);
Lazy loading on my journal page
r2951 }
YUE.on('show_watched','click',function(e){
show_watched(e);
personal Journal UI...
r1741 })
Lazy loading on my journal page
r2951 //init watched
show_watched();
whitespace cleanup
r2973
Lazy loading on my journal page
r2951 var tabs = {
'watched': show_watched,
'my': show_my,
}
var url = location.href.split('#');
if (url[1]) {
//We have a hash
var tabHash = url[1];
fix small issue with anchor autolinks
r3120 var func = tabs[tabHash]
if (func){
Mads Kiilerich
html: don't use tabs
r3197 func();
fix small issue with anchor autolinks
r3120 }
whitespace cleanup
r2973 }
Use common function for generation of grid data...
r3154 function watched_renderer(data){
var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
whitespace cleanup
r2973
Use common function for generation of grid data...
r3154 myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"menu"},
{key:"raw_name"},
{key:"name"},
{key:"last_changeset"},
{key:"action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
var pos = data[i].raw_name.toLowerCase().indexOf(req)
if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
return res;
}
// 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:"last_changeset",label:"${_('Tip')}",sortable:true,
whitespace cleanup
r3168 sortOptions: { sortFunction: revisionSort }},
Use common function for generation of grid data...
r3154 {key:"action",label:"${_('Action')}",sortable:false},
];
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 var myDataTable = new YAHOO.widget.DataTable("watched_repos_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"name",dir:"asc"},
Unified the paginators for pylons and YUI....
r3776 paginator: YUI_paginator(25, ['watched-user-paginator']),
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 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 filterTimeout = null;
updateFilter = function () {
// Reset timeout
filterTimeout = null;
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 // Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
// Get filtered data
myDataSource.sendRequest(YUD.get('q_filter_watched').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
};
YUE.on('q_filter_watched','click',function(){
if(!YUD.hasClass('q_filter_watched', 'loaded')){
//TODO: load here full list later to do search within groups
YUD.addClass('q_filter_watched', 'loaded');
}
});
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 YUE.on('q_filter_watched','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
});
}
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 function table_renderer(data){
var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"menu"},
{key:"raw_name"},
{key:"name"},
{key:"last_changeset"},
{key:"action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
var pos = data[i].raw_name.toLowerCase().indexOf(req)
if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
return res;
}
// 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:"last_changeset",label:"${_('Tip')}",sortable:true,
whitespace cleanup
r3168 sortOptions: { sortFunction: revisionSort }},
Use common function for generation of grid data...
r3154 {key:"action",label:"${_('Action')}",sortable:false},
];
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"name",dir:"asc"},
Unified the paginators for pylons and YUI....
r3776 paginator: YUI_paginator(25, ['user-paginator']),
Use common function for generation of grid data...
r3154
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 filterTimeout = null;
updateFilter = function () {
// Reset timeout
filterTimeout = null;
// Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
// Get filtered data
myDataSource.sendRequest(YUD.get('q_filter').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
};
YUE.on('q_filter','click',function(){
if(!YUD.hasClass('q_filter', 'loaded')){
//TODO: load here full list later to do search within groups
YUD.addClass('q_filter', 'loaded');
Added sorting into journal and admin pages...
r1779 }
Use common function for generation of grid data...
r3154 });
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 YUE.on('q_filter','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
});
whitespace cleanup
r3168 }
White-space cleanup
r1888 </script>
</%def>