%if c.user_api_keys: %for api_key in c.user_api_keys: %endfor %else: %endif
${c.user.api_key}
${_('Built-in')} ${_('Expires')}: ${_('Never')} ${h.form(url('my_account_api_keys_delete'))} ${h.hidden('del_api_key',c.user.api_key)} ${h.hidden('del_api_key_builtin',1)} ${h.end_form()}
${api_key.api_key}
${api_key.description} %if api_key.expires == -1: ${_('Expires')}: ${_('Never')} %else: %if api_key.is_expired: ${_('Expired')}: ${h.age(h.time_to_datetime(api_key.expires))} %else: ${_('Expires')}: ${h.age(h.time_to_datetime(api_key.expires))} %endif %endif ${h.form(url('my_account_api_keys_delete'))} ${h.hidden('del_api_key',api_key.api_key)} ${h.end_form()}
${_('No additional API keys specified')}
${h.form(url('my_account_api_keys'), method='post')}
${h.text('description', class_='form-control', placeholder=_('Description'))}
${h.select('lifetime', '', c.lifetime_options)}
${h.submit('save',_('Add'),class_="btn btn-default")} ${h.reset('reset',_('Reset'),class_="btn btn-default")}
${h.end_form()}

${_(''' API keys are used to let scripts or services access %s using your account, as if you had provided the script or service with your actual password. ''') % (c.site_name or 'Kallithea')}

${_(''' Like passwords, API keys should therefore never be shared with others, nor passed to untrusted scripts or services. If such sharing should happen anyway, reset the API key on this page to prevent further use. ''')}