<%inherit file="/user/settings.html" />
<%namespace name="forms" file="/forms.html"/>
<%namespace name="components" file="/components.html"/>


<%block name="settings_content">
${tiles.user.header(c.page_user)}
<form class="well" method="POST" enctype="multipart/form-data">

    <input type="hidden" name="_method" value="PUT" />

    ${h.field_token()|n}

    ${components.flashmessages()}

    <h2>${_(u'Notification settings')}</h2>

    <p class="info">
      ${_("Select how you would like to be notified of events.")}
      <a target="_new" href="/static/notification_faq.html#howmany">${_("Help.")}</a>
    </p>

    ${forms.input(_("Email"), 'email')}

    %if c.page_user.email is not None:
    %if c.page_user.is_email_activated():
    <div class="input_wrapper">
        <table border="0" width="100%">
            <tr>
                <th colspan="4">${_("fewer")}</th>
                <th colspan="2">${_("more notifications")}</th>
            </tr>
            <tr>
                    <td><input type="radio" name="email_priority" value="6"
                        ${"checked='checked'" if c.page_user.email_priority==6 else ""} /></td>
                    <td><input type="radio" name="email_priority" value="4"
                        ${"checked='checked'" if c.page_user.email_priority==4 else ""} /></td>
                    <td><input type="radio" name="email_priority" value="3"
                        ${"checked='checked'" if c.page_user.email_priority==3 else ""} /></td>
                    <td><input type="radio" name="email_priority" value="2"
                        ${"checked='checked'" if c.page_user.email_priority==2 else ""} /></td>
                    <td><input type="radio" name="email_priority" value="1"
                        ${"checked='checked'" if c.page_user.email_priority==1 else ""} /></td>
            </tr>
        </table>
    </div>
    %else:
    <div>${_("Not confirmed.")}
        <a href="/user/${c.page_user.user_name}/resend?${h.url_token()}">${_("Re-send activation link")}</a>
    </div>
    %endif
    %endif

    <br />

    ${forms.checkbox(_("News service"), 'email_messages', help=_(u"Receive occasional news from instance administrators"))}

    ${components.savebox(cancel_url=None)}

</form>
</%block>
