changeset 1304:5a96551ee9c0 beta

gui-improvments
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 02 May 2011 19:07:18 +0200
parents 9773b46e239f
children 166317d464f3
files rhodecode/lib/base.py rhodecode/public/css/style.css rhodecode/templates/changelog/changelog.html rhodecode/templates/files/files_annotate.html rhodecode/templates/files/files_browser.html rhodecode/templates/files/files_source.html rhodecode/templates/forks/forks_data.html
diffstat 7 files changed, 83 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/base.py	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/lib/base.py	Mon May 02 19:07:18 2011 +0200
@@ -2,9 +2,12 @@
 
 Provides the BaseController class for subclassing.
 """
+import copy
+
 from pylons import config, tmpl_context as c, request, session
 from pylons.controllers import WSGIController
 from pylons.templating import render_mako as render
+
 from rhodecode import __version__
 from rhodecode.lib.auth import AuthUser
 from rhodecode.lib.utils import get_repo_slug
@@ -60,12 +63,17 @@
         super(BaseRepoController, self).__before__()
         if c.repo_name:
 
-            c.rhodecode_repo, dbrepo = self.scm_model.get(c.repo_name,
-                                                          retval='repo')
+            r, dbrepo = self.scm_model.get(c.repo_name, retval='repo')
 
-            if c.rhodecode_repo is not None:
+            if r is not None:
                 c.repository_followers = self.scm_model.get_followers(c.repo_name)
                 c.repository_forks = self.scm_model.get_forks(c.repo_name)
             else:
                 c.repository_followers = 0
                 c.repository_forks = 0
+
+            # Since RhodeCode uses heavy memory caching we make a deepcopy
+            # of object taken from cache. This way we lose reference to cached
+            # instance in memory and keep it relatively small even for 
+            # very large number of changesets
+            c.rhodecode_repo = copy.copy(r)
--- a/rhodecode/public/css/style.css	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/public/css/style.css	Mon May 02 19:07:18 2011 +0200
@@ -1717,7 +1717,7 @@
 
 div.browserblock .browser-header {
 background:#FFF;
-padding:10px 0px 35px 0px;
+padding:10px 0px 25px 0px;
 width: 100%;
 }
 div.browserblock .browser-nav {
@@ -1725,16 +1725,16 @@
 }
 
 div.browserblock .browser-branch {
-padding:10px 0 0 0;
 float:left;
 }
+
 div.browserblock .browser-branch label {
 color:#4A4A4A;
 vertical-align:text-top;
 }
 
 div.browserblock .browser-header span {
-margin-left:25px;
+margin-left:5px;
 font-weight:700;
 }
 
@@ -1823,27 +1823,33 @@
 padding-left:4px;
 }
 
-.info_box * {
-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;
 margin-right:3px;
 }
 
-.info_box input#at_rev {
-text-align:center;
-padding:5px 3px 3px 2px;
-}
+.info_box .rev {
+color: #003367;
+font-size: 1.6em;
+font-weight: bold;
+vertical-align: sub;
+}
+
+
+.info_box input#at_rev,.info_box input#size {
+background:#FFF;
+border-top:1px solid #b3b3b3;
+border-left:1px solid #b3b3b3;
+border-right:1px solid #eaeaea;
+border-bottom:1px solid #eaeaea;
+color:#000;
+font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
+font-size:12px;
+margin:0;
+padding:1px 5px 1px;
+}
+
+
 
 .info_box input#view {
 text-align:center;
@@ -2187,6 +2193,21 @@
 color:#FFF;
 }
 
+#content div.box input.ui-button-small {
+background:#e5e3e3 url("../images/button.png") repeat-x;
+border-top:1px solid #DDD;
+border-left:1px solid #c6c6c6;
+border-right:1px solid #DDD;
+border-bottom:1px solid #c6c6c6;
+color:#515151;
+outline:none;
+margin:0;
+}
+
+#content div.box input.ui-button-small submit,button{
+cursor: pointer;
+}
+
 #content div.box div.title div.search div.button input.ui-state-hover {
 background:#46a0c1 url("../images/button_highlight_selected.png") repeat-x;
 border:1px solid #316293;
--- a/rhodecode/templates/changelog/changelog.html	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/templates/changelog/changelog.html	Mon May 02 19:07:18 2011 +0200
@@ -34,11 +34,9 @@
 					<div class="container_header">
 				        ${h.form(h.url.current(),method='get')}
 				        <div class="info_box">
-				          <span>${_('Show')}:</span>
+				          ${h.submit('set',_('Show'),class_="ui-button-small")}
 				          ${h.text('size',size=1,value=c.size)}
-				          <span>${_('revisions')}</span>
-				          ${h.submit('set',_('set'))}
-				          
+				          <span class="rev">${_('revisions')}</span>
 				        </div>
 				        ${h.end_form()}
 					<div id="rev_range_container" style="display:none"></div>
--- a/rhodecode/templates/files/files_annotate.html	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/templates/files/files_annotate.html	Mon May 02 19:07:18 2011 +0200
@@ -51,8 +51,8 @@
 			        ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
 			        ${h.hidden('diff2',c.file.last_changeset.raw_id)}
 			        ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
-			        ${h.submit('diff','diff to revision',class_="ui-button")}
-			        ${h.submit('show_rev','show at revision',class_="ui-button")}
+			        ${h.submit('diff','diff to revision',class_="ui-button-small")}
+			        ${h.submit('show_rev','show at revision',class_="ui-button-small")}
 			        ${h.end_form()}
 			        </div>
 			    </dd>					
--- a/rhodecode/templates/files/files_browser.html	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/templates/files/files_browser.html	Mon May 02 19:07:18 2011 +0200
@@ -10,11 +10,11 @@
 		<div class="browser-nav">
 			${h.form(h.url.current())}
 			<div class="info_box">
-	          <span >${_('view')}@rev</span> 
-	          <a href="${c.url_prev}" title="${_('previous revision')}">&laquo;</a>
+	          <span class="rev">${_('view')}@rev</span> 
+	          <a class="rev" href="${c.url_prev}" title="${_('previous revision')}">&laquo;</a>
 	          ${h.text('at_rev',value=c.changeset.revision,size=3)}
-	          <a href="${c.url_next}" title="${_('next revision')}">&raquo;</a>
-	          ${h.submit('view','view')}
+	          <a class="rev" href="${c.url_next}" title="${_('next revision')}">&raquo;</a>
+	          ## ${h.submit('view',_('view'),class_="ui-button-small")}
 		    </div>           
 			${h.end_form()}
 		</div>
--- a/rhodecode/templates/files/files_source.html	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/templates/files/files_source.html	Mon May 02 19:07:18 2011 +0200
@@ -22,8 +22,8 @@
 		${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
 		${h.hidden('diff2',c.files_list.last_changeset.raw_id)}
 		${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)}
-		${h.submit('diff','diff to revision',class_="ui-button")}
-		${h.submit('show_rev','show at revision',class_="ui-button")}
+		${h.submit('diff','diff to revision',class_="ui-button-small")}
+		${h.submit('show_rev','show at revision',class_="ui-button-small")}
 		${h.end_form()}
 		</div>
 	</dd>
--- a/rhodecode/templates/forks/forks_data.html	Mon May 02 15:01:29 2011 +0200
+++ b/rhodecode/templates/forks/forks_data.html	Mon May 02 19:07:18 2011 +0200
@@ -1,24 +1,27 @@
 ## -*- coding: utf-8 -*-
 
-% for f in c.forks_pager:
-    <div>
-        <div class="fork_user">
-            <div class="gravatar">
-                <img alt="gravatar" src="${h.gravatar_url(f.user.email,24)}"/>
-            </div>
-            <span style="font-size: 20px">
-             <b>${f.user.username}</b> (${f.user.name} ${f.user.lastname}) / 
-              ${h.link_to(f.repo_name,h.url('summary_home',repo_name=f.repo_name))}
-             </span>
-             <div style="padding:5px 3px 3px 42px;">${f.description}</div>
-        </div>
-        <div style="clear:both;padding-top: 10px"></div>
-        <div class="follower_date">${_('forked')} - 
-        <span class="tooltip" title="${f.created_on}"> ${h.age(f.created_on)}</span></div>
-        <div style="border-bottom: 1px solid #DDD;margin:10px 0px 10px 0px"></div>            
-    </div>                
-% endfor 
-
+% if c.forks_pager:
+	% for f in c.forks_pager:
+	    <div>
+	        <div class="fork_user">
+	            <div class="gravatar">
+	                <img alt="gravatar" src="${h.gravatar_url(f.user.email,24)}"/>
+	            </div>
+	            <span style="font-size: 20px">
+	             <b>${f.user.username}</b> (${f.user.name} ${f.user.lastname}) / 
+	              ${h.link_to(f.repo_name,h.url('summary_home',repo_name=f.repo_name))}
+	             </span>
+	             <div style="padding:5px 3px 3px 42px;">${f.description}</div>
+	        </div>
+	        <div style="clear:both;padding-top: 10px"></div>
+	        <div class="follower_date">${_('forked')} - 
+	        <span class="tooltip" title="${f.created_on}"> ${h.age(f.created_on)}</span></div>
+	        <div style="border-bottom: 1px solid #DDD;margin:10px 0px 10px 0px"></div>            
+	    </div>
+	% endfor
+% else:
+	${_('There are no forks yet')} 
+% endif
 <div class="pagination-wh pagination-left">
 <script type="text/javascript">
   var data_div = 'forks';