Merge pull request #85 from simple-login/deleted-alias-page
Deleted alias page
This commit is contained in:
commit
9d2aff6aa8
|
@ -15,4 +15,5 @@ from .views import (
|
|||
lifetime_licence,
|
||||
directory,
|
||||
mailbox,
|
||||
deleted_alias,
|
||||
)
|
||||
|
|
|
@ -3,64 +3,64 @@
|
|||
{% set active_page = "dashboard" %}
|
||||
{% block head %}
|
||||
<style>
|
||||
{# https://bootsnipp.com/snippets/rljEW#}
|
||||
.card-counter{
|
||||
box-shadow: 2px 2px 10px #DADADA;
|
||||
margin: 5px;
|
||||
padding: 20px 10px;
|
||||
background-color: #fff;
|
||||
height: 100px;
|
||||
border-radius: 5px;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
{# https://bootsnipp.com/snippets/rljEW#}
|
||||
.card-counter {
|
||||
box-shadow: 2px 2px 10px #DADADA;
|
||||
margin: 5px;
|
||||
padding: 20px 10px;
|
||||
background-color: #fff;
|
||||
height: 100px;
|
||||
border-radius: 5px;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
|
||||
.card-counter:hover{
|
||||
box-shadow: 4px 4px 20px #DADADA;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
.card-counter:hover {
|
||||
box-shadow: 4px 4px 20px #DADADA;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
|
||||
.card-counter.primary{
|
||||
background-color: #007bff;
|
||||
color: #FFF;
|
||||
}
|
||||
.card-counter.primary {
|
||||
background-color: #007bff;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.danger{
|
||||
background-color: #ef5350;
|
||||
color: #FFF;
|
||||
}
|
||||
.card-counter.danger {
|
||||
background-color: #ef5350;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.success{
|
||||
background-color: #66bb6a;
|
||||
color: #FFF;
|
||||
}
|
||||
.card-counter.success {
|
||||
background-color: #66bb6a;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.info{
|
||||
background-color: #26c6da;
|
||||
color: #FFF;
|
||||
}
|
||||
.card-counter.info {
|
||||
background-color: #26c6da;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter i{
|
||||
font-size: 5em;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.card-counter i {
|
||||
font-size: 5em;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.card-counter .count-numbers{
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 20px;
|
||||
font-size: 32px;
|
||||
display: block;
|
||||
}
|
||||
.card-counter .count-numbers {
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 20px;
|
||||
font-size: 32px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card-counter .count-name{
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 65px;
|
||||
text-transform: capitalize;
|
||||
opacity: 0.5;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
}
|
||||
.card-counter .count-name {
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 65px;
|
||||
text-transform: capitalize;
|
||||
opacity: 0.5;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block title %}
|
||||
|
@ -73,37 +73,37 @@
|
|||
{{ alias }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-at"></i>
|
||||
<span class="count-numbers">{{ total }}</span>
|
||||
<span class="count-name">Email Handled</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-paper-plane"></i>
|
||||
<span class="count-numbers">{{ email_forwarded }}</span>
|
||||
<span class="count-name">Email Forwarded</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-reply"></i>
|
||||
<span class="count-numbers">{{ email_replied }}</span>
|
||||
<span class="count-name">Email Replied</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter danger">
|
||||
<i class="fa fa-ban"></i>
|
||||
<span class="count-numbers">{{ email_blocked }}</span>
|
||||
<span class="count-name">Email Blocked</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-at"></i>
|
||||
<span class="count-numbers">{{ total }}</span>
|
||||
<span class="count-name">Email Handled</span>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="pt-4">Activities</h2>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-paper-plane"></i>
|
||||
<span class="count-numbers">{{ email_forwarded }}</span>
|
||||
<span class="count-name">Email Forwarded</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter primary">
|
||||
<i class="fa fa-reply"></i>
|
||||
<span class="count-numbers">{{ email_replied }}</span>
|
||||
<span class="count-name">Email Replied</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
<div class="card-counter danger">
|
||||
<i class="fa fa-ban"></i>
|
||||
<span class="count-numbers">{{ email_blocked }}</span>
|
||||
<span class="count-name">Email Blocked</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="pt-4">Activities</h2>
|
||||
<div class="row">
|
||||
{% for log in logs %}
|
||||
<div class="col-12">
|
||||
|
@ -134,7 +134,8 @@
|
|||
<nav aria-label="Alias log navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {% if page_id == 0 %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('dashboard.alias_log', alias_id=alias_id, page_id=page_id-1) }}">Previous</a>
|
||||
<a class="page-link"
|
||||
href="{{ url_for('dashboard.alias_log', alias_id=alias_id, page_id=page_id-1) }}">Previous</a>
|
||||
</li>
|
||||
<li class="page-item {% if last_page %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('dashboard.alias_log', alias_id=alias_id, page_id=page_id+1) }}">Next</a>
|
||||
|
|
|
@ -8,35 +8,32 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block default_content %}
|
||||
<div class="row">
|
||||
<div class="col-md-8 offset-md-2">
|
||||
<h1> Billing </h1>
|
||||
<div class="bg-white p-6" style="max-width: 60em; margin: auto">
|
||||
<h1 class="h3 mb-5"> Billing </h1>
|
||||
|
||||
<p>
|
||||
You are on the <b>{{ current_user.get_subscription().plan_name() }}</b> plan. Thank you very much for supporting
|
||||
SimpleLogin. 🙌
|
||||
</p>
|
||||
|
||||
{% if sub.cancelled %}
|
||||
<p>
|
||||
You are on the <b>{{ current_user.get_subscription().plan_name() }}</b> plan. Thank you very much for supporting SimpleLogin. 🙌
|
||||
Sad to see you go 😢. Your subscription ends {{ current_user.get_subscription().next_bill_date | dt }}.
|
||||
</p>
|
||||
|
||||
{% if sub.cancelled %}
|
||||
<p>
|
||||
Sad to see you go 😢. Your subscription ends {{ current_user.get_subscription().next_bill_date | dt }}.
|
||||
</p>
|
||||
{% else %}
|
||||
<div class="mt-3">
|
||||
Click here to update billing information on Paddle, our payment partner: <br>
|
||||
<a class="btn btn-success" href="{{ sub.update_url }}"> Update billing information </a>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<div class="mt-3">
|
||||
Click here to update billing information on Paddle, our payment partner: <br>
|
||||
<a class="btn btn-success" href="{{ sub.update_url }}"> Update billing information </a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div>
|
||||
Don't want to protect your inbox anymore? <br>
|
||||
<a class="btn btn-warning" href="{{ sub.cancel_url }}"> Cancel subscription 😔 </a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div>
|
||||
Don't want to protect your inbox anymore? <br>
|
||||
<a class="btn btn-warning" href="{{ sub.cancel_url }}"> Cancel subscription 😔 </a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
|
|
25
app/dashboard/templates/dashboard/deleted_alias.html
Normal file
25
app/dashboard/templates/dashboard/deleted_alias.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{% extends 'default.html' %}
|
||||
|
||||
{% block title %}
|
||||
Deleted Aliases
|
||||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{% endblock %}
|
||||
|
||||
{% block default_content %}
|
||||
<div style="max-width: 60em; margin: auto">
|
||||
<h1 class="h3 mb-5"> Deleted Aliases </h1>
|
||||
|
||||
{% for deleted_alias in deleted_aliases %}
|
||||
<div class="my-4 p-4 card border-light">
|
||||
{{ deleted_alias.email }}
|
||||
<div class="small-text">
|
||||
Deleted {{ deleted_alias.created_at | dt }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -126,17 +126,18 @@
|
|||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-title" id="notification">Notifications
|
||||
<div class="small-text mt-1 mb-3">Do you want to receive our newsletters?</div>
|
||||
<div class="card-title" id="notification">Newsletters
|
||||
<div class="small-text mt-1 mb-3">
|
||||
Every now and then we can send you an email
|
||||
to let you know about a new feature that might be useful to you.
|
||||
</div>
|
||||
</div>
|
||||
<form method="post">
|
||||
<input type="hidden" name="form-name" value="notification-preference">
|
||||
<div class="form-inline mb-3">
|
||||
<div class="form-group">
|
||||
<input type="checkbox" id="notification" name="notification" {% if current_user.notification %}
|
||||
checked {% endif %} class="form-check-input">
|
||||
<label for="notification">I want to receive your newsletter</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="notification" name="notification" {% if current_user.notification %}
|
||||
checked {% endif %} class="form-check-input">
|
||||
<label for="notification">I want to receive your newsletter</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-primary">Submit</button>
|
||||
</form>
|
||||
|
@ -144,8 +145,6 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% if current_user.get_subscription() %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
@ -161,6 +160,22 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-title">Deleted Aliases
|
||||
<div class="small-text mt-1 mb-3" style="max-width: 40rem">
|
||||
When an alias is deleted, all its activities are deleted and no emails can be sent to it. <br>
|
||||
It is moved to another location and only used to check when new alias is created. <br>
|
||||
This check is necessary to avoid someone else accidentally taking this alias. <br>
|
||||
Because in this case, the other person might receive inadvertently information that belong to you. <br>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ url_for('dashboard.deleted_alias_route') }}" class="btn btn-outline-primary">
|
||||
See deleted aliases
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-title">Export Data
|
||||
|
|
13
app/dashboard/views/deleted_alias.py
Normal file
13
app/dashboard/views/deleted_alias.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from flask import render_template
|
||||
from flask_login import login_required, current_user
|
||||
|
||||
from app.dashboard.base import dashboard_bp
|
||||
from app.models import DeletedAlias
|
||||
|
||||
|
||||
@dashboard_bp.route("/deleted_alias", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def deleted_alias_route():
|
||||
deleted_aliases = DeletedAlias.query.filter_by(user_id=current_user.id)
|
||||
|
||||
return render_template("dashboard/deleted_alias.html", **locals())
|
|
@ -49,6 +49,7 @@ from app.models import (
|
|||
LifetimeCoupon,
|
||||
Directory,
|
||||
Mailbox,
|
||||
DeletedAlias,
|
||||
)
|
||||
from app.monitor.base import monitor_bp
|
||||
from app.oauth.base import oauth_bp
|
||||
|
@ -184,6 +185,10 @@ def fake_data():
|
|||
Mailbox.create(user_id=user.id, email="ab@cd.ef", verified=True)
|
||||
db.session.commit()
|
||||
|
||||
DeletedAlias.create(user_id=user.id, email="d1@ab.cd")
|
||||
DeletedAlias.create(user_id=user.id, email="d2@ab.cd")
|
||||
db.session.commit()
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
|
|
Loading…
Reference in a new issue