[PATCH] summary: repeat repo type in front of clone URL

Thomas De Schampheleire patrickdepinguin at gmail.com
Mon Apr 6 15:14:53 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1428347105 -7200
#      Mon Apr 06 21:05:05 2015 +0200
# Node ID 3ad9caafab3cb0c2706e65d569ba65b1f1eadbff
# Parent  51478fb28f7f3f4dacc4863765ceeebd35b1e140
summary: repeat repo type in front of clone URL

Repeatedly, users report cloning problems of the Kallithea sources on IRC,
caused by them assuming that it is a Git repository.

Try to solve this problem by repeating the repository tag, indicating 'hg'
or 'git' in front of the clone URL.

Additionally, decrease the font size of the URL a notch, and improve
alignment with the repotag by removing top/bottom padding.

To avoid duplication of the repotag logic, introduce a mako def for it.

diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -1276,8 +1276,8 @@
 #content div.box div.form div.fields div.field div.input input#clone_url,
 #content div.box div.form div.fields div.field div.input input#clone_url_id
 {
-    font-size: 16px;
-    padding: 2px;
+    font-size: 14px;
+    padding: 0 2px;
 }
 
 #content div.box div.form div.fields div.field div.file input {
diff --git a/kallithea/templates/base/base.html b/kallithea/templates/base/base.html
--- a/kallithea/templates/base/base.html
+++ b/kallithea/templates/base/base.html
@@ -85,6 +85,15 @@
   </ul>
 </%def>
 
+<%def name="repotag(repo)">
+  %if h.is_hg(repo):
+    <span class="repotag" title="${_('Mercurial repository')}">hg</span>
+  %endif
+  %if h.is_git(repo):
+    <span class="repotag" title="${_('Git repository')}">git</span>
+  %endif
+</%def>
+
 <%def name="repo_context_bar(current=None, rev=None)">
   <% rev = None if rev == 'tip' else rev %>
   <%
@@ -103,12 +112,7 @@
   <!--- CONTEXT BAR -->
   <div id="context-bar" class="box">
       <h2>
-        %if h.is_hg(c.db_repo):
-          <span class="repotag">hg</span>
-        %endif
-        %if h.is_git(c.db_repo):
-          <span class="repotag">git</span>
-        %endif
+        ${repotag(c.db_repo)}
 
         ## public/private
         %if c.db_repo.private:
diff --git a/kallithea/templates/data_table/_dt_elements.html b/kallithea/templates/data_table/_dt_elements.html
--- a/kallithea/templates/data_table/_dt_elements.html
+++ b/kallithea/templates/data_table/_dt_elements.html
@@ -2,6 +2,8 @@
 ## usage:
 ## <%namespace name="dt" file="/data_table/_dt_elements.html"/>
 
+<%namespace name="base" file="/base/base.html"/>
+
 <%def name="quick_menu(repo_name)">
   <ul class="menu_items hidden">
   ##<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
@@ -63,11 +65,7 @@
     <a href="${h.url('edit_repo' if admin else 'summary_home', repo_name=name)}">
 
     ##TYPE OF REPO
-    %if h.is_hg(rtype):
-        <span class="repotag" title="${_('Mercurial repository')}">hg</span>
-    %elif h.is_git(rtype):
-        <span class="repotag" title="${_('Git repository')}">git</span>
-    %endif
+    ${base.repotag(rtype)}
 
     ##PRIVATE/PUBLIC
     %if private and c.visual.show_private_icon:
diff --git a/kallithea/templates/summary/summary.html b/kallithea/templates/summary/summary.html
--- a/kallithea/templates/summary/summary.html
+++ b/kallithea/templates/summary/summary.html
@@ -72,6 +72,7 @@
                   <label>${_('Clone URL')}:</label>
                 </div>
                 <div class="input ${summary(c.show_stats)}">
+                  ${self.repotag(c.db_repo)}
                   <input style="width:80%" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
                   <input style="display:none;width:80%" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/>
                   <div style="display:none" id="clone_by_name" class="btn btn-small">${_('Show by Name')}</div>


More information about the kallithea-general mailing list