diff rhodecode/templates/summary/summary.html @ 945:05b59c48556f beta

fixed error when trying to make download on empty repository
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 16 Jan 2011 12:27:44 +0100
parents bec32ac08c9a
children 72f008ed9b18
line wrap: on
line diff
--- a/rhodecode/templates/summary/summary.html	Fri Jan 14 13:24:00 2011 +0100
+++ b/rhodecode/templates/summary/summary.html	Sun Jan 16 12:27:44 2011 +0100
@@ -128,17 +128,20 @@
 			      <label>${_('Download')}:</label>
 			  </div>
 			  <div class="input-short">
-		        
-		        ${h.select('download_options',c.repo_info.get_changeset().raw_id,c.download_options)}
-		        %for cnt,archive in enumerate(c.repo_info._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.repo_info.name,
-		                fname='tip'+archive['extension']),class_="archive_icon")}</span>
-		        %endfor
+		        %if len(c.repo_info.revisions) == 0:
+		          ${_('There are no downloads yet')}
+		        %else:
+			        ${h.select('download_options',c.repo_info.get_changeset().raw_id,c.download_options)}
+			        %for cnt,archive in enumerate(c.repo_info._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.repo_info.name,
+			                fname='tip'+archive['extension']),class_="archive_icon")}</span>
+			        %endfor
+			    %endif
 			  </div>
 			 </div>
 			 
@@ -268,12 +271,11 @@
     </div>
     
     <div class="table">
-        
          %if c.no_data:
            <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}
            %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
                 [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
-           %endif
+           %endif         
            </div>
         %endif:  
         <div id="commit_history" style="width:460px;height:300px;float:left"></div>