Start dashboard
This commit is contained in:
parent
bdc901d518
commit
7de70b423c
5 changed files with 75 additions and 3 deletions
7
site.py
7
site.py
|
@ -75,6 +75,13 @@ def settings():
|
||||||
database.tradd(twapi_login(session).me().id, request.form["trtoken"])
|
database.tradd(twapi_login(session).me().id, request.form["trtoken"])
|
||||||
return render_template("settings.html", login = True, trlogin = is_trlogin(session), trloginfail = trloginfail)
|
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")
|
@app.route("/twpost")
|
||||||
def twpost():
|
def twpost():
|
||||||
if is_twlogin(session):
|
if is_twlogin(session):
|
||||||
|
|
64
templates/dashboard.html
Normal file
64
templates/dashboard.html
Normal 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 %}
|
|
@ -8,7 +8,7 @@
|
||||||
<p>Manage your commissions was never so easy with with the Cyberplanificateur</p>
|
<p>Manage your commissions was never so easy with with the Cyberplanificateur</p>
|
||||||
<ul class="actions special">
|
<ul class="actions special">
|
||||||
{% if login %}
|
{% if login %}
|
||||||
<li><a href="#" class="button primary">Dashboard</a></li>
|
<li><a href="{{ url_for('dashboard') }}" class="button primary">Dashboard</a></li>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<article id="main">
|
<article id="main">
|
||||||
<header>
|
<header>
|
||||||
<h2>Settings</h2>
|
<h2>Settings</h2>
|
||||||
<p>Aliquam ut ex ut interdum donec amet imperdiet eleifend</p>
|
<p>Account settings of Cyberplanificateur</p>
|
||||||
</header>
|
</header>
|
||||||
<section class="wrapper style5">
|
<section class="wrapper style5">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ url_for('home') }}">Home</a></li>
|
<li><a href="{{ url_for('home') }}">Home</a></li>
|
||||||
{% if login %}
|
{% 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('settings')}}">Settings</a></li>
|
||||||
<li><a href="{{ url_for('twlogout')}}">Log Out</a></li>
|
<li><a href="{{ url_for('twlogout')}}">Log Out</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
Reference in a new issue