Changeset - 1c32b72930fa
[Not reviewed]
beta
0 10 0
leonardo - 13 years ago 2013-03-04 18:30:50

Addding context bar to more repo related pages.
Fixing the base template to work on non-repo related pages.
10 files changed with 176 insertions and 132 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/summary.py
Show inline comments
 
@@ -51,50 +51,48 @@ from rhodecode.lib.vcs.backends.base imp
 
from rhodecode.lib.markup_renderer import MarkupRenderer
 
from rhodecode.lib.celerylib import run_task
 
from rhodecode.lib.celerylib.tasks import get_commits_stats
 
from rhodecode.lib.helpers import RepoPage
 
from rhodecode.lib.compat import json, OrderedDict
 
from rhodecode.lib.vcs.nodes import FileNode
 

	
 
log = logging.getLogger(__name__)
 

	
 
README_FILES = [''.join([x[0][0], x[1][0]]) for x in
 
                    sorted(list(product(ALL_READMES, ALL_EXTS)),
 
                           key=lambda y:y[0][1] + y[1][1])]
 

	
 

	
 
class SummaryController(BaseRepoController):
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def __before__(self):
 
        super(SummaryController, self).__before__()
 

	
 
    def index(self, repo_name):
 
        c.dbrepo = dbrepo = c.rhodecode_db_repo
 
        c.following = self.scm_model.is_following_repo(repo_name,
 
                                                self.rhodecode_user.user_id)
 

	
 
        def url_generator(**kw):
 
            return url('shortlog_home', repo_name=repo_name, size=10, **kw)
 

	
 
        c.repo_changesets = RepoPage(c.rhodecode_repo, page=1,
 
                                     items_per_page=10, url=url_generator)
 
        page_revisions = [x.raw_id for x in list(c.repo_changesets)]
 
        c.statuses = c.rhodecode_db_repo.statuses(page_revisions)
 

	
 
        if self.rhodecode_user.username == 'default':
 
            # for default(anonymous) user we don't need to pass credentials
 
            username = ''
 
            password = ''
 
        else:
 
            username = str(self.rhodecode_user.username)
 
            password = '@'
 

	
 
        parsed_url = urlparse(url.current(qualified=True))
 

	
 
        default_clone_uri = '{scheme}://{user}{pass}{netloc}{path}'
 

	
 
        uri_tmpl = config.get('clone_uri', default_clone_uri)
 
        uri_tmpl = uri_tmpl.replace('{', '%(').replace('}', ')s')
 
        decoded_path = safe_unicode(urllib.unquote(parsed_url.path))
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -38,58 +38,59 @@
 

	
 
#content #context-bar,
 
#content #context-bar a,
 
#content #context-bar button {
 
 	color: #FFFFFF;
 
}
 

	
 
#content #context-bar a:hover,
 
#content #context-bar button:hover {
 
 	text-decoration: none;
 
 	color: #bfe3ff;
 
}
 

	
 
#content #context-bar .icon {
 
	display: inline-block;
 
	width: 16px;
 
	height: 16px;
 
	vertical-align: text-bottom;
 
}
 

	
 
ul.horizontal-list {
 
	display: block;
 
/*	overflow: hidden;*/
 
}
 

	
 
ul.horizontal-list > li {
 
	float: left;
 
	padding-right: 5px;
 
	position: relative;
 
}
 

	
 
ul.horizontal-list > li ul {
 
	position: absolute;
 
	display: none;
 
	right: 0;
 
	z-index: 999;
 
}
 

	
 
ul.horizontal-list li:hover > ul {
 
	display: block;
 
}
 

	
 
ul.horizontal-list ul li {
 
	position: relative;
 
	border-bottom: 1px solid rgba(0,0,0,0.1);
 
	border-top: 1px solid rgba(255,255,255,0.1);
 
}
 

	
 
ul.horizontal-list > li ul ul {
 
	position: absolute;
 
	right: 100%;
 
	top: -1px;
 
	min-width: 200px;
 
	max-height: 400px;
 
	overflow-x:hidden;
 
	overflow-y:auto;
 
}
 

	
 
