Merge lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls into lp://staging/ubuntu-accomplishments-web
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls |
Merge into: | lp://staging/ubuntu-accomplishments-web |
Diff against target: |
361 lines (+112/-115) 7 files modified
common/models.py (+4/-0) gallery/templates/gallery/opportunities/by_category.html (+2/-2) gallery/templates/gallery/opportunities/details.html (+9/-9) gallery/templates/gallery/trophies/by_category.html (+2/-2) gallery/templates/gallery/trophies/by_collection.html (+2/-2) gallery/templates/gallery/trophies/by_date.html (+2/-2) gallery/views.py (+91/-98) |
To merge this branch: | bzr merge lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gabriel Patiño (community) | Needs Resubmitting | ||
ubuntu-accomplishments-web-editor-drivers | Pending | ||
Review via email: mp+113445@code.staging.launchpad.net |
Description of the change
I've added a method to the Icon model to get it's url (Icon.url()), and changed the templates to use it.
Since templates needs an Icon object for this to work, and we were using queryset.
The good thing is that gallery.views is now some lines of code shorter.
I guess we could also refactor it a little to avoid code duplication, but would be out of scope.
Unmerged revisions
- 197. By Gabriel Patiño
-
Setting back the number of days for latest gallery to seven.
- 196. By Gabriel Patiño
-
Fixed duplicated trophies in latest gallery for trophies with several categories.
- 195. By Gabriel Patiño
-
Fixed Latest Trophies
- 194. By Gabriel Patiño
-
PEP8 compliance
- 193. By Gabriel Patiño
-
Created a format_queryset method in the top level class for lists to reduce code duplication.
- 192. By Gabriel Patiño
-
Fixed multi category issue in trophies and opportunities
- 191. By Gabriel Patiño
-
Merge from trunk
- 190. By Gabriel Patiño
-
Changed the way icons urls are generated, and simplified galleries for trophies and opportunities
I've been fixing some stuff Janos pointed to me by mail:
1. Now the rendered html is the same as the one generated by using the trunk.
2. I wasn't handle multicategories for opportunities and trhopies. It's now fixed
3. I'd removed accidentaly the labels Today and This Week in the Latest trophies page, fixed.
I had to clean up some code and then I realized we had code duplication when creating the data structure sent to the template.
I've created a format_queryset method to avoid duplication, and redefine it only when needed.