magfest / ubersystem

MAGFest's Ubersystem - handles ticketing, staffing, analytics, volunteers, and tons more
http://magfest.org
GNU Affero General Public License v3.0
48 stars 55 forks source link

As a coder, I want the ability to select models by slug as a decorator #3050

Open kitsuta opened 6 years ago

kitsuta commented 6 years ago

It was out of scope for the related PR, but it would be SUPER nice if this code: https://github.com/magfest/panels/blob/11216ab653ffe78c9ebd6dd92ee8ba07dab5b100/panels/site_sections/attractions_admin.py#L340

from the panels repo was generic-ified and turned into a decorator. Pretty URLs for everyone!

RobRuana commented 6 years ago

Even better if we could start supporting URLs that have paths deeper than one level. I was able to use the path to create a nice URL like this: https://staging4.uber.magfest.org/uber/attractions/escape-room

But I couldn't add another path level for features, so I had to do this: https://staging4.uber.magfest.org/uber/attractions/escape-room?feature=egyptian-tomb

The reason we can't have paths more than one level deep is because of how we include javascript and css files in base.html:

<link rel="stylesheet" href="../static/deps/combined.min.css" />
<script src="../static/deps/combined.min.js" type="text/javascript"></script>

With a second path level in the URL we get 404s for those resources.

kitsuta commented 6 years ago

Whoa, wait, is that seriously the only reason? Or would we have to eliminate ALL relative URLs?

RobRuana commented 6 years ago

There's probably other places with this issue, but those were the only ones I encountered.

kitsuta commented 6 years ago

Let's consider that part of this issue, then!