ul.horizontal-list > li a {
 
	white-space: nowrap;
 
@@ -249,49 +250,49 @@ ul#context-actions {
 
	background: -webkit-linear-gradient(top, #5d5d5d 0%, #484848 100%); /* Chrome10+,Safari5.1+ */
 
	background: -o-linear-gradient(top, #5d5d5d 0%, #484848 100%); /* Opera 11.10+ */
 
	background: -ms-linear-gradient(top, #5d5d5d 0%, #484848 100%); /* IE10+ */
 
	background: linear-gradient(to bottom, #5d5d5d 0%, #484848 100%); /* W3C */
 
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5d5d5d', endColorstr='#484848',GradientType=0 ); /* IE6-9 */
 
}
 

	
 
#content #context-pages .icon {
 
	margin-right:5px;
 
}
 

	
 
#content #context-pages li {
 
	border-right: 1px solid rgba(0,0,0,0.1);
 
	border-left: 1px solid rgba(255,255,255,0.1);
 
	padding: 0;
 
}
 

	
 
#content #context-pages li:last-child {
 
	border-right:none;
 
}
 

	
 
#context-pages a, 
 
#context-pages .admin_menu a{
 
	display: block;
 
	padding: 0px 10px;
 
	padding: 0px 10px 1px 30px;
 
	padding-left: 30px;
 
	line-height: 35px;
 
}
 

	
 
#revision-changer:before,
 
#context-pages a.childs:after,
 
#context-pages a.dropdown:after {
 
	content: ' \25BE';
 
}
 
#context-pages a.childs:after{
 
	float: right;
 
	padding-left: 5px;
 
}
 

	
 
#revision-changer:before {
 
	position: absolute;
 
	top: 0px;
 
	right: 0px;
 
	border-right: 1px solid rgba(0,0,0,0.1);
 
	height: 25px;
 
	padding-top: 10px;
 
	padding-right: 10px;
 
}
 

	
rhodecode/public/css/style.css
Show inline comments
 
modified file chmod 100755 => 100644
 
@@ -1069,49 +1069,49 @@ tbody .yui-dt-editable { cursor: pointer
 
.yui-skin-sam .yui-dt-paginator .yui-dt-next { display: none }
 
.yui-skin-sam a.yui-dt-page {
 
    border: 1px solid #cbcbcb;
 
    padding: 2px 6px;
 
    text-decoration: none;
 
    background-color: #fff;
 
}
 
.yui-skin-sam .yui-dt-selected {
 
    border: 1px solid #fff;
 
    background-color: #fff;
 
}
 

	
 
#content #left {
 
    left: 0;
 
    width: 280px;
 
    position: absolute;
 
}
 

	
 
#content #right {
 
    margin: 0 60px 10px 290px;
 
}
 

	
 
#content div.box {
 
    clear: both;
 
    overflow: hidden;
 
/*    overflow: hidden;*/
 
    background: #fff;
 
    margin: 0 0 10px;
 
    padding: 0 0 10px;
 
    -webkit-border-radius: 4px 4px 4px 4px;
 
    -khtml-border-radius: 4px 4px 4px 4px;
 
    -moz-border-radius: 4px 4px 4px 4px;
 
    border-radius: 4px 4px 4px 4px;
 
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
 
}
 

	
 
#content div.box-left {
 
    width: 49%;
 
    clear: none;
 
    float: left;
 
    margin: 0 0 10px;
 
}
 

	
 
#content div.box-right {
 
    width: 49%;
 
    clear: none;
 
    float: right;
 
    margin: 0 0 10px;
 
}
 

	
 
@@ -1840,48 +1840,107 @@ div.form div.fields div.field div.button
 

	
 
#content div.box div.traffic div.legend li.visits {
 
    border-left: 12px solid #edc240;
 
}
 

	
 
#content div.box div.traffic div.legend li.pageviews {
 
    border-left: 12px solid #afd8f8;
 
}
 

	
 
#content div.box div.traffic table {
 
    width: auto;
 
}
 

	
 
#content div.box div.traffic table td {
 
    background: transparent;
 
    border: none;
 
    padding: 2px 3px 3px;
 
}
 

	
 
#content div.box div.traffic table td.legendLabel {
 
    padding: 0 3px 2px;
 
}
 

	
 
#summary {
 
    float: left;
 
    width: 80%;
 
}
 

	
 
#summary-menu-stats{
 
    float: left;
 
    width: 20%;
 
}
 

	
 
#summary-menu-stats ul {
 
    margin: 0 10px;
 
    display: block;
 
    background-color: #f9f9f9;
 
    border: 1px solid #d1d1d1;
 
    border-radius: 4px;
 
}
 

	
 
#content #summary-menu-stats li {
 
    border-top: 1px solid #d1d1d1;
 
    line-height: 32px;
 
    padding: 0;
 
}
 

	
 
#content #summary-menu-stats li:hover {
 
    background: #f0f0f0;
 
}
 

	
 
#content #summary-menu-stats li:first-child {
 
    border-top: none;
 
}
 

	
 
#summary-menu-stats a.followers { background-image: url('../images/icons/heart.png')}
 
#summary-menu-stats a.forks     { background-image: url('../images/icons/arrow_divide.png')}
 
#summary-menu-stats a.settings  { background-image: url('../images/icons/cog_edit.png')}
 
#summary-menu-stats a.feed      { background-image: url('../images/icons/rss_16.png')}
 
#summary-menu-stats a.repo-size { background-image: url('../images/icons/server.png')}
 

	
 
#summary-menu-stats a {
 
    display: block;
 
    color: #000000;
 
    padding: 0 30px;
 
    background-repeat: no-repeat;
 
    background-position: 10px 50%;
 
}
 

	
 
#repo_size_2 {
 
    margin-left: 25px;
 
}
 

	
 
#summary-menu-stats a:hover {
 
    text-decoration: none;
 
}
 

	
 
#summary-menu-stats a span{
 
    background-color: #FFF;
 
    border: 1px inset #f0f0f0;
 
    border-radius:7px;
 
    padding: 1px;
 
    font-size: 10px;
 
}
 

	
 
#summary .metatag {
 
    display: inline-block;
 
    padding: 3px 5px;
 
    margin-bottom: 3px;
 
    margin-right: 1px;
 
    border-radius: 5px;
 
}
 

	
 
#content div.box #summary p {
 
    margin-bottom: -5px;
 
    width: 600px;
 
    white-space: pre-wrap;
 
}
 

	
 
#content div.box #summary p:last-child {
 
    margin-bottom: 9px;
 
}
 

	
 
#content div.box #summary p:first-of-type {
 
    margin-top: 9px;
 
}
 

	
rhodecode/templates/base/base.html
Show inline comments
 
@@ -46,157 +46,159 @@
 
               ${c.rhodecode_version} © 2010-${h.datetime.today().year} by Marcin Kuzminski
 
           </p>
 
       </div>
 
   </div>
 
</div>
 
<!-- END FOOTER -->
 

	
 
### MAKO DEFS ###
 
<%def name="page_nav()">
 
    ${self.menu()}
 
</%def>
 

	
 
<%def name="breadcrumbs()">
 
    <div class="breadcrumbs">
 
    ${self.breadcrumbs_links()}
 
    </div>
 
</%def>
 

	
 
<%def name="context_bar(current=None)">
 
   %if c.repo_name:
 
    ${repo_context_bar(current)}
 
   %endif
 
</%def>
 

	
 
<%def name="admin_menu()">
 
  <ul class="admin_menu">
 
      <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li>
 
      <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
 
      <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
 
      <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
 
      <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
 
      <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
 
      <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
 
      <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li>
 
      <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
 
  </ul>
 
</%def>
 

	
 
<%def name="admin_menu_simple()">
 
  <ul>
 
      <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
 
  </ul>
 
</%def>
 

	
 
<%def name="repo_context_bar(current=None)">
 
  <%
 
      def follow_class():
 
          if c.repository_following:
 
              return h.literal('following')
 
          else:
 
            return h.literal('follow')
 
  %>
 
  <%
 
    def is_current(selected):
 
        if selected == current:
 
            return h.literal('class="current"')
 
    %>
 

	
 
  <!--- CONTEXT BAR -->
 
  <div id="context-bar" class="box">
 
    <div id="context-top">
 
      <div id= "breadcrumbs">
 
        ${h.link_to(_(u'Repositories'),h.url('home'))}
 
        »
 
        ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
      </div>
 
      ## TODO: this check feels wrong, it would be better to have a check for permissions
 
      ## also it feels like a job for the controller
 
      %if c.rhodecode_user.username != 'default':
 
        <ul id="context-actions" class="horizontal-list">
 
          <li>
 
           <button class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');">
 
            <!--span class="icon show-follow follow"></span>
 
            <span class="icon show-following following"></span-->
 
            <span class="show-follow">${_('Follow')}</span>
 
            <span class="show-following">${_('Unfollow')}</span>
 
          </button>
 
          </li>
 
          <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li>
 
          %if h.is_hg(c.rhodecode_repo):
 
          <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Pull Request')}</a></li>
 
          %endif
 
        </ul>
 
      %endif
 
    </div>
 
    <div id="context-state">
 
      <!--button id="revision-changer">
 
        <span class="branch-name">graphics/shader-move</span>
 
        <span class="revision">@73318:8d3d6ee94072</span>
 
      </button-->
 
      &nbsp;
 
      <ul id="context-pages" class="horizontal-list">
 
        <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li>
 
        <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelogs')}</a></li>
 
        <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li>
 
        <li>
 
        <li ${is_current('switch-to')}>
 
          <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a>
 
          <ul id="switch_to_list_2" class="switch_to submenu">
 
            <li><a href="#">${_('loading...')}</a></li>
 
          </ul>
 
        </li>
 
        <li ${is_current('options')}>
 
          <a href="#" class="dropdown options"></span>Options</a>
 
          <ul>
 
             %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
 
               %if h.HasPermissionAll('hg.admin')('access settings on repository'):
 
                   <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
 
               %else:
 
                   <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
 
               %endif
 
             %endif
 
              %if c.rhodecode_db_repo.fork:
 
               <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li>
 
              %endif
 
              <li>${h.link_to(_('lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li>
 
              <li>${h.link_to(_('search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li>
 

	
 
              %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
 
                %if c.rhodecode_db_repo.locked[0]:
 
                  <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
 
                %else:
 
                  <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
 
                %endif
 
              %endif
 

	
 
              % if h.HasPermissionAll('hg.admin')('access admin main page'):
 
                 <li>
 
                   ${h.link_to(_('admin'),h.url('admin_home'),class_='admin childs')}
 
                    <%def name="admin_menu()">
 
                    <ul class="admin_menu">
 
                        <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li>
 
                        <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
 
                        <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
 
                        <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
 
                        <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
 
                        <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
 
                        <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
 
                        <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li>
 
                        <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
 
                    </ul>
 
                    </%def>
 
                    ## ADMIN MENU
 
                    ${admin_menu()}
 
                 </li>
 
              ## if you're a admin of any groups, show admin menu for it
 
              % elif c.rhodecode_user.groups_admin:
 
                 <li>
 
                   ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
 
                    <%def name="admin_menu_simple()">
 
                    <ul>
 
                        <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
 
                    </ul>
 
                    </%def>
 
                    
 
                    ## ADMIN MENU
 
                    ${admin_menu_simple()}
 
                 </li>
 
              % endif
 
             </ul>
 
        </li>
 
        <li ${is_current('showpullrequest')}><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">1</a></li>
 
      </ul>
 
    </div>
 
  </div>
 
  <script type="text/javascript">
 
      YUE.on('branch_tag_switcher_2','mouseover',function(){
 
         var loaded = YUD.hasClass('branch_tag_switcher_2','loaded');
 
         if(!loaded){
 
             YUD.addClass('branch_tag_switcher_2','loaded');
 
             ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2',
 
                 function(o){},
 
                 function(o){YUD.removeClass('branch_tag_switcher_2','loaded');}
 
                 ,null);
 
         }
 
         return false;
 
      });
 
  </script>
 
  <!--- END CONTEXT BAR -->
 
@@ -281,133 +283,98 @@
 
    </li>
 
</%def>
 

	
 
<%def name="menu(current=None)">
 
        <%
 
        def is_current(selected):
 
            if selected == current:
 
                return h.literal('class="current"')
 
        %>
 
        <ul id="quick">
 
          <!-- repo switcher -->
 
          <li ${is_current('home')}>
 
              <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="${h.url('home')}">
 
              <span class="icon">
 
                  <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" />
 
              </span>
 
              <span>${_('Repositories')}</span>
 
              </a>
 
              <ul id="repo_switcher_list" class="repo_switcher">
 
                  <li>
 
                      <a href="#">${_('loading...')}</a>
 
                  </li>
 
              </ul>
 
          </li>
 
        ## we render this menu only not for those pages
 
        %if current not in ['home','admin', 'search', 'journal']:
 
            ##REGULAR MENU
 
            <li>
 
                <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
 
                <span class="icon_short">
 
                    <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" />
 
                </span>
 
                <span id="current_followers_count" class="short">${c.repository_followers}</span>
 
                </a>
 
            </li>
 
            <li>
 
                <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}">
 
                <span class="icon_short">
 
                    <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" />
 
                </span>
 
                <span class="short">${c.repository_forks}</span>
 
                </a>
 
          ##ROOT MENU
 
          %if c.rhodecode_user.username != 'default':
 
            <li ${is_current('journal')}>
 
              <a class="menu_link" title="${_('Show recent activity')}"  href="${h.url('journal')}">
 
              <span class="icon">
 
                  <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
 
              </span>
 
              <span>${_('Journal')}</span>
 
              </a>
 
            </li>
 
            ${usermenu()}
 
            <script type="text/javascript">
 
                YUE.on('branch_tag_switcher','mouseover',function(){
 
                   var loaded = YUD.hasClass('branch_tag_switcher','loaded');
 
                   if(!loaded){
 
                       YUD.addClass('branch_tag_switcher','loaded');
 
                       ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list',
 
                           function(o){},
 
                           function(o){YUD.removeClass('branch_tag_switcher','loaded');}
 
                           ,null);
 
                   }
 
                   return false;
 
                });
 
            </script>
 
        %else:
 
            ##ROOT MENU
 
            %if c.rhodecode_user.username != 'default':
 
             <li ${is_current('journal')}>
 
                <a class="menu_link" title="${_('Show recent activity')}"  href="${h.url('journal')}">
 
                <span class="icon">
 
                    <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
 
          %else:
 
            <li ${is_current('journal')}>
 
              <a class="menu_link" title="${_('Public journal')}"  href="${h.url('public_journal')}">
 
              <span class="icon">
 
                  <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" />
 
              </span>
 
              <span>${_('Public journal')}</span>
 
              </a>
 
            </li>
 
          %endif
 
          <li ${is_current('search')}>
 
              <a class="menu_link" title="${_('Search in repositories')}"  href="${h.url('search')}">
 
              <span class="icon">
 
                  <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
 
              </span>
 
              <span>${_('Search')}</span>
 
              </a>
 
          </li>
 
          % if h.HasPermissionAll('hg.admin')('access admin main page'):
 
            <li ${is_current('admin')}>
 
              <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
 
              <span class="icon">
 
                    <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
 
                </span>
 
                <span>${_('Journal')}</span>
 
                </a>
 
             </li>
 
            %else:
 
             <li ${is_current('journal')}>
 
                <a class="menu_link" title="${_('Public journal')}"  href="${h.url('public_journal')}">
 
                <span class="icon">
 
                    <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" />
 
                </span>
 
                <span>${_('Public journal')}</span>
 
                </a>
 
             </li>
 
            %endif
 
            <li ${is_current('search')}>
 
                <a class="menu_link" title="${_('Search in repositories')}"  href="${h.url('search')}">
 
                <span class="icon">
 
                    <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
 
                </span>
 
                <span>${_('Search')}</span>
 
                </a>
 
                <span>${_('Admin')}</span>
 
              </a>
 
              ${admin_menu()}
 
            </li>
 
            % if h.HasPermissionAll('hg.admin')('access admin main page'):
 
            <li ${is_current('admin')}>
 
               <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
 
               <span class="icon">
 
                   <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
 
               </span>
 
               <span>${_('Admin')}</span>
 
               </a>
 
                ${admin_menu()}
 
            </li>
 
            % elif c.rhodecode_user.groups_admin:
 
            <li ${is_current('admin')}>
 
               <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
 
               <span class="icon">
 
                   <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
 
               </span>
 
               <span>${_('Admin')}</span>
 
               </a>
 
                ${admin_menu_simple()}
 
            </li>
 
            % endif
 
            ${usermenu()}
 
        %endif
 
          % elif c.rhodecode_user.groups_admin:
 
          <li ${is_current('admin')}>
 
              <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
 
                <span class="icon">
 
                    <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
 
                </span>
 
                <span>${_('Admin')}</span>
 
              </a>
 
              ${admin_menu_simple()}
 
          </li>
 
          % endif
 
          ${usermenu()}
 
<script type="text/javascript">
 
    YUE.on('repo_switcher','mouseover',function(){
 
      var target = 'q_filter_rs';
 
      var qfilter_activate = function(){
 
          var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
 
          var func = function(node){
 
              return node.parentNode;
 
          }
 
          q_filter(target,nodes,func);
 
      }
 

	
 
      var loaded = YUD.hasClass('repo_switcher','loaded');
 
      if(!loaded){
 
         YUD.addClass('repo_switcher','loaded');
 
         ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
 
             function(o){qfilter_activate();YUD.get(target).focus()},
 
             function(o){YUD.removeClass('repo_switcher','loaded');}
 
             ,null);
 
      }else{
 
         YUD.get(target).focus();
 
      }
 
      return false;
 
     });
 

	
rhodecode/templates/bookmarks/bookmarks.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Bookmarks') % c.repo_name} - ${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('/'))}
 
    &raquo;
 
    ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
    &raquo;
 
    ${_('bookmarks')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('bookmarks')}
 
</%def>
 
<%def name="main()">
 
<div class="box">
 
${self.context_bar('switch-to')}
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    <div class="table">
 
        <%include file='bookmarks_data.html'/>
 
    </div>
 
</div>
 
<script type="text/javascript">
 

	
 
// main table sorting
 
var myColumnDefs = [
 
    {key:"name",label:"${_('Name')}",sortable:true},
 
    {key:"date",label:"${_('Date')}",sortable:true,
 
        sortOptions: { sortFunction: dateSort }},
 
    {key:"author",label:"${_('Author')}",sortable:true},
 
    {key:"revision",label:"${_('Revision')}",sortable:true,
 
        sortOptions: { sortFunction: revisionSort }},
 
];
 

	
 
var myDataSource = new YAHOO.util.DataSource(YUD.get("bookmarks_data"));
 

	
 
myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
rhodecode/templates/branches/branches.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Branches') % c.repo_name} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    <input class="q_filter_box" id="q_filter_branches" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
 
    ${h.link_to(_(u'Home'),h.url('/'))}
 
    &raquo;
 
    ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
    &raquo;
 
    ${_('branches')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('branches')}
 
</%def>
 

	
 
<%def name="main()">
 
${self.context_bar('switch-to')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    %if c.repo_branches:
 
    <div class="info_box" id="compare_branches" style="clear: both;padding: 10px 19px;vertical-align: right;text-align: right;"><a href="#" class="ui-btn small">${_('Compare branches')}</a></div>
 
    %endif
 
    <div class="table">
 
        <%include file='branches_data.html'/>
 
    </div>
 
</div>
 
<script type="text/javascript">
 
YUE.on('compare_branches','click',function(e){
 
    YUE.preventDefault(e);
 
    var org = YUQ('input[name=compare_org]:checked')[0];
 
    var other = YUQ('input[name=compare_other]:checked')[0];
 

	
 
    if(org && other){
 
        var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref='__ORG__',other_ref_type='branch',other_ref='__OTHER__')}";
 
        var u = compare_url.replace('__ORG__',org.value)
 
                           .replace('__OTHER__',other.value);
 
        window.location=u;
rhodecode/templates/followers/followers.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Followers') % c.repo_name} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(_(u'Home'),h.url('/'))}
 
    &raquo;
 
    ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
    &raquo;
 
    ${_('followers')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('followers')}
 
</%def>
 
<%def name="main()">
 
${self.context_bar('followers')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    <div class="table">
 
        <div id="followers">
 
            ${c.followers_data}
 
        </div>
 
    </div>
 
</div>
 
</%def>
rhodecode/templates/forks/forks.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Forks') % c.repo_name} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(_(u'Home'),h.url('/'))}
 
    &raquo;
 
    ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
    &raquo;
 
    ${_('forks')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('forks')}
 
</%def>
 
<%def name="main()">
 
${self.context_bar('forks')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    <div class="table">
 
        <div id="forks">
 
            ${c.forks_data}
 
        </div>
 
    </div>
 
</div>
 
</%def>
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -23,72 +23,48 @@
 

	
 
<%def name="main()">
 
    ${self.context_bar('summary')}
 
    <%
 
    summary = lambda n:{False:'summary-short'}.get(n)
 
    %>
 
    %if c.show_stats:
 
        <div class="box box-left">
 
    %else:
 
        <div class="box">
 
    %endif
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    <div class="form">
 
      <div id="summary" class="fields">
 

	
 
             <div class="field">
 
              <div class="label-summary">
 
                  <label>${_('Name')}:</label>
 
              </div>
 
              <div class="input ${summary(c.show_stats)}">
 
                  <div style="float:right;padding:5px 0px 0px 5px">
 
                     %if c.rhodecode_user.username != 'default':
 
                      ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='atom_icon')}
 
                     %else:
 
                      ${h.link_to(_('ATOM'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='atom_icon')}
 
                     %endif
 
                  </div>
 
                  %if c.rhodecode_user.username != 'default':
 
                      %if c.following:
 
                      <span id="follow_toggle" class="following tooltip" title="${_('Stop following this repository')}"
 
                            onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
 
                      </span>
 
                      %else:
 
                      <span id="follow_toggle" class="follow tooltip" title="${_('Start following this repository')}"
 
                            onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')">
 
                      </span>
 
                      %endif
 
                      <div style="float:right;padding:0px 0px 0px 0px">
 
                         <span class="reposize tooltip" title="${_('Click to show size of repository')}"
 
                            onclick="javascript:showRepoSize('repo_size','${c.dbrepo.repo_name}','${str(h.get_token())}')">
 
                         </span>
 
                         <span id="repo_size"></span>
 
                      </div>
 
                  %endif:
 

	
 
                   ## locking icon
 
                    %if c.rhodecode_db_repo.enable_locking:
 
                      %if c.rhodecode_db_repo.locked[0]:
 
                        <span class="locking_locked tooltip" title="${_('Repository locked by %s') % h.person_by_id(c.rhodecode_db_repo.locked[0])}"></span>
 
                      %else:
 
                        <span class="locking_unlocked tooltip" title="${_('Repository unlocked')}"></span>
 
                      %endif
 
                    %endif
 
                 ##REPO TYPE
 
                 %if h.is_hg(c.dbrepo):
 
                   <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
 
                 %endif
 
                 %if h.is_git(c.dbrepo):
 
                   <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
 
                 %endif
 

	
 
                 ##PUBLIC/PRIVATE
 
                 %if c.dbrepo.private:
 
                    <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
 
                 %else:
 
                    <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
 
                 %endif
 

	
 
@@ -168,49 +144,87 @@
 
             </div>
 

	
 
             <div class="field">
 
              <div class="label-summary">
 
                  <label>${_('Download')}:</label>
 
              </div>
 
              <div class="input ${summary(c.show_stats)}">
 
                %if len(c.rhodecode_repo.revisions) == 0:
 
                  ${_('There are no downloads yet')}
 
                %elif c.enable_downloads is False:
 
                  ${_('Downloads are disabled for this repository')}
 
                    %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
 
                        ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
                    %endif
 
                %else:
 
                    ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
 
                         <span id="${'zip_link'}">${h.link_to(_('Download as zip'), h.url('files_archive_home',repo_name=c.dbrepo.repo_name,fname='tip.zip'),class_="archive_icon ui-btn")}</span>
 
                    <span style="vertical-align: bottom">
 
                        <input id="archive_subrepos" type="checkbox" name="subrepos" />
 
                        <label for="archive_subrepos" class="tooltip" title="${h.tooltip(_('Check this to download archive with subrepos'))}" >${_('with subrepos')}</label>
 
                    </span>
 
                %endif
 
              </div>
 
             </div>
 
      </div>
 
        </div>
 
        <div id="summary-menu-stats">
 
          <ul>
 
            <li>
 
               <a class="followers" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
 
                <span id="current_followers_count">${c.repository_followers}</span>
 
                ${_('Followes')}
 
              </a>
 
            </li>
 
            <li>
 
              <a class="forks" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}">
 
                <span>${c.repository_forks}</span>
 
                ${_('Forks')}
 
              </a>
 
            </li>
 
            <li>
 
              %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
 
               %if h.HasPermissionAll('hg.admin')('access settings on repository'):
 
                   ${h.link_to(_('Settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}
 
               %else:
 
                   ${h.link_to(_('Settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}
 
               %endif
 
             %endif
 
            </li>
 
            <li>
 
              %if c.rhodecode_user.username != 'default':
 
                ${h.link_to(_('Feed'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='feed')}
 
              %else:
 
                ${h.link_to(_('Feed'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='feed')}
 
              %endif
 
            </li>
 
            %if c.rhodecode_user.username != 'default':
 
            <li>
 
              <a href="#" class="repo-size" onclick="javascript:showRepoSize('repo_size_2','${c.dbrepo.repo_name}','${str(h.get_token())}')">Repository Size</a>
 
              <span id="repo_size_2"></span>
 
            </li>
 
            %endif
 
          </ul>
 
        </div>
 
    </div>
 
</div>
 

	
 
%if c.show_stats:
 
<div class="box box-right"  style="min-height:455px">
 
    <!-- box / title -->
 
    <div class="title">
 
        <h5>${_('Commit activity by day / author')}</h5>
 
    </div>
 

	
 
    <div class="graph">
 
         <div style="padding:0 10px 10px 17px;">
 
         %if c.no_data:
 
           ${c.no_data_msg}
 
           %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
 
                ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
           %endif
 
        %else:
 
            ${_('Stats gathered: ')} ${c.stats_percentage}%
 
        %endif
 
        </div>
 
        <div id="commit_history" style="width:450px;height:300px;float:left"></div>
 
        <div style="clear: both;height: 10px"></div>
 
        <div id="overview" style="width:450px;height:100px;float:left"></div>
rhodecode/templates/tags/tags.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Tags') % c.repo_name} - ${c.rhodecode_name}
 
</%def>
 

	
 

	
 
<%def name="breadcrumbs_links()">
 
    <input class="q_filter_box" id="q_filter_tags" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
 
    ${h.link_to(_(u'Home'),h.url('/'))}
 
    &raquo;
 
    ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
 
    &raquo;
 
    ${_('tags')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('tags')}
 
</%def>
 
<%def name="main()">
 
${self.context_bar('switch-to')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    %if c.repo_tags:
 
    <div class="info_box" id="compare_tags" style="clear: both;padding: 10px 19px;vertical-align: right;text-align: right;"><a href="#" class="ui-btn small">${_('Compare tags')}</a></div>
 
    %endif
 
    <div class="table">
 
        <%include file='tags_data.html'/>
 
    </div>
 
</div>
 
<script type="text/javascript">
 
YUE.on('compare_tags','click',function(e){
 
    YUE.preventDefault(e);
 
    var org = YUQ('input[name=compare_org]:checked')[0];
 
    var other = YUQ('input[name=compare_other]:checked')[0];
 

	
 
    if(org && other){
 
        var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='tag',org_ref='__ORG__',other_ref_type='tag',other_ref='__OTHER__')}";
 
        var u = compare_url.replace('__ORG__',org.value)
 
                           .replace('__OTHER__',other.value);
 
        window.location=u;
0 comments (0 inline, 0 general)