-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make sidebar collapsible remove unnecessary overflow:visible (#sidebar_plugin_SpoolManager) css rule because it overrides the visibility setting in the .collapse class. * use a modal dialog for sidebar spool selection * disable the pointer style cursor when hovering over color preview (sidebar) - set cursor to auto because the color preview is not clickable * change css margin of the selected spools list (sidebar) - results in a more balanced whitespace distribution * refactoring: formatting html * show vendors in sidebar fixes #190 * in sidebar: remove "-" when material is missing * fix sidebar css to better work with UI customization plugins Co-authored-by: OllisGit <[email protected]>
- Loading branch information
Showing
4 changed files
with
144 additions
and
62 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
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
107 changes: 50 additions & 57 deletions
107
octoprint_SpoolManager/templates/SpoolManager_sidebar.jinja2
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 |
---|---|---|
@@ -1,63 +1,56 @@ | ||
<div id="sidebar_spool_select" class="control-group"> | ||
<!-- TODO support for multiple spools for multiple tools --> | ||
{% include "SpoolManager_sidebar_dialogs.jinja2" %} | ||
|
||
<div id="sidebar_spool_select"> | ||
<!-- TODO support for multiple spools for multiple tools --> | ||
|
||
<div id="selectedSpools" data-bind="foreach: selectedSpoolsForSidebar"> | ||
<div> | ||
<!-- ko if: $parent.selectedSpoolsForSidebar().length > 1 --> | ||
<div> | ||
<b><span data-bind="text: $index"></span>:</b> | ||
</div> | ||
<!-- /ko --> | ||
<!-- ko ifnot: $data --> | ||
<div class="spool-label"> | ||
No spool selected | ||
</div> | ||
<!-- /ko --> | ||
<!-- ko if: $data --> | ||
<div> | ||
<span class="color-preview" data-bind="style: {'background-color': color}, attr: { title: colorName }"></span> | ||
</div> | ||
<div class="spool-label"> | ||
<span data-bind="text: material"></span> - <span data-bind="text: displayName"></span> | ||
<span data-bind="text: $root.remainingText($data), attr: {title: $root.buildTooltipForSpoolItem($data, 'Remaining weight: ', 'remainingWeight')}" class="spool-remaining" title="Remaining weight"></span> | ||
</div> | ||
<!-- /ko --> | ||
<div> | ||
<div class="btn-group"> | ||
<!-- ko if: $data --> | ||
<button class="btn btn-mini" data-bind="click: $parent.editSpoolFromSidebar.bind($data, $index())" title="Edit Spool"><span class="icon-edit"></span></button> | ||
<button class="btn btn-mini" data-bind="click: $parent.deselectSpoolForSidebar.bind($data, $index())" title="Deselect Spool"><span class="icon-remove"></span></button> | ||
<div> | ||
<!-- ko if: $parent.selectedSpoolsForSidebar().length > 1 --> | ||
<div> | ||
<b><span data-bind="text: $index"></span>:</b> | ||
</div> | ||
<!-- /ko --> | ||
<!-- ko ifnot: $data --> | ||
<div class="spool-label"> | ||
No spool selected | ||
</div> | ||
<div> | ||
<div class="btn-group"> | ||
<button class="btn btn-mini" | ||
data-bind="click: $parent.sidebarOpenSelectSpoolDialog.bind($data, $index())" | ||
title="Change Spool"><span class="icon-refresh"></span></button> | ||
</div> | ||
</div> | ||
<!-- /ko --> | ||
<!-- ko if: $data --> | ||
<div> | ||
<span class="color-preview" | ||
data-bind="style: {'background-color': color}, attr: { title: colorName }"></span> | ||
</div> | ||
<div class="spool-label"> | ||
<!-- ko if: material --> | ||
<span data-bind="text: material"></span> - | ||
<!-- /ko --> | ||
|
||
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button> | ||
|
||
<ul class="dropdown-menu dropdown-menu-right" data-bind="foreach: $parent.allSpoolsForSidebar"> | ||
<li> | ||
<a href="#" data-bind="click: $root.selectSpoolForSidebar.bind($data, $parentContext.$index())"> | ||
<span class="color-preview" data-bind="style: {'background-color': $data.color}, attr: { title: $data.colorName }"></span> | ||
<span class="filament-label"> | ||
<span><span data-bind="text: $data.material"></span> - <span data-bind="text: $data.displayName">FirstSpool</span></span> | ||
<span data-bind="text: $root.remainingText($data), attr: {title: $root.buildTooltipForSpoolItem($data, 'Remaining weight: ', 'remainingWeight')}" ></span> | ||
</span> | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
<span data-bind="text: displayName"></span> | ||
<!-- ko if: vendor --> | ||
(<span data-bind="text: vendor"></span>) | ||
<!-- /ko --> | ||
<span data-bind="text: $root.remainingText($data), attr: {title: $root.buildTooltipForSpoolItem($data, 'Remaining weight: ', 'remainingWeight')}" | ||
class="spool-remaining" title="Remaining weight"></span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<nobr> | ||
<!-- Not needed autorelaod implemented <a href="#" data-bind="click: loadSpoolsForSidebar" title="Reload spools entries"><span class="icon-refresh"></span></a>--> | ||
<div> | ||
<span ><input style="vertical-align:text-bottom" type="checkbox" data-bind="checked: pluginSettings.hideEmptySpoolsInSidebar" > Hide empty spools</span> | ||
<span ><input style="vertical-align:text-bottom" type="checkbox" data-bind="checked: pluginSettings.hideInactiveSpoolsInSidebar" > Hide inactive spools</span> | ||
<div> | ||
<div class="btn-group"> | ||
<button class="btn btn-mini" data-bind="click: $parent.editSpoolFromSidebar.bind($data, $index())" | ||
title="Edit Spool"><span class="icon-edit"></span></button> | ||
<button class="btn btn-mini" | ||
data-bind="click: $parent.deselectSpoolForSidebar.bind($data, $index())" | ||
title="Deselect Spool"><span class="icon-remove"></span></button> | ||
<button class="btn btn-mini" | ||
data-bind="click: $parent.sidebarOpenSelectSpoolDialog.bind($data, $index())" | ||
title="Change Spool"><span class="icon-refresh"></span></button> | ||
</div> | ||
</div> | ||
<!-- /ko --> | ||
</div> | ||
</nobr> | ||
|
||
<div> | ||
<small>Order: last used.</small> | ||
</div> | ||
|
||
|
||
</div> | ||
</div> |
47 changes: 47 additions & 0 deletions
47
octoprint_SpoolManager/templates/SpoolManager_sidebar_dialogs.jinja2
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,47 @@ | ||
<div id="sidebar_select_spool_dialog" class="modal hide fade-in"> | ||
<div class="modal-header"> | ||
<a href="#" class="close" data-dismiss="modal" aria-hidden="true">×</a> | ||
<h3>Select Spool</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div> | ||
<p>Please select the spool for tool <span data-bind="text: sidebarSelectSpoolModalToolIndex()"></span></p> | ||
<div class="filter"> | ||
<label> | ||
<input style="vertical-align:baseline" type="checkbox" | ||
data-bind="checked: pluginSettings.hideEmptySpoolsInSidebar"> | ||
Hide empty spools | ||
</label> | ||
<label> | ||
<input style="vertical-align:baseline" type="checkbox" | ||
data-bind="checked: pluginSettings.hideInactiveSpoolsInSidebar"> | ||
Hide inactive spools | ||
</label> | ||
</div> | ||
</div> | ||
<table class="table table-hover table-bordered"> | ||
<tbody data-bind="foreach: allSpoolsForSidebar()"> | ||
<tr class="entry clickable" data-bind="click: $root.sidebarSelectSpoolFromDialog.bind($data)"> | ||
<td class="spool-label"> | ||
<span class="color-preview" | ||
data-bind="style: {'background-color': color}, attr: { title: colorName }"></span> | ||
<span> | ||
<!-- ko if: material --> | ||
<span data-bind="text: material"></span> - | ||
<!-- /ko --> | ||
<span data-bind="text: displayName"></span> | ||
<!-- ko if: vendor --> | ||
(<span data-bind="text: vendor"></span>) | ||
<!-- /ko --> | ||
<span data-bind="text: $root.remainingText($data), attr: {title: $root.buildTooltipForSpoolItem($data, 'Remaining weight: ', 'remainingWeight')}" | ||
class="spool-remaining" title="Remaining weight"></span> | ||
</span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="modal-footer"> | ||
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</a> | ||
</div> | ||
</div> |