diff --git a/rhodecode/config/routing.py b/rhodecode/config/routing.py --- a/rhodecode/config/routing.py +++ b/rhodecode/config/routing.py @@ -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)) diff --git a/rhodecode/controllers/bookmarks.py b/rhodecode/controllers/bookmarks.py new file mode 100644 --- /dev/null +++ b/rhodecode/controllers/bookmarks.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.bookmarks + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Bookmarks controller for rhodecode + + :created_on: Dec 1, 2011 + :author: marcink + :copyright: (C) 2009-2011 Marcin Kuzminski + :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 . +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') diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -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; padding: 12px 9px 7px 24px; } -#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; + width: 167px; + margin: 0; + padding: 12px 9px 7px 24px; +} + +#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; width: 167px; margin: 0; @@ -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; + color: #ffffff; } .right .logtags .tagtag,.logtags .tagtag { padding: 1px 3px 2px; @@ -2104,8 +2121,31 @@ h3.files_location { -moz-border-radius: 3px; border-radius: 3px; } +.right .logtags .tagtag a:hover,.logtags .tagtag a{ + color: #ffffff; +} .right .logtags .tagtag a:hover,.logtags .tagtag a:hover{ text-decoration: none; + color: #ffffff; +} +.right .logbooks .bookbook,.logbooks .bookbook { + padding: 1px 3px 2px; + background-color: #46A546; + 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; +} +.right .logbooks .bookbook,.logbooks .bookbook a{ + color: #ffffff; +} +.right .logbooks .bookbook,.logbooks .bookbook a:hover{ + text-decoration: none; + color: #ffffff; } div.browserblock { overflow: hidden; diff --git a/rhodecode/templates/base/base.html b/rhodecode/templates/base/base.html --- a/rhodecode/templates/base/base.html +++ b/rhodecode/templates/base/base.html @@ -63,8 +63,7 @@ %if c.rhodecode_user.username != 'default':
  • - ${_('Journal')} - ##(${c.unread_journal} + ${_('Journal')}
  • %endif %if c.rhodecode_user.username == 'default': diff --git a/rhodecode/templates/bookmarks/bookmarks.html b/rhodecode/templates/bookmarks/bookmarks.html new file mode 100644 --- /dev/null +++ b/rhodecode/templates/bookmarks/bookmarks.html @@ -0,0 +1,40 @@ +## -*- coding: utf-8 -*- +<%inherit file="/base/base.html"/> + +<%def name="title()"> + ${c.repo_name} ${_('Bookmarks')} - ${c.rhodecode_name} + + + +<%def name="breadcrumbs_links()"> + + ${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()"> +
    + +
    + ${self.breadcrumbs()} +
    + +
    + <%include file='bookmarks_data.html'/> +
    +
    + + \ No newline at end of file diff --git a/rhodecode/templates/bookmarks/bookmarks_data.html b/rhodecode/templates/bookmarks/bookmarks_data.html new file mode 100644 --- /dev/null +++ b/rhodecode/templates/bookmarks/bookmarks_data.html @@ -0,0 +1,33 @@ +%if c.repo_bookmarks: + + + + + + + + + %for cnt,book in enumerate(c.repo_bookmarks.items()): + + + + + + + + %endfor +
    ${_('date')}${_('name')}${_('author')}${_('revision')}${_('links')}
    + ${book[1].date} + + + ${h.link_to(book[0], + h.url('changeset_home',repo_name=c.repo_name,revision=book[1].raw_id))} + + ${h.person(book[1].author)}r${book[1].revision}:${h.short_id(book[1].raw_id)} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=book[1].raw_id),class_="ui-button-small xsmall")} + | + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=book[1].raw_id),class_="ui-button-small xsmall")} +
    +%else: + ${_('There are no bookmarks yet')} +%endif \ No newline at end of file diff --git a/rhodecode/templates/journal/journal.html b/rhodecode/templates/journal/journal.html --- a/rhodecode/templates/journal/journal.html +++ b/rhodecode/templates/journal/journal.html @@ -17,7 +17,7 @@
    ${_('Journal')}
    @@ -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();}); YUE.preventDefault(e); }) diff --git a/rhodecode/templates/summary/summary.html b/rhodecode/templates/summary/summary.html --- a/rhodecode/templates/summary/summary.html +++ b/rhodecode/templates/summary/summary.html @@ -118,23 +118,10 @@
    - -
    -
    - ${'r%s:%s' % (h.get_changeset_safe(c.rhodecode_repo,'tip').revision, - h.get_changeset_safe(c.rhodecode_repo,'tip').short_id)} - - - ${h.age(c.rhodecode_repo.last_change)} - ${_('by')} ${h.get_changeset_safe(c.rhodecode_repo,'tip').author} -
    -
    - -
    -
    - +
    diff --git a/rhodecode/templates/switch_to_list.html b/rhodecode/templates/switch_to_list.html --- a/rhodecode/templates/switch_to_list.html +++ b/rhodecode/templates/switch_to_list.html @@ -22,4 +22,16 @@
  • ${h.link_to(_('There are no tags yet'),'#')}
  • %endif + +
  • + ${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()): +
    • ${h.link_to('%s - %s' % (book[0],h.short_id(book[1])),h.url('files_home',repo_name=c.repo_name,revision=book[1]))}
    • + %endfor + %else: +
    • ${h.link_to(_('There are no bookmarks yet'),'#')}
    • + %endif +
  • \ No newline at end of file