blreams / collegefootballpick10

Football pool web app
4 stars 2 forks source link

Address redundancy of overall_results html templates #131

Closed blreams closed 7 years ago

blreams commented 7 years ago

When I was working on Issue #123, I figured out that there was a good bit of redundancy in the following templates:

I figured that I could combine all four of those templates into a single template and use the context variable pool_state to render appropriately within the template. The reason for such a change is twofold:

  1. It will make it easier to incorporate the jquery tablesorter if it only has to be applied in a single template.
  2. It follows from the python DRY (Don't Repeat Yourself) principle.

I have a commit ready to go for this issue.

blreams commented 7 years ago

I am making similar changes to the following week results templates:

These three templates are replaced by a single template named week_results_combined.html. In this template I am using a new context variable week_state to render the page appropriately based on the state of the week.

One other note...in these combined templates, I am removing the "dummy" <td> tags that served to create line separators between table rows. Instead, the same effect can be created by adding border-bottom css attributes to each of the actual row <td> elements. This is necessary because the table sorter would have separated out all those empty <td> tags upon sorting.

blreams commented 7 years ago

Deployed to pythonanywhere, closing this issue.