[PATCH] Issue #126: Improve UX for setting a remote repo

Mads Kiilerich mads at kiilerich.com
Wed Apr 22 06:52:59 EDT 2015


On 04/22/2015 09:55 AM, Ben Finney wrote:
> # HG changeset patch
> # User Ben Finney<ben at benfinney.id.au>
> # Date 1429660546 -36000
> #      Wed Apr 22 09:55:46 2015 +1000
> # Node ID 4c08e06b42f9c085b9d69e81bb219fd1c74fd1b0
> # Parent  4857d8f170d937383b8bde700494320fff80a88f
> Refer to “remote repository” and “clone” consistently in templates.

Thanks for the patch! A couple of comments ...

> diff --git a/kallithea/templates/admin/repos/repo_add_base.html b/kallithea/templates/admin/repos/repo_add_base.html
> --- a/kallithea/templates/admin/repos/repo_add_base.html
> +++ b/kallithea/templates/admin/repos/repo_add_base.html
> @@ -11,7 +11,10 @@
>               <div class="input">
>                   ${h.text('repo_name',class_="small")}
>                   <div style="margin: 6px 0px 0px 0px">
> -                    <a id="remote_clone_toggle" href="#"><i class="icon-download-cloud"></i> ${_('Import existing repository ?')}</a>
> +                    <a id="remote_clone_toggle" href="#">
> +                        <i class="icon-download-cloud"></i>
> +                        ${_('Clone from an existing repository?')}
> +                    </a>
>                   </div>
>                   %if not c.authuser.is_admin:
>                       ${h.hidden('user_created',True)}
> @@ -20,11 +23,13 @@
>            </div>
>           <div id="remote_clone" class="field" style="display: none">
>               <div class="label">
> -                <label for="clone_uri">${_('Clone from')}:</label>
> +                <label for="clone_uri">${_('Clone from remote repo')}:</label>

I don't think the word "repo" is used in other user-facing messages ... 
or it shouldn't. It would be nice to consistently spell it out as 
repository ... unless there are severe spacing constraints...

>               </div>
>               <div class="input">
>                   ${h.text('clone_uri',class_="small")}
> -                <span class="help-block">${_('Optional URL from which repository should be cloned.')}</span>
> +                <span class="help-block">
> +                    ${_('Optional URL of remote repository. If set, this repository will be cloned from remote.')}
> +                </span>
>               </div>
>           </div>
>           <div class="field">
> diff --git a/kallithea/templates/admin/repos/repo_edit_remote.html b/kallithea/templates/admin/repos/repo_edit_remote.html
> --- a/kallithea/templates/admin/repos/repo_edit_remote.html
> +++ b/kallithea/templates/admin/repos/repo_edit_remote.html
> @@ -1,16 +1,22 @@
>   %if c.repo_info.clone_uri:
>   <div style="font-size: 20px; padding: 0px 0px 10px 0px">
> -   ${_('Remote URL')}: <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a></li>
> +   ${_('Remote repo URL')}: <a href="${c.repo_info.clone_uri}">${c.repo_info.clone_uri_hidden}</a></li>
>   </div>
>   ${h.form(url('edit_repo_remote', repo_name=c.repo_name), method='put')}
>   <div class="form">
> -   <div class="fields">
> -       ${h.submit('remote_pull_%s' % c.repo_info.repo_name,_('Pull Changes from Remote Location'),class_="btn btn-small",onclick="return confirm('"+_('Confirm to pull changes from remote side.')+"');")}
> -   </div>
> +    <div class="fields">
> +        ${h.submit(
> +            'remote_pull_%s' % c.repo_info.repo_name,
> +            _('Pull Changes from Remote Repo'),
> +            class_="btn btn-small",
> +            onclick="return confirm('"
> +                + _('Confirm to pull changes from remote repository.')
> +                + "');")}

Let's hope no languages use ' in the translation of that string ;-)

I think the mix of python and javascript would be more readable with a % 
formatter ... and javascript and python are so close that %r might be 
better than manual quoting.

> +    </div>
>   </div>
>   ${h.end_form()}
>   %else:
> -  <div style="font-size: 20px">
> -    ${_('This repository does not have a remote URL set.')}
> -  </div>
> +    <div style="font-size: 20px">
> +        ${_('This repository does not have a remote repository URL.')}
> +    </div>
>   %endif
> diff --git a/kallithea/templates/admin/repos/repo_edit_settings.html b/kallithea/templates/admin/repos/repo_edit_settings.html
> --- a/kallithea/templates/admin/repos/repo_edit_settings.html
> +++ b/kallithea/templates/admin/repos/repo_edit_settings.html
> @@ -34,7 +34,9 @@
>                       ${h.text('clone_uri',class_="medium")}
>                       ${h.hidden('clone_uri_change', 'NEW')}
>                      %endif
> -                 <span id="alter_clone_uri_help_block" class="help-block">${_('URL used for doing remote pulls.')}</span>
> +                  <span id="alter_clone_uri_help_block" class="help-block">
> +                      ${_('Remote repository URL to pull from.')}
> +                  </span>
>                  </div>
>               </div>
>               <div class="field">

/Mads
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20150422/3979cdde/attachment.html>


More information about the kallithea-general mailing list