Changeset - 7967d00e4692
[Not reviewed]
beta
0 13 0
Mads Kiilerich - 13 years ago 2013-03-19 21:47:34
madski@unity3d.com
Transplanted from: 6be5c256fb9b
Stylistic cleanup - mostly formatting
8 files changed with 3 insertions and 19 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/base.py
Show inline comments
 
@@ -305,25 +305,24 @@ class BaseController(WSGIController):
 

	
 

	
 
class BaseRepoController(BaseController):
 
    """
 
    Base class for controllers responsible for loading all needed data for
 
    repository loaded items are
 

	
 
    c.rhodecode_repo: instance of scm repository
 
    c.rhodecode_db_repo: instance of db
 
    c.repository_followers: number of followers
 
    c.repository_forks: number of forks
 
    c.repository_following: weather the current user is following the current repo
 

	
 
    """
 

	
 
    def __before__(self):
 
        super(BaseRepoController, self).__before__()
 
        if c.repo_name:
 

	
 
            dbr = c.rhodecode_db_repo = Repository.get_by_repo_name(c.repo_name)
 
            c.rhodecode_repo = c.rhodecode_db_repo.scm_instance
 
            # update last change according to VCS data
 
            dbr.update_changeset_cache(dbr.get_changeset())
 
            if c.rhodecode_repo is None:
 
                log.error('%s this repository is present in database but it '
rhodecode/lib/utils2.py
Show inline comments
 
@@ -346,25 +346,24 @@ def engine_from_config(configuration, pr
 
            event.listen(engine, "after_cursor_execute",
 
                         after_cursor_execute)
 

	
 
    return engine
 

	
 

	
 
def age(prevdate, show_short_version=False):
 
    """
 
    turns a datetime into an age string.
 
    If show_short_version is True, then it will generate a not so accurate but shorter string,
 
    example: 2days ago, instead of 2 days and 23 hours ago.
 

	
 

	
 
    :param prevdate: datetime object
 
    :param show_short_version: if it should aproximate the date and return a shorter string
 
    :rtype: unicode
 
    :returns: unicode words describing age
 
    """
 
    now = datetime.datetime.now()
 
    now = now.replace(microsecond=0)
 
    order = ['year', 'month', 'day', 'hour', 'minute', 'second']
 
    deltas = {}
 
    future = False
 

	
 
    if prevdate > now:
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -153,24 +153,25 @@ ul.horizontal-list li a {
 

	
 
#quick a,
 
#context-pages ul ul a {
 
    padding-left: 10px;
 
}
 

	
 
ul#context-actions {
 
    display: inline-block;
 
    float: right;
 
    border-radius: 4px;
 
    background-image: linear-gradient(top, #4574a2 0%, #2f5d8b 100%);
 
}
 

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

	
 
#context-actions button,
 
#context-actions a {
 
    display: block;
 
    cursor: pointer;
 
    background: none;
 
    border: none;
 
@@ -243,25 +244,25 @@ ul#context-actions {
 

	
 
#context-state {
 
    background-color: #336699;
 
    border-top: 1px solid #517da8;
 
    min-height: 36px;
 
}
 

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

	
 
#context-pages li.curreasdnt {
 
#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;
 
}
rhodecode/public/css/style.css
Show inline comments
 
modified file chmod 100644 => 100755
 
@@ -412,25 +412,24 @@ div:hover > a.permalink {
 

	
 
#header #header-inner #quick li span {
 
    display: inline;
 
    margin: 0;
 
}
 

	
 
#header #header-inner #quick li span.normal {
 
    border: none;
 
    padding: 10px 12px 8px;
 
}
 

	
 
#header #header-inner #quick li span.icon {
 

	
 
    border-left: none;
 
    padding-left: 10px ;
 
}
 

	
 
#header #header-inner #quick li span.icon_short {
 
    top: 0;
 
    left: 0;
 
    border-left: none;
 
    border-right: 1px solid #2e5c89;
 
    padding: 8px 6px 4px;
 
}
 

	
 
@@ -1716,25 +1715,24 @@ div.form div.fields div.field div.button
 
#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;
 
    background-repeat: no-repeat;
 
    background-position: 10px 50%;
 
    padding-right: 10px;
 
}
 

	
 

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

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

	
 
#summary-menu-stats a span {
 
@@ -2505,28 +2503,24 @@ h3.files_location {
 
    float: left;
 
    margin: 0px 0px 0px 3px;
 
}
 

	
 
#graph_content #changesets {
 
    table-layout: fixed;
 
    border-collapse: collapse;
 
    border-left: none;
 
    border-right: none;
 
    border-color: #cdcdcd;
 
}
 

	
 
#graph_content .container {
 

	
 
}
 

	
 
#graph_content #changesets td {
 
    overflow: hidden;
 
    text-overflow: ellipsis;
 
    white-space: nowrap;
 
    height: 31px;
 
    border-color: #cdcdcd;
 
    text-align: left;
 
}
 

	
 
#graph_content .container .author {
 
   width: 105px;
 
}
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -567,25 +567,24 @@ var showRepoSize = function(target, repo
 
        YUD.get(target).innerHTML = _TM['Loading ...'];
 
        var url = pyroutes.url('repo_size', {"repo_name":repo_name});
 
        YUC.asyncRequest('POST',url,{
 
            success:function(o){
 
            	YUD.get(target).innerHTML = JSON.parse(o.responseText);
 
            	YUD.addClass(target, 'loaded');
 
            }
 
        },args);    	
 
    }
 
    return false;	
 
}
 

	
 

	
 
/**
 
 * TOOLTIP IMPL.
 
 */
 
YAHOO.namespace('yuitip');
 
YAHOO.yuitip.main = {
 

	
 
	$:			YAHOO.util.Dom.get,
 

	
 
	bgColor:	'#000',
 
	speed:		0.3,
 
	opacity:	0.9,
 
	offset:		[15,15],
rhodecode/templates/base/base.html
Show inline comments
 
@@ -74,25 +74,25 @@
 
      <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li>
 
      <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
 
      <li>${h.link_to(_('user 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>
 
      <li>${h.link_to(_('repository 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')
 
  %>
 
  <%
 
@@ -120,28 +120,24 @@
 
            <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">${_('Create 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-->
 
      <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">${_('Changelog')}</a></li>
 
        <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></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>
rhodecode/templates/base/root.html
Show inline comments
 
@@ -2,25 +2,24 @@
 
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
    <head>
 
        <title>${self.title()}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <meta name="robots" content="index, nofollow"/>
 
        <link rel="icon" href="${h.url('/images/icons/database_gear.png')}" type="image/png" />
 

	
 
        ## CSS ###
 
        <%def name="css()">
 
            <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.rhodecode_version)}" media="screen"/>
 
            <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.rhodecode_version)}"/>
 

	
 
            <link rel="stylesheet" type="text/css" href="${h.url('/css/contextbar.css', ver=c.rhodecode_version)}"/>
 
            ## EXTRA FOR CSS
 
            ${self.css_extra()}
 
        </%def>
 
        <%def name="css_extra()">
 
        </%def>
 

	
 
        ${self.css()}
 

	
 
        %if c.ga_code:
 
        <!-- Analytics -->
 
        <script type="text/javascript">
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -101,25 +101,24 @@ ${self.context_bar('changelog')}
 
                                        <div class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
 
                                            ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
 
                                        </div>
 
                                    %endif
 
                                </div>
 
                            </div>
 
                        </td>
 
                    </tr>
 
                %endfor
 
                </tbody>
 
                </table>
 

	
 

	
 
                <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')}"></script>
 
        <script type="text/javascript">
 
            YAHOO.util.Event.onDOMReady(function(){
 

	
 
                //Monitor range checkboxes and build a link to changesets
 
                //ranges
 
@@ -225,27 +224,25 @@ ${self.context_bar('changelog')}
 
                        window.location = url;
 
                    }else{
 
                        window.location = url_main;
 
                    }
 

	
 
                });
 

	
 
                function set_canvas(width) {
 
                    var c = document.getElementById('graph_nodes');
 
                    var t = document.getElementById('graph_content');
 
                    canvas = document.getElementById('graph_canvas');
 
                    var div_h = t.clientHeight;
 
                    //c.style.height=div_h+'px';
 
                    canvas.setAttribute('height',div_h);
 
                    //c.style.height=width+'px';
 
                    canvas.setAttribute('width',width);
 
                };
 
                var heads = 1;
 
                var line_count = 0;
 
                var jsdata = ${c.jsdata|n};
 

	
 
                for (var i=0;i<jsdata.length;i++) {
 
                    var in_l = jsdata[i][2];
 
                    for (var j in in_l) {
 
                        var m = in_l[j][1];
 
                        if (m > line_count)
 
                            line_count = m;
0 comments (0 inline, 0 general)