Skip to content

Commit

Permalink
Merge branch '1635-feature-email-notifications-for-activity-streams' …
Browse files Browse the repository at this point in the history
…of github.com:okfn/ckan into 1635-feature-email-notifications-for-activity-streams

Conflicts:
	ckan/templates/user/edit_user_form.html
  • Loading branch information
Sean Hammond committed Dec 18, 2012
2 parents a3d7f5d + a5aa673 commit d245f8e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 23 deletions.
16 changes: 16 additions & 0 deletions ckan/public/base/css/main.css
Expand Up @@ -5014,6 +5014,13 @@ ol.media-grid:after {
label {
font-weight: bold;
}
.btn-rounded {
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
padding-left: 15px;
padding-right: 15px;
}
label {
cursor: pointer;
font-size: 14px;
Expand Down Expand Up @@ -5123,6 +5130,12 @@ textarea {
padding: 6px 0 6px 25px;
margin-top: 6px;
}
.form-horizontal .info-help {
padding: 6px 0;
}
.form-horizontal .info-help-tight {
margin-top: -10px;
}
.form-horizontal .info-inline {
float: right;
width: 265px;
Expand Down Expand Up @@ -7297,6 +7310,9 @@ header.masthead .debug {
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.activity .load-less {
margin-bottom: 15px;
}
.popover .about {
margin-bottom: 10px;
}
Expand Down
7 changes: 7 additions & 0 deletions ckan/public/base/less/forms.less
Expand Up @@ -143,6 +143,13 @@ textarea {
margin-top: 6px;
}

.form-horizontal .info-help {
padding: 6px 0;
}
.form-horizontal .info-help-tight {
margin-top: -10px;
}

.form-horizontal .info-inline {
float: right;
width: 265px;
Expand Down
22 changes: 22 additions & 0 deletions ckan/templates/macros/form.html
Expand Up @@ -309,6 +309,28 @@
{%- endif -%}
{% endmacro %}

{#
Renders an small help box with a description. This will usually be used
with in a call block when creating an input element.

text - The text to include as a helper.
inline - If true displays the info box inline with the input.
classes - A list of classes to add to the info box.

Example

{% import 'macros/form.html' as form %}
{% call form.input('name') %}
{{ form.help(_('A little bit of text describing the input')) }}
{% endcall %}

#}
{% macro help(text='', inline=false, classes=[]) %}
{%- if text -%}
<div class="info-block info-help{{ " " ~ classes | join(' ') }}">{{ text }}</div>
{%- endif -%}
{% endmacro %}

{#
Builds a space seperated list of html attributes from a dict of key/value pairs.
Generally only used internally by macros.
Expand Down
44 changes: 21 additions & 23 deletions ckan/templates/user/edit_user_form.html
@@ -1,38 +1,36 @@
{% import 'macros/form.html' as form %}

<form class="dataset-form form-horizontal" method="post" action="{{ action }}">
{{ form.errors(error_summary) }}
{{ form.errors(error_summary) }}

<fieldset>
<legend>{{ _('Change your details') }}</legend>
<fieldset>
<legend>{{ _('Change your details') }}</legend>

{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium']) }}
{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium']) }}

{{ form.input('fullname', label=_('Full name'), id='field-fullname', value=data.fullname, error=errors.fullname, placeholder=_('eg. Joe Bloggs'), classes=['control-medium']) }}
{{ form.input('fullname', label=_('Full name'), id='field-fullname', value=data.fullname, error=errors.fullname, placeholder=_('eg. Joe Bloggs'), classes=['control-medium']) }}

{{ form.input('email', label=_('Email'), id='field-email', type='email', value=data.email, error=errors.email, placeholder=_('eg. joe@example.com'), classes=['control-medium']) }}
{{ form.input('email', label=_('Email'), id='field-email', type='email', value=data.email, error=errors.email, placeholder=_('eg. joe@example.com'), classes=['control-medium']) }}

{{ form.markdown('about', label=_('About'), id='field-about', value=data.about, error=errors.about, placeholder=_('A little information about yourself')) }}
</fieldset>
{{ form.markdown('about', label=_('About'), id='field-about', value=data.about, error=errors.about, placeholder=_('A little information about yourself')) }}

<fieldset>
<legend>{{ _('Change your password') }}</legend>
{% if c.show_email_notifications %}
{% call form.checkbox('email_notifications', label=_('Subscribe to activity notification emails'), id='field-email-notifications', value=True, checked=c.userobj.email_notifications) %}
{{ form.help(_('Whenever there\'s a new activity on the site related to a thing that you follow you\'ll get a notification email'), classes=['info-help-tight']) }}
{% endcall %}
{% endif %}

{{ form.input('password1', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium']) }}
</fieldset>

{{ form.input('password2', label=_('Confirm Password'), id='field-password-confirm', value=data.password2, error=errors.password2, classes=['control-medium']) }}
</fieldset>
<fieldset>
<legend>{{ _('Change your password') }}</legend>

{% if c.show_email_notifications %}
<fieldset>
<legend>{{ _('Change your preferences') }}</legend>
{{ form.input('password1', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium']) }}

{{ form.checkbox('email_notifications', label=_('Email Notifications'), id='field-email-notifications', value=True, checked=c.userobj.activity_streams_email_notifications, classes=['control-medium']) }}

</fieldset>
{% endif %}
{{ form.input('password2', label=_('Confirm Password'), id='field-password-confirm', value=data.password2, error=errors.password2, classes=['control-medium']) }}
</fieldset>

<div class="form-actions">
<button class="btn btn-primary" type="submit" name="save">{{ _('Update Profile') }}</button>
</div>
<div class="form-actions">
<button class="btn btn-primary" type="submit" name="save">{{ _('Update Profile') }}</button>
</div>
</form>

0 comments on commit d245f8e

Please sign in to comment.