[GH-ISSUE #533] too much duplicate code in template/instances.html #398

Open
opened 2026-02-27 16:39:08 +03:00 by kerem · 2 comments
Owner

Originally created by @bsavelev on GitHub (Mar 27, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/533

Hello!
https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L149

I see code for <tr id="{{ inst.name }}"> 4 times
May be replace JS html generation with django generation? I can prepare PR...

Originally created by @bsavelev on GitHub (Mar 27, 2015). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/533 Hello! https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L149 I see code for `<tr id="{{ inst.name }}">` 4 times May be replace JS html generation with django generation? I can prepare PR...
Author
Owner

@retspen commented on GitHub (Mar 27, 2015):

I can change this section to http://github.hubspot.com/sortable/

<!-- gh-comment-id:86974482 --> @retspen commented on GitHub (Mar 27, 2015): I can change this section to http://github.hubspot.com/sortable/
Author
Owner

@bsavelev commented on GitHub (Mar 27, 2015):

Sorry, I didn't understand, I'll try to explain
I talk about code that repeat many times:
1 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L34
2 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L163
3 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L189
4 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L218

As I can see all of that can be replaced with one additinal view with template from [1] and $(elem).loads("{{ url 'new_view' host_id }}")

<!-- gh-comment-id:87002528 --> @bsavelev commented on GitHub (Mar 27, 2015): Sorry, I didn't understand, I'll try to explain I talk about code that repeat many times: 1 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L34 2 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L163 3 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L189 4 https://github.com/retspen/webvirtmgr/blob/master/templates/instances.html#L218 As I can see all of that can be replaced with one additinal view with template from [1] and `$(elem).loads("{{ url 'new_view' host_id }}")`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#398
No description provided.