galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/054d8af08f09/
Changeset: 054d8af08f09
Branch: next-stable
User: jmchilton
Date: 2014-10-06 01:36:27+00:00
Summary: Backport Kyle's fix to docker's host argument from default.
See https://bitbucket.org/galaxy/galaxy-central/pull-request/515/fixing-how-doc….
Affected #: 1 file
diff -r 12497a97f7d22d08c6fdafe0c544b4f7a906da98 -r 054d8af08f098c76b9b64eb5d60835956abc8ae1 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
https://bitbucket.org/galaxy/galaxy-central/commits/37cf5505992b/
Changeset: 37cf5505992b
User: jmchilton
Date: 2014-10-06 01:36:43+00:00
Summary: Merge next-stable.
Affected #: 1 file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm (pull request #515)
by commits-noreply@bitbucket.org 06 Oct '14
by commits-noreply@bitbucket.org 06 Oct '14
06 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b42fee58bc40/
Changeset: b42fee58bc40
User: jmchilton
Date: 2014-10-06 01:35:01+00:00
Summary: Merged in kellrott/galaxy-farm (pull request #515)
Fixing how docker_utils.__docker_prefix adds host info to command line
Affected #: 1 file
diff -r 3aa7288f5a97970df22fd38c400237028fe33e4b -r b42fee58bc402de82fb4667baa575cb81ab55f4b lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b94303434f03/
Changeset: b94303434f03
User: kell...(a)gmail.com
Date: 2014-10-05 05:01:12+00:00
Summary: Fixing how docker_util.__docker_prefix sets the host information
Affected #: 1 file
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r b94303434f031569a3484edb14e5d1b7a29c36d5 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -59,6 +59,7 @@
):
inspect_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
inspect_command_parts.extend(["inspect", image])
+ print inspect_command_parts
inspect_image_command = " ".join(inspect_command_parts)
pull_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
@@ -116,5 +117,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
https://bitbucket.org/galaxy/galaxy-central/commits/4aca849f229f/
Changeset: 4aca849f229f
User: kell...(a)gmail.com
Date: 2014-10-05 05:05:38+00:00
Summary: Removing stray print statement
Affected #: 1 file
diff -r b94303434f031569a3484edb14e5d1b7a29c36d5 -r 4aca849f229f538770376d091fac30e4a76854a8 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -59,7 +59,6 @@
):
inspect_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
inspect_command_parts.extend(["inspect", image])
- print inspect_command_parts
inspect_image_command = " ".join(inspect_command_parts)
pull_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
https://bitbucket.org/galaxy/galaxy-central/commits/b42fee58bc40/
Changeset: b42fee58bc40
User: jmchilton
Date: 2014-10-06 01:35:01+00:00
Summary: Merged in kellrott/galaxy-farm (pull request #515)
Fixing how docker_utils.__docker_prefix adds host info to command line
Affected #: 1 file
diff -r 3aa7288f5a97970df22fd38c400237028fe33e4b -r b42fee58bc402de82fb4667baa575cb81ab55f4b lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
by commits-noreply@bitbucket.org 06 Oct '14
by commits-noreply@bitbucket.org 06 Oct '14
06 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3aa7288f5a97/
Changeset: 3aa7288f5a97
User: jmchilton
Date: 2014-10-06 01:31:21+00:00
Summary: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
Adding tool_library_dir to tool_conf parser
Affected #: 3 files
diff -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 -r 3aa7288f5a97970df22fd38c400237028fe33e4b lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,7 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -687,7 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
+
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -717,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
7 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7666506937e2/
Changeset: 7666506937e2
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-09-25 22:24:31+00:00
Summary: Adding in the ability to configure a tool 'auto-load' directory.
Affected #: 3 files
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -120,7 +120,7 @@
# tool shed install data. There are many situtations in which it is
# valuable to seperate these - for instance bootstrapping fresh Galaxy
# instances with pretested installs. The following optin can be used to
-# separate the tool shed install database (all other options listed above
+# separate the tool shed install database (all other options listed above
# but prefixed with install_ are also available).
#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE
@@ -160,6 +160,14 @@
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
+# Path to autoload tools from.
+# Every directory inside the autoload directory will be scanned for *.xml files
+# and those will be loaded as tool descriptors
+#tool_autoload_dir = ./tool-autoload
+
+# Autoload Panel, for all tools that are autoloaded, they are placed in this tool section
+#tool_autoload_section = Development
+
# Path to the directory in which tool dependencies are placed. This is used by
# the tool shed to install dependencies and can also be used by administrators
# to manually install or link to dependencies. For details, see:
@@ -173,7 +181,7 @@
#tool_sheds_config_file = config/tool_sheds_conf.xml
# Enable automatic polling of relative tool sheds to see if any updates
-# are available for installed repositories. Ideally only one Galaxy
+# are available for installed repositories. Ideally only one Galaxy
# server process should be able to check for repository updates. The
# setting for hours_between_check should be an integer between 1 and 24.
#enable_tool_shed_check = False
@@ -238,7 +246,7 @@
#citation_cache_data_dir = database/citations/data
#citation_cache_lock_dir = database/citations/lock
-# External service types config file, defines what types of external_services configurations
+# External service types config file, defines what types of external_services configurations
# are available in Galaxy (.sample is used if default does not exist).
#external_service_type_config_file = config/external_service_types_conf.xml
@@ -347,15 +355,15 @@
# -- Account activation
-# This is user account activation feature global flag. If set to "False" the rest of the Account
+# This is user account activation feature global flag. If set to "False" the rest of the Account
# activation configuration is ignored and user activation is disabled (a.k.a. accounts are active since registration).
# Note the activation is also not working in case the smtp server is not defined.
#user_activation_on = False
-# Activation grace period. Activation is not forced (login is not disabled) until
+# Activation grace period. Activation is not forced (login is not disabled) until
# grace period has passed. Users under grace period can't run jobs (see inactivity_box_content).
-# In hours. Default is 3. Enter 0 to disable grace period.
-# Users with OpenID logins have grace period forever.
+# In hours. Default is 3. Enter 0 to disable grace period.
+# Users with OpenID logins have grace period forever.
#activation_grace_period = 0
# Used for warning box for inactive accounts (unable to run jobs).
@@ -415,7 +423,7 @@
# - $iso8601 (complete format string as specified by ISO 8601 international standard).
# pretty_datetime_format = $locale (UTC)
-# The URL of the page to display in Galaxy's middle pane when loaded. This can be
+# The URL of the page to display in Galaxy's middle pane when loaded. This can be
# an absolute or relative URL.
#welcome_url = /static/welcome.html
@@ -447,7 +455,7 @@
# The URL linked by the "Galaxy Q&A" link in the "Help" menu
# The Galaxy Q&A site is under development; when the site is done, this URL
# will be set and uncommented.
-#qa_url =
+#qa_url =
# Serve static content, which must be enabled if you're not serving it via a
# proxy server. These options should be self explanatory and so are not
@@ -600,7 +608,7 @@
# if testing shows that Galaxy is able to create files using these formats.
# Specific formats can be disabled with this option, separate more than one
# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'.
-#disable_library_comptypes =
+#disable_library_comptypes =
# Some sequencer integration features in beta allow you to automatically
# transfer datasets. This is done using a lightweight transfer manager which
@@ -750,7 +758,7 @@
# File where Data Managers are configured (.sample used if default does not
# exist)
#data_manager_config_file = config/data_manager_conf.xml
-# File where Tool Shed based Data Managers are configured
+# File where Tool Shed based Data Managers are configured
#shed_data_manager_config_file = config/shed_data_manager_conf.xml
# Directory to store Data Manager based tool-data; defaults to tool_data_path
#galaxy_data_manager_data_path = tool-data
@@ -869,11 +877,11 @@
# ---- Galaxy External Message Queue -------------------------------------------------
-# Galaxy uses AMQ protocol to receive messages from external sources like
+# Galaxy uses AMQ protocol to receive messages from external sources like
# bar code scanners. Galaxy has been tested against RabbitMQ AMQP implementation.
-# For Galaxy to receive messages from a message queue the RabbitMQ server has
+# For Galaxy to receive messages from a message queue the RabbitMQ server has
# to be set up with a user account and other parameters listed below. The 'host'
-# and 'port' fields should point to where the RabbitMQ server is running.
+# and 'port' fields should point to where the RabbitMQ server is running.
[galaxy_amqp]
@@ -886,4 +894,3 @@
#exchange = galaxy_exchange
#routing_key = bar_code_scanner
#rabbitmqctl_path = /path/to/rabbitmqctl
-
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -88,6 +88,9 @@
self.user_label_filters = listify( kwargs.get( "user_tool_label_filters", [] ), do_strip=True )
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
+ self.tool_autoload_dir = kwargs.get( "tool_autoload_dir", None )
+ self.tool_autoload_section = kwargs.get( "tool_autoload_section", None )
+
# Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
# been migrated from the Galaxy code distribution to the Tool Shed.
self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -157,6 +157,23 @@
self.init_tools( config_filename )
except:
log.exception( "Error loading tools defined in config %s", config_filename )
+ if self.app.config.tool_autoload_dir is not None:
+ log.info("Autoloading tool directory: %s" % (self.app.config.tool_autoload_dir))
+
+ auto_load_section = ToolSection({
+ 'id' : "__tool_autoload__",
+ 'version' : "1.0.0",
+ 'name' : self.app.config.tool_autoload_section})
+
+ for tool_xml_path in glob.glob(os.path.join(self.app.config.tool_autoload_dir, "*", "*.xml")):
+ log.info("AutoLoading: %s" % (tool_xml_path))
+ tool = self.load_tool(tool_xml_path)
+ self.tools_by_id[ tool.id ] = tool
+ self.__add_tool_to_tool_panel( tool, auto_load_section, section=True )
+
+ self.tool_panel[ "__tool_autoload__" ] = auto_load_section
+ #self.__add_tool_to_tool_panel( auto_load_section, self.tool_panel, section=False )
+
if self.app.name == 'galaxy' and self.integrated_tool_panel_config_has_contents:
# Load self.tool_panel based on the order in self.integrated_tool_panel.
self.load_tool_panel()
@@ -816,7 +833,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/3a03061c4a85/
Changeset: 3a03061c4a85
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:10:09+00:00
Summary: Default Merge
Affected #: 116 files
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.frame.js
--- a/client/galaxy/scripts/galaxy.frame.js
+++ b/client/galaxy/scripts/galaxy.frame.js
@@ -1,9 +1,8 @@
// dependencies
define(["galaxy.masthead", "mvc/ui/ui-frames"], function(mod_masthead, Frames) {
-// frame manager
-var GalaxyFrame = Backbone.View.extend(
-{
+/** Frame manager uses the ui-frames to create the scratch book masthead icon and functionality **/
+var GalaxyFrame = Backbone.View.extend({
// base element
el_main: 'body',
@@ -17,8 +16,7 @@
button_load : null,
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// add to masthead menu
var self = this;
@@ -28,8 +26,7 @@
});
// add activate icon
- this.button_active = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_active = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
onclick : function() { self._activate(); },
@@ -44,8 +41,7 @@
Galaxy.masthead.append(this.button_active);
// add load icon
- this.button_load = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_load = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
onclick : function(e) {
@@ -122,35 +118,77 @@
});
},
+
+ /**
+ * Add a trackster visualization to the frames.
+ */
+ add_trackster_viz: function(viz_id) {
+ var self = this;
+ require(['viz/visualization', 'viz/trackster'], function(visualization, trackster) {
+ var viz = new visualization.Visualization({id: viz_id});
+ $.when( viz.fetch() ).then( function() {
+ var ui = new trackster.TracksterUI(galaxy_config.root);
+
+ // Construct frame config based on dataset's type.
+ var frame_config = {
+ title: viz.get('name'),
+ type: 'other',
+ content: function(parent_elt) {
+ // Create view config.
+ var view_config = {
+ container: parent_elt,
+ name: viz.get('title'),
+ id: viz.id,
+ // FIXME: this will not work with custom builds b/c the dbkey needed to be encoded.
+ dbkey: viz.get('dbkey'),
+ stand_alone: false
+ },
+ latest_revision = viz.get('latest_revision'),
+ drawables = latest_revision.config.view.drawables;
+
+ // Set up datasets in drawables.
+ _.each(drawables, function(d) {
+ d.dataset = {
+ hda_ldda: d.hda_ldda,
+ id: d.dataset_id
+ };
+ });
+
+ view = ui.create_visualization(view_config,
+ latest_revision.config.viewport,
+ latest_revision.config.view.drawables,
+ latest_revision.config.bookmarks,
+ false);
+ }
+ };
+
+ self.add(frame_config);
+ });
+ });
+ },
/**
* Add and display a new frame/window based on options.
*/
- add: function(options)
- {
+ add: function(options){
// open new tab
- if (options.target == '_blank')
- {
+ if (options.target == '_blank'){
window.open(options.content);
return;
}
// reload entire window
- if (options.target == '_top' || options.target == '_parent' || options.target == '_self')
- {
+ if (options.target == '_top' || options.target == '_parent' || options.target == '_self'){
window.location = options.content;
return;
}
// validate
- if (!this.active)
- {
+ if (!this.active){
// fix url if main frame is unavailable
var $galaxy_main = $(window.parent.document).find('#galaxy_main');
- if (options.target == 'galaxy_main' || options.target == 'center')
- {
- if ($galaxy_main.length === 0)
- {
+ if (options.target == 'galaxy_main' || options.target == 'center'){
+ if ($galaxy_main.length === 0){
var href = options.content;
if (href.indexOf('?') == -1)
href += '?';
@@ -173,11 +211,9 @@
},
// activate/disable panel
- _activate: function ()
- {
+ _activate: function (){
// check
- if (this.active)
- {
+ if (this.active){
// disable
this.active = false;
@@ -196,8 +232,7 @@
},
// update frame counter
- _refresh: function()
- {
+ _refresh: function(){
// update on screen counter
this.button_load.number(this.frames.length());
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -1,9 +1,8 @@
// dependencies
define([], function() {
-// masthead
-var GalaxyMasthead = Backbone.View.extend(
-{
+/** Masthead **/
+var GalaxyMasthead = Backbone.View.extend({
// base element
el_masthead: '#everything',
@@ -17,8 +16,7 @@
list: [],
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// update options
this.options = options;
@@ -51,27 +49,23 @@
},
// configure events
- events:
- {
+ events: {
'click' : '_click',
'mousedown' : function(e) { e.preventDefault() }
},
// adds a new item to the masthead
- append : function(item)
- {
+ append : function(item) {
return this._add(item, true);
},
// adds a new item to the masthead
- prepend : function(item)
- {
+ prepend : function(item) {
return this._add(item, false);
},
// activate
- highlight: function(id)
- {
+ highlight: function(id) {
var current = $(this.el).find('#' + id + '> li');
if (current) {
current.addClass('active');
@@ -79,11 +73,9 @@
},
// adds a new item to the masthead
- _add : function(item, append)
- {
+ _add : function(item, append) {
var $loc = $(this.el).find('#' + item.location);
- if ($loc)
- {
+ if ($loc){
// create frame for new item
var $current = $(item.el);
@@ -106,8 +98,7 @@
},
// handle click event
- _click: function(e)
- {
+ _click: function(e) {
// close all popups
var $all = $(this.el).find('.popup');
if ($all) {
@@ -129,8 +120,7 @@
*/
// fill template
- _template: function(options)
- {
+ _template: function(options) {
var brand_text = options.brand ? ("/ " + options.brand) : "" ;
return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
'<div style="position: relative; right: -50%; float: left;">' +
@@ -150,12 +140,10 @@
}
});
-// icon
-var GalaxyMastheadIcon = Backbone.View.extend(
-{
+/** Masthead icon **/
+var GalaxyMastheadIcon = Backbone.View.extend({
// icon options
- options:
- {
+ options:{
id : '',
icon : 'fa-cog',
tooltip : '',
@@ -169,8 +157,7 @@
location: 'iconbar',
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -189,20 +176,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// switch icon
- icon: function (new_icon)
- {
+ icon: function (new_icon){
// update icon class
$(this.el).find('.icon').removeClass(this.options.icon)
.addClass(new_icon);
@@ -212,26 +196,22 @@
},
// toggle
- toggle: function()
- {
+ toggle: function(){
$(this.el).addClass('toggle');
},
// untoggle
- untoggle: function()
- {
+ untoggle: function(){
$(this.el).removeClass('toggle');
},
// set/get number
- number: function(new_number)
- {
+ number: function(new_number){
$(this.el).find('.number').text(new_number);
},
// fill template icon
- _template: function (options)
- {
+ _template: function (options){
var tmpl = '<div id="' + options.id + '" class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
if (options.with_number)
@@ -243,12 +223,10 @@
}
});
-// tab
-var GalaxyMastheadTab = Backbone.View.extend(
-{
+/** Masthead tab **/
+var GalaxyMastheadTab = Backbone.View.extend({
// main options
- options:
- {
+ options:{
id : '',
title : '',
target : '_parent',
@@ -268,14 +246,12 @@
$menu: null,
// events
- events:
- {
+ events:{
'click .head' : '_head'
},
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -300,20 +276,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// add menu item
- add: function (options)
- {
+ add: function (options){
// menu option defaults
var menuOptions = {
title : 'Title',
@@ -333,8 +306,7 @@
menuOptions.content = galaxy_config.root + menuOptions.content;
// check if submenu element is available
- if (!this.$menu)
- {
+ if (!this.$menu){
// insert submenu element into root
$(this.el).find('.root').append(this._templateMenu());
@@ -353,8 +325,7 @@
// add events
var self = this;
- $item.on('click', function(e)
- {
+ $item.on('click', function(e){
// prevent default
e.preventDefault();
@@ -372,8 +343,7 @@
},
// show menu on header click
- _head: function(e)
- {
+ _head: function(e){
// prevent default
e.preventDefault();
@@ -387,8 +357,7 @@
}
},
- _attachPopover : function()
- {
+ _attachPopover : function(){
var $popover_element = $(this.el).find('.head');
$popover_element.popover({
html: true,
@@ -402,25 +371,21 @@
},
// fill template header
- _templateMenuItem: function (options)
- {
+ _templateMenuItem: function (options){
return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
},
// fill template header
- _templateMenu: function ()
- {
+ _templateMenu: function (){
return '<ul class="popup dropdown-menu"></ul>';
},
- _templateDivider: function()
- {
+ _templateDivider: function(){
return '<li class="divider"></li>';
},
// fill template
- _template: function (options)
- {
+ _template: function (options){
// start template
var tmpl = '<ul id="' + options.id + '" class="nav navbar-nav" border="0" cellspacing="0">' +
'<li class="root dropdown" style="">' +
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -1,13 +1,8 @@
-/*
- galaxy menu
-*/
-
// dependencies
define(["galaxy.masthead"], function(mod_masthead) {
-// frame manager
-var GalaxyMenu = Backbone.Model.extend(
-{
+/** GalaxyMenu uses the GalaxyMasthead class in order to add menu items and icons to the Masthead **/
+var GalaxyMenu = Backbone.Model.extend({
// options
options: null,
@@ -15,16 +10,14 @@
masthead: null,
// initialize
- initialize: function(options)
- {
+ initialize: function(options) {
this.options = options.config;
this.masthead = options.masthead;
this.create();
},
// default menu
- create: function()
- {
+ create: function(){
//
// Analyze data tab.
//
@@ -137,8 +130,7 @@
var tab_visualization = new mod_masthead.GalaxyMastheadTab(visualization_options);
- if (this.options.user.valid) //add submenu only when user is logged in
- {
+ if (this.options.user.valid){ //add submenu only when user is logged in
tab_visualization.add({
title : "New Track Browser",
content : "visualization/trackster",
@@ -155,8 +147,7 @@
//
// Cloud menu.
//
- if (this.options.enable_cloud_launch)
- {
+ if (this.options.enable_cloud_launch){
var tab_cloud = new mod_masthead.GalaxyMastheadTab({
id : "cloud",
title : "Cloud",
@@ -172,8 +163,7 @@
//
// Admin.
//
- if (this.options.is_admin_user)
- {
+ if (this.options.is_admin_user) {
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
@@ -192,8 +182,7 @@
title : "Help",
title_attribute : 'Support, contact, and community hubs'
});
- if (this.options.biostar_url)
- {
+ if (this.options.biostar_url){
tab_help.add({
title : "Galaxy Biostar",
content : this.options.biostar_url_redirect,
@@ -235,8 +224,7 @@
content : this.options.citation_url,
target : "_blank"
});
- if (this.options.terms_url)
- {
+ if (this.options.terms_url){
tab_help.add({
title : "Terms and Conditions",
content : this.options.terms_url,
@@ -248,8 +236,7 @@
//
// User tab.
//
- if (!this.options.user.valid)
- {
+ if (!this.options.user.valid){
var tab_user = new mod_masthead.GalaxyMastheadTab({
id : "user",
title : "User",
@@ -265,8 +252,7 @@
});
// register
- if (this.options.allow_user_creation)
- {
+ if (this.options.allow_user_creation){
tab_user.add({
title : "Register",
content : "user/create",
@@ -331,8 +317,7 @@
target : "galaxy_main"
});
- if (this.options.use_remote_user)
- {
+ if (this.options.use_remote_user){
tab_user.add({
title : "Public Name",
content : "user/edit_username?cntrller=user",
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/base-mvc.js
--- a/client/galaxy/scripts/mvc/base-mvc.js
+++ b/client/galaxy/scripts/mvc/base-mvc.js
@@ -380,11 +380,6 @@
/** allow the view to be dragged, set up event handlers */
draggableOn : function(){
this.draggable = true;
- //TODO: I have no idea why this doesn't work with the events hash or jq.on()...
- //this.$el.find( '.title-bar' )
- // .attr( 'draggable', true )
- // .bind( 'dragstart', this.dragStartHandler, false )
- // .bind( 'dragend', this.dragEndHandler, false );
this.dragStartHandler = _.bind( this._dragStartHandler, this );
this.dragEndHandler = _.bind( this._dragEndHandler, this );
@@ -402,23 +397,22 @@
},
/** sets the dataTransfer data to the model's toJSON
- * @fires dragstart (bbone event) which is passed this view
+ * @fires draggable:dragstart (bbone event) which is passed the event and this view
*/
_dragStartHandler : function( event ){
- //this.debug( 'dragStartHandler:', this, event, arguments )
- this.trigger( 'dragstart', this );
event.dataTransfer.effectAllowed = 'move';
+ //ASSUMES: this.model
//TODO: all except IE: should be 'application/json', IE: must be 'text'
event.dataTransfer.setData( 'text', JSON.stringify( this.model.toJSON() ) );
+ this.trigger( 'draggable:dragstart', event, this );
return false;
},
/** handle the dragend
- * @fires dragend (bbone event) which is passed this view
+ * @fires draggable:dragend (bbone event) which is passed the event and this view
*/
_dragEndHandler : function( event ){
- this.trigger( 'dragend', this );
- //this.debug( 'dragEndHandler:', event )
+ this.trigger( 'draggable:dragend', event, this );
return false;
}
};
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
@@ -181,6 +181,8 @@
}
var $visualizations = $( this.templates.visualizations( visualizations, this ) );
+ //HACK: need to re-write those directed at galaxy_main with linkTarget
+ $visualizations.find( '[target="galaxy_main"]').attr( 'target', this.linkTarget );
// use addBack here to include the root $visualizations elem (for the case of 1 visualization)
this._addScratchBookFn( $visualizations.find( '.visualization-link' ).addBack( '.visualization-link' ) );
return $visualizations;
@@ -188,6 +190,7 @@
/** add scratchbook functionality to visualization links */
_addScratchBookFn : function( $links ){
+ var li = this;
$links.click( function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
Galaxy.frame.add({
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-li.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js
@@ -160,7 +160,7 @@
// add frame manager option onclick event
var self = this;
displayBtnData.onclick = function( ev ){
- if( Galaxy.frame && Galaxy.frame.active ){
+ if (Galaxy.frame && Galaxy.frame.active) {
// Add dataset to frames.
Galaxy.frame.add_dataset(self.model.get('id'));
ev.preventDefault();
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-model.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-model.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-model.js
@@ -359,74 +359,11 @@
Backbone.Collection.prototype.set.call( this, models, options );
},
-// /** Convert this ad-hoc collection of hdas to a formal collection tracked
-// by the server.
-// **/
-// promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
-////TODO: seems like this would be better in mvc/collections
-// options = options || {};
-// options.url = this.url();
-// options.type = "POST";
-// var full_collection_type = collection_type;
-// var element_identifiers = [],
-// name = null;
-//
-// // This mechanism is rough - no error handling, allows invalid selections, no way
-// // for user to pick/override element identifiers. This is only really meant
-// if( collection_type === "list" ) {
-// this.chain().each( function( hda ) {
-// // TODO: Handle duplicate names.
-// var name = hda.attributes.name;
-// var id = hda.get('id');
-// var content_type = hda.attributes.history_content_type;
-// if( content_type === "dataset" ) {
-// if( full_collection_type !== "list" ) {
-// this.log( "Invalid collection type" );
-// }
-// element_identifiers.push( { name: name, src: "hda", id: id } );
-// } else {
-// if( full_collection_type === "list" ) {
-// full_collection_type = "list:" + hda.attributes.collection_type;
-// } else {
-// if( full_collection_type !== "list:" + hda.attributes.collection_type ) {
-// this.log( "Invalid collection type" );
-// }
-// }
-// element_identifiers.push( { name: name, src: "hdca", id: id } );
-// }
-// });
-// name = "New Dataset List";
-// } else if( collection_type === "paired" ) {
-// var ids = this.ids();
-// if( ids.length !== 2 ){
-// // TODO: Do something...
-// }
-// element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } );
-// element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } );
-// name = "New Dataset Pair";
-// }
-// options.data = {
-// type: "dataset_collection",
-// name: name,
-// collection_type: full_collection_type,
-// element_identifiers: JSON.stringify( element_identifiers )
-// };
-//
-// var xhr = jQuery.ajax( options );
-// xhr.done( function( message, status, responseObj ){
-// history.refresh( );
-// });
-// xhr.fail( function( xhr, status, message ){
-// if( xhr.responseJSON && xhr.responseJSON.error ){
-// error = xhr.responseJSON.error;
-// } else {
-// error = xhr.responseJSON;
-// }
-// xhr.responseText = error;
-// // Do something?
-// });
-// return xhr;
-// },
+ ///** Convert this ad-hoc collection of hdas to a formal collection tracked
+ // by the server.
+ //**/
+ //promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
+ //},
/** String representation. */
toString : function(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-contents.js
--- a/client/galaxy/scripts/mvc/history/history-contents.js
+++ b/client/galaxy/scripts/mvc/history/history-contents.js
@@ -187,6 +187,7 @@
/** copy an existing, accessible hda into this collection */
copy : function( id ){
+//TODO: incorp collections
var collection = this,
xhr = jQuery.post( this.url(), {
source : 'hda',
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-model.js
--- a/client/galaxy/scripts/mvc/history/history-model.js
+++ b/client/galaxy/scripts/mvc/history/history-model.js
@@ -14,7 +14,7 @@
* @constructs
*/
var History = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
-/** @lends History.prototype */{
+ BASE_MVC.mixin( BASE_MVC.SearchableModelMixin, /** @lends History.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
@@ -117,7 +117,19 @@
return _.reduce( _.values( this.get( 'state_details' ) ), function( memo, num ){ return memo + num; }, 0 );
},
- // ........................................................................ ajax
+ // ........................................................................ search
+ /** What model fields to search with */
+ searchAttributes : [
+ 'name', 'annotation', 'tags'
+ ],
+
+ /** Adding title and singular tag */
+ searchAliases : {
+ title : 'name',
+ tag : 'tags'
+ },
+
+ // ........................................................................ updates
/** does the contents collection indicate they're still running and need to be updated later?
* delay + update if needed
* @param {Function} onReadyCallback function to run when all contents are in the ready state
@@ -187,6 +199,18 @@
return xhr;
},
+ // ........................................................................ ajax
+ /** save this history, _Mark_ing it as deleted (just a flag) */
+ _delete : function( options ){
+ if( this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: true }, options );
+ },
+ /** save this history, _Mark_ing it as undeleted */
+ undelete : function( options ){
+ if( !this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: false }, options );
+ },
+
/** Make a copy of this history on the server
* @param {Boolean} current if true, set the copy as the new current history (default: true)
* @param {String} name name of new history (default: none - server sets to: Copy of <current name>)
@@ -210,9 +234,28 @@
//TODO:?? all datasets?
var history = this,
- xhr = jQuery.post( this.urlRoot, postData );
- xhr.done( function( newData ){
- history.trigger( 'copied', history, newData );
+ copy = jQuery.post( this.urlRoot, postData );
+ // if current - queue to setAsCurrent before firing 'copied'
+ if( current ){
+ return copy.then( function( response ){
+ var newHistory = new History( response );
+ return newHistory.setAsCurrent()
+ .done( function(){
+ history.trigger( 'copied', history, response );
+ });
+ });
+ }
+ return copy.done( function( response ){
+ history.trigger( 'copied', history, response );
+ });
+ },
+
+ setAsCurrent : function(){
+ var history = this,
+ xhr = jQuery.getJSON( '/history/set_as_current?id=' + this.id );
+
+ xhr.done( function(){
+ history.trigger( 'set-as-current', history );
});
return xhr;
},
@@ -221,7 +264,7 @@
toString : function(){
return 'History(' + this.get( 'id' ) + ',' + this.get( 'name' ) + ')';
}
-});
+}));
//------------------------------------------------------------------------------ CLASS VARS
/** When the history has running hdas,
@@ -351,12 +394,15 @@
create : function create( data, hdas, historyOptions, xhrOptions ){
var collection = this,
- history = new History( data || {}, hdas || [], historyOptions || {} );
- return history.save( xhrOptions ).done( function( newData ){
+ xhr = jQuery.getJSON( galaxy_config.root + 'history/create_new_current' );
+ return xhr.done( function( newData ){
+ var history = new History( newData, [], historyOptions || {} );
// new histories go in the front
//TODO: (implicit ordering by update time...)
collection.unshift( history );
+ collection.trigger( 'new-current' );
});
+//TODO: move back to using history.save (via Deferred.then w/ set_as_current)
},
toString: function toString(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel-edit-current.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
@@ -398,14 +398,17 @@
//TODO: move show_deleted/hidden into panel from opt menu and remove this
/** add listeners to an external options menu (templates/webapps/galaxy/root/index.mako) */
connectToOptionsMenu : function( optionsMenu ){
+ var panel = this;
if( !optionsMenu ){
- return this;
+ return panel;
}
// set a visible indication in the popupmenu for show_hidden/deleted based on the currHistoryPanel's settings
- this.on( 'new-storage', function( storage, panel ){
- if( optionsMenu && storage ){
- optionsMenu.findItemByHtml( _l( 'Include Deleted Datasets' ) ).checked = storage.get( 'show_deleted' );
- optionsMenu.findItemByHtml( _l( 'Include Hidden Datasets' ) ).checked = storage.get( 'show_hidden' );
+ this.on( 'new-storage show-deleted show-hidden', function(){
+//TODO: global
+ var menu = ( Galaxy && Galaxy.historyOptionsMenu )? Galaxy.historyOptionsMenu : undefined;
+ if( menu ){
+ menu.findItemByHtml( _l( 'Include Deleted Datasets' ) ).checked = panel.showDeleted;
+ menu.findItemByHtml( _l( 'Include Hidden Datasets' ) ).checked = panel.showHidden;
}
});
return this;
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel-edit.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit.js
@@ -69,6 +69,17 @@
this.multiselectActions = attributes.multiselectActions || this._getActions();
},
+ /** Override to handle history as drag-drop target */
+ _setUpListeners : function(){
+ _super.prototype._setUpListeners.call( this );
+
+ this.on( 'drop', function( ev, data ){
+ this.dataDropped( data );
+ // remove the drop target
+ this.dropTargetOff();
+ });
+ },
+
// ------------------------------------------------------------------------ listeners
/** listening for collection events */
_setUpCollectionListeners : function(){
@@ -104,6 +115,42 @@
return $newRender;
},
+ /** override to render counts when the items are rendered */
+ renderItems : function( $whereTo ){
+ var views = _super.prototype.renderItems.call( this, $whereTo );
+ this._renderCounts( $whereTo );
+ return views;
+ },
+
+ /** override to show counts, what's deleted/hidden, and links to toggle those */
+ _renderCounts : function( $whereTo ){
+//TODO: too complicated
+ function toggleLink( _class, text ){
+ return [ '<a class="', _class, '" href="javascript:void(0);">', text, '</a>' ].join( '' );
+ }
+ $whereTo = $whereTo || this.$el;
+ var deleted = this.collection.where({ deleted: true }),
+ hidden = this.collection.where({ visible: false }),
+ msgs = [];
+
+ if( this.views.length ){
+ msgs.push( [ this.views.length, _l( 'shown' ) ].join( ' ' ) );
+ }
+ if( deleted.length ){
+ msgs.push( ( !this.showDeleted )?
+ ([ deleted.length, toggleLink( 'toggle-deleted-link', _l( 'deleted' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-deleted-link', _l( 'hide deleted' ) ) )
+ );
+ }
+ if( hidden.length ){
+ msgs.push( ( !this.showHidden )?
+ ([ hidden.length, toggleLink( 'toggle-hidden-link', _l( 'hidden' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-hidden-link', _l( 'hide hidden' ) ) )
+ );
+ }
+ return $whereTo.find( '.subtitle' ).html( msgs.join( ', ' ) );
+ },
+
/** render the tags sub-view controller */
_renderTags : function( $where ){
var panel = this;
@@ -296,10 +343,18 @@
return options;
},
+ ///** Override to alter data in drag based on multiselection */
+ //_setUpItemViewListeners : function( view ){
+ // var panel = this;
+ // _super.prototype._setUpItemViewListeners.call( panel, view );
+ //
+ //},
+
/** If this item is deleted and we're not showing deleted items, remove the view
* @param {Model} the item model to check
*/
_handleHdaDeletionChange : function( itemModel ){
+ this._renderCounts();
if( itemModel.get( 'deleted' ) && !this.showDeleted ){
this.removeItemView( itemModel );
}
@@ -309,6 +364,7 @@
* @param {Model} the item model to check
*/
_handleHdaVisibleChange : function( itemModel ){
+ this._renderCounts();
if( itemModel.hidden() && !this.storage.showHidden ){
this.removeItemView( itemModel );
}
@@ -337,7 +393,9 @@
// ------------------------------------------------------------------------ panel events
/** event map */
events : _.extend( _.clone( _super.prototype.events ), {
- 'click .show-selectors-btn' : 'toggleSelectors'
+ 'click .show-selectors-btn' : 'toggleSelectors',
+ 'click .toggle-deleted-link' : function( ev ){ this.toggleShowDeleted(); },
+ 'click .toggle-hidden-link' : function( ev ){ this.toggleShowHidden(); }
}),
/** Update the history size display (curr. upper right of panel).
@@ -346,6 +404,132 @@
this.$el.find( '.history-size' ).text( this.model.get( 'nice_size' ) );
},
+ // ------------------------------------------------------------------------ as drop target
+ /** */
+ dropTargetOn : function(){
+ if( this.dropTarget ){ return this; }
+ this.dropTarget = true;
+
+ //TODO: to init
+ var dropHandlers = {
+ 'dragenter' : _.bind( this.dragenter, this ),
+ 'dragover' : _.bind( this.dragover, this ),
+ 'dragleave' : _.bind( this.dragleave, this ),
+ 'drop' : _.bind( this.drop, this )
+ };
+//TODO: scroll to top
+ var $dropTarget = this._renderDropTarget();
+ this.$list().before([ this._renderDropTargetHelp(), $dropTarget ]);
+ for( var evName in dropHandlers ){
+ if( dropHandlers.hasOwnProperty( evName ) ){
+ //console.debug( evName, dropHandlers[ evName ] );
+ $dropTarget.on( evName, dropHandlers[ evName ] );
+ }
+ }
+ return this;
+ },
+
+ /** */
+ _renderDropTarget : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target' )
+ .css({
+ 'height': '64px',
+ 'margin': '0px 10px 10px 10px',
+ 'border': '1px dashed black',
+ 'border-radius' : '3px'
+ });
+ },
+
+ /** */
+ _renderDropTargetHelp : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target-help' )
+ .css({
+ 'margin' : '10px 10px 4px 10px',
+ 'color' : 'grey',
+ 'font-size' : '80%',
+ 'font-style' : 'italic'
+ })
+ .text( _l( 'Drag datasets here to copy them to the current history' ) );
+ },
+
+ /** */
+ dropTargetOff : function(){
+ if( !this.dropTarget ){ return this; }
+ //this.log( 'dropTargetOff' );
+ this.dropTarget = false;
+ //
+ //var dropTarget = this.$( '.history-drop-target' ).get(0);
+ //for( var evName in this._dropHandlers ){
+ // if( this._dropHandlers.hasOwnProperty( evName ) ){
+ // console.debug( evName, this._dropHandlers[ evName ] );
+ // dropTarget.off( evName, this._dropHandlers[ evName ] );
+ // }
+ //}
+ this.$( '.history-drop-target' ).remove();
+ this.$( '.history-drop-target-help' ).remove();
+ return this;
+ },
+ /** */
+ dropTargetToggle : function(){
+ if( this.dropTarget ){
+ this.dropTargetOff();
+ } else {
+ this.dropTargetOn();
+ }
+ return this;
+ },
+
+ /** */
+ dragenter : function( ev ){
+ //console.debug( 'dragenter:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '2px solid black' );
+ },
+ /** */
+ dragover : function( ev ){
+ ev.preventDefault();
+ ev.stopPropagation();
+ },
+ /** */
+ dragleave : function( ev ){
+ //console.debug( 'dragleave:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '1px dashed black' );
+ },
+ /** */
+ drop : function( ev ){
+ //console.warn( 'dataTransfer:', ev.dataTransfer.getData( 'text' ) );
+ //console.warn( 'dataTransfer:', ev.originalEvent.dataTransfer.getData( 'text' ) );
+ ev.preventDefault();
+ //ev.stopPropagation();
+ ev.dataTransfer.dropEffect = 'move';
+
+ //console.debug( 'ev.dataTransfer:', ev.dataTransfer );
+
+ var panel = this,
+ data = ev.dataTransfer.getData( "text" );
+ try {
+ data = JSON.parse( data );
+
+ } catch( err ){
+ this.warn( 'error parsing JSON from drop:', data );
+ }
+ this.trigger( 'droptarget:drop', ev, data, panel );
+ return false;
+ },
+
+ /** */
+ dataDropped : function( data ){
+ var panel = this;
+ // HDA: dropping will copy it to the history
+ if( _.isObject( data ) && data.model_class === 'HistoryDatasetAssociation' && data.id ){
+ return panel.model.contents.copy( data.id );
+ }
+ return jQuery.when();
+ },
+
// ........................................................................ misc
/** Return a string rep of the history */
toString : function(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel.js
--- a/client/galaxy/scripts/mvc/history/history-panel.js
+++ b/client/galaxy/scripts/mvc/history/history-panel.js
@@ -395,6 +395,7 @@
if( store ){
this.storage.set( 'show_deleted', show );
}
+ this.trigger( 'show-hidden', show );
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
return this.showDeleted;
@@ -412,6 +413,7 @@
if( store ){
this.storage.set( 'show_hidden', show );
}
+ this.trigger( 'show-hidden', show );
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
return this.showHidden;
@@ -606,9 +608,7 @@
'<div class="title">',
'<div class="name"><%= history.name %></div>',
'</div>',
- '<div class="subtitle">',
- //'<%= view.collection.length %>', _l( ' items' ),
- '</div>',
+ '<div class="subtitle"></div>',
'<div class="history-size"><%= history.nice_size %></div>',
'<div class="actions"></div>',
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/galaxy/galaxy-central/commits/b8db34a82175/
Changeset: b8db34a82175
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:12:47+00:00
Summary: Reverting back to default
Affected #: 3 files
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -120,7 +120,7 @@
# tool shed install data. There are many situtations in which it is
# valuable to seperate these - for instance bootstrapping fresh Galaxy
# instances with pretested installs. The following optin can be used to
-# separate the tool shed install database (all other options listed above
+# separate the tool shed install database (all other options listed above
# but prefixed with install_ are also available).
#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE
@@ -160,14 +160,6 @@
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
-# Path to autoload tools from.
-# Every directory inside the autoload directory will be scanned for *.xml files
-# and those will be loaded as tool descriptors
-#tool_autoload_dir = ./tool-autoload
-
-# Autoload Panel, for all tools that are autoloaded, they are placed in this tool section
-#tool_autoload_section = Development
-
# Path to the directory in which tool dependencies are placed. This is used by
# the tool shed to install dependencies and can also be used by administrators
# to manually install or link to dependencies. For details, see:
@@ -187,7 +179,7 @@
#watch_tools = False
# Enable automatic polling of relative tool sheds to see if any updates
-# are available for installed repositories. Ideally only one Galaxy
+# are available for installed repositories. Ideally only one Galaxy
# server process should be able to check for repository updates. The
# setting for hours_between_check should be an integer between 1 and 24.
#enable_tool_shed_check = False
@@ -252,7 +244,7 @@
#citation_cache_data_dir = database/citations/data
#citation_cache_lock_dir = database/citations/lock
-# External service types config file, defines what types of external_services configurations
+# External service types config file, defines what types of external_services configurations
# are available in Galaxy (.sample is used if default does not exist).
#external_service_type_config_file = config/external_service_types_conf.xml
@@ -361,15 +353,15 @@
# -- Account activation
-# This is user account activation feature global flag. If set to "False" the rest of the Account
+# This is user account activation feature global flag. If set to "False" the rest of the Account
# activation configuration is ignored and user activation is disabled (a.k.a. accounts are active since registration).
# Note the activation is also not working in case the smtp server is not defined.
#user_activation_on = False
-# Activation grace period. Activation is not forced (login is not disabled) until
+# Activation grace period. Activation is not forced (login is not disabled) until
# grace period has passed. Users under grace period can't run jobs (see inactivity_box_content).
-# In hours. Default is 3. Enter 0 to disable grace period.
-# Users with OpenID logins have grace period forever.
+# In hours. Default is 3. Enter 0 to disable grace period.
+# Users with OpenID logins have grace period forever.
#activation_grace_period = 0
# Used for warning box for inactive accounts (unable to run jobs).
@@ -429,7 +421,7 @@
# - $iso8601 (complete format string as specified by ISO 8601 international standard).
# pretty_datetime_format = $locale (UTC)
-# The URL of the page to display in Galaxy's middle pane when loaded. This can be
+# The URL of the page to display in Galaxy's middle pane when loaded. This can be
# an absolute or relative URL.
#welcome_url = /static/welcome.html
@@ -461,7 +453,7 @@
# The URL linked by the "Galaxy Q&A" link in the "Help" menu
# The Galaxy Q&A site is under development; when the site is done, this URL
# will be set and uncommented.
-#qa_url =
+#qa_url =
# Serve static content, which must be enabled if you're not serving it via a
# proxy server. These options should be self explanatory and so are not
@@ -614,7 +606,7 @@
# if testing shows that Galaxy is able to create files using these formats.
# Specific formats can be disabled with this option, separate more than one
# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'.
-#disable_library_comptypes =
+#disable_library_comptypes =
# Some sequencer integration features in beta allow you to automatically
# transfer datasets. This is done using a lightweight transfer manager which
@@ -764,7 +756,7 @@
# File where Data Managers are configured (.sample used if default does not
# exist)
#data_manager_config_file = config/data_manager_conf.xml
-# File where Tool Shed based Data Managers are configured
+# File where Tool Shed based Data Managers are configured
#shed_data_manager_config_file = config/shed_data_manager_conf.xml
# Directory to store Data Manager based tool-data; defaults to tool_data_path
#galaxy_data_manager_data_path = tool-data
@@ -883,11 +875,11 @@
# ---- Galaxy External Message Queue -------------------------------------------------
-# Galaxy uses AMQ protocol to receive messages from external sources like
+# Galaxy uses AMQ protocol to receive messages from external sources like
# bar code scanners. Galaxy has been tested against RabbitMQ AMQP implementation.
-# For Galaxy to receive messages from a message queue the RabbitMQ server has
+# For Galaxy to receive messages from a message queue the RabbitMQ server has
# to be set up with a user account and other parameters listed below. The 'host'
-# and 'port' fields should point to where the RabbitMQ server is running.
+# and 'port' fields should point to where the RabbitMQ server is running.
[galaxy_amqp]
@@ -900,3 +892,4 @@
#exchange = galaxy_exchange
#routing_key = bar_code_scanner
#rabbitmqctl_path = /path/to/rabbitmqctl
+
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -88,9 +88,6 @@
self.user_label_filters = listify( kwargs.get( "user_tool_label_filters", [] ), do_strip=True )
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
- self.tool_autoload_dir = kwargs.get( "tool_autoload_dir", None )
- self.tool_autoload_section = kwargs.get( "tool_autoload_section", None )
-
# Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
# been migrated from the Galaxy code distribution to the Tool Shed.
self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -159,23 +159,6 @@
self.init_tools( config_filename )
except:
log.exception( "Error loading tools defined in config %s", config_filename )
- if self.app.config.tool_autoload_dir is not None:
- log.info("Autoloading tool directory: %s" % (self.app.config.tool_autoload_dir))
-
- auto_load_section = ToolSection({
- 'id' : "__tool_autoload__",
- 'version' : "1.0.0",
- 'name' : self.app.config.tool_autoload_section})
-
- for tool_xml_path in glob.glob(os.path.join(self.app.config.tool_autoload_dir, "*", "*.xml")):
- log.info("AutoLoading: %s" % (tool_xml_path))
- tool = self.load_tool(tool_xml_path)
- self.tools_by_id[ tool.id ] = tool
- self.__add_tool_to_tool_panel( tool, auto_load_section, section=True )
-
- self.tool_panel[ "__tool_autoload__" ] = auto_load_section
- #self.__add_tool_to_tool_panel( auto_load_section, self.tool_panel, section=False )
-
if self.app.name == 'galaxy' and self.integrated_tool_panel_config_has_contents:
# Load self.tool_panel based on the order in self.integrated_tool_panel.
self.load_tool_panel()
@@ -880,7 +863,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/890d470c5a61/
Changeset: 890d470c5a61
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:57:03+00:00
Summary: Adding tool_library_dir to tool_conf parser. This will cause all the child directories of a given directory to be watched for tools.
Affected #: 1 file
diff -r b8db34a82175099ad7e52bde344dd356c7199bb4 -r 890d470c5a618cfcb6f53b2f457f8d461ef71fd5 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -236,6 +236,8 @@
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ elif elem.tag == 'tool_library_dir':
+ self.__watch_directory_children( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -688,6 +690,8 @@
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ elif sub_elem.tag == 'tool_library_dir':
+ self.__watch_directory_children( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +700,16 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def __watch_directory_children( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ for sub in os.listdir( directory ):
+ child = os.path.join(directory, sub)
+ if os.path.isdir(child):
+ self.__watch_directory(None, elems, tool_path, integrated_elems, load_panel_dict, child)
+
+ def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict, directory=None ):
+ if directory is None:
+ directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
def quick_load( tool_file, async=True ):
try:
@@ -863,7 +875,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/a55060d94308/
Changeset: a55060d94308
Branch: tool-autoload
User: kellrott
Date: 2014-10-01 17:15:43+00:00
Summary: Changing tool_library_repo to work off of tool_dir with attr recursive=True
Affected #: 1 file
diff -r 890d470c5a618cfcb6f53b2f457f8d461ef71fd5 -r a55060d943081345db52ed74f8564d98af5d501a lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,9 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
- elif elem.tag == 'tool_library_dir':
- self.__watch_directory_children( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -689,9 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
- elif sub_elem.tag == 'tool_library_dir':
- self.__watch_directory_children( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -700,16 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory_children( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
- for sub in os.listdir( directory ):
- child = os.path.join(directory, sub)
- if os.path.isdir(child):
- self.__watch_directory(None, elems, tool_path, integrated_elems, load_panel_dict, child)
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", False) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict, directory=None ):
- if directory is None:
- directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -729,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
https://bitbucket.org/galaxy/galaxy-central/commits/041438f8b528/
Changeset: 041438f8b528
Branch: tool-autoload
User: kellrott
Date: 2014-10-02 17:06:53+00:00
Summary: Changing tool_dir in tool_conf to be recursive by default
Affected #: 1 file
diff -r a55060d943081345db52ed74f8564d98af5d501a -r 041438f8b5281d2ff6618208ff72463b5eeebf52 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -699,7 +699,7 @@
def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
- recursive = string_as_bool( sub_elem.attrib.get("recursive", False) )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
https://bitbucket.org/galaxy/galaxy-central/commits/3aa7288f5a97/
Changeset: 3aa7288f5a97
User: jmchilton
Date: 2014-10-06 01:31:21+00:00
Summary: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
Adding tool_library_dir to tool_conf parser
Affected #: 3 files
diff -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 -r 3aa7288f5a97970df22fd38c400237028fe33e4b lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,7 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -687,7 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
+
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -717,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/12497a97f7d2/
Changeset: 12497a97f7d2
Branch: next-stable
User: jmchilton
Date: 2014-10-06 01:20:05+00:00
Summary: Back port Kyle's tool download fixes from default.
Affected #: 1 file
diff -r 105a53b01211993297b7ee64251cf3c1677883f7 -r 12497a97f7d22d08c6fdafe0c544b4f7a906da98 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -742,20 +742,21 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
# If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
if image_found:
fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
@@ -767,7 +768,7 @@
tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
https://bitbucket.org/galaxy/galaxy-central/commits/342ee791fe55/
Changeset: 342ee791fe55
User: jmchilton
Date: 2014-10-06 01:25:01+00:00
Summary: Merge next-stable fixes to tool downloader.
Affected #: 1 file
diff -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -789,9 +789,9 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
+ image_found = False
if tool.help is not None:
tool_help = tool.help._source
- image_found = False
# Check each line of the rendered tool help for an image tag that points to a location under static/
for help_line in tool_help.split( '\n' ):
image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
@@ -804,16 +804,16 @@
tarball_files.append( ( filesystem_path, tarball_path ) )
image_found = True
tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm/tool-extract (pull request #508)
by commits-noreply@bitbucket.org 06 Oct '14
by commits-noreply@bitbucket.org 06 Oct '14
06 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1daa729f4e72/
Changeset: 1daa729f4e72
User: jmchilton
Date: 2014-10-06 01:05:59+00:00
Summary: Merged in kellrott/galaxy-farm/tool-extract (pull request #508)
Adding the tool package download function to the API. Also fixing a few issues in the packaging code.
Affected #: 3 files
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -789,32 +789,33 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
- image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ image_found = False
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
@@ -823,6 +824,8 @@
for external_file in tool.get_externally_referenced_paths( os.path.abspath( tool.config_file ) ):
external_file_abspath = os.path.abspath( os.path.join( tool_path, external_file ) )
tarball_files.append( ( external_file_abspath, external_file ) )
+ if os.path.exists( os.path.join( tool_path, "Dockerfile" ) ):
+ tarball_files.append( ( os.path.join( tool_path, "Dockerfile" ), "Dockerfile" ) )
# Find tests, and check them for test data.
tests = tool.tests
if tests is not None:
@@ -863,7 +866,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -66,6 +66,18 @@
rval.append( citation.to_dict( 'bibtex' ) )
return rval
+ @web.expose_api_raw
+ @web.require_admin
+ def download( self, trans, id, **kwds ):
+ tool_tarball, success, message = trans.app.toolbox.package_tool( trans, id )
+ if success:
+ trans.response.set_content_type( 'application/x-gzip' )
+ download_file = open( tool_tarball )
+ os.unlink( tool_tarball )
+ tarball_path, filename = os.path.split( tool_tarball )
+ trans.response.headers[ "Content-Disposition" ] = 'attachment; filename="%s.tgz"' % ( id )
+ return download_file
+
@web.expose_api_anonymous
def create( self, trans, payload, **kwd ):
"""
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -180,6 +180,7 @@
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/402e63010f17/
Changeset: 402e63010f17
Branch: tool-extract
User: kell...(a)gmail.com
Date: 2014-09-25 23:48:14+00:00
Summary: Adding the tool package download function to the API. Also fixing a few issues in the packaging code.
Affected #: 3 files
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 402e63010f17e58b1b33e488fa98db36bd56ef98 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -742,32 +742,33 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
- image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ image_found = False
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.rstrip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
@@ -776,6 +777,8 @@
for external_file in tool.get_externally_referenced_paths( os.path.abspath( tool.config_file ) ):
external_file_abspath = os.path.abspath( os.path.join( tool_path, external_file ) )
tarball_files.append( ( external_file_abspath, external_file ) )
+ if os.path.exists( os.path.join( tool_path, "Dockerfile" ) ):
+ tarball_files.append( ( os.path.join( tool_path, "Dockerfile" ), "Dockerfile" ) )
# Find tests, and check them for test data.
tests = tool.tests
if tests is not None:
@@ -816,7 +819,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 402e63010f17e58b1b33e488fa98db36bd56ef98 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -66,6 +66,18 @@
rval.append( citation.to_dict( 'bibtex' ) )
return rval
+ @web.expose_api_raw
+ @web.require_admin
+ def download( self, trans, id, **kwds ):
+ tool_tarball, success, message = trans.app.toolbox.package_tool( trans, id )
+ if success:
+ trans.response.set_content_type( 'application/x-gzip' )
+ download_file = open( tool_tarball )
+ os.unlink( tool_tarball )
+ tarball_path, filename = os.path.split( tool_tarball )
+ trans.response.headers[ "Content-Disposition" ] = 'attachment; filename="%s.tgz"' % ( id )
+ return download_file
+
@web.expose_api_anonymous
def create( self, trans, payload, **kwd ):
"""
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 402e63010f17e58b1b33e488fa98db36bd56ef98 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -180,6 +180,7 @@
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
https://bitbucket.org/galaxy/galaxy-central/commits/fb942723853e/
Changeset: fb942723853e
Branch: tool-extract
User: kell...(a)gmail.com
Date: 2014-09-26 00:06:08+00:00
Summary: Fixing small bug
Affected #: 1 file
diff -r 402e63010f17e58b1b33e488fa98db36bd56ef98 -r fb942723853e34ea58fefa3792a58f5184dba5c6 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -768,7 +768,7 @@
tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.rstrip().split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
https://bitbucket.org/galaxy/galaxy-central/commits/1daa729f4e72/
Changeset: 1daa729f4e72
User: jmchilton
Date: 2014-10-06 01:05:59+00:00
Summary: Merged in kellrott/galaxy-farm/tool-extract (pull request #508)
Adding the tool package download function to the API. Also fixing a few issues in the packaging code.
Affected #: 3 files
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -789,32 +789,33 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
- image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ image_found = False
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
@@ -823,6 +824,8 @@
for external_file in tool.get_externally_referenced_paths( os.path.abspath( tool.config_file ) ):
external_file_abspath = os.path.abspath( os.path.join( tool_path, external_file ) )
tarball_files.append( ( external_file_abspath, external_file ) )
+ if os.path.exists( os.path.join( tool_path, "Dockerfile" ) ):
+ tarball_files.append( ( os.path.join( tool_path, "Dockerfile" ), "Dockerfile" ) )
# Find tests, and check them for test data.
tests = tool.tests
if tests is not None:
@@ -863,7 +866,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -66,6 +66,18 @@
rval.append( citation.to_dict( 'bibtex' ) )
return rval
+ @web.expose_api_raw
+ @web.require_admin
+ def download( self, trans, id, **kwds ):
+ tool_tarball, success, message = trans.app.toolbox.package_tool( trans, id )
+ if success:
+ trans.response.set_content_type( 'application/x-gzip' )
+ download_file = open( tool_tarball )
+ os.unlink( tool_tarball )
+ tarball_path, filename = os.path.split( tool_tarball )
+ trans.response.headers[ "Content-Disposition" ] = 'attachment; filename="%s.tgz"' % ( id )
+ return download_file
+
@web.expose_api_anonymous
def create( self, trans, payload, **kwd ):
"""
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -180,6 +180,7 @@
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Upload: Enable click on filename for ftp files, ToolForm: Fixes and adjustments
by commits-noreply@bitbucket.org 03 Oct '14
by commits-noreply@bitbucket.org 03 Oct '14
03 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e7708503e1aa/
Changeset: e7708503e1aa
User: guerler
Date: 2014-10-03 19:31:27+00:00
Summary: Upload: Enable click on filename for ftp files, ToolForm: Fixes and adjustments
Affected #: 13 files
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -137,9 +137,20 @@
console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
},
success: function() {
- // inputs
- self.inputs = self.model.get('inputs');
-
+ // create tool form section
+ self.section = new ToolSection.View(self, {
+ inputs : self.model.get('inputs'),
+ cls : 'ui-table-plain'
+ });
+
+ // TEMPORARY SWITCH
+ // switch to classic tool form mako if the form definition is incompatible
+ if (self.incompatible) {
+ self.$el.hide();
+ $('#tool-form-classic').show();
+ return;
+ }
+
// create portlet
self.portlet = new Portlet.View({
icon : 'fa-wrench',
@@ -192,12 +203,6 @@
// configure portlet and form table
self.setElement(self.portlet.content());
- // create tool form section
- self.section = new ToolSection.View(self, {
- inputs : self.model.get('inputs'),
- cls : 'ui-table-plain'
- });
-
// append tool section
self.portlet.append(self.section.$el);
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -260,62 +260,70 @@
switch(field_type) {
// text input field
case 'text' :
- field = this._field_text(input_def);
+ field = this._fieldText(input_def);
break;
// select field
case 'select' :
- field = this._field_select(input_def);
+ field = this._fieldSelect(input_def);
break;
// dataset
case 'data':
- field = this._field_data(input_def);
+ field = this._fieldData(input_def);
break;
// dataset column
case 'data_column':
- field = this._field_select(input_def);
+ field = this._fieldSelect(input_def);
break;
// conditional select field
case 'conditional':
- field = this._field_conditional(input_def);
+ field = this._fieldConditional(input_def);
break;
// hidden field
case 'hidden':
- field = this._field_hidden(input_def);
+ field = this._fieldHidden(input_def);
break;
// integer field
case 'integer':
- field = this._field_slider(input_def);
+ field = this._fieldSlider(input_def);
break;
// float field
case 'float':
- field = this._field_slider(input_def);
+ field = this._fieldSlider(input_def);
break;
// boolean field
case 'boolean':
- field = this._field_boolean(input_def);
+ field = this._fieldBoolean(input_def);
break;
- }
-
- // pick a generic field if specific mapping failed
- if (!field) {
- if (input_def.options) {
- // assign select field
- field = this._field_select(input_def);
- } else {
- // assign text field
- field = this._field_text(input_def);
- }
-
- // log
- console.debug('tools-form::_addRow() : Auto matched field type (' + field_type + ').');
+
+ // genome field
+ case 'genomebuild':
+ field = this._fieldSelect(input_def);
+ break;
+
+ // flag as incompatible
+ default:
+ // flag
+ this.app.incompatible = true;
+
+ // with or without options
+ if (input_def.options) {
+ // assign select field
+ field = this._fieldSelect(input_def);
+ } else {
+ // assign text field
+ field = this._fieldText(input_def);
+ }
+
+ // log
+ console.debug('tools-form::_addRow() : Auto matched field type (' + field_type + ').');
}
// set field value
@@ -348,7 +356,7 @@
/** Conditional input field selector
*/
- _field_conditional : function(input_def) {
+ _fieldConditional : function(input_def) {
// link this
var self = this;
@@ -401,7 +409,7 @@
/** Data input field
*/
- _field_data : function(input_def) {
+ _fieldData : function(input_def) {
// link this
var self = this;
@@ -505,7 +513,7 @@
/** Select/Checkbox/Radio options field
*/
- _field_select : function (input_def) {
+ _fieldSelect : function (input_def) {
// configure options fields
var options = [];
for (var i in input_def.options) {
@@ -537,7 +545,7 @@
/** Text input field
*/
- _field_text : function(input_def) {
+ _fieldText : function(input_def) {
return new Ui.Input({
id : 'field-' + input_def.id,
area : input_def.area
@@ -546,7 +554,7 @@
/** Slider field
*/
- _field_slider: function(input_def) {
+ _fieldSlider: function(input_def) {
// set min/max
input_def.min = input_def.min || 0;
input_def.max = input_def.max || 100000;
@@ -568,7 +576,7 @@
/** Hidden field
*/
- _field_hidden : function(input_def) {
+ _fieldHidden : function(input_def) {
return new Ui.Hidden({
id : 'field-' + input_def.id
});
@@ -576,7 +584,7 @@
/** Boolean field
*/
- _field_boolean : function(input_def) {
+ _fieldBoolean : function(input_def) {
return new Ui.RadioButton.View({
id : 'field-' + input_def.id,
data : [ { label : 'Yes', value : 'true' },
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 client/galaxy/scripts/mvc/ui/ui-slider.js
--- a/client/galaxy/scripts/mvc/ui/ui-slider.js
+++ b/client/galaxy/scripts/mvc/ui/ui-slider.js
@@ -39,7 +39,8 @@
// add text field event
this.$text.on('keydown', function (event) {
var v = event.which;
- if (!(v == 13 || v == 8 || v == 37 || v == 39 || v == 189 || (v >= 48 && v <= 57)
+ console.log(v);
+ if (!(v == 8 || v == 9 || v == 13 || v == 37 || v == 39 || v == 189 || (v >= 48 && v <= 57)
|| (self.options.step != 1 && $(this).val().indexOf('.') == -1) && v == 190)) {
event.preventDefault();
}
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 client/galaxy/scripts/mvc/upload/upload-ftp.js
--- a/client/galaxy/scripts/mvc/upload/upload-ftp.js
+++ b/client/galaxy/scripts/mvc/upload/upload-ftp.js
@@ -59,9 +59,15 @@
// add
add: function(ftp_file) {
+ // link this
+ var self = this;
+
// create new item
var $it = $(this._templateRow(ftp_file));
+ // identify icon
+ var $icon = $it.find('.icon');
+
// append to table
$(this.el).find('tbody').append($it);
@@ -72,16 +78,17 @@
} else {
icon_class = this.options.class_add;
}
- $it.find('#upload-ftp-add').addClass(icon_class);
+
+ // add icon class
+ $icon.addClass(icon_class);
// click to add ftp files
- var self = this;
- $it.find('#upload-ftp-add').on('click', function() {
+ $it.on('click', function() {
// find model
var model_index = self._find(ftp_file);
// update icon
- $(this).removeClass();
+ $icon.removeClass();
// add model
if (!model_index) {
@@ -94,13 +101,13 @@
}]);
// add new icon class
- $(this).addClass(self.options.class_remove);
+ $icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
// add new icon class
- $(this).addClass(self.options.class_add);
+ $icon.addClass(self.options.class_add);
}
});
},
@@ -121,8 +128,8 @@
// template row
_templateRow: function(options) {
- return '<tr>' +
- '<td><div id="upload-ftp-add"/></td>' +
+ return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
+ '<td><div class="icon"/></td>' +
'<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
'<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
'<td style="white-space: nowrap;">' + options.ctime + '</td>' +
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -137,9 +137,20 @@
console.debug('tools-form::_initializeToolForm() : Attempt to fetch tool model failed.');
},
success: function() {
- // inputs
- self.inputs = self.model.get('inputs');
-
+ // create tool form section
+ self.section = new ToolSection.View(self, {
+ inputs : self.model.get('inputs'),
+ cls : 'ui-table-plain'
+ });
+
+ // TEMPORARY SWITCH
+ // switch to classic tool form mako if the form definition is incompatible
+ if (self.incompatible) {
+ self.$el.hide();
+ $('#tool-form-classic').show();
+ return;
+ }
+
// create portlet
self.portlet = new Portlet.View({
icon : 'fa-wrench',
@@ -192,12 +203,6 @@
// configure portlet and form table
self.setElement(self.portlet.content());
- // create tool form section
- self.section = new ToolSection.View(self, {
- inputs : self.model.get('inputs'),
- cls : 'ui-table-plain'
- });
-
// append tool section
self.portlet.append(self.section.$el);
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -260,62 +260,70 @@
switch(field_type) {
// text input field
case 'text' :
- field = this._field_text(input_def);
+ field = this._fieldText(input_def);
break;
// select field
case 'select' :
- field = this._field_select(input_def);
+ field = this._fieldSelect(input_def);
break;
// dataset
case 'data':
- field = this._field_data(input_def);
+ field = this._fieldData(input_def);
break;
// dataset column
case 'data_column':
- field = this._field_select(input_def);
+ field = this._fieldSelect(input_def);
break;
// conditional select field
case 'conditional':
- field = this._field_conditional(input_def);
+ field = this._fieldConditional(input_def);
break;
// hidden field
case 'hidden':
- field = this._field_hidden(input_def);
+ field = this._fieldHidden(input_def);
break;
// integer field
case 'integer':
- field = this._field_slider(input_def);
+ field = this._fieldSlider(input_def);
break;
// float field
case 'float':
- field = this._field_slider(input_def);
+ field = this._fieldSlider(input_def);
break;
// boolean field
case 'boolean':
- field = this._field_boolean(input_def);
+ field = this._fieldBoolean(input_def);
break;
- }
-
- // pick a generic field if specific mapping failed
- if (!field) {
- if (input_def.options) {
- // assign select field
- field = this._field_select(input_def);
- } else {
- // assign text field
- field = this._field_text(input_def);
- }
-
- // log
- console.debug('tools-form::_addRow() : Auto matched field type (' + field_type + ').');
+
+ // genome field
+ case 'genomebuild':
+ field = this._fieldSelect(input_def);
+ break;
+
+ // flag as incompatible
+ default:
+ // flag
+ this.app.incompatible = true;
+
+ // with or without options
+ if (input_def.options) {
+ // assign select field
+ field = this._fieldSelect(input_def);
+ } else {
+ // assign text field
+ field = this._fieldText(input_def);
+ }
+
+ // log
+ console.debug('tools-form::_addRow() : Auto matched field type (' + field_type + ').');
}
// set field value
@@ -348,7 +356,7 @@
/** Conditional input field selector
*/
- _field_conditional : function(input_def) {
+ _fieldConditional : function(input_def) {
// link this
var self = this;
@@ -401,7 +409,7 @@
/** Data input field
*/
- _field_data : function(input_def) {
+ _fieldData : function(input_def) {
// link this
var self = this;
@@ -505,7 +513,7 @@
/** Select/Checkbox/Radio options field
*/
- _field_select : function (input_def) {
+ _fieldSelect : function (input_def) {
// configure options fields
var options = [];
for (var i in input_def.options) {
@@ -537,7 +545,7 @@
/** Text input field
*/
- _field_text : function(input_def) {
+ _fieldText : function(input_def) {
return new Ui.Input({
id : 'field-' + input_def.id,
area : input_def.area
@@ -546,7 +554,7 @@
/** Slider field
*/
- _field_slider: function(input_def) {
+ _fieldSlider: function(input_def) {
// set min/max
input_def.min = input_def.min || 0;
input_def.max = input_def.max || 100000;
@@ -568,7 +576,7 @@
/** Hidden field
*/
- _field_hidden : function(input_def) {
+ _fieldHidden : function(input_def) {
return new Ui.Hidden({
id : 'field-' + input_def.id
});
@@ -576,7 +584,7 @@
/** Boolean field
*/
- _field_boolean : function(input_def) {
+ _fieldBoolean : function(input_def) {
return new Ui.RadioButton.View({
id : 'field-' + input_def.id,
data : [ { label : 'Yes', value : 'true' },
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/mvc/ui/ui-slider.js
--- a/static/scripts/mvc/ui/ui-slider.js
+++ b/static/scripts/mvc/ui/ui-slider.js
@@ -39,7 +39,8 @@
// add text field event
this.$text.on('keydown', function (event) {
var v = event.which;
- if (!(v == 13 || v == 8 || v == 37 || v == 39 || v == 189 || (v >= 48 && v <= 57)
+ console.log(v);
+ if (!(v == 8 || v == 9 || v == 13 || v == 37 || v == 39 || v == 189 || (v >= 48 && v <= 57)
|| (self.options.step != 1 && $(this).val().indexOf('.') == -1) && v == 190)) {
event.preventDefault();
}
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -59,9 +59,15 @@
// add
add: function(ftp_file) {
+ // link this
+ var self = this;
+
// create new item
var $it = $(this._templateRow(ftp_file));
+ // identify icon
+ var $icon = $it.find('.icon');
+
// append to table
$(this.el).find('tbody').append($it);
@@ -72,16 +78,17 @@
} else {
icon_class = this.options.class_add;
}
- $it.find('#upload-ftp-add').addClass(icon_class);
+
+ // add icon class
+ $icon.addClass(icon_class);
// click to add ftp files
- var self = this;
- $it.find('#upload-ftp-add').on('click', function() {
+ $it.on('click', function() {
// find model
var model_index = self._find(ftp_file);
// update icon
- $(this).removeClass();
+ $icon.removeClass();
// add model
if (!model_index) {
@@ -94,13 +101,13 @@
}]);
// add new icon class
- $(this).addClass(self.options.class_remove);
+ $icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
// add new icon class
- $(this).addClass(self.options.class_add);
+ $icon.addClass(self.options.class_add);
}
});
},
@@ -121,8 +128,8 @@
// template row
_templateRow: function(options) {
- return '<tr>' +
- '<td><div id="upload-ftp-add"/></td>' +
+ return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
+ '<td><div class="icon"/></td>' +
'<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
'<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
'<td style="white-space: nowrap;">' + options.ctime + '</td>' +
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-datasets","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(h,l,j,a,f,d,i,k,c,g){var e=Backbone.Model.extend({initialize:function(m){this.url=galaxy_config.root+"api/tools/"+m.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(n){var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:n.id});this.tree=new c(this);this.job_handler=new g(this);this.field_list={};this.input_list={};this.element_list={};this.datasets=new i({history_id:this.options.history_id,success:function(){m._initializeToolForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated tree structure. Refresh.")},_initializeToolForm:function(){var n=this;var o=new l.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});var p=new l.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});var m=new l.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+n.options.id)}});this.model.fetch({error:function(q){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.inputs=n.model.get("inputs");n.portlet=new h.View({icon:"fa-wrench",title:"<b>"+n.model.get("name")+"</b> "+n.model.get("description"),buttons:{execute:new l.ButtonIcon({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",floating:"clear",onclick:function(){n.job_handler.submit()}})},operations:{button_question:o,button_search:p,button_share:m}});if(!n.options.biostar_url){o.$el.hide();p.$el.hide()}n.$el.append(n.portlet.$el);if(n.options.help!=""){n.$el.append(d.help(n.options.help))}if(n.options.citations){n.$el.append(d.citations());var q=new j.ToolCitationCollection();q.tool_id=n.options.id;var r=new a.CitationListView({collection:q});r.render();q.fetch()}n.setElement(n.portlet.content());n.section=new k.View(n,{inputs:n.model.get("inputs"),cls:"ui-table-plain"});n.portlet.append(n.section.$el);n.refresh()}})}});return{View:b}});
\ No newline at end of file
+define(["mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-datasets","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(h,l,j,a,f,d,i,k,c,g){var e=Backbone.Model.extend({initialize:function(m){this.url=galaxy_config.root+"api/tools/"+m.id+"?io_details=true"}});var b=Backbone.View.extend({container:"body",initialize:function(n){var m=this;if(parent.Galaxy&&parent.Galaxy.modal){this.modal=parent.Galaxy.modal}else{this.modal=new l.Modal.View()}this.options=n;this.setElement("<div/>");$(this.container).append(this.$el);this.model=new e({id:n.id});this.tree=new c(this);this.job_handler=new g(this);this.field_list={};this.input_list={};this.element_list={};this.datasets=new i({history_id:this.options.history_id,success:function(){m._initializeToolForm()}})},message:function(m){$(this.container).empty();$(this.container).append(m)},reset:function(){for(var m in this.element_list){this.element_list[m].reset()}},refresh:function(){this.tree.refresh();for(var m in this.field_list){this.field_list[m].trigger("change")}console.debug("tools-form::refresh() - Recreated tree structure. Refresh.")},_initializeToolForm:function(){var n=this;var o=new l.ButtonIcon({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/p/new/post/")}});var p=new l.ButtonIcon({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(n.options.biostar_url+"/t/"+n.options.id+"/")}});var m=new l.ButtonIcon({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",galaxy_config.root+"root?tool_id="+n.options.id)}});this.model.fetch({error:function(q){console.debug("tools-form::_initializeToolForm() : Attempt to fetch tool model failed.")},success:function(){n.section=new k.View(n,{inputs:n.model.get("inputs"),cls:"ui-table-plain"});if(n.incompatible){n.$el.hide();$("#tool-form-classic").show();return}n.portlet=new h.View({icon:"fa-wrench",title:"<b>"+n.model.get("name")+"</b> "+n.model.get("description"),buttons:{execute:new l.ButtonIcon({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",floating:"clear",onclick:function(){n.job_handler.submit()}})},operations:{button_question:o,button_search:p,button_share:m}});if(!n.options.biostar_url){o.$el.hide();p.$el.hide()}n.$el.append(n.portlet.$el);if(n.options.help!=""){n.$el.append(d.help(n.options.help))}if(n.options.citations){n.$el.append(d.citations());var q=new j.ToolCitationCollection();q.tool_id=n.options.id;var r=new a.CitationListView({collection:q});r.render();q.fetch()}n.setElement(n.portlet.content());n.portlet.append(n.section.$el);n.refresh()}})}});return{View:b}});
\ No newline at end of file
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-dataset"],function(d,a,g,c,b){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new a.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._field_text(h);break;case"select":i=this._field_select(h);break;case"data":i=this._field_data(h);break;case"data_column":i=this._field_select(h);break;case"conditional":i=this._field_conditional(h);break;case"hidden":i=this._field_hidden(h);break;case"integer":i=this._field_slider(h);break;case"float":i=this._field_slider(h);break;case"boolean":i=this._field_boolean(h);break}if(!i){if(h.options){i=this._field_select(h)}else{i=this._field_text(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_field_conditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_field_data:function(h){var i=this;var j=h.id;return new b.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(o){var n=o.values[0].id;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var m in l){var k=i.app.field_list[l[m]];k.wait&&k.wait()}i.app.datasets.getDetails(n,function(r){var z=null;if(r){console.debug("tool-form::field_data() - Selected dataset "+n+".");z=r.metadata_column_types;if(!z){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+n+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+n+".")}for(var t in l){var v=i.app.input_list[l[t]];var w=i.app.field_list[l[t]];if(!v||!w){console.debug("tool-form::field_data() - FAILED: Column not found.")}var s=v.numerical;var q=[];for(var y in z){var x=z[y];var p=(parseInt(y)+1);var u="Text";if(x=="int"||x=="float"){u="Number"}if(x=="int"||x=="float"||!s){q.push({label:"Column: "+p+" ["+u+"]",value:p})}}if(w){w.update(q);if(!w.exists(w.value())){w.value(w.first())}w.show()}}})}})},_field_select:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_field_text:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_field_slider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_field_hidden:function(h){return new g.Hidden({id:"field-"+h.id})},_field_boolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-dataset"],function(d,a,g,c,b){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new a.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"conditional":i=this._fieldConditional(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_fieldConditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_fieldData:function(h){var i=this;var j=h.id;return new b.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(o){var n=o.values[0].id;var l=i.app.tree.references(j,"data_column");if(l.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}for(var m in l){var k=i.app.field_list[l[m]];k.wait&&k.wait()}i.app.datasets.getDetails(n,function(r){var z=null;if(r){console.debug("tool-form::field_data() - Selected dataset "+n+".");z=r.metadata_column_types;if(!z){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+n+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+n+".")}for(var t in l){var v=i.app.input_list[l[t]];var w=i.app.field_list[l[t]];if(!v||!w){console.debug("tool-form::field_data() - FAILED: Column not found.")}var s=v.numerical;var q=[];for(var y in z){var x=z[y];var p=(parseInt(y)+1);var u="Text";if(x=="int"||x=="float"){u="Number"}if(x=="int"||x=="float"||!s){q.push({label:"Column: "+p+" ["+u+"]",value:p})}}if(w){w.update(q);if(!w.exists(w.value())){w.value(w.first())}w.show()}}})}})},_fieldSelect:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_fieldText:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_fieldSlider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/packed/mvc/ui/ui-slider.js
--- a/static/scripts/packed/mvc/ui/ui-slider.js
+++ b/static/scripts/packed/mvc/ui/ui-slider.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{value:"",min:1,max:100,step:1},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$slider=this.$el.find("#slider");this.$text=this.$el.find("#text");this.$slider.slider(this.options);this.$text.on("change",function(){c.value($(this).val())});this.$text.on("keydown",function(f){var e=f.which;if(!(e==13||e==8||e==37||e==39||e==189||(e>=48&&e<=57)||(c.options.step!=1&&$(this).val().indexOf(".")==-1)&&e==190)){f.preventDefault()}});this.$slider.on("slide",function(e,f){c.value(f.value)})},value:function(c){if(c!==undefined){c=Math.max(Math.min(c,this.options.max),this.options.min);if(this.options.onchange){this.options.onchange(c)}this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{value:"",min:1,max:100,step:1},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$slider=this.$el.find("#slider");this.$text=this.$el.find("#text");this.$slider.slider(this.options);this.$text.on("change",function(){c.value($(this).val())});this.$text.on("keydown",function(f){var e=f.which;console.log(e);if(!(e==8||e==9||e==13||e==37||e==39||e==189||(e>=48&&e<=57)||(c.options.step!=1&&$(this).val().indexOf(".")==-1)&&e==190)){f.preventDefault()}});this.$slider.on("slide",function(e,f){c.value(f.value)})},value:function(c){if(c!==undefined){c=Math.max(Math.min(c,this.options.max),this.options.min);if(this.options.onchange){this.options.onchange(c)}this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ No newline at end of file
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(e){var d=$(this._templateRow(e));$(this.el).find("tbody").append(d);var c="";if(this._find(e)){c=this.options.class_remove}else{c=this.options.class_add}d.find("#upload-ftp-add").addClass(c);var b=this;d.find("#upload-ftp-add").on("click",function(){var f=b._find(e);$(this).removeClass();if(!f){b.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]);$(this).addClass(b.options.class_remove)}else{b.app.collection.remove(f);$(this).addClass(b.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr><td><div id="upload-ftp-add"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("click",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
diff -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 templates/webapps/galaxy/tool_form.api.mako
--- a/templates/webapps/galaxy/tool_form.api.mako
+++ b/templates/webapps/galaxy/tool_form.api.mako
@@ -1,5 +1,4 @@
<%inherit file="/base.mako"/>
-
<%
# load tool help
tool_help = ''
@@ -31,8 +30,8 @@
'history_id' : trans.security.encode_id( trans.history.id )
}
%>
-${h.js( "libs/bibtex", "libs/jquery/jquery-ui" )}
-${h.css( 'base', 'jquery-ui/smoothness/jquery-ui')}
+${h.js("libs/bibtex", "libs/jquery/jquery-ui")}
+${h.css('base', 'jquery-ui/smoothness/jquery-ui')}
<script>
require(['mvc/tools/tools-form'], function(ToolsForm){
$(function(){
@@ -41,10 +40,15 @@
});
</script>
-%if tool.tool_shed_repository:
- <% tool_url = tool.tool_shed_repository.get_sharable_url( tool.app ) %>
- %if tool_url:
- <br/>
- ${ render_msg( 'This tool was installed from a ToolShed, you may be able to find additional information by following this link: <a href="%s" target="_blank">%s</a>' % ( tool_url, tool_url ), 'info' ) }
- %endif
-%endif
+##%if tool.tool_shed_repository:
+## <% tool_url = tool.tool_shed_repository.get_sharable_url( tool.app ) %>
+## %if tool_url:
+## <br/>
+## ${ render_msg( 'This tool was installed from a ToolShed, you may be able to find additional information by following this link: <a href="%s" target="_blank">%s</a>' % ( tool_url, tool_url ), 'info' ) }
+## %endif
+##%endif
+
+## classic tool form
+<div id="tool-form-classic" style="display: none;">
+ <%include file="tool_form.mako"/>
+</div>
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: c3d57de7f661e7a47b154874f07c10798f0fe2f7
https://github.com/galaxyproject/usegalaxy-playbook/commit/c3d57de7f661e7a4…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-10-03 (Fri, 03 Oct 2014)
Changed paths:
M bootstrap-ansible.bash
Log Message:
-----------
Note to self.
1
0