Changeset - 962f753552cd
[Not reviewed]
Mads Kiilerich - 11 years ago 2014-07-03 01:03:22
madski@unity3d.com
old style: don't reserve space for icons - they will have take the space they need
3 files changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -181,172 +181,171 @@ ul#context-actions {
 
    margin: 0px;
 
    height: auto;
 
    padding: 10px 10px 10px 30px;
 
    background-repeat: no-repeat;
 
    background-position: 10px 50%;
 
    font-size: 1em;
 
}
 

	
 
#context-actions a {
 
    padding: 11px 10px 12px 30px;
 
}
 

	
 
#header #header-inner #quick li:hover,
 
#revision-changer:hover,
 
#context-pages li:hover,
 
#context-actions li:hover,
 
#content #context-actions li:hover,
 
#header #header-inner #quick li.current,
 
#context-pages li.current {
 
    background: #6388ad; /* Old browsers */
 
    background: -moz-linear-gradient(top, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* FF3.6+ */
 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
 
    background: -webkit-linear-gradient(top, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* Chrome10+,Safari5.1+ */
 
    background: -o-linear-gradient(top, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* Opera 11.10+ */
 
    background: -ms-linear-gradient(top, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* IE10+ */
 
    background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* W3C */
 
    /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#88bfe8', endColorstr='#70b0e0',GradientType=0 ); /* IE6-9 */*/
 
}
 

	
 

	
 
#content #context-actions li:first-child {
 
    border-left: none;
 
    border-radius: 4px 0 0px 4px;
 
}
 

	
 
#content #context-actions li:last-child {
 
    border-right: none;
 
    border-radius: 0 4px 4px 0;
 
}
 

	
 
#content #context-actions .icon {
 
    margin: auto;
 
    margin-bottom: 5px;
 
    display: block;
 
    clear: both;
 
    float: none;
 
}
 

	
 
#content #context-pages .follow .show-following,
 
#content #context-pages .following .show-follow {
 
    display: none;
 
}
 

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

	
 
#context-pages li.current {
 
    background: #535353; /* Old browsers */
 
    background: -moz-linear-gradient(top, #5d5d5d 0%, #484848 100%); /* FF3.6+ */
 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5d5d5d), color-stop(100%,#484848)); /* Chrome,Safari4+ */
 
    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 */
 
}
 

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

	
 
#header #header-inner #quick li,
 
#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;
 
}
 

	
 
#header #header-inner #quick li:last-child,
 
#content #context-pages li:last-child {
 
    border-right: none;
 
}
 

	
 
#header #header-inner #quick > li:first-child {
 
    border-left: none;
 
}
 

	
 
#header #header-inner #quick > li:first-child > a {
 
    border-radius: 4px 0 0 4px;
 
}
 

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

	
 
#header #header-inner #quick a.thin,
 
#context-pages a.thin,
 
#context-pages .admin_menu a.thin {
 
    line-height: 28px !important;
 
}
 

	
 
#header #header-inner #quick a#quick_login_link {
 
    padding-left: 0px;
 
}
 

	
 
#header #header-inner #quick a {
 
    overflow: hidden;
 
}
 
#quick a.childs:after,
 
#revision-changer:before,
 
#context-pages a.childs:after,
 
#context-pages a.dropdown:after {
 
    content: ' \25BE';
 
}
 
#context-pages a.childs {
 
    padding-right: 30px;
 
}
 
#context-pages a.childs:after {
 
    position: absolute;
 
    float: right;
 
    padding-left: 5px;
 
    padding-right: 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;
 
}
 

	
 
#context-pages li:last-child a {
 
    padding-right: 10px;
 
}
 

	
 
#context-bar #revision-changer {
 
    position: relative;
 
    cursor: pointer;
 
    border: none;
 
    padding: 0;
 
    margin: 0;
 
    color: #FFFFFF;
 
    font-size: 0.85em;
 
    padding: 2px 15px;
 
    padding-bottom: 3px;
 
    padding-right: 30px;
 
    border-right: 1px solid rgba(255,255,255,0.1);
 
}
 

	
 
#revision-changer .branch-name,
 
#revision-changer .revision {
 
    display: block;
 
    text-align: center;
 
    line-height: 1.5em;
 
}
 

	
 
#revision-changer .branch-name {
 
    font-weight: bold;
 
}
 

	
 
#revision-changer .revision {
 
    text-transform: uppercase;
 
}
rhodecode/public/css/style.css
Show inline comments
 
@@ -902,201 +902,196 @@ tbody .yui-dt-editable { cursor: pointer
 
}
 
.yui-skin-sam .yui-dt-paginator .yui-dt-first,
 
.yui-skin-sam .yui-dt-paginator .yui-dt-last,
 
.yui-skin-sam .yui-dt-paginator .yui-dt-selected { padding: 2px 6px }
 
.yui-skin-sam .yui-dt-paginator a.yui-dt-first,
 
.yui-skin-sam .yui-dt-paginator a.yui-dt-last { text-decoration: none }
 
.yui-skin-sam .yui-dt-paginator .yui-dt-previous,
 
.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;
 
    background: #fff;
 
    margin: 0 0 10px;
 
    padding: 0 0 10px;
 
    -webkit-border-radius: 4px 4px 4px 4px;
 
    -khtml-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;
 
}
 

	
 
#content div.box div.title {
 
    clear: both;
 
    overflow: hidden;
 
    background-color: #003B76;
 
    background-repeat: repeat-x;
 
    background-image: -khtml-gradient(linear, left top, left bottom, from(#003B76), to(#00376E) );
 
    background-image: -moz-linear-gradient(top, #003b76, #00376e);
 
    background-image: -ms-linear-gradient(top, #003b76, #00376e);
 
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76), color-stop(100%, #00376e) );
 
    background-image: -webkit-linear-gradient(top, #003b76, #00376e);
 
    background-image: -o-linear-gradient(top, #003b76, #00376e);
 
    background-image: linear-gradient(to bottom, #003b76, #00376e);
 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76', endColorstr='#00376e', GradientType=0 );
 
    margin: 0 0 20px;
 
    padding: 0;
 
    border-radius: 4px 4px 0 0;
 
}
 

	
 
#content div.box div.title h5 {
 
    float: left;
 
    border: none;
 
    color: #fff;
 
    margin: 0;
 
    padding: 11px 0 11px 10px;
 
}
 

	
 
#content div.box div.title .link-white {
 
    color: #FFFFFF;
 
}
 

	
 
#content div.box div.title .link-white.current {
 
    color: #BFE3FF;
 
}
 

	
 
#content div.box div.title ul.links li {
 
    list-style: none;
 
    float: left;
 
    margin: 0;
 
    padding: 0;
 
}
 

	
 
#content div.box div.title ul.links li a {
 
    border-left: 1px solid #316293;
 
    color: #FFFFFF;
 
    display: block;
 
    float: left;
 
    font-size: 13px;
 
    font-weight: 700;
 
    height: 1%;
 
    margin: 0;
 
    padding: 11px 22px 12px;
 
    margin: 4px;
 
    text-decoration: none;
 
}
 

	
 
#content div.box h1, #content div.box h2, #content div.box h3, #content div.box h4, #content div.box h5, #content div.box h6,
 
#content div.box div.h1, #content div.box div.h2, #content div.box div.h3, #content div.box div.h4, #content div.box div.h5, #content div.box div.h6 {
 
    clear: both;
 
    overflow: hidden;
 
    margin: 8px 20px 5px;
 
}
 

	
 
#content div.box p {
 
    color: #5f5f5f;
 
    font-size: 12px;
 
    line-height: 150%;
 
    margin: 0 24px 10px;
 
    padding: 0;
 
}
 

	
 
#content div.box blockquote {
 
    border-left: 4px solid #DDD;
 
    color: #5f5f5f;
 
    font-size: 11px;
 
    line-height: 150%;
 
    margin: 0 34px;
 
    padding: 0 0 0 14px;
 
}
 

	
 
#content div.box blockquote p {
 
    margin: 10px 0;
 
    padding: 0;
 
}
 

	
 
#content div.box dl {
 
    margin: 10px 0px;
 
}
 

	
 
#content div.box dt {
 
    font-size: 12px;
 
    margin: 0;
 
}
 

	
 
#content div.box dd {
 
    font-size: 12px;
 
    margin: 0;
 
    padding: 8px 0 8px 15px;
 
}
 

	
 
#content div.box li {
 
    font-size: 12px;
 
    padding: 4px 0;
 
}
 

	
 
#content div.box ul.disc, #content div.box ul.circle {
 
    margin: 10px 24px 10px 38px;
 
}
 

	
 
#content div.box ul.square {
 
    margin: 10px 24px 10px 40px;
 
}
 

	
 
#content div.box img.left {
 
    border: none;
 
    float: left;
 
    margin: 10px 10px 10px 0;
 
}
 

	
 
#content div.box img.right {
 
    border: none;
 
    float: right;
 
    margin: 10px 0 10px 10px;
 
}
 

	
 
#content div.box div.messages {
 
    clear: both;
 
    overflow: hidden;
 
    margin: 0 20px;
 
    padding: 0;
 
}
 

	
 
#content div.box div.message {
 
    clear: both;
 
    overflow: hidden;
 
    margin: 0;
 
    padding: 5px 0;
 
    white-space: pre-wrap;
 
}
 
#content div.box div.expand {
 
    width: 110%;
 
    height: 14px;
 
    font-size: 10px;
 
    text-align: center;
 
    cursor: pointer;
 
    color: #666;
 

	
 
    background: -webkit-gradient(linear,0% 50%,100% 50%,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(64,96,128,0.1)));
 
    background: -webkit-linear-gradient(top,rgba(255,255,255,0),rgba(64,96,128,0.1));
 
@@ -1648,193 +1643,193 @@ div.form div.fields div.field div.button
 
}
 

	
 
#content div.box div.pagination-wh a:hover, #content div.box div.pagination-wh a:active {
 
    background: #b4b4b4 url("../images/pager_selected.png") repeat-x;
 
    border-top: 1px solid #ccc;
 
    border-left: 1px solid #bebebe;
 
    border-bottom: 1px solid #afafaf;
 
    text-decoration: none;
 
}
 

	
 
#content div.box div.traffic div.legend {
 
    clear: both;
 
    overflow: hidden;
 
    border-bottom: 1px solid #ddd;
 
    margin: 0 0 10px;
 
    padding: 0 0 10px;
 
}
 

	
 
#content div.box div.traffic div.legend h6 {
 
    float: left;
 
    border: none;
 
    margin: 0;
 
    padding: 0;
 
}
 

	
 
#content div.box div.traffic div.legend li {
 
    list-style: none;
 
    float: left;
 
    font-size: 11px;
 
    margin: 0;
 
    padding: 0 8px 0 4px;
 
}
 

	
 
#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;
 
}
 

	
 
#content div.box #summary {
 
    margin-right: 200px;
 
}
 

	
 
#summary-menu-stats {
 
    float: left;
 
    width: 180px;
 
    position: absolute;
 
    top: 0;
 
    right: 0;
 
}
 

	
 
#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;
 
    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;
 
    padding: 12px 30px;
 
    padding: 12px 10px;
 
    background-repeat: no-repeat;
 
    background-position: 10px 50%;
 
    padding-right: 10px;
 
}
 

	
 
#repo_size_2.loaded {
 
    margin-left: 30px;
 
    display: block;
 
    padding-right: 10px;
 
    padding-bottom: 7px;
 
}
 

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

	
 
#summary-menu-stats a span {
 
    background-color: #DEDEDE;
 
    color: #888 !important;
 
    border-radius: 4px;
 
    padding: 2px 4px;
 
    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;
 
}
 

	
 
.metatag {
 
    display: inline-block;
 
    margin-right: 1px;
 
    -webkit-border-radius: 4px 4px 4px 4px;
 
    -khtml-border-radius: 4px 4px 4px 4px;
 
    border-radius: 4px 4px 4px 4px;
 

	
 
    border: solid 1px #9CF;
 
    padding: 2px 3px 2px 3px !important;
 
    background-color: #DEF;
 
}
 

	
 
.metatag[tag="dead"] {
 
    background-color: #E44;
 
}
 

	
 
.metatag[tag="stale"] {
 
    background-color: #EA4;
 
}
 

	
 
.metatag[tag="featured"] {
 
    background-color: #AEA;
 
}
 

	
 
.metatag[tag="requires"] {
 
    background-color: #9CF;
 
}
 

	
 
.metatag[tag="recommends"] {
 
    background-color: #BDF;
 
}
 

	
 
.metatag[tag="lang"] {
 
    background-color: #FAF474;
 
}
 

	
 
.metatag[tag="license"] {
 
    border: solid 1px #9CF;
 
    background-color: #DEF;
 
    target-new: tab !important;
 
}
 
.metatag[tag="see"] {
 
    border: solid 1px #CBD;
 
    background-color: #EDF;
 
}
 

	
 
a.metatag[tag="license"]:hover {
 
    background-color: #003367;
 
    color: #FFF;
 
    text-decoration: none;
 
@@ -4906,96 +4901,100 @@ table.code-difftable .add {
 
table.code-difftable .add ins {
 
    background: none repeat scroll 0 0 #AAFFAA;
 
    text-decoration: none;
 
}
 
table.code-difftable .del {
 
    background: none repeat scroll 0 0 #FFDDDD;
 
}
 
table.code-difftable .del del {
 
    background: none repeat scroll 0 0 #FFAAAA;
 
    text-decoration: none;
 
}
 

	
 
/** LINE NUMBERS **/
 
table.code-difftable .lineno {
 

	
 
    padding-left: 2px;
 
    padding-right: 2px;
 
    text-align: right;
 
    width: 32px;
 
    -moz-user-select: none;
 
    -webkit-user-select: none;
 
    border-right: 1px solid #CCC !important;
 
    border-left: 0px solid #CCC !important;
 
    border-top: 0px solid #CCC !important;
 
    border-bottom: none !important;
 
    vertical-align: middle !important;
 

	
 
}
 
table.code-difftable .lineno.new {
 
}
 
table.code-difftable .lineno.old {
 
}
 
table.code-difftable .lineno a {
 
    color: #747474 !important;
 
    font: 11px "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace !important;
 
    letter-spacing: -1px;
 
    text-align: right;
 
    padding-right: 2px;
 
    cursor: pointer;
 
    display: block;
 
    width: 32px;
 
}
 

	
 
table.code-difftable .lineno-inline {
 
    background: none repeat scroll 0 0 #FFF !important;
 
    padding-left: 2px;
 
    padding-right: 2px;
 
    text-align: right;
 
    width: 30px;
 
    -moz-user-select: none;
 
    -webkit-user-select: none;
 
}
 

	
 
/** CODE **/
 
table.code-difftable .code {
 
    display: block;
 
    width: 100%;
 
}
 
table.code-difftable .code td {
 
    margin: 0;
 
    padding: 0;
 
}
 
table.code-difftable .code pre {
 
    margin: 0;
 
    padding: 0;
 
    height: 17px;
 
    line-height: 17px;
 
}
 

	
 

	
 
.diffblock.margined.comm .line .code:hover {
 
    background-color: #FFFFCC !important;
 
    cursor: pointer !important;
 
    background-image: url("../images/icons/comment_add.png") !important;
 
    background-repeat: no-repeat !important;
 
    background-position: right !important;
 
    background-position: 0% 50% !important;
 
}
 
.diffblock.margined.comm .line .code.no-comment:hover {
 
    background-image: none !important;
 
    cursor: auto !important;
 
    background-color: inherit !important;
 
}
 

	
 
div.comment:target>.comment-wrapp {
 
    border: solid 2px #ee0 !important;
 
}
 

	
 
.lineno:target a {
 
    border: solid 2px #ee0 !important;
 
    margin: -2px;
 
}
 

	
 
#help_kb {
 
    display: none;
 
}
 

	
 
.repo-switcher-dropdown .select2-result-label span.repo-icons {
 
    margin-left: -12px;
 
}
rhodecode/templates/base/base.html
Show inline comments
 
@@ -272,204 +272,206 @@
 
            ${h.end_form()}
 
        %else:
 
            <div class="links_left">
 
                <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
 
                <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
 
                <div class="email">${c.rhodecode_user.email}</div>
 
            </div>
 
            <div class="links_right">
 
            <ol class="links">
 
              <li><a href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a></li>
 
              <li>${h.link_to(_(u'My account'),h.url('my_account'))}</li>
 
              <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
 
            </ol>
 
            </div>
 
        %endif
 
      </div>
 
  </div>
 

	
 
    </li>
 
</%def>
 

	
 
<%def name="menu(current=None)">
 
        <%
 
        def is_current(selected):
 
            if selected == current:
 
                return h.literal('class="current"')
 
        %>
 
        <ul id="quick" class="horizontal-list">
 
          <!-- repo switcher -->
 
          <li ${is_current('repositories')}>
 
            <input id="repo_switcher" name="repo_switcher" type="hidden">
 
          </li>
 

	
 
          ##ROOT MENU
 
          %if c.rhodecode_user.username != 'default':
 
            <li ${is_current('journal')}>
 
              <a class="menu_link" title="${_('Show recent activity')}"  href="${h.url('journal')}">
 
                <i class="icon-book"></i> ${_('Journal')}
 
              </a>
 
            </li>
 
          %else:
 
            <li ${is_current('journal')}>
 
              <a class="menu_link" title="${_('Public journal')}"  href="${h.url('public_journal')}">
 
                <i class="icon-book"></i> ${_('Public journal')}
 
              </a>
 
            </li>
 
          %endif
 
            <li ${is_current('gists')}>
 
              <a class="menu_link childs" title="${_('Show public gists')}"  href="${h.url('gists')}">
 
                <i class="icon-file-2"></i> ${_('Gists')}
 
              </a>
 
                <ul class="admin_menu">
 
                  <li><a href="${h.url('new_gist', public=1)}"><i class="icon-file-alt"></i> ${_('Create new gist')}</a></li>
 
                  <li><a href="${h.url('gists')}"><i class="icon-copy"></i> ${_('All public gists')}</a></li>
 
                  %if c.rhodecode_user.username != 'default':
 
                    <li><a href="${h.url('gists', public=1)}"><i class="icon-copy"></i> ${_('My public gists')}</a></li>
 
                    <li><a href="${h.url('gists', private=1)}"><i class="icon-file-text"></i> ${_('My private gists')}</a></li>
 
                  %endif
 
                </ul>
 
            </li>
 
          <li ${is_current('search')}>
 
              <a class="menu_link" title="${_('Search in repositories')}"  href="${h.url('search')}">
 
                <i class="icon-search"></i> ${_('Search')}
 
              </a>
 
          </li>
 
          % if h.HasPermissionAll('hg.admin')('access admin main page'):
 
            <li ${is_current('admin')}>
 
              <a class="menu_link childs" title="${_('Admin')}" href="${h.url('admin_home')}">
 
                <i class="icon-cog"></i> ${_('Admin')}
 
              </a>
 
              ${admin_menu()}
 
            </li>
 
          % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
 
          <li ${is_current('admin')}>
 
              <a class="menu_link childs" title="${_('Admin')}">
 
                <i class="icon-cog"></i> ${_('Admin')}
 
              </a>
 
              ${admin_menu_simple(c.rhodecode_user.repositories_admin,
 
                                  c.rhodecode_user.repository_groups_admin,
 
                                  c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
 
          </li>
 
          % endif
 
          ${usermenu()}
 

	
 
    <script type="text/javascript">
 
        var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
 
        var cache = {}
 
        /*format the look of items in the list*/
 
        var format = function(state){
 
            if (!state.id){
 
              return state.text; // optgroup
 
            }
 
            var obj_dict = state.obj;
 
            var tmpl = '';
 

	
 
            if(obj_dict && state.type == 'repo'){
 
                tmpl += '<span class="repo-icons">';
 
                if(obj_dict['repo_type'] === 'hg'){
 
                    tmpl += '<i class="icon-hg"></i> ';
 
                }
 
                else if(obj_dict['repo_type'] === 'git'){
 
                    tmpl += '<i class="icon-git"></i> ';
 
                }
 
                if(obj_dict['private']){
 
                    tmpl += '<i class="icon-lock" style="color: #e85634;"></i> ';
 
                }
 
                else if(visual_show_public_icon){
 
                    tmpl += '<i class="icon-unlock-alt"></i> ';
 
                }
 
                tmpl += '</span>';
 
            }
 
            if(obj_dict && state.type == 'group'){
 
                    tmpl += '<i class="icon-folder-close"></i> ';
 
            }
 
            tmpl += state.text;
 
            return tmpl;
 
        }
 

	
 
        $("#repo_switcher").select2({
 
            placeholder: '<i class="icon-archive"></i> ${_('Repositories')} <i class="icon-caret-down"></i>',
 
            dropdownAutoWidth: true,
 
            formatResult: format,
 
            formatSelection: format,
 
            formatNoMatches: function(term){
 
                return "${_('No matches found')}";
 
            },
 
            containerCssClass: "repo-switcher",
 
            dropdownCssClass: "repo-switcher-dropdown",
 
            escapeMarkup: function(m){
 
                // don't escape our custom placeholder
 
                if(m.substr(0,28) == '<i class="icon-archive"></i>'){
 
                    return m;
 
                }
 

	
 
                return Select2.util.escapeMarkup(m);
 
            },
 
            query: function(query){
 
              var key = 'cache';
 
              var cached = cache[key] ;
 
              if(cached) {
 
                var data = {results: []};
 
                //filter results
 
                $.each(cached.results, function(){
 
                    var section = this.text;
 
                    var children = [];
 
                    $.each(this.children, function(){
 
                        if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
 
                            children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj})
 
                        }
 
                    })
 
                    if(children.length !== 0){
 
                        data.results.push({'text': section, 'children': children})
 
                    }
 

	
 
                });
 
                query.callback(data);
 
              }else{
 
                  $.ajax({
 
                    url: "${h.url('repo_switcher_data')}",
 
                    data: {},
 
                    dataType: 'json',
 
                    type: 'GET',
 
                    success: function(data) {
 
                      cache[key] = data;
 
                      query.callback({results: data.results});
 
                    }
 
                  })
 
              }
 
            },
 
        });
 

	
 
        $("#repo_switcher").on('select2-selecting', function(e){
 
            e.preventDefault();
 
            window.location = pyroutes.url('summary_home', {'repo_name': e.val})
 
        })
 

	
 
        ## Global mouse bindings ##
 

	
 
        // general help "?"
 
        Mousetrap.bind(['?'], function(e) {
 
            $('#help_kb').modal({})
 
        });
 

	
 
        // / open the quick filter
 
        Mousetrap.bind(['/'], function(e) {
 
            $("#repo_switcher").select2("open");
 

	
 
            // return false to prevent default browser behavior
 
            // and stop event from bubbling
 
            return false;
 
        });
 

	
 
        // ctrl/command+b, show the the main bar
 
        Mousetrap.bind(['command+b', 'ctrl+b'], function(e) {
 
            if($('#header-inner').hasClass('hover') && $('#content').hasClass('hover')){
 
                $('#header-inner').removeClass('hover');
 
                $('#content').removeClass('hover');
 
            }
 
            else{
 
                $('#header-inner').addClass('hover');
 
                $('#content').addClass('hover');
 
            }
 
            return false;
 
        });
 

	
 
        // general nav g + action
0 comments (0 inline, 0 general)