1
0
Fork 0

Start dashboard

This commit is contained in:
Ethanell 2019-04-28 15:09:39 +02:00
parent bdc901d518
commit 7de70b423c
5 changed files with 75 additions and 3 deletions

View file

@ -75,6 +75,13 @@ def settings():
database.tradd(twapi_login(session).me().id, request.form["trtoken"])
return render_template("settings.html", login = True, trlogin = is_trlogin(session), trloginfail = trloginfail)
@app.route("/dashboard")
def dashboard():
if not is_twlogin(session):
return redirect("/")
return render_template("dashboard.html", login = True, tweets = ["test1", "test2", "test3"], timeline = [{"id": 1, "text": "test1"}, {"id": 2, "text": "test2"}, {"id": 3, "text": "test3"}, {"id": 4, "text": "test4"}])
@app.route("/twpost")
def twpost():
if is_twlogin(session):

64
templates/dashboard.html Normal file
View file

@ -0,0 +1,64 @@
{% extends "template.html" %}
{% block content %}
<!-- Main -->
<article id="main">
<header>
<h2>Dashboard</h2>
<p>Your personal dashboard</p>
</header>
<section class="wrapper style5">
<div class="inner">
<h3>Current automatized tweets</h3>
<hr />
<table>
{% for t in tweets %}
<tr>
<td><blockquote>{{ t }}</blockquote></td>
<td><a href="#" class="button primary">Disable</a>
<a href="#" class="button">Delet</a></td>
</tr>
{% endfor %}
</table>
<hr />
<h3>Add an automatized tweet</h3>
<hr />
<section>
<div class="row">
<div class="col-6 col-12-medium">
{% for t in timeline %}
<div class="col-4 col-12-small">
<input type="radio" id="{{ t['id'] }}" name="tweet">
<label for="{{ t['id'] }}">{{ t['text'] }}</label>
</div>
{% endfor %}
</div>
<div class="col-6 col-12-medium">
<input type="text" name="slots" placeholder="Slots number" />
<input type="text" name="keywords" placeholder="Keywords (separate with a comma)" />
</div>
</div>
</section>
<input type="submit" value="Connect" class="button primary">
<hr />
<h3>Trello board</h3>
<hr />
<section>
<div class="row">
<div class="col-6 col-12-medium">
<h4>Choose a board</h4>
</div>
<div class="col-6 col-12-medium">
<h4>Choose a columns</h4>
</div>
</div>
</section>
<hr />
</div>
</section>
</article>
{% endblock %}

View file

@ -8,9 +8,9 @@
<p>Manage your commissions was never so easy with with the Cyberplanificateur</p>
<ul class="actions special">
{% if login %}
<li><a href="#" class="button primary">Dashboard</a></li>
<li><a href="{{ url_for('dashboard') }}" class="button primary">Dashboard</a></li>
{% else %}
<li><a href="{{ url_for('twlogin')}}" class="button primary">Login !</a></li>
<li><a href="{{ url_for('twlogin') }}" class="button primary">Login !</a></li>
{% endif %}
</ul>
</div>

View file

@ -5,7 +5,7 @@
<article id="main">
<header>
<h2>Settings</h2>
<p>Aliquam ut ex ut interdum donec amet imperdiet eleifend</p>
<p>Account settings of Cyberplanificateur</p>
</header>
<section class="wrapper style5">
<div class="inner">

View file

@ -28,6 +28,7 @@
<ul>
<li><a href="{{ url_for('home') }}">Home</a></li>
{% if login %}
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
<li><a href="{{ url_for('settings')}}">Settings</a></li>
<li><a href="{{ url_for('twlogout')}}">Log Out</a></li>
{% else %}