Merge lp://staging/~qzhang/lava-scheduler/add-template4device into lp://staging/lava-scheduler

Proposed by Spring Zhang
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
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle (community) Approve
Spring Zhang (community) Needs Resubmitting
Review via email: mp+95154@code.staging.launchpad.net

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!

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

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?

Revision history for this message
Spring Zhang (qzhang) wrote :

Thanks, the good examples, I prefer the first. The key point I realize now is I can't include "{% block content %}" and call "{{ block.super }}" to retrieve parent content block, I only need to extends the block definition in {% block content %}

136. By Spring Zhang

make a basic workable version

137. By Spring Zhang

Merge more common content

138. By Spring Zhang

sync with mainline

Revision history for this message
Spring Zhang (qzhang) wrote :

New version, merged new django_table2 modification from upstream

review: Needs Resubmitting
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks better, I think you can move the 'columns' stuff into the _device_base.html template though?

139. By Spring Zhang

Merge more duplicate code

Revision history for this message
Spring Zhang (qzhang) wrote :

'columns' merged.

review: Needs Resubmitting
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'll leave this review to everyone else. I think it would be nice to see how we can then simplify it with the stuff that's landed (landing?) to lava-server for very very very simple and much better (faster/cleaner/scalable) table rendering.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks good to me.

review: Approve
140. By Spring Zhang

merge with mainline

141. By Spring Zhang

Correct right hostname link

142. By Spring Zhang

add return and fix parameter lost

143. By Spring Zhang

merge with mainline

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches