[PATCH 4 of 8] admin: e-mail: display settings as read-only input fields

Mads Kiilerich mads at kiilerich.com
Thu Jul 23 12:14:05 UTC 2015


On 07/22/2015 09:50 PM, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
> # Date 1437509310 -7200
> #      Tue Jul 21 22:08:30 2015 +0200
> # Node ID c8e5401db62afbfe417a35b10189bf85aff97726
> # Parent  07fc479b91cef2b8f6240d1b64baabdf3caebdc0
> admin: e-mail: display settings as read-only input fields
>
> Using a definition list to display the e-mail settings has following
> disadvantages:
> - different look&feel than the other admin settings, including the equally
>    read-only hooks page
> - there are only two elements in a definition list (the item and its value)
>    and it is therefore difficult to add more clarification about these items
>
> Instead, follow the same strategy as on the hooks page, showing each setting
> in a read-only text input field.

I think it is a bit confusing that these real-only values look so much 
like the only actual input field on the same page. Why show it as an 
input field? Thoughts?

/Mads


>
> diff --git a/kallithea/templates/admin/settings/settings_email.html b/kallithea/templates/admin/settings/settings_email.html
> --- a/kallithea/templates/admin/settings/settings_email.html
> +++ b/kallithea/templates/admin/settings/settings_email.html
> @@ -1,4 +1,3 @@
> -<dl class="dl-horizontal">
>   <%
>    elems = [
>       (_('Email prefix'), 'email_prefix'),
> @@ -15,15 +14,25 @@
>       (_('SMTP auth'), 'smtp_auth'),
>    ]
>   %>
> -%for dt, dd in elems:
> -  <dt style="width:150px; text-align: left">${dt}:</dt>
> -  <dd style="margin-left: 160px">${c.ini.get(dd)}</dd>
> -%endfor
> -</dl>
>   
>   ${h.form(url('admin_settings_email'), method='post')}
>       <div class="form">
>   
> +        <h4>${_('Settings (read-only)')}</h4>
> +        <div class="fields">
> +          %for label, setting in elems:
> +            <div class="field">
> +                <div class="label">
> +                    <label for="${setting}">${label}</label>
> +                </div>
> +                <div class="input">
> +                    ${h.text('setting', c.ini.get(setting), size=50, readonly='readonly')}
> +                </div>
> +            </div>
> +          %endfor
> +        </div>
> +
> +        <h4>${_('Test e-mail')}</h4>
>           <div class="fields">
>               <div class="field">
>                   <div class="label">



More information about the kallithea-general mailing list