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,
|
lifetime_licence,
|
||||||
directory,
|
directory,
|
||||||
mailbox,
|
mailbox,
|
||||||
|
deleted_alias,
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,64 +3,64 @@
|
||||||
{% set active_page = "dashboard" %}
|
{% set active_page = "dashboard" %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<style>
|
<style>
|
||||||
{# https://bootsnipp.com/snippets/rljEW#}
|
{# https://bootsnipp.com/snippets/rljEW#}
|
||||||
.card-counter{
|
.card-counter {
|
||||||
box-shadow: 2px 2px 10px #DADADA;
|
box-shadow: 2px 2px 10px #DADADA;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
transition: .3s linear all;
|
transition: .3s linear all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter:hover{
|
.card-counter:hover {
|
||||||
box-shadow: 4px 4px 20px #DADADA;
|
box-shadow: 4px 4px 20px #DADADA;
|
||||||
transition: .3s linear all;
|
transition: .3s linear all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter.primary{
|
.card-counter.primary {
|
||||||
background-color: #007bff;
|
background-color: #007bff;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter.danger{
|
.card-counter.danger {
|
||||||
background-color: #ef5350;
|
background-color: #ef5350;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter.success{
|
.card-counter.success {
|
||||||
background-color: #66bb6a;
|
background-color: #66bb6a;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter.info{
|
.card-counter.info {
|
||||||
background-color: #26c6da;
|
background-color: #26c6da;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter i{
|
.card-counter i {
|
||||||
font-size: 5em;
|
font-size: 5em;
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter .count-numbers{
|
.card-counter .count-numbers {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 35px;
|
right: 35px;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-counter .count-name{
|
.card-counter .count-name {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 35px;
|
right: 35px;
|
||||||
top: 65px;
|
top: 65px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block title %}
|
{% block title %}
|
||||||
|
@ -73,37 +73,37 @@
|
||||||
{{ alias }}
|
{{ alias }}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 col-sm-6">
|
<div class="col-md-3 col-sm-6">
|
||||||
<div class="card-counter primary">
|
<div class="card-counter primary">
|
||||||
<i class="fa fa-at"></i>
|
<i class="fa fa-at"></i>
|
||||||
<span class="count-numbers">{{ total }}</span>
|
<span class="count-numbers">{{ total }}</span>
|
||||||
<span class="count-name">Email Handled</span>
|
<span class="count-name">Email Handled</span>
|
||||||
</div>
|
</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>
|
</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">
|
<div class="row">
|
||||||
{% for log in logs %}
|
{% for log in logs %}
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
@ -134,7 +134,8 @@
|
||||||
<nav aria-label="Alias log navigation">
|
<nav aria-label="Alias log navigation">
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li class="page-item {% if page_id == 0 %}disabled{% endif %}">
|
<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>
|
||||||
<li class="page-item {% if last_page %}disabled{% endif %}">
|
<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>
|
<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 %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block default_content %}
|
{% block default_content %}
|
||||||
<div class="row">
|
<div class="bg-white p-6" style="max-width: 60em; margin: auto">
|
||||||
<div class="col-md-8 offset-md-2">
|
<h1 class="h3 mb-5"> Billing </h1>
|
||||||
<h1> 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>
|
<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>
|
</p>
|
||||||
|
|
||||||
{% if sub.cancelled %}
|
{% else %}
|
||||||
<p>
|
<div class="mt-3">
|
||||||
Sad to see you go 😢. Your subscription ends {{ current_user.get_subscription().next_bill_date | dt }}.
|
Click here to update billing information on Paddle, our payment partner: <br>
|
||||||
</p>
|
<a class="btn btn-success" href="{{ sub.update_url }}"> Update billing information </a>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% else %}
|
<hr>
|
||||||
<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>
|
|
||||||
|
|
||||||
|
<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>
|
</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">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-title" id="notification">Notifications
|
<div class="card-title" id="notification">Newsletters
|
||||||
<div class="small-text mt-1 mb-3">Do you want to receive our newsletters?</div>
|
<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>
|
</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="hidden" name="form-name" value="notification-preference">
|
<input type="hidden" name="form-name" value="notification-preference">
|
||||||
<div class="form-inline mb-3">
|
<div class="form-check">
|
||||||
<div class="form-group">
|
<input type="checkbox" id="notification" name="notification" {% if current_user.notification %}
|
||||||
<input type="checkbox" id="notification" name="notification" {% if current_user.notification %}
|
checked {% endif %} class="form-check-input">
|
||||||
checked {% endif %} class="form-check-input">
|
<label for="notification">I want to receive your newsletter</label>
|
||||||
<label for="notification">I want to receive your newsletter</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-outline-primary">Submit</button>
|
<button type="submit" class="btn btn-outline-primary">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -144,8 +145,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% if current_user.get_subscription() %}
|
{% if current_user.get_subscription() %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
@ -161,6 +160,22 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% 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">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-title">Export Data
|
<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,
|
LifetimeCoupon,
|
||||||
Directory,
|
Directory,
|
||||||
Mailbox,
|
Mailbox,
|
||||||
|
DeletedAlias,
|
||||||
)
|
)
|
||||||
from app.monitor.base import monitor_bp
|
from app.monitor.base import monitor_bp
|
||||||
from app.oauth.base import oauth_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)
|
Mailbox.create(user_id=user.id, email="ab@cd.ef", verified=True)
|
||||||
db.session.commit()
|
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
|
@login_manager.user_loader
|
||||||
def load_user(user_id):
|
def load_user(user_id):
|
||||||
|
|
Loading…
Reference in a new issue