-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create include_multinodes_checkboxes.html for code reuse
- Loading branch information
Showing
3 changed files
with
44 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
scrapydweb/templates/scrapydweb/include_multinodes_checkboxes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div id="multinodes"> | ||
<a class="link" href="{{ url_servers }}" target="_blank">To select nodes in the Servers page »</a> | ||
<div class="line-container"> | ||
<div class="key"><span>*</span>multinodes</div> | ||
<input type="text" name="checked_amount" value="1" hidden /> | ||
<div class="multiselect"> | ||
<div class="selectBox" onclick="showCheckboxes();"> | ||
<div class="value"> | ||
<span id="selected_nodes_statement">{{ SCRAPYD_SERVERS[node-1] }}</span> | ||
<svg class="icon anchor" aria-hidden="true"> | ||
<use xlink:href="#icon-down"></use> | ||
</svg> | ||
</div> | ||
<div class="overSelect"></div> | ||
</div> | ||
<div id="checkboxes" style="display: none;"> | ||
<label for="checkCurrent"><input type="checkbox" id="checkCurrent" />Check current node only</label> | ||
<label for="syncFromServersPage"><input type="checkbox" id="syncFromServersPage" />Sync from Servers page</label> | ||
<label for="checkAll"><input type="checkbox" id="checkAll" />CheckAll / UncheckAll</label> | ||
<div id="nodes_checkboxes"> | ||
{% for SCRAPYD_SERVER in SCRAPYD_SERVERS %} | ||
{% if SCRAPYD_SERVERS_GROUPS[loop.index-1] and loop.changed(SCRAPYD_SERVERS_GROUPS[loop.index-1]) %} | ||
<span> --- {{ SCRAPYD_SERVERS_GROUPS[loop.index-1] }} --- </span> | ||
{% endif %} | ||
|
||
<label id="label_{{ loop.index }}" for="checkbox_{{ loop.index }}" {% if loop.index == node %}style="color: #409EFF; font-weight: 700;"{% endif %}> | ||
<input type="checkbox" id="checkbox_{{ loop.index }}" name="{{ loop.index }}" | ||
{% if loop.index in selected_nodes %}checked{% endif %} />{{ SCRAPYD_SERVER }} | ||
</label> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<div class="form-item-error">Select at least one node</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters