| adding new pages - linuxgaming - Linux gaming aggregate tool, built to test out… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 037a088ab023bbf6f52788711363482f2a404fc3 | |
| parent d63baf1c3958f7983396c41caa4d1e15a2f4b21d | |
| Author: Jay Scott <[email protected]> | |
| Date: Thu, 19 Jul 2018 21:38:57 +0100 | |
| adding new pages | |
| Diffstat: | |
| M CHANGELOG | 7 +++++++ | |
| M TODO.md | 2 +- | |
| M config/feed_config.yaml | 64 ++++++++++++++++++-----------… | |
| M linuxgaming/__init__.py | 4 ++-- | |
| D linuxgaming/details.py | 29 ----------------------------- | |
| A linuxgaming/sources.py | 38 +++++++++++++++++++++++++++++… | |
| M linuxgaming/templates/base.html | 14 ++++++++++---- | |
| M linuxgaming/templates/macros/items… | 2 +- | |
| A linuxgaming/templates/pages/all_so… | 48 +++++++++++++++++++++++++++… | |
| R linuxgaming/templates/pages/detail… | 0 | |
| 10 files changed, 144 insertions(+), 64 deletions(-) | |
| --- | |
| diff --git a/CHANGELOG b/CHANGELOG | |
| @@ -3,8 +3,15 @@ | |
| Thur 19 Jul | |
| -- | |
| + - added new pages | |
| + - all sources | |
| + - gitlab link | |
| - refactored | |
| +note: had to add an extra website field to the config file to allow me | |
| + to pull this info in jinja2. I suspect this can been done out with | |
| + this extra info but am not sure how to do it. | |
| + | |
| Wed 18 Jul | |
| --- | |
| diff --git a/TODO.md b/TODO.md | |
| @@ -1,7 +1,7 @@ | |
| # TODO | |
| - - add menu with source info / about etc | |
| - move updates to AWS Lambda function | |
| + - Fix feed_config layout, the websites part. | |
| - add API | |
| - add Itch.io games | |
| - add Steam games | |
| diff --git a/config/feed_config.yaml b/config/feed_config.yaml | |
| @@ -1,27 +1,7 @@ | |
| -linux_gaming: | |
| - icon: "reddit.png" | |
| - about: "/r/Linux_Gaming is for informative and interesting gaming content an… | |
| - rss: | |
| - website: "https://www.reddit.com/r/linux_gaming/" | |
| - type: "article" | |
| - url: "https://www.reddit.com/r/linux_gaming/new/.rss?limit=300" | |
| - | |
| -GoG: | |
| - icon: "gog.png" | |
| - about: "GOG.com is a digital distribution platform with a curated selection … | |
| - gog: | |
| - website: "https://www.gog.com/" | |
| - | |
| -NuSuey: | |
| - icon: "nusuey.png" | |
| - about: "Linux enthusiast, geek, casual streamer, the guy who made http://tux… | |
| - twitch: | |
| - website: "https://www.twitch.tv/nusuey/" | |
| - twitch_id: "7863182" | |
| - | |
| HexDSL: | |
| icon: "hexdsl.png" | |
| about: "Linux Gaming Rambles, shows and streams presented by HexDSL. Apparen… | |
| + website: "https://www.youtube.com/user/hexdsl/" | |
| youtube: | |
| website: "https://www.youtube.com/user/hexdsl/" | |
| channel_id: "UCRE3NFNtdjR96-H4QG4U1Fg" | |
| @@ -32,6 +12,7 @@ HexDSL: | |
| TheLinuxGamer: | |
| icon: "thelinuxgamer.png" | |
| about: "Weekly content revolving around Linux gaming. Reviews, tutorials, le… | |
| + website: "https://www.youtube.com/user/tuxreviews" | |
| youtube: | |
| website: "https://www.youtube.com/user/tuxreviews/" | |
| channel_id: "UCv1Kcz-CuGM6mxzL3B1_Eiw" | |
| @@ -39,6 +20,7 @@ TheLinuxGamer: | |
| GamingOnLinux: | |
| icon: "gol.png" | |
| about: "A little bit of information on who GamingOnLinux are, we are just a … | |
| + website: "https://www.gamingonlinux.com/" | |
| rss: | |
| website: "https://www.gamingonlinux.com/" | |
| type: "article" | |
| @@ -50,6 +32,7 @@ GamingOnLinux: | |
| BLGP: | |
| icon: "blgp.png" | |
| about: "The Best Linux Games Podcast features only the best news, reviews, a… | |
| + website: "http://www.bestlinuxgames.com/" | |
| rss: | |
| website: "http://www.bestlinuxgames.com/" | |
| type: "podcast" | |
| @@ -61,23 +44,50 @@ BLGP: | |
| LinuxGameConsortium: | |
| icon: "lgc.png" | |
| about: "Since we maintain the foundation of the Linux community. Yet support… | |
| + website: "https://linuxgameconsortium.com" | |
| rss: | |
| website: "https://linuxgameconsortium.com" | |
| type: "article" | |
| url: "https://linuxgameconsortium.com/feed/" | |
| +XPenguin: | |
| + icon: "xpenguin.png" | |
| + about: "A weekly Linux gaming podcast hosted by HexDSL and HamishTPB." | |
| + website: "http://xpenguin.club/" | |
| + rss: | |
| + website: "http://xpenguin.club/" | |
| + type: "podcast" | |
| + url: "http://xpenguin.club/rss.xml" | |
| + | |
| MostlyLinux: | |
| icon: "mostlylinux.png" | |
| about: "Gaming with a touch of Linux and a libertarianish ethos. We are #Fre… | |
| + website: "http://mostlylinux.libsyn.com" | |
| rss: | |
| website: "http://mostlylinux.libsyn.com" | |
| type: "podcast" | |
| url: "http://mostlylinux.libsyn.com/rss" | |
| -XPenguin: | |
| - icon: "xpenguin.png" | |
| - about: "A weekly Linux gaming podcast hosted by HexDSL and HamishTPB." | |
| +linux_gaming: | |
| + icon: "reddit.png" | |
| + about: "/r/Linux_Gaming is for informative and interesting gaming content an… | |
| + website: "https://www.reddit.com/r/linux_gaming/" | |
| rss: | |
| - website: "http://xpenguin.club/" | |
| - type: "podcast" | |
| - url: "http://xpenguin.club/rss.xml" | |
| + website: "https://www.reddit.com/r/linux_gaming/" | |
| + type: "article" | |
| + url: "https://www.reddit.com/r/linux_gaming/new/.rss?limit=300" | |
| + | |
| +NuSuey: | |
| + icon: "nusuey.png" | |
| + about: "Linux enthusiast, geek, casual streamer, the guy who made http://tux… | |
| + website: "https://www.twitch.tv/nusuey/" | |
| + twitch: | |
| + website: "https://www.twitch.tv/nusuey/" | |
| + twitch_id: "7863182" | |
| + | |
| +GoG: | |
| + icon: "gog.png" | |
| + about: "GOG.com is a digital distribution platform with a curated selection … | |
| + website: "https://www.gog.com/" | |
| + gog: | |
| + website: "https://www.gog.com/" | |
| diff --git a/linuxgaming/__init__.py b/linuxgaming/__init__.py | |
| @@ -10,7 +10,7 @@ from flask_htmlmin import HTMLMIN | |
| import dateutil.parser | |
| from . import update | |
| -from . import details | |
| +from . import sources | |
| from . import search | |
| from . import database | |
| @@ -34,7 +34,7 @@ def create_app(): | |
| # register blueprint modules | |
| app.register_blueprint(update.BP) | |
| - app.register_blueprint(details.BP) | |
| + app.register_blueprint(sources.BP) | |
| app.register_blueprint(search.BP) | |
| @app.route("/") | |
| diff --git a/linuxgaming/details.py b/linuxgaming/details.py | |
| @@ -1,29 +0,0 @@ | |
| -""" | |
| -shows more details about the current sources. | |
| - | |
| -:return: Blueprint | |
| -""" | |
| -from flask import (Blueprint, flash, redirect, render_template, url_for, | |
| - current_app) | |
| -from . import database | |
| -from . import util | |
| - | |
| -BP = Blueprint('details', __name__, url_prefix='/details') | |
| - | |
| - | |
| [email protected]("/<path:path>", methods=["GET"]) | |
| -def details(path): | |
| - """Source details page""" | |
| - feed_config = util.load_yaml() | |
| - | |
| - if path in feed_config: | |
| - source_data = feed_config[path] | |
| - else: | |
| - flash('1337 Hacks in progress...') | |
| - current_app.logger.info('Manual details probe %s', path) | |
| - return redirect(url_for('home')) | |
| - | |
| - source_items = database.find_all({"name": path}) | |
| - | |
| - return render_template( | |
| - 'pages/details.html', data=source_data, entries=source_items) | |
| diff --git a/linuxgaming/sources.py b/linuxgaming/sources.py | |
| @@ -0,0 +1,38 @@ | |
| +""" | |
| +shows more sources about the current sources. | |
| + | |
| +:return: Blueprint | |
| +""" | |
| +from flask import (Blueprint, flash, redirect, render_template, url_for, | |
| + current_app) | |
| +from . import database | |
| +from . import util | |
| + | |
| +BP = Blueprint('sources', __name__, url_prefix='/sources') | |
| + | |
| + | |
| [email protected]("/all", methods=["GET"]) | |
| +def sources_all(): | |
| + """display all sources""" | |
| + | |
| + feed_config = util.load_yaml() | |
| + | |
| + return render_template('pages/all_sources.html', data=feed_config) | |
| + | |
| + | |
| [email protected]("/<path:path>", methods=["GET"]) | |
| +def sources(path): | |
| + """Source page""" | |
| + feed_config = util.load_yaml() | |
| + | |
| + if path in feed_config: | |
| + source_data = feed_config[path] | |
| + else: | |
| + flash('1337 Hacks in progress...') | |
| + current_app.logger.info('Manual sources probe %s', path) | |
| + return redirect(url_for('home')) | |
| + | |
| + source_items = database.find_all({"name": path}) | |
| + | |
| + return render_template( | |
| + 'pages/sources.html', data=source_data, entries=source_items) | |
| diff --git a/linuxgaming/templates/base.html b/linuxgaming/templates/base.html | |
| @@ -7,9 +7,9 @@ | |
| <title>Linux gaming sources in one place!</title> | |
| <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> | |
| <link rel="icon" href="/favicon.ico" type="image/x-icon"> | |
| - <link rel="stylesheet" | |
| - href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/seman… | |
| - integrity="sha256-ncjDAd2/rm/vaNTqp7Kk96MfSeHACtbiDU9NWKqNuCI=" | |
| + <link rel="stylesheet" | |
| + href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/seman… | |
| + integrity="sha256-ncjDAd2/rm/vaNTqp7Kk96MfSeHACtbiDU9NWKqNuCI=" | |
| crossorigin="anonymous" /> | |
| </head> | |
| @@ -39,7 +39,6 @@ | |
| <a class="item" href="/search/game" data-content="Filter all games"> | |
| <i class="game blue large icon"></i> | |
| </a> | |
| - | |
| <div class="right item"> | |
| <div class="item"> | |
| <i class="ellipsis vertical disabled icon"></i> | |
| @@ -49,6 +48,13 @@ | |
| <i class="search olive icon"></i> | |
| </div> | |
| </div> | |
| + <a class="item" href="/sources/all" data-content="Show data sources"> | |
| + <i class="database black large icon"></i> | |
| + </a> | |
| + <a class="item" href="https://gitlab.com/jayscott/linuxgaming" | |
| + data-content="Source code"> | |
| + <i class="gitlab orange large icon"></i> | |
| + </a> | |
| </div> | |
| </div> | |
| diff --git a/linuxgaming/templates/macros/items.html b/linuxgaming/templates/ma… | |
| @@ -27,7 +27,7 @@ | |
| </td> | |
| <td> | |
| {% if not "gog" in item.name %} | |
| - <a href="/details/{{ item.name }}"> | |
| + <a href="/sources/{{ item.name }}"> | |
| <img alt="{{ item.name }} icon" src="{{ url_for('static', filena… | |
| </a> | |
| {% else %} | |
| diff --git a/linuxgaming/templates/pages/all_sources.html b/linuxgaming/templat… | |
| @@ -0,0 +1,48 @@ | |
| +{% extends "base.html" %} | |
| + | |
| +{% block content %} | |
| + | |
| +{% with messages = get_flashed_messages() %} | |
| + {% if messages %} | |
| + {% for message in messages %} | |
| + <div class="ui massive red icon message"> | |
| + <i class="spinner loading icon"></i> | |
| + <div class="content"> | |
| + <div class="header"> | |
| + {{ message }} | |
| + </div> | |
| + </div> | |
| + </div> | |
| + {% endfor %} | |
| + {% endif %} | |
| +{% endwith %} | |
| + | |
| +<div class="ui three cards"> | |
| + | |
| + {% for key, value in data.items() %} | |
| + <div class="card"> | |
| + <div class="blurring dimmable image"> | |
| + <div class="ui dimmer"> | |
| + <div class="content"> | |
| + <div class="center"> | |
| + <a href="{{ value.website }}" class="ui inverted button">Visit… | |
| + </div> | |
| + </div> | |
| + </div> | |
| + <img class="ui small image" src="{{ url_for('static', filename='images… | |
| + </div> | |
| + | |
| + <div class="content"> | |
| + <a class="header">{{ key }}</a> | |
| + <div class="meta"> | |
| + <span class="date">{{ value.about }} </span> | |
| + </div> | |
| + </div> | |
| + </div> | |
| + {% endfor %} | |
| + | |
| +</div> | |
| + | |
| +{% endblock %} | |
| + | |
| + | |
| diff --git a/linuxgaming/templates/pages/details.html b/linuxgaming/templates/p… |