1
0
Fork 0

Background color, spelling, Trello login, trello board ans tweets fix

This commit is contained in:
Ethanell 2019-04-30 19:53:01 +02:00
parent 87a881d310
commit 69abe3f6e6
3 changed files with 7 additions and 5 deletions

View file

@ -69,7 +69,7 @@ def twlogout():
@app.route("/trlogin") @app.route("/trlogin")
@login_required @login_required
def trlogin(): def trlogin():
if current_user.twitter_api.first(): if current_user.trello_api.first():
return "Already an api connected." return "Already an api connected."
return redirect(f"https://trello.com/1/authorize?expiration=never&name=Cyberplanificateur&scope=read,write&response_type=token&key={trello_credentials.api_key}&return_url=https://cyberplanificateur.flifloo.fr/settings") return redirect(f"https://trello.com/1/authorize?expiration=never&name=Cyberplanificateur&scope=read,write&response_type=token&key={trello_credentials.api_key}&return_url=https://cyberplanificateur.flifloo.fr/settings")
@ -138,8 +138,10 @@ def dashboard():
keywords += f" {text} |" keywords += f" {text} |"
tweets.append({"text": statu.text, "id": t.statu_id, "slots": f"{t.slots}/{t.slots_max}", "keywords": keywords}) tweets.append({"text": statu.text, "id": t.statu_id, "slots": f"{t.slots}/{t.slots_max}", "keywords": keywords})
for t in twapi.user_timeline(): for t in twapi.user_timeline(count = 200):
if not t.in_reply_to_status_id and not t.retweeted and not Tweets.query.filter_by(user = current_user, statu_id = t.id).first(): if not t.in_reply_to_status_id and not t.retweeted and not Tweets.query.filter_by(user = current_user, statu_id = t.id).first():
if len(timeline) >= 5:
break
timeline.append({"text": t.text, "id": t.id}) timeline.append({"text": t.text, "id": t.id})
@ -147,7 +149,7 @@ def dashboard():
trapi = trapi.api_login() trapi = trapi.api_login()
for b in trapi.list_boards(): for b in trapi.list_boards():
select = False select = False
if b.id == current_user.boards.first().board_id: if current_user.boards.first() and b.id == current_user.boards.first().board_id:
select = True select = True
boards.append({"text": b.name, "id": b.id, "select": select}) boards.append({"text": b.name, "id": b.id, "select": select})

View file

@ -5,7 +5,7 @@
<section id="banner"> <section id="banner">
<div class="inner"> <div class="inner">
<h2>Cyberplanificateur</h2> <h2>Cyberplanificateur</h2>
<p>Manage your commissions was never so easy with with the Cyberplanificateur</p> <p>Managing your commissions was never so easy with with the Cyberplanificateur</p>
<ul class="actions special"> <ul class="actions special">
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<li><a href="{{ url_for('dashboard') }}" class="button primary">Dashboard</a></li> <li><a href="{{ url_for('dashboard') }}" class="button primary">Dashboard</a></li>

View file

@ -11,7 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}" />
<noscript><link rel="stylesheet" href="{{ url_for('static', filename='css/noscript.css') }}" /></noscript> <noscript><link rel="stylesheet" href="{{ url_for('static', filename='css/noscript.css') }}" /></noscript>
<header class="intro-header" style="background-image: url('static/images/banner.jpg')"> <!--<header class="intro-header" style="background-image: url('static/images/banner.jpg')">-->
</head> </head>
<body class="landing is-preload"> <body class="landing is-preload">