firefly-iii/resources/views/v1/profile/index.twig

179 lines
8.2 KiB
Twig

{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ trans('firefly.user_id_is',{user: userId})|raw }}
</p>
{% if not SANDSTORM %}
<div class="row">
<div class="col-lg-6">
<ul>
<li><a href="{{ route('profile.change-email') }}">{{ 'change_your_email'|_ }}</a></li>
<li><a href="{{ route('profile.change-password') }}">{{ 'change_your_password'|_ }}</a></li>
<li><a class="text-danger" href="{{ route('profile.delete-account') }}">{{ 'delete_account'|_ }}</a></li>
</ul>
</div>
<div class="col-lg-6">
<p>
{{ 'permanent_delete_stuff'|_ }}
</p>
<ul>
<li><a onclick="return confirm('{{ trans('firefly.are_you_sure')|escape('js') }}');" class="text-danger" href="{{ route('profile.delete-budgets') }}">{{ 'delete_all_budgets'|_ }}</a></li>
<li><a onclick="return confirm('{{ trans('firefly.are_you_sure')|escape('js') }}');" class="text-danger" href="{{ route('profile.delete-categories') }}">{{ 'delete_all_categories'|_ }}</a></li>
<li><a onclick="return confirm('{{ trans('firefly.are_you_sure')|escape('js') }}');" class="text-danger" href="{{ route('profile.delete-tags') }}">{{ 'delete_all_tags'|_ }}</a></li>
</ul>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% if SANDSTORM %}
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Offer template</h3>
</div>
<div class="box-body">
<p>
Block for sandstorm thing
</p>
<div>
<iframe style="width: 100%; height: 55px; margin: 0; border: 0;" id="offer-iframe">
</iframe>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% if not SANDSTORM %}
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'command_line_token'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'explain_command_line_token'|_ }}
</p>
<p>
<input id="token" type="text" class="form-control" name="token" value="{{ accessToken.data }}" size="32" maxlength="32" readonly/>
</p>
<p>
<form action="{{ route('profile.regenerate') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-danger btn-xs"><i class="fa fa-refresh"></i> {{ 'regenerate_command_line_token'|_ }}</button>
</form>
</p>
</div>
</div>
</div>
</div>
{% endif %}
{% if not SANDSTORM %}
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'pref_two_factor_auth'|_ }}</h3>
</div>
<div class="box-body">
<p class="text-info">{{ 'pref_two_factor_auth_help'|_ }}</p>
{% if enabled2FA == true %}
<p class="text-info">
{{ trans('firefly.pref_two_factor_backup_code_count', {count: mfaBackupCount}) }}
</p>
<div class="btn-group">
<a class="btn btn-info" href="{{ route('profile.code') }}">
<i class="fa fa-recycle"></i>
{{ 'pref_two_factor_auth_reset_code'|_ }}</a>
<a class="btn btn-default" href="{{ route('profile.new-backup-codes') }}">
<i class="fa fa-star"></i>
{{ 'pref_two_factor_new_backup_codes'|_ }}</a>
<a class="btn btn-danger" href="{{ route('profile.delete-code') }}">
<i class="fa fa-trash"></i>
{{ 'pref_two_factor_auth_disable_2fa'|_ }}</a>
</div>
{% else %}
<p>
<form action="{{ route('profile.enable2FA') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-info"><i class="fa fa-lock"></i> {{ 'pref_enable_two_factor_auth'|_ }}</button>
</form>
</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<passport-clients></passport-clients>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<passport-authorized-clients></passport-authorized-clients>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<passport-personal-access-tokens></passport-personal-access-tokens>
</div>
</div>
{% endblock %}
{% block scripts %}
{% if SANDSTORM %}
<script>
function requestIframeURL() {
var template = "You can use the $API_TOKEN key to reach Firefly III at $API_HOST.";
window.parent.postMessage({
renderTemplate: {
rpcId: "0",
template: template,
clipboardButton: 'left'
}
}, "*");
}
document.addEventListener("DOMContentLoaded", requestIframeURL);
var copyIframeURLToElement = function (event) {
if (event.data.rpcId === "0") {
if (event.data.error) {
console.log("ERROR: " + event.data.error);
} else {
var el = document.getElementById("offer-iframe");
el.setAttribute("src", event.data.uri);
}
}
};
window.addEventListener("message", copyIframeURLToElement);
</script>
{% endif %}
{% endblock %}