sc3 / django-townsquare

Python-Django port of Townsquare project found at https://github.com/sc3/townsquare
2 stars 5 forks source link

decouple templates: bootstrap, general, user, admin, base, index #32

Open bepetersn opened 10 years ago

bepetersn commented 10 years ago

It's way too cluttered right now. I can't understand how they all fit together in the least.

MMisery commented 10 years ago

I'm not entirely sure where the issue lies for you, so I'll just rattle off a few things:

The "admin" folder in templates folder is largely useless - it's a remnant of time I/we was/were working with editing the look of the Django admin console. We've since moved to building our own interface and using decorators.

I don't currently recall a "general" or a "users" template, but I should be able to address the others. The other templates are built off "base", which contains a call to the JavaScript files. "Index" extends from "base" and is the home page for a logged in volunteer. Every template that's used by a view with the login_required decorator is extended from "index".

Now, could there be a better way of dealing with all of that? Possibly.

bepetersn commented 10 years ago

My thoughts were basically twofold:

1) "decouple" was a carefully chosen word. In "index.html", which as you say most of these files extend from, there is a lot of code we don't need. It looks like the home for /volunteer/home. Conceptually, at least, we should either move this code into its own file, or stop extending other templates from it.

2) In general, I wanted to normalize the naming schemas. The direction in which it seems to me this should happen is along the line of who can access a given page -- of permissions. Templates in the "admin" folder can only be accessed by people with admin privileges, in the "users" folder by people with user privileges, and in the "general" folder by anyone.

What do you think?

MMisery commented 10 years ago

I've nothing against setting a standard for names, and it's something I had to do in the last commit or two in order to fix some things. Just have to find every place the names are referenced. Also, if I'm not mistaken (which I likely am), the admin folder in a Django project is the second place Django looks to change the look of the default admin console, so there might have to be a setting changed in that case, if possible.