@@ -403,6 +403,9 @@ def make_map(config):
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))
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')
@@ -616,16 +616,24 @@ div.options a {
padding: 12px 9px 7px 24px;
}
#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;
width: 167px;
margin: 0;
#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;
@@ -1084,6 +1092,11 @@ div.options a {
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;
@@ -2089,8 +2102,12 @@ h3.files_location {
border-radius: 3px;
padding-left:4px;
.right .logtags .branchtag a:hover,.logtags .branchtag a{
color: #ffffff;
.right .logtags .branchtag a:hover,.logtags .branchtag a:hover{
text-decoration: none;
.right .logtags .tagtag,.logtags .tagtag {
padding: 1px 3px 2px;
@@ -2104,8 +2121,31 @@ h3.files_location {
-moz-border-radius: 3px;
.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;
font-size: 9.75px;
font-weight: bold;
text-transform: uppercase;
white-space: nowrap;
-webkit-border-radius: 3px;
.right .logbooks .bookbook,.logbooks .bookbook a{
.right .logbooks .bookbook,.logbooks .bookbook a:hover{
div.browserblock {
overflow: hidden;
@@ -63,8 +63,7 @@
</li>
%if c.rhodecode_user.username != 'default':
<li>
<a href="${h.url('journal')}">${_('Journal')}</a>
##(${c.unread_journal}
%endif
%if c.rhodecode_user.username == 'default':
## -*- 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()}
</div>
<!-- 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>
%else:
${_('There are no bookmarks yet')}
@@ -17,7 +17,7 @@
<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>
</ul>
@@ -170,7 +170,7 @@
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();});
@@ -118,23 +118,10 @@
<div class="field">
<div class="label-summary">
<label>${_('Last change')}:</label>
<div class="input ${summary(c.show_stats)}">
<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"/>
@@ -22,4 +22,16 @@
<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')}
<ul>
%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: