Merge lp://staging/~qzhang/lava-scheduler/add-template4device into lp://staging/lava-scheduler
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | 139 |
Merged at revision: | 147 |
Proposed branch: | lp://staging/~qzhang/lava-scheduler/add-template4device |
Merge into: | lp://staging/lava-scheduler |
Diff against target: |
412 lines (+161/-200) 4 files modified
lava_scheduler_app/templates/lava_scheduler_app/_device_base.html (+145/-0) lava_scheduler_app/templates/lava_scheduler_app/device.html (+5/-135) lava_scheduler_app/templates/lava_scheduler_app/health_jobs.html (+5/-63) lava_scheduler_app/views.py (+6/-2) |
To merge this branch: | bzr merge lp://staging/~qzhang/lava-scheduler/add-template4device |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle (community) | Approve | ||
Spring Zhang (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
Add a template for health_job.html and device.html, it is device_base.html. I'm confused with the template system:
1. if I don't make device_base.html all blocks and use {{ block.super }} in device.html, it can't be displayed right on the page
2. in health_job.html, I only use a {{ block.super }} in content block, it should get all parent template, but it can't work, the page is wrong, only can I do the same way like device.html it will be right. I didn't do the modification here to make a difference. In my opinion, it will work if I delete the block definition of device_base.html which only contain a {{ block.super }} in device.html, all of them can also work.
Expect our django experts to point out, thanks!
I'm afraid I don't understand how you are approaching this. There are two basic approaches, define a generic device template that provides blocks for the specific device pages to fill or providing a "device details" template that other templates can include. I did the former in https:/ /code.launchpad .net/~mwhudson/ lava-scheduler/ cleanup- device- template- 1/+merge/ 95496 and the latter in https:/ /code.launchpad .net/~mwhudson/ lava-scheduler/ cleanup- device- template- 2/+merge/ 95497 -- I honestly didn't know which would turn out to be nicer, so I did both. I think the first is a bit nicer, but the second is a bit simpler. Do they make sense to you? Which do you prefer?