aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagrande <milo@ubuntu.com>2013-05-30 14:49:56 +0200
committerMilo Casagrande <milo@ubuntu.com>2013-05-31 09:23:16 +0200
commitd885b880ceefa763a2dd21297e2dfeeb26ca202a (patch)
tree67339e8980bb96d52bd7a349d1e563f82110c3c9
parent050c18d3d476ef73e6e8d3615a579e6cc583eadd (diff)
Show a git+ssh clone URL in the git repository summary.linaro
* Two new config field have been added to achieve this: git_ssh_uri - file system path to the repos clone_uri_ssh - how the clone URL is made up * Fixed CSS in order to not show borders on the input fields where the clone URL are shown. * Removed button to show repo ID.
-rw-r--r--production.ini9
-rw-r--r--rhodecode/controllers/summary.py16
-rwxr-xr-xrhodecode/public/css/style.css3
-rw-r--r--rhodecode/templates/summary/summary.html6
4 files changed, 29 insertions, 5 deletions
diff --git a/production.ini b/production.ini
index ac4cf1ea..d7b44666 100644
--- a/production.ini
+++ b/production.ini
@@ -141,6 +141,15 @@ default_encoding = utf8
#clone_uri = {scheme}://{user}{pass}{netloc}{path}
+## Linaro
+## This is necessary to add a second clone URL entry to clone via git+ssh
+
+## This is am easier path to the git repositories, usually a symlink to them.
+git_ssh_uri = /git
+
+## Values here are the same as above
+#clone_uri_ssh = git+ssh://{user}{pass}{netloc}{git_ssh_uri}{path}
+
## issue tracking mapping for commits messages
## comment out issue_pat, issue_server, issue_prefix to enable
diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py
index 25eef9c7..ce924b50 100644
--- a/rhodecode/controllers/summary.py
+++ b/rhodecode/controllers/summary.py
@@ -105,6 +105,22 @@ class SummaryController(BaseRepoController):
'path': urllib.quote(safe_str(decoded_path))
}
+ # Linaro changes:
+ # Needed to show a git+ssh clone URL, since we have that functionality.
+ # Two new config values have been added to the INI file:
+ # git_ssh_uri - path on the file system to easily access the repos
+ # clone_uri_ssh - how the clone URL is made up
+ def_git_ssh_uri = '/git'
+ def_ssh_uri_tmpl = 'git+ssh://{user}{pass}{netloc}{git_ssh_uri}{path}'
+
+ git_ssh_uri = config.get('git_ssh_uri', def_git_ssh_uri)
+ ssh_uri_tmpl = config.get('clone_uri_ssh', def_ssh_uri_tmpl)
+ ssh_uri_tmpl = ssh_uri_tmpl.replace('{', '%(').replace('}', ')s')
+
+ uri_dict['git_ssh_uri'] = safe_unicode(urllib.unquote(git_ssh_uri))
+
+ c.clone_repo_url_ssh = (ssh_uri_tmpl % uri_dict)
+
uri = (uri_tmpl % uri_dict)
# generate another clone url by id
uri_dict.update(
diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css
index 35b41199..78252f73 100755
--- a/rhodecode/public/css/style.css
+++ b/rhodecode/public/css/style.css
@@ -1309,8 +1309,9 @@ tbody .yui-dt-editable { cursor: pointer }
#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;
+ font-size: 14px;
padding: 2px;
+ border: none;
}
#content div.box div.form div.fields div.field div.file input {
diff --git a/rhodecode/templates/summary/summary.html b/rhodecode/templates/summary/summary.html
index 6018ed79..ba225b03 100644
--- a/rhodecode/templates/summary/summary.html
+++ b/rhodecode/templates/summary/summary.html
@@ -131,10 +131,8 @@ ${self.context_bar('summary')}
<label>${_('Clone url')}:</label>
</div>
<div class="input ${summary(c.show_stats)}">
- <input style="width:${'75%' if c.show_stats else '80%'}" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
- <input style="display:none;width:${'75%' if c.show_stats else '80%'}" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/>
- <div style="display:none" id="clone_by_name" class="ui-btn clone">${_('Show by Name')}</div>
- <div id="clone_by_id" class="ui-btn clone">${_('Show by ID')}</div>
+ <input style="width:${'80%' if c.show_stats else '85%'}" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/>
+ <input style="width:${'80%' if c.show_stats else '85%'}" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url_ssh}" />
</div>
</div>