Changeset - cabe887a9829
[Not reviewed]
beta
0 8 0
Marcin Kuzminski - 15 years ago 2011-02-15 18:52:08
marcin@python-works.com
removed obsolete _static flag from url, and fixed urls in webhelpers
8 files changed with 45 insertions and 42 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -403,28 +403,30 @@ email_or_none = lambda x: util.email(x) 
 
person = lambda x: _person(x)
 
short_id = lambda x: x[:12]
 

	
 

	
 
def bool2icon(value):
 
    """Returns True/False values represented as small html image of true/false
 
    icons
 
    
 
    :param value: bool value
 
    """
 

	
 
    if value is True:
 
        return HTML.tag('img', src="/images/icons/accept.png", alt=_('True'))
 
        return HTML.tag('img', src=url("/images/icons/accept.png"),
 
                        alt=_('True'))
 

	
 
    if value is False:
 
        return HTML.tag('img', src="/images/icons/cancel.png", alt=_('False'))
 
        return HTML.tag('img', src=url("/images/icons/cancel.png"),
 
                        alt=_('False'))
 

	
 
    return value
 

	
 

	
 
def action_parser(user_log):
 
    """This helper will map the specified string action into translated
 
    fancy names with icons and links
 
    
 
    :param user_log: user log instance
 
    """
 

	
 
    action = user_log.action
 
@@ -509,39 +511,40 @@ def action_parser(user_log):
 
        action = action + " " + action_str[1]()
 

	
 
    return literal(action)
 

	
 
def action_parser_icon(user_log):
 
    action = user_log.action
 
    action_params = None
 
    x = action.split(':')
 

	
 
    if len(x) > 1:
 
        action, action_params = x
 

	
 
    tmpl = """<img src="/images/icons/%s" alt="%s"/>"""
 
    tmpl = """<img src="%s/%s" alt="%s"/>"""
 
    map = {'user_deleted_repo':'database_delete.png',
 
           'user_created_repo':'database_add.png',
 
           'user_forked_repo':'arrow_divide.png',
 
           'user_updated_repo':'database_edit.png',
 
           'admin_deleted_repo':'database_delete.png',
 
           'admin_created_repo':'database_add.png',
 
           'admin_forked_repo':'arrow_divide.png',
 
           'admin_updated_repo':'database_edit.png',
 
           'push':'script_add.png',
 
           'pull':'down_16.png',
 
           'started_following_repo':'heart_add.png',
 
           'stopped_following_repo':'heart_delete.png',
 
            }
 
    return literal(tmpl % (map.get(action, action), action))
 
    return literal(tmpl % ((url('/images/icons/')),
 
                           map.get(action, action), action))
 

	
 

	
 
#==============================================================================
 
# PERMS
 
#==============================================================================
 
from rhodecode.lib.auth import HasPermissionAny, HasPermissionAll, \
 
HasRepoPermissionAny, HasRepoPermissionAll
 

	
 
#==============================================================================
 
# GRAVATAR URL
 
#==============================================================================
 
import hashlib
rhodecode/public/css/style.css
Show inline comments
 
@@ -302,80 +302,80 @@ padding:0;
 
}
 
 
#header #header-inner #quick li a {
 
top:0;
 
left:0;
 
height:1%;
 
display:block;
 
clear:both;
 
overflow:hidden;
 
color:#FFF;
 
font-weight:700;
 
text-decoration:none;
 
background:#369 url("../../images/quick_l.png") no-repeat top left;
 
background:#369 url("../images/quick_l.png") no-repeat top left;
 
padding:0;
 
}
 
 
#header #header-inner #quick li span.short {
 
padding:9px 6px 8px 6px;
 
}
 
 
#header #header-inner #quick li span {
 
top:0;
 
right:0;
 
height:1%;
 
display:block;
 
float:left;
 
background:url("../../images/quick_r.png") no-repeat top right;
 
background:url("../images/quick_r.png") no-repeat top right;
 
border-left:1px solid #3f6f9f;
 
margin:0;
 
padding:10px 12px 8px 10px;
 
}
 
 
#header #header-inner #quick li span.normal {
 
border:none;
 
padding:10px 12px 8px;
 
}
 
 
#header #header-inner #quick li span.icon {
 
top:0;
 
left:0;
 
border-left:none;
 
background:url("../../images/quick_l.png") no-repeat top left;
 
background:url("../images/quick_l.png") no-repeat top left;
 
border-right:1px solid #2e5c89;
 
padding:8px 8px 4px;
 
}
 
 
#header #header-inner #quick li span.icon_short {
 
top:0;
 
left:0;
 
border-left:none;
 
background:url("../../images/quick_l.png") no-repeat top left;
 
background:url("../images/quick_l.png") no-repeat top left;
 
border-right:1px solid #2e5c89;
 
padding:9px 4px 4px;
 
}
 
 
#header #header-inner #quick li a:hover {
 
background:#4e4e4e url("../../images/quick_l_selected.png") no-repeat top left;
 
background:#4e4e4e url("../images/quick_l_selected.png") no-repeat top left;
 
}
 
 
#header #header-inner #quick li a:hover span {
 
border-left:1px solid #545454;
 
background:url("../../images/quick_r_selected.png") no-repeat top right;
 
background:url("../images/quick_r_selected.png") no-repeat top right;
 
}
 
 
#header #header-inner #quick li a:hover span.icon,#header #header-inner #quick li a:hover span.icon_short {
 
border-left:none;
 
border-right:1px solid #464646;
 
background:url("../../images/quick_l_selected.png") no-repeat top left;
 
background:url("../images/quick_l_selected.png") no-repeat top left;
 
}
 
 
 
#header #header-inner #quick ul {
 
top:29px;
 
right:0;
 
min-width:200px;
 
display:none;
 
position:absolute;
 
background:#FFF;
 
border:1px solid #666;
 
border-top:1px solid #003367;
 
@@ -995,36 +995,36 @@ padding:6px 12px;
 
div.form div.fields div.field div.highlight .ui-state-hover {
 
background:#46a0c1 url("../images/button_highlight_selected.png") repeat-x;
 
border-top:1px solid #78acbf;
 
border-left:1px solid #34819e;
 
border-right:1px solid #35829f;
 
border-bottom:1px solid #257897;
 
color:#FFF;
 
margin:0;
 
padding:6px 12px;
 
}
 
 
#content div.box div.form div.fields div.buttons div.highlight input.ui-button {
 
background:#4e85bb url("../../images/button_highlight.png") repeat-x;
 
background:#4e85bb url("../images/button_highlight.png") repeat-x;
 
border-top:1px solid #5c91a4;
 
border-left:1px solid #2a6f89;
 
border-right:1px solid #2b7089;
 
border-bottom:1px solid #1a6480;
 
color:#fff;
 
margin:0;
 
padding:6px 12px;
 
}
 
 
#content div.box div.form div.fields div.buttons div.highlight input.ui-state-hover {
 
background:#46a0c1 url("../../images/button_highlight_selected.png") repeat-x;
 
background:#46a0c1 url("../images/button_highlight_selected.png") repeat-x;
 
border-top:1px solid #78acbf;
 
border-left:1px solid #34819e;
 
border-right:1px solid #35829f;
 
border-bottom:1px solid #257897;
 
color:#fff;
 
margin:0;
 
padding:6px 12px;
 
}
 
 
#content div.box table {
 
width:100%;
 
border-collapse:collapse;
 
@@ -1283,25 +1283,25 @@ font-weight:700;
 
float:left;
 
padding-left:10px;
 
}
 
#footer div#footer-inner .footer-link a {
 
color:#FFF; 
 
}
 
 
#login div.title {
 
width:420px;
 
clear:both;
 
overflow:hidden;
 
position:relative;
 
background:#003367 url("../../images/header_inner.png") repeat-x;
 
background:#003367 url("../images/header_inner.png") repeat-x;
 
margin:0 auto;
 
padding:0;
 
}
 
 
#login div.inner {
 
width:380px;
 
background:#FFF url("../images/login.png") no-repeat top left;
 
border-top:none;
 
border-bottom:none;
 
margin:0 auto;
 
padding:20px;
 
}
 
@@ -1769,25 +1769,25 @@ margin-left:25px;
 
color:#003367;
 
cursor:pointer;
 
text-decoration:none;
 
}
 
 
#path_unlock {
 
color:red;
 
font-size:1.2em;
 
padding-left:4px;
 
}
 
 
.info_box * {
 
background:url("../../images/pager.png") repeat-x scroll 0 0 #EBEBEB;
 
background:url("../images/pager.png") repeat-x scroll 0 0 #EBEBEB;
 
color:#4A4A4A;
 
font-weight:700;
 
height:1%;
 
display:inline;
 
border-color:#DEDEDE #C4C4C4 #C4C4C4 #CFCFCF;
 
border-style:solid;
 
border-width:1px;
 
padding:4px 6px;
 
}
 
 
.info_box span {
 
margin-left:3px;
 
@@ -2011,66 +2011,66 @@ padding:11px 0 11px 10px;
 
 
.breadcrumbs a {
 
color:#FFF;
 
}
 
 
.flash_msg ul {
 
margin:0;
 
padding:0 0 10px;
 
}
 
 
.error_msg {
 
background-color:#FFCFCF;
 
background-image:url("../../images/icons/error_msg.png");
 
background-image:url("../images/icons/error_msg.png");
 
border:1px solid #FF9595;
 
color:#C30;
 
}
 
 
.warning_msg {
 
background-color:#FFFBCC;
 
background-image:url("../../images/icons/warning_msg.png");
 
background-image:url("../images/icons/warning_msg.png");
 
border:1px solid #FFF35E;
 
color:#C69E00;
 
}
 
 
.success_msg {
 
background-color:#D5FFCF;
 
background-image:url("../../images/icons/success_msg.png");
 
background-image:url("../images/icons/success_msg.png");
 
border:1px solid #97FF88;
 
color:#090;
 
}
 
 
.notice_msg {
 
background-color:#DCE3FF;
 
background-image:url("../../images/icons/notice_msg.png");
 
background-image:url("../images/icons/notice_msg.png");
 
border:1px solid #93A8FF;
 
color:#556CB5;
 
}
 
 
.success_msg,.error_msg,.notice_msg,.warning_msg {
 
background-position:10px center;
 
background-repeat:no-repeat;
 
font-size:12px;
 
font-weight:700;
 
min-height:14px;
 
line-height:14px;
 
margin-bottom:0;
 
margin-top:0;
 
display:block;
 
overflow:auto;
 
padding:6px 10px 6px 40px;
 
}
 
 
#msg_close {
 
background:transparent url("../../icons/cross_grey_small.png") no-repeat scroll 0 0;
 
background:transparent url("../icons/cross_grey_small.png") no-repeat scroll 0 0;
 
cursor:pointer;
 
height:16px;
 
position:absolute;
 
right:5px;
 
top:5px;
 
width:16px;
 
}
 
 
div#legend_container table,div#legend_choices table {
 
width:auto !important;
 
}
 
 
@@ -2102,57 +2102,57 @@ padding:2px 2px 0;
 
#header,#content,#footer {
 
min-width:1024px;
 
}
 
 
#content {
 
min-height:100%;
 
clear:both;
 
overflow:hidden;
 
padding:14px 30px;
 
}
 
 
#content div.box div.title div.search {
 
background:url("../../images/title_link.png") no-repeat top left;
 
background:url("../images/title_link.png") no-repeat top left;
 
border-left:1px solid #316293;
 
}
 
 
#content div.box div.title div.search div.input input {
 
border:1px solid #316293;
 
}
 
 
#content div.box div.title div.search div.button input.ui-button {
 
background:#4e85bb url("../../images/button_highlight.png") repeat-x;
 
background:#4e85bb url("../images/button_highlight.png") repeat-x;
 
border:1px solid #316293;
 
border-left:none;
 
color:#FFF;
 
}
 
 
#content div.box div.title div.search div.button input.ui-state-hover {
 
background:#46a0c1 url("../../images/button_highlight_selected.png") repeat-x;
 
background:#46a0c1 url("../images/button_highlight_selected.png") repeat-x;
 
border:1px solid #316293;
 
border-left:none;
 
color:#FFF;
 
}
 
 
#content div.box div.form div.fields div.field div.highlight .ui-button {
 
background:#4e85bb url("../../images/button_highlight.png") repeat-x;
 
background:#4e85bb url("../images/button_highlight.png") repeat-x;
 
border-top:1px solid #5c91a4;
 
border-left:1px solid #2a6f89;
 
border-right:1px solid #2b7089;
 
border-bottom:1px solid #1a6480;
 
color:#fff;
 
}
 
 
#content div.box div.form div.fields div.field div.highlight .ui-state-hover {
 
background:#46a0c1 url("../../images/button_highlight_selected.png") repeat-x;
 
background:#46a0c1 url("../images/button_highlight_selected.png") repeat-x;
 
border-top:1px solid #78acbf;
 
border-left:1px solid #34819e;
 
border-right:1px solid #35829f;
 
border-bottom:1px solid #257897;
 
color:#fff;
 
}
 
 
ins,div.options a:hover {
 
text-decoration:none;
 
}
 
 
img,#header #header-inner #quick li a:hover span.normal,#header #header-inner #quick li ul li.last,#content div.box div.form div.fields div.field div.textarea table td table td a,#clone_url {
rhodecode/templates/base/base.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
<head>
 
    <title>${next.title()}</title>
 
    <link rel="icon" href="${h.url('/images/icons/database_gear.png',_static=True)}" type="image/png" />
 
    <link rel="icon" href="${h.url('/images/icons/database_gear.png')}" type="image/png" />
 
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
    <meta name="robots" content="index, nofollow"/>
 
    <!-- stylesheets -->
 
    ${self.css()}
 
    <!-- scripts -->
 
    ${self.js()}
 
%if c.ga_code:
 
<script type="text/javascript">
 

	
 
  var _gaq = _gaq || [];
 
  _gaq.push(['_setAccount', '${c.ga_code}']);
 
  _gaq.push(['_trackPageview']);
 
@@ -317,39 +317,39 @@
 
                   </span>
 
                   <span>${_('Admin')}</span>                 
 
                   </a>
 
                    ${admin_menu()}
 
                </li>
 
				%endif
 
			</ul>
 
		%endif    
 
</%def>
 

	
 

	
 
<%def name="css()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/style.css',_static=True)}" media="screen" />
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css',_static=True)}"  />
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/diff.css',_static=True)}"  />
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css')}"  />
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/diff.css')}"  />
 
</%def>
 

	
 
<%def name="js()">
 
##<script type="text/javascript" src="${h.url('/js/yui/utilities/utilities.js',_static=True)}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/container/container.js',_static=True)}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/datasource/datasource.js',_static=True)}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/autocomplete/autocomplete.js',_static=True)}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/selector/selector-min.js',_static=True)}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/utilities/utilities.js')}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/container/container.js')}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/datasource/datasource.js')}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/autocomplete/autocomplete.js')}"></script>
 
##<script type="text/javascript" src="${h.url('/js/yui/selector/selector-min.js')}"></script>
 

	
 
<script type="text/javascript" src="${h.url('/js/yui2a.js',_static=True)}"></script>
 
<!--[if IE]><script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js',_static=True)}"></script><![endif]-->
 
<script type="text/javascript" src="${h.url('/js/yui.flot.js',_static=True)}"></script>
 
<script type="text/javascript" src="${h.url('/js/yui2a.js')}"></script>
 
<!--[if IE]><script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script><![endif]-->
 
<script type="text/javascript" src="${h.url('/js/yui.flot.js')}"></script>
 

	
 
<script type="text/javascript">
 
var base_url  = "${h.url('toggle_following')}";
 
var YUC = YAHOO.util.Connect;
 
var YUD = YAHOO.util.Dom;
 
var YUE = YAHOO.util.Event;
 

	
 
function onSuccess(target){
 
	
 
	var f = YUD.get(target.id);
 
    if(f.getAttribute('class')=='follow'){
 
        f.setAttribute('class','following');
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -92,25 +92,25 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
									%endfor
 
								</span>																	
 
						</div>				
 
					</div>
 
					
 
				%endfor
 
				<div class="pagination-wh pagination-left">
 
					${c.pagination.pager('$link_previous ~2~ $link_next')}
 
				</div>			
 
				</div>
 
			</div>
 
			
 
			<script type="text/javascript" src="${h.url('/js/graph.js',_static=True)}"></script>
 
			<script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
 
			<script type="text/javascript">
 
				YAHOO.util.Event.onDOMReady(function(){
 
					
 
                    //Monitor range checkboxes and build a link to changesets
 
                    //ranges
 
                    var checkboxes = YUD.getElementsByClassName('changeset_range');
 
                    var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
 
                    YUE.on(checkboxes,'click',function(e){      
 
                        var checked_checkboxes = [];
 
                        for (pos in checkboxes){
 
                            if(checkboxes[pos].checked){
 
                                checked_checkboxes.push(checkboxes[pos]);
rhodecode/templates/errors/error_document.html
Show inline comments
 
@@ -2,25 +2,25 @@
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>Error - ${c.error_message}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
	    %if c.redirect_time:
 
	        <meta http-equiv="refresh" content="${c.redirect_time}; url=${c.url_redirect}"/>
 
	    %endif        
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css',_static=True)}" media="screen" />
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
 
	    <style type="text/css">
 
	     #main_div{
 
	       border: 0px solid #000;
 
	       width: 500px;
 
	       margin: auto;
 
	       text-align: center;
 
	       margin-top: 200px;
 
	       font-size: 1.6em;
 
	     }
 
	     .error_message{
 
	        text-align: center;
 
	        color:#003367;
rhodecode/templates/login.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Sign In')} - ${c.rhodecode_name}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/icons/database_gear.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css',_static=True)}" media="screen" />
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
 

	
 
    </head>
 
    <body>
 
<div id="login">
 
            <!-- login -->
 
            <div class="title top-left-rounded-corner top-right-rounded-corner">
 
                <h5>${_('Sign In to')} ${c.rhodecode_name}</h5>
 
            </div>
 
            <div class="inner">            
 
                ${h.form(h.url.current(came_from=c.came_from))}
 
                <div class="form">
 
                    <!-- fields -->
rhodecode/templates/password_reset.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Reset You password')} - ${c.rhodecode_name}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css',_static=True)}" media="screen" />
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
 

	
 
    </head>
 
    <body>
 
		<div id="register">
 
			
 
			<div class="title top-left-rounded-corner top-right-rounded-corner">
 
				<h5>${_('Reset You password to')} ${c.rhodecode_name}</h5>
 
			</div>
 
			<div class="inner">
 
			    ${h.form(url('password_reset'))}
 
			    <div class="form">
 
			        <!-- fields -->
rhodecode/templates/register.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Sign Up')} - ${c.rhodecode_name}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css',_static=True)}" media="screen" />
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
 

	
 
    </head>
 
    <body>
 
		<div id="register">
 
			
 
			<div class="title top-left-rounded-corner top-right-rounded-corner">
 
				<h5>${_('Sign Up to')} ${c.rhodecode_name}</h5>
 
			</div>
 
			<div class="inner">
 
			    ${h.form(url('register'))}
 
			    <div class="form">
 
			        <!-- fields -->
0 comments (0 inline, 0 general)