@@ -394,24 +394,27 @@ def make_map(config):
rmap.connect('summary_home', '/{repo_name:.*}/summary',
controller='summary', conditions=dict(function=check_repo))
rmap.connect('shortlog_home', '/{repo_name:.*}/shortlog',
controller='shortlog', conditions=dict(function=check_repo))
rmap.connect('branches_home', '/{repo_name:.*}/branches',
controller='branches', conditions=dict(function=check_repo))
rmap.connect('tags_home', '/{repo_name:.*}/tags',
controller='tags', conditions=dict(function=check_repo))
rmap.connect('bookmarks_home', '/{repo_name:.*}/bookmarks',
controller='bookmarks', conditions=dict(function=check_repo))
rmap.connect('changelog_home', '/{repo_name:.*}/changelog',
controller='changelog', conditions=dict(function=check_repo))
rmap.connect('changelog_details', '/{repo_name:.*}/changelog_details/{cs}',
controller='changelog', action='changelog_details',
conditions=dict(function=check_repo))
rmap.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
controller='files', revision='tip', f_path='',
rmap.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',
new file 100644
# -*- coding: utf-8 -*-
"""
rhodecode.controllers.bookmarks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bookmarks controller for rhodecode
:created_on: Dec 1, 2011
:author: marcink
:copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
:license: GPLv3, see COPYING for more details.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from pylons import tmpl_context as c
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
from rhodecode.lib.base import BaseRepoController, render
from rhodecode.lib.compat import OrderedDict
log = logging.getLogger(__name__)
class BookmarksController(BaseRepoController):
@LoginRequired()
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
'repository.admin')
def __before__(self):
super(BookmarksController, self).__before__()
def index(self):
c.repo_bookmarks = OrderedDict()
bookmarks = [(name, c.rhodecode_repo.get_changeset(hash_)) for \
name, hash_ in c.rhodecode_repo._repo._bookmarks.items()]
ordered_tags = sorted(bookmarks, key=lambda x: x[1].date, reverse=True)
for name, cs_book in ordered_tags:
c.repo_bookmarks[name] = cs_book
return render('bookmarks/bookmarks.html')
@@ -607,34 +607,42 @@ div.options a {
padding: 12px 9px 7px 24px;
}
#header #header-inner #quick li ul li a.branches,#header #header-inner #quick li ul li a.branches:hover
{
background: #FFF url("../images/icons/arrow_branch.png") no-repeat 4px
9px;
width: 167px;
margin: 0;
#header #header-inner #quick li ul li a.tags,#header #header-inner #quick li ul li a.tags:hover
#header #header-inner #quick li ul li a.tags,
#header #header-inner #quick li ul li a.tags:hover{
background: #FFF url("../images/icons/tag_blue.png") no-repeat 4px 9px;
#header #header-inner #quick li ul li a.admin,#header #header-inner #quick li ul li a.admin:hover
#header #header-inner #quick li ul li a.bookmarks,
#header #header-inner #quick li ul li a.bookmarks:hover{
background: #FFF url("../images/icons/tag_green.png") no-repeat 4px 9px;
#header #header-inner #quick li ul li a.admin,
#header #header-inner #quick li ul li a.admin:hover{
background: #FFF url("../images/icons/cog_edit.png") no-repeat 4px 9px;
.groups_breadcrumbs a {
color: #fff;
.groups_breadcrumbs a:hover {
color: #bfe3ff;
@@ -1075,24 +1083,29 @@ div.options a {
#content div.box div.form div.fields div.field div.input input {
background: #FFF;
border-top: 1px solid #b3b3b3;
border-left: 1px solid #b3b3b3;
border-right: 1px solid #eaeaea;
border-bottom: 1px solid #eaeaea;
color: #000;
font-size: 11px;
padding: 7px 7px 6px;
#content div.box div.form div.fields div.field div.input input#clone_url{
font-size: 16px;
padding: 2px 7px 2px;
#content div.box div.form div.fields div.field div.file input {
background: none repeat scroll 0 0 #FFFFFF;
border-color: #B3B3B3 #EAEAEA #EAEAEA #B3B3B3;
border-style: solid;
border-width: 1px;
color: #000000;
#content div.box div.form div.fields div.field div.input input.small {
@@ -2080,41 +2093,68 @@ h3.files_location {
padding: 1px 3px 2px;
background-color: #bfbfbf;
font-size: 9.75px;
font-weight: bold;
color: #ffffff;
text-transform: uppercase;
white-space: nowrap;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding-left:4px;
.right .logtags .branchtag a:hover,.logtags .branchtag a{
.right .logtags .branchtag a:hover,.logtags .branchtag a:hover{
text-decoration: none;
.right .logtags .tagtag,.logtags .tagtag {
background-color: #62cffc;
.right .logtags .tagtag a:hover,.logtags .tagtag a{
.right .logtags .tagtag a:hover,.logtags .tagtag a:hover{
.right .logbooks .bookbook,.logbooks .bookbook {
background-color: #46A546;
.right .logbooks .bookbook,.logbooks .bookbook a{
.right .logbooks .bookbook,.logbooks .bookbook a:hover{
div.browserblock {
overflow: hidden;
border: 1px solid #ccc;
background: #f8f8f8;
font-size: 100%;
line-height: 125%;
padding: 0;
div.browserblock .browser-header {
@@ -54,26 +54,25 @@
</div>
<div class="notifications">
<a href="${h.url('notifications')}">${c.unread_notifications}</a>
%endif
</li>
<li>
<a href="${h.url('home')}">${_('Home')}</a>
%if c.rhodecode_user.username != 'default':
<a href="${h.url('journal')}">${_('Journal')}</a>
##(${c.unread_journal}
%if c.rhodecode_user.username == 'default':
<li class="last highlight">${h.link_to(_(u'Login'),h.url('login_home'),id='quick_login_link')}</li>
%else:
<li class="last highlight">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
</ul>
<!-- end user -->
<div id="header-inner" class="title">
<div id="logo">
<h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${c.repo_name} ${_('Bookmarks')} - ${c.rhodecode_name}
</%def>
<%def name="breadcrumbs_links()">
<input class="q_filter_box" id="q_filter_bookmarks" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
${h.link_to(u'Home',h.url('/'))}
»
${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
${_('bookmarks')}
<%def name="page_nav()">
${self.menu('bookmarks')}
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
<!-- end box / title -->
<div class="table">
<%include file='bookmarks_data.html'/>
<script type="text/javascript">
var nodes = YUQ('div.table tr td .logtags .tagtag a');
var target = 'q_filter_bookmarks';
var func = function(node){
return node.parentNode.parentNode.parentNode.parentNode;
q_filter(target,nodes,func);
</script>
\ No newline at end of file
%if c.repo_bookmarks:
<table>
<tr>
<th class="left">${_('date')}</th>
<th class="left">${_('name')}</th>
<th class="left">${_('author')}</th>
<th class="left">${_('revision')}</th>
<th class="left">${_('links')}</th>
</tr>
%for cnt,book in enumerate(c.repo_bookmarks.items()):
<tr class="parity${cnt%2}">
<td><span class="tooltip" title="${h.age(book[1].date)}">
${book[1].date}</span>
</td>
<td>
<span class="logbooks">
<span class="bookbook">${h.link_to(book[0],
h.url('changeset_home',repo_name=c.repo_name,revision=book[1].raw_id))}</span>
</span>
<td title="${book[1].author}">${h.person(book[1].author)}</td>
<td>r${book[1].revision}:${h.short_id(book[1].raw_id)}</td>
<td class="nowrap">
${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=book[1].raw_id),class_="ui-button-small xsmall")}
<span style="color:#515151">|</span>
${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=book[1].raw_id),class_="ui-button-small xsmall")}
%endfor
</table>
${_('There are no bookmarks yet')}
@@ -8,25 +8,25 @@
${self.menu('home')}
<div class="box box-left">
<h5>${_('Journal')}</h5>
<ul class="links">
<span><a href="#"><img id="refresh" class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/>
<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>
<div id="journal">${c.journal_data}</div>
<div class="box box-right">
<h5>
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
<a id="show_my" class="link-white" href="#my">${_('My repositories')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
@@ -161,17 +161,17 @@
YUE.on('show_watched','click',function(e){
YUD.setStyle('my','display','none');
YUD.setStyle('watched','display','');
var nodes = YUQ('#watched .watched_repo a');
var target = 'q_filter';
return node.parentNode.parentNode;
YUE.preventDefault(e);
})
YUE.on('refresh','click',function(e){
ypjax(e.target.href,"journal",function(){show_more_event();tooltip_activate();});
ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();});
@@ -109,41 +109,28 @@
<div class="input ${summary(c.show_stats)}">
<div class="gravatar">
<img alt="gravatar" src="${h.gravatar_url(c.dbrepo.user.email)}"/>
${_('Username')}: ${c.dbrepo.user.username}<br/>
${_('Name')}: ${c.dbrepo.user.name} ${c.dbrepo.user.lastname}<br/>
${_('Email')}: <a href="mailto:${c.dbrepo.user.email}">${c.dbrepo.user.email}</a>
<div class="field">
<div class="label-summary">
<label>${_('Last change')}:</label>
<b>${'r%s:%s' % (h.get_changeset_safe(c.rhodecode_repo,'tip').revision,
h.get_changeset_safe(c.rhodecode_repo,'tip').short_id)}</b> -
<span class="tooltip" title="${c.rhodecode_repo.last_change}">
${h.age(c.rhodecode_repo.last_change)}</span>
${_('by')} ${h.get_changeset_safe(c.rhodecode_repo,'tip').author}
<label>${_('Clone url')}:</label>
<input type="text" id="clone_url" readonly="readonly" value="${c.rhodecode_repo.alias} clone ${c.clone_repo_url}" size="70"/>
<input type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}" size="70"/>
<label>${_('Trending files')}:</label>
%if c.show_stats:
<div id="lang_stats"></div>
${_('Statistics are disabled for this repository')}
@@ -13,13 +13,25 @@
${h.link_to('%s (%s)' % (_('tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
<ul>
%if c.rhodecode_repo.tags.values():
%for cnt,tag in enumerate(c.rhodecode_repo.tags.items()):
<li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
<li>${h.link_to(_('There are no tags yet'),'#')}</li>
${h.link_to('%s (%s)' % (_('bookmarks'),len(c.rhodecode_repo.bookmarks.values()),),h.url('bookmarks_home',repo_name=c.repo_name),class_='bookmarks childs')}
%if c.rhodecode_repo.bookmarks.values():
%for cnt,book in enumerate(c.rhodecode_repo.bookmarks.items()):
<li>${h.link_to('%s - %s' % (book[0],h.short_id(book[1])),h.url('files_home',repo_name=c.repo_name,revision=book[1]))}</li>
<li>${h.link_to(_('There are no bookmarks yet'),'#')}</li>
Status change: