Changeset - 47c2a006d43b
[Not reviewed]
beta
0 5 0
Marcin Kuzminski - 14 years ago 2011-12-03 03:14:41
marcin@python-works.com
Summary page downloads limited to zip.
- changing url can download also other formats
- just zip is enough for most cases
- looks cleaner
5 files changed with 59 insertions and 40 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/__init__.py
Show inline comments
 
@@ -61,7 +61,8 @@ def init_model(engine):
 

	
 

	
 
class BaseModel(object):
 
    """Base Model for all RhodeCode models, it adds sql alchemy session
 
    """
 
    Base Model for all RhodeCode models, it adds sql alchemy session
 
    into instance of model
 

	
 
    :param sa: If passed it reuses this session instead of creating a new one
rhodecode/model/scm.py
Show inline comments
 
@@ -141,7 +141,7 @@ class ScmModel(BaseModel):
 
            repos_path = self.repos_path
 

	
 
        baseui = make_ui('db')
 
        repos_list = {}
 
        repos = {}
 

	
 
        for name, path in get_filesystem_repos(repos_path, recursive=True):
 

	
 
@@ -150,7 +150,7 @@ class ScmModel(BaseModel):
 
            name = Repository.url_sep().join(name.split(os.sep))
 

	
 
            try:
 
                if name in repos_list:
 
                if name in repos:
 
                    raise RepositoryError('Duplicate repository name %s '
 
                                          'found in %s' % (name, path))
 
                else:
 
@@ -160,15 +160,15 @@ class ScmModel(BaseModel):
 
                    if path[0] == 'hg' and path[0] in BACKENDS.keys():
 

	
 
                        # for mercurial we need to have an str path
 
                        repos_list[name] = klass(safe_str(path[1]),
 
                        repos[name] = klass(safe_str(path[1]),
 
                                                 baseui=baseui)
 

	
 
                    if path[0] == 'git' and path[0] in BACKENDS.keys():
 
                        repos_list[name] = klass(path[1])
 
                        repos[name] = klass(path[1])
 
            except OSError:
 
                continue
 

	
 
        return repos_list
 
        return repos
 

	
 
    def get_repos(self, all_repos=None, sort_key=None):
 
        """
rhodecode/public/css/diff.css
Show inline comments
 
@@ -7,7 +7,7 @@ div.diffblock {
 
    line-height: 100%;
 
    /* new */
 
    line-height: 125%;
 
        -webkit-border-radius: 6px 6px 0px 0px;
 
    -webkit-border-radius: 6px 6px 0px 0px;
 
    -moz-border-radius: 6px 6px 0px 0px;
 
    border-radius: 6px 6px 0px 0px;     
 
}
rhodecode/public/css/style.css
Show inline comments
 
@@ -2154,6 +2154,9 @@ div.browserblock {
 
	font-size: 100%;
 
	line-height: 125%;
 
	padding: 0;
 
    -webkit-border-radius: 6px 6px 0px 0px;
 
    -moz-border-radius: 6px 6px 0px 0px;
 
    border-radius: 6px 6px 0px 0px;	
 
}
 
 
div.browserblock .browser-header {
 
@@ -2715,12 +2718,18 @@ div.gravatar img {
 
	border: 1px solid #316293;
 
}
 
 
.ui-button-small a:hover {
 
input.ui-button-small,
 
.ui-button-small {
 
    background-color: #eedc94;
 
    background-repeat: repeat-x;
 
    background-image: -khtml-gradient(linear, left top, left bottom, from(#F4F4F4),to(#ECECEC) );
 
    background-image: -moz-linear-gradient(top, #F4F4F4, #ECECEC);
 
    background-image: -ms-linear-gradient(top, #F4F4F4, #ECECEC);
 
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #F4F4F4),color-stop(100%, #F4F4F4) );
 
    background-image: -webkit-linear-gradient(top, #F4F4F4, #ECECEC) );
 
    background-image: -o-linear-gradient(top, #F4F4F4, #ECECEC) );
 
    background-image: linear-gradient(top, #F4F4F4, #ECECEC);
 
	
 
}
 
 
input.ui-button-small,.ui-button-small {
 
	background: #e5e3e3 url("../images/button.png") repeat-x !important;
 
	border-top: 1px solid #DDD !important;
 
	border-left: 1px solid #c6c6c6 !important;
 
	border-right: 1px solid #DDD !important;
 
@@ -2737,13 +2746,16 @@ input.ui-button-small,.ui-button-small {
 
	padding: 3px 3px 3px 3px;
 
}
 
 
input.ui-button-small.xsmall,.ui-button-small.xsmall{
 
input.ui-button-small.xsmall,
 
.ui-button-small.xsmall{
 
    padding: 1px 2px 1px 1px;
 
}
 
 
input.ui-button-small:hover,.ui-button-small:hover {
 
	background: #b4b4b4 url("../images/button_selected.png") repeat-x
 
		!important;
 
input.ui-button-small:hover,
 
.ui-button-small:hover,
 
.ui-button-small.xsmall:hover
 
 {
 
	background: #b4b4b4 url("../images/button_selected.png") repeat-x !important;
 
	border-top: 1px solid #ccc !important;
 
	border-left: 1px solid #bebebe !important;
 
	border-right: 1px solid #b1b1b1 !important;
 
@@ -2775,8 +2787,12 @@ 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
 
	{
 
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
 
{
 
	border: none;
 
}
 
 
@@ -2784,19 +2800,27 @@ img.icon,.right .merge img {
 
	vertical-align: bottom;
 
}
 
 
#header ul#logged-user,#content div.box div.title ul.links,#content div.box div.message div.dismiss,#content div.box div.traffic div.legend ul
 
#header ul#logged-user,#content div.box div.title ul.links,
 
#content div.box div.message div.dismiss,
 
#content div.box div.traffic div.legend ul
 
	{
 
	float: right;
 
	margin: 0;
 
	padding: 0;
 
}
 
 
#header #header-inner #home,#header #header-inner #logo,#content div.box ul.left,#content div.box ol.left,#content div.box div.pagination-left,div#commit_history,div#legend_data,div#legend_container,div#legend_choices
 
#header #header-inner #home,#header #header-inner #logo,
 
#content div.box ul.left,#content div.box ol.left,
 
#content div.box div.pagination-left,div#commit_history,
 
div#legend_data,div#legend_container,div#legend_choices
 
	{
 
	float: left;
 
}
 
 
#header #header-inner #quick li:hover ul ul,#header #header-inner #quick li:hover ul ul ul,#header #header-inner #quick li:hover ul ul ul ul,#content #left #menu ul.closed,#content #left #menu li ul.collapsed,.yui-tt-shadow
 
#header #header-inner #quick li:hover ul ul,
 
#header #header-inner #quick li:hover ul ul ul,
 
#header #header-inner #quick li:hover ul ul ul ul,
 
#content #left #menu ul.closed,#content #left #menu li ul.collapsed,.yui-tt-shadow
 
	{
 
	display: none;
 
}
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -155,15 +155,7 @@
 
                    %endif  		          
 
		        %else:
 
			        ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
 
			        %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
 
			             %if cnt >=1:
 
			             |
 
			             %endif
 
			             <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}" 
 
			                  id="${archive['type']+'_link'}">${h.link_to(archive['type'],
 
			                h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
 
			                fname='tip'+archive['extension']),class_="archive_icon")}</span>
 
			        %endfor
 
			             <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-button-small")}</span>
 
                    <span style="vertical-align: bottom">
 
                        <input id="archive_subrepos" type="checkbox" name="subrepos"/> <span class="tooltip" title="${_('Check this to download archive with subrepos')}" >${_('with subrepos')}</span>
 
                    </span>
 
@@ -250,9 +242,7 @@ YUE.on(clone_url,'click',function(e){
 

	
 
var tmpl_links = {};
 
%for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
 
  tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'],
 
       h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
 
       fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_="archive_icon")}';
 
  tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.dbrepo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='archive_icon ui-button-small')}';
 
%endfor
 

	
 
YUE.on(['download_options','archive_subrepos'],'change',function(e){
 
@@ -261,13 +251,17 @@ YUE.on(['download_options','archive_subr
 
   
 
   for(k in tmpl_links){
 
       var s = YUD.get(k+'_link');
 
       title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
 
       s.title = title_tmpl.replace('__CS_NAME__',new_cs.text);
 
       s.title = s.title.replace('__CS_EXT__',k);
 
       var url = tmpl_links[k].replace('__CS__',new_cs.value);
 
       var subrepos = YUD.get('archive_subrepos').checked
 
       url = url.replace('__SUB__',subrepos);
 
       s.innerHTML = url 
 
       if(s){
 
         var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
 
         title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text);
 
         title_tmpl = title_tmpl.replace('__CS_EXT__',k);
 
         
 
         var url = tmpl_links[k].replace('__CS__',new_cs.value);
 
         var subrepos = YUD.get('archive_subrepos').checked;
 
         url = url.replace('__SUB__',subrepos);
 
         url = url.replace('__NAME__',title_tmpl);
 
         s.innerHTML = url
 
       }
 
   }
 
});
 
</script>
0 comments (0 inline, 0 general)