From a9de731b325778d95cd7a5f12a67dd393dbf1d0f Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Thu, 29 Mar 2018 23:05:52 +0100 Subject: Rewrite URLs in templates to use `url_for()` --- pysite/base_route.py | 3 +-- pysite/views/main/logout.py | 2 +- templates/main/index.html | 2 +- templates/main/info/index.html | 8 ++++---- templates/main/info/jams.html | 34 +++++++++++++++++----------------- templates/main/info/rules.html | 2 +- templates/main/navigation.html | 36 ++++++++++++++++++------------------ 7 files changed, 43 insertions(+), 44 deletions(-) diff --git a/pysite/base_route.py b/pysite/base_route.py index c7d58f49..95bf3a03 100644 --- a/pysite/base_route.py +++ b/pysite/base_route.py @@ -6,7 +6,7 @@ from flask import Blueprint, Response, jsonify, render_template, url_for from flask.views import MethodView from werkzeug.exceptions import default_exceptions -from pysite.constants import DISCORD_OAUTH_REDIRECT, ErrorCodes +from pysite.constants import ErrorCodes from pysite.mixins import OauthMixin @@ -30,7 +30,6 @@ class BaseView(MethodView, OauthMixin): context["current_page"] = self.name context["view"] = self context["logged_in"] = self.logged_in - context["login_url"] = DISCORD_OAUTH_REDIRECT context["static_file"] = self._static_file return render_template(template_names, **context) diff --git a/pysite/views/main/logout.py b/pysite/views/main/logout.py index fce30972..2461450d 100644 --- a/pysite/views/main/logout.py +++ b/pysite/views/main/logout.py @@ -4,8 +4,8 @@ from pysite.base_route import RouteView class LogoutView(RouteView): - name = "logout" path = "/auth/logout" + name = "logout" def get(self): if self.logged_in: diff --git a/templates/main/index.html b/templates/main/index.html index b4796dd4..81bab464 100644 --- a/templates/main/index.html +++ b/templates/main/index.html @@ -18,7 +18,7 @@ on a complex project, we've got someone who can help you if you get stuck.

- + Join us on  
diff --git a/templates/main/info/index.html b/templates/main/info/index.html index f80c0f88..2d72d48f 100644 --- a/templates/main/info/index.html +++ b/templates/main/info/index.html @@ -19,28 +19,28 @@

Code Jams   - +
Information on our monthly code jams, where users are paired into teams to compete with each other

Getting Help   - +
How to ask for help - and how to interpret the responses

Resources   - +
A page full of useful resources for learning and working with Python

Server Rules   - +
Rules and infraction information for our server

diff --git a/templates/main/info/jams.html b/templates/main/info/jams.html index 3bba1870..f4de813c 100644 --- a/templates/main/info/jams.html +++ b/templates/main/info/jams.html @@ -91,8 +91,8 @@ dialogue, and it will be forked to your account.

- - + +

Once this has been done, you should find yourself looking at your new copy of the repository. Next @@ -101,9 +101,9 @@ collaborator.

- - - + + +

Now that you've set up your repository, it's time to install Git. If you're on Linux, you can @@ -119,7 +119,7 @@ repository page on GitHub. Use cd project-name to change directory to the repository.

- +

Now, open the newly-cloned repository in your favourite editor and make some edits. We'll be using @@ -127,7 +127,7 @@ you prefer. For example, let's create a file named "hello.py", and add a line of code to it.

- +

Now that we've edited a file, we need to make Git aware of our changes. Head back over to your @@ -140,8 +140,8 @@ Following this, we can use git push origin master to push our commit up to GitHub.

- - + +

In order to pull the latest version of the code when the repository was cloned earlier, we can @@ -149,9 +149,9 @@ the help of our lovely assistant...

- - - + + +

Oh boy. @@ -164,10 +164,10 @@ button to finish.

- - - - + + + +

Now that your pull request has been created, keep working on your project! Code that you push to @@ -177,7 +177,7 @@ if you wish.

- +

That's all there is to it! Keep working at your task, do your best and you might just come out diff --git a/templates/main/info/rules.html b/templates/main/info/rules.html index dd7e14d4..e4ff0609 100644 --- a/templates/main/info/rules.html +++ b/templates/main/info/rules.html @@ -73,7 +73,7 @@

  • Keep all discussions SFW - No ecchi - or NSFW media. If you wouldn't want + or NSFW media. If you wouldn't want the entire world to know about your interest in it, it doesn't belong on this server.
  • diff --git a/templates/main/navigation.html b/templates/main/navigation.html index 53bdf196..eb325a37 100644 --- a/templates/main/navigation.html +++ b/templates/main/navigation.html @@ -6,7 +6,7 @@