Skip to content

Commit

Permalink
restyling news html
Browse files Browse the repository at this point in the history
  • Loading branch information
OPelham committed Jan 10, 2022
1 parent 0751861 commit 4e4db85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
12 changes: 6 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import requests
# from pytz import timezone
# from datetime import datetime
import os
# import hidden_space
# import os
import hidden_space

# use hidden space when testing on local and environment variables when using heroku
# WEATHER_API_KEY = hidden_space.WEATHER_API_KEY
# NEWS_API_KEY = hidden_space.NEWS_API_KEY
WEATHER_API_KEY = os.environ.get("WEATHER_KEY")
NEWS_API_KEY = os.environ.get("NEWS_KEY")
WEATHER_API_KEY = hidden_space.WEATHER_API_KEY
NEWS_API_KEY = hidden_space.NEWS_API_KEY
# WEATHER_API_KEY = os.environ.get("WEATHER_KEY")
# NEWS_API_KEY = os.environ.get("NEWS_KEY")

app = Flask(__name__)

Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="collapse navbar-collapse" id="navbarNavAltMarkup" style="font-family: monospace">
<div class="navbar-nav">
<a class="nav-link" href="/news/">Headlines</a>
<a class="nav-link" href="/newzealand/">New Zealand</a>
Expand Down
20 changes: 11 additions & 9 deletions templates/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

{% block body %}

<div class="container">
<h1 style="margin-top: 3.5rem; padding: 1rem; text-align: center">{{ title.title() }}</h1>
<div class="container" style="height: 3.5rem"></div>

<div >
<h1 style="padding: 1rem; text-align: center; background-color: #2F5061; color: #E57F84; font-family: monospace; margin-bottom: 1rem">{{ title.title() }}</h1>
</div>


Expand All @@ -18,13 +20,13 @@ <h1 style="margin-top: 3.5rem; padding: 1rem; text-align: center">{{ title.title
<img src="{{ article.get('urlToImage') }}" class="card-img-top" alt="Article Image" style="padding-top: 0rem">
{% endif %}
<div class="card-body">
<h5 class="article title">{{ article.get("title") }}</h5>
{% if article.get("publishedAt") != None %}
<h6 class="card-subtitle mb-2 text-muted">{{ article.get("publishedAt") }}</h6>
{% endif %}
{% if article.get("description") != None %}
<p class="card-text">{{ article.get("description") }}.</p>
{% endif %}
<h5 class="article title" style="color: #E57F84">{{ article.get("title") }}</h5>
{% if article.get("publishedAt") != None %}
<h6 class="card-subtitle mb-2 text-muted" style="color: #2F5061">{{ article.get("publishedAt") }}</h6>
{% endif %}
{% if article.get("description") != None %}
<p class="card-text" style="color: #2F5061">{{ article.get("description") }}.</p>
{% endif %}
<a href="{{ article.get('url') }}" class="card-link" style=" color: #2F5061">{{ article.get('source').get('name') }} </a>
</div>
</div>
Expand Down

0 comments on commit 4e4db85

Please sign in to comment.