Skip to content

Commit

Permalink
Merge pull request #912 from scholtalbers/reorder-workflow-controls
Browse files Browse the repository at this point in the history
Reorder workflow inputs to top
  • Loading branch information
dannon committed Oct 15, 2015
2 parents 2d01cae + a9c91d3 commit 296dab0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 33 deletions.
28 changes: 19 additions & 9 deletions lib/galaxy/workflow/modules.py
Expand Up @@ -983,26 +983,36 @@ def load_module_sections( trans ):
""" Get abstract description of the workflow modules this Galaxy instance
is configured with.
"""
inputs_section = {
module_sections = {}
module_sections['inputs'] = {
"name": "inputs",
"title": "Inputs",
"modules": [
{"name": "data_input", "title": "Input Dataset", "description": "Input dataset"},
{"name": "data_collection_input", "title": "Input Dataset Collection", "description": "Input dataset collection"},
{
"name": "data_input",
"title": "Input Dataset",
"description": "Input dataset"
},
{
"name": "data_collection_input",
"title": "Input Dataset Collection",
"description": "Input dataset collection"
},
],
}
module_sections = [
inputs_section
]

if trans.app.config.enable_beta_workflow_modules:
experimental_modules = {
module_sections['experimental'] = {
"name": "experimental",
"title": "Experimental",
"modules": [
{"name": "pause", "title": "Pause Workflow for Dataset Review", "description": "Pause for Review"},
{
"name": "pause",
"title": "Pause Workflow for Dataset Review",
"description": "Pause for Review"
},
],
}
module_sections.append(experimental_modules)

return module_sections

Expand Down
60 changes: 36 additions & 24 deletions templates/webapps/galaxy/workflow/editor.mako
Expand Up @@ -259,6 +259,24 @@
"<div class='progress progress-striped progress-info active'><div class='progress-bar' style='width: 100%;'></div></div>", self.overlay_visible )}
</%def>


<%def name="render_module_section(module_section)">
<div class="toolSectionTitle" id="title___workflow__${module_section['name']}__">
<span>${module_section["title"]}</span>
</div>
<div id="__workflow__${module_section['name']}__" class="toolSectionBody">
<div class="toolSectionBg">
%for module in module_section["modules"]:
<div class="toolTitle">
<a href="#" onclick="workflow_view.add_node_for_module( '${module['name']}', '${module['title']}' )">
${module['description']}
</a>
</div>
%endfor
</div>
</div>
</%def>

<%def name="left_panel()">
<%
from galaxy.tools import Tool
Expand All @@ -272,11 +290,20 @@
</div>
<div class="unified-panel-body" style="overflow: auto;">
<div class="toolMenu">
<div class="toolMenu">
<%
from galaxy.workflow.modules import load_module_sections
module_sections = load_module_sections( trans )
%>
<div id="tool-search" style="padding-bottom: 5px; position: relative; display: block; width: 100%">
<input type="text" name="query" placeholder="search tools" id="tool-search-query" class="search-query parent-width" />
<img src="${h.url_for('/static/images/loading_small_white_bg.gif')}" id="search-spinner" class="search-spinner" />
</div>
<div class="toolSectionWrapper">
${render_module_section(module_sections['inputs'])}
</div>
<div class="toolSectionList">
%for val in app.toolbox.tool_panel_contents( trans ):
<div class="toolSectionWrapper">
Expand Down Expand Up @@ -321,35 +348,20 @@
%endif
## End Data Manager Tools
</div>
<div>&nbsp;</div>
%for section_name, module_section in module_sections.items():
%if section_name != "inputs":
${render_module_section(module_section)}
%endif
%endfor
## Feedback when search returns no results.
<div id="search-no-results" style="display: none; padding-top: 5px">
<em><strong>Search did not match any tools.</strong></em>
</div>
<div>&nbsp;</div>
<div class="toolMenuGroupHeader">Workflow control</div>
<%
from galaxy.workflow.modules import load_module_sections
%>
%for module_section in load_module_sections( trans ):
<% section_title = module_section["title"] %>
<% section_name = module_section["name"] %>
<div class="toolSectionTitle" id="title___workflow__${section_name}__">
<span>${section_title}</span>
</div>
<div id="__workflow__${section_name}__" class="toolSectionBody">
<div class="toolSectionBg">
%for module in module_section["modules"]:
<div class="toolTitle">
<a href="#" onclick="workflow_view.add_node_for_module( '${module['name']}', '${module['title']}' )">${module['description']}</a>
</div><!-- end toolTitle -->
%endfor
</div>
</div>
%endfor
</div>
</div>
</%def>

<%def name="center_panel()">
Expand Down Expand Up @@ -445,4 +457,4 @@
</div>
</div>
</%def>
</%def>

0 comments on commit 296dab0

Please sign in to comment.