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
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 5171f8218643ed986a76281dd821a0000f605b87
https://github.com/galaxyproject/usegalaxy-playbook/commit/5171f8218643ed98…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2015-01-28 (Wed, 28 Jan 2015)
Changed paths:
M stage/group_vars/all.yml
Log Message:
-----------
Update Test.
1
0
commit/galaxy-central: natefoo: Merged in natefoo/galaxy-central/samtools1_bam_index (pull request #651)
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f0a96002a553/
Changeset: f0a96002a553
User: natefoo
Date: 2015-01-28 18:36:35+00:00
Summary: Merged in natefoo/galaxy-central/samtools1_bam_index (pull request #651)
Allow BAM's set_meta() to use samtools 1 to generate the index, if the samtools found on $PATH is samtools 1.
Affected #: 1 file
diff -r c8ba5ce3b64af0fa6564744c0e45fc4c4ae1d450 -r f0a96002a5538b1b5e2ebafe8f80a64ed299b418 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -264,10 +264,23 @@
##$ samtools index
##Usage: samtools index <in.bam> [<out.index>]
stderr_name = tempfile.NamedTemporaryFile( prefix = "bam_index_stderr" ).name
- command = 'samtools index %s %s' % ( dataset.file_name, index_file.file_name )
- proc = subprocess.Popen( args=command, shell=True, stderr=open( stderr_name, 'wb' ) )
+ command = [ 'samtools', 'index', dataset.file_name, index_file.file_name ]
+ proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
exit_code = proc.wait()
#Did index succeed?
+ if exit_code == -6:
+ # SIGABRT, most likely samtools 1.0+ which does not accept the index name parameter.
+ dataset_symlink = os.path.join( os.path.dirname( index_file.file_name ),
+ '__dataset_%d_%s' % ( dataset.id, os.path.basename( index_file.file_name ) ) )
+ os.symlink( dataset.file_name, dataset_symlink )
+ try:
+ command = [ 'samtools', 'index', dataset_symlink ]
+ exit_code = subprocess.call( args=command, stderr=open( stderr_name, 'wb' ) )
+ shutil.move( dataset_symlink + '.bai', index_file.file_name )
+ except Exception, e:
+ open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed: %s\n' % e)
+ finally:
+ os.unlink( dataset_symlink )
stderr = open( stderr_name ).read().strip()
if stderr:
if exit_code != 0:
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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/402569731d73/
Changeset: 402569731d73
Branch: samtools1_bam_index
User: natefoo
Date: 2015-01-28 15:38:22+00:00
Summary: Allow BAM's set_meta() to use samtools 1 to generate the index, if the samtools found on $PATH is samtools 1.
Affected #: 1 file
diff -r 01c1ca281fba5d2fc38f7fcaec30c7c358bcf268 -r 402569731d731d794f07838388609ad859345fa2 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -264,10 +264,19 @@
##$ samtools index
##Usage: samtools index <in.bam> [<out.index>]
stderr_name = tempfile.NamedTemporaryFile( prefix = "bam_index_stderr" ).name
- command = 'samtools index %s %s' % ( dataset.file_name, index_file.file_name )
- proc = subprocess.Popen( args=command, shell=True, stderr=open( stderr_name, 'wb' ) )
+ command = [ 'samtools', 'index', dataset.file_name, index_file.file_name ]
+ proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
exit_code = proc.wait()
#Did index succeed?
+ if exit_code == -6:
+ # SIGABRT, most likely samtools 1.0+ which does not accept the index name parameter.
+ command = [ 'samtools', 'index', dataset.file_name ]
+ proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
+ exit_code = proc.wait()
+ if os.path.exists( os.path.join( dataset.file_name, '.bai' ) ):
+ shutil.move( os.path.join( dataset.file_name, '.bai' ), index_file.file_name )
+ else:
+ open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed\n')
stderr = open( stderr_name ).read().strip()
if stderr:
if exit_code != 0:
https://bitbucket.org/galaxy/galaxy-central/commits/b3a163116fac/
Changeset: b3a163116fac
Branch: samtools1_bam_index
User: natefoo
Date: 2015-01-28 16:58:23+00:00
Summary: Use a symlink to the dataset in the same directory as the MetadataTempFile as the input to samtools index so there's no clobber risk. Thanks Dan.
Affected #: 1 file
diff -r 402569731d731d794f07838388609ad859345fa2 -r b3a163116fac6b6b554524e70b3a2f4058fef1e8 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -270,13 +270,18 @@
#Did index succeed?
if exit_code == -6:
# SIGABRT, most likely samtools 1.0+ which does not accept the index name parameter.
- command = [ 'samtools', 'index', dataset.file_name ]
- proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
- exit_code = proc.wait()
- if os.path.exists( os.path.join( dataset.file_name, '.bai' ) ):
- shutil.move( os.path.join( dataset.file_name, '.bai' ), index_file.file_name )
- else:
- open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed\n')
+ dataset_symlink = os.path.join( os.path.dirname( index_file.file_name ),
+ '__dataset_%d_%s' % ( dataset.id, os.path.basename( index_file.file_name ) ) )
+ os.symlink( dataset.file_name, dataset_symlink )
+ try:
+ command = [ 'samtools', 'index', dataset_symlink ]
+ proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
+ exit_code = proc.wait()
+ shutil.move( dataset_symlink + '.bai', index_file.file_name )
+ except Exception, e:
+ open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed: %s\n' % e)
+ finally:
+ os.unlink( dataset_symlink )
stderr = open( stderr_name ).read().strip()
if stderr:
if exit_code != 0:
https://bitbucket.org/galaxy/galaxy-central/commits/8d9cbbb3374f/
Changeset: 8d9cbbb3374f
Branch: samtools1_bam_index
User: natefoo
Date: 2015-01-28 18:25:11+00:00
Summary: Use subprocess.call() rather than Popen(), thanks Nicola.
Affected #: 1 file
diff -r b3a163116fac6b6b554524e70b3a2f4058fef1e8 -r 8d9cbbb3374f203a15f1c4e8c59e067c05b62cec lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -275,8 +275,7 @@
os.symlink( dataset.file_name, dataset_symlink )
try:
command = [ 'samtools', 'index', dataset_symlink ]
- proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
- exit_code = proc.wait()
+ exit_code = subprocess.call( args=command, stderr=open( stderr_name, 'wb' ) )
shutil.move( dataset_symlink + '.bai', index_file.file_name )
except Exception, e:
open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed: %s\n' % e)
https://bitbucket.org/galaxy/galaxy-central/commits/f0a96002a553/
Changeset: f0a96002a553
User: natefoo
Date: 2015-01-28 18:36:35+00:00
Summary: Merged in natefoo/galaxy-central/samtools1_bam_index (pull request #651)
Allow BAM's set_meta() to use samtools 1 to generate the index, if the samtools found on $PATH is samtools 1.
Affected #: 1 file
diff -r c8ba5ce3b64af0fa6564744c0e45fc4c4ae1d450 -r f0a96002a5538b1b5e2ebafe8f80a64ed299b418 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -264,10 +264,23 @@
##$ samtools index
##Usage: samtools index <in.bam> [<out.index>]
stderr_name = tempfile.NamedTemporaryFile( prefix = "bam_index_stderr" ).name
- command = 'samtools index %s %s' % ( dataset.file_name, index_file.file_name )
- proc = subprocess.Popen( args=command, shell=True, stderr=open( stderr_name, 'wb' ) )
+ command = [ 'samtools', 'index', dataset.file_name, index_file.file_name ]
+ proc = subprocess.Popen( args=command, stderr=open( stderr_name, 'wb' ) )
exit_code = proc.wait()
#Did index succeed?
+ if exit_code == -6:
+ # SIGABRT, most likely samtools 1.0+ which does not accept the index name parameter.
+ dataset_symlink = os.path.join( os.path.dirname( index_file.file_name ),
+ '__dataset_%d_%s' % ( dataset.id, os.path.basename( index_file.file_name ) ) )
+ os.symlink( dataset.file_name, dataset_symlink )
+ try:
+ command = [ 'samtools', 'index', dataset_symlink ]
+ exit_code = subprocess.call( args=command, stderr=open( stderr_name, 'wb' ) )
+ shutil.move( dataset_symlink + '.bai', index_file.file_name )
+ except Exception, e:
+ open( stderr_name, 'ab+' ).write( 'Galaxy attempted to build the BAM index with samtools 1.0+ but failed: %s\n' % e)
+ finally:
+ os.unlink( dataset_symlink )
stderr = open( stderr_name ).read().strip()
if stderr:
if exit_code != 0:
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: dan: Fix for XmlToolSource.parse_command() to return None when a command element does not exist or text is empty.
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c8ba5ce3b64a/
Changeset: c8ba5ce3b64a
User: dan
Date: 2015-01-28 17:09:56+00:00
Summary: Fix for XmlToolSource.parse_command() to return None when a command element does not exist or text is empty.
Affected #: 1 file
diff -r 43c52ed25263e787f922c902590df41929edb0d8 -r c8ba5ce3b64af0fa6564744c0e45fc4c4ae1d450 lib/galaxy/tools/parser/xml.py
--- a/lib/galaxy/tools/parser/xml.py
+++ b/lib/galaxy/tools/parser/xml.py
@@ -79,7 +79,7 @@
def parse_command(self):
command_el = self._command_el
- return (command_el is not None) and command_el.text
+ return ( ( command_el is not None ) and command_el.text ) or None
def parse_interpreter(self):
command_el = self._command_el
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
6 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a2a8f96e7cb4/
Changeset: a2a8f96e7cb4
User: davebgx
Date: 2015-01-28 16:49:48+00:00
Summary: Remove the alert popups from the repository and tool dependency installation status pages.
Affected #: 2 files
diff -r 01c1ca281fba5d2fc38f7fcaec30c7c358bcf268 -r a2a8f96e7cb49c4799d1ab9d86cc1e866d7e5cec templates/admin/tool_shed_repository/common.mako
--- a/templates/admin/tool_shed_repository/common.mako
+++ b/templates/admin/tool_shed_repository/common.mako
@@ -259,9 +259,6 @@
});
tool_dependency_status_updater( dependency_status_list );
},
- error: function() {
- alert( "tool_dependency_status_updater_callback failed..." );
- }
});
};
</script>
@@ -317,9 +314,6 @@
});
tool_shed_repository_status_updater( repository_status_list );
},
- error: function() {
- alert( "tool_shed_repository_status_updater_callback failed..." );
- }
});
};
</script>
diff -r 01c1ca281fba5d2fc38f7fcaec30c7c358bcf268 -r a2a8f96e7cb49c4799d1ab9d86cc1e866d7e5cec templates/admin/tool_shed_repository/initiate_repository_installation.mako
--- a/templates/admin/tool_shed_repository/initiate_repository_installation.mako
+++ b/templates/admin/tool_shed_repository/initiate_repository_installation.mako
@@ -23,9 +23,6 @@
success : function ( data ) {
//alert( "Initializing repository installation succeeded" );
},
- error: function() {
- alert( "Initializing repository installation failed" );
- },
});
};
</script>
https://bitbucket.org/galaxy/galaxy-central/commits/43c52ed25263/
Changeset: 43c52ed25263
User: davebgx
Date: 2015-01-28 16:50:31+00:00
Summary: Allow a Galaxy admin to configure environment variables (e.g. $PATH) for their local Galaxy installation without altering the environment for their shell.
Affected #: 1 file
diff -r a2a8f96e7cb49c4799d1ab9d86cc1e866d7e5cec -r 43c52ed25263e787f922c902590df41929edb0d8 run.sh
--- a/run.sh
+++ b/run.sh
@@ -10,6 +10,18 @@
. .venv/bin/activate
fi
+# If there is a file that defines a shell environment specific to this
+# instance of Galaxy, source the file.
+if [ -z "$GALAXY_LOCAL_ENV_FILE" ];
+then
+ GALAXY_LOCAL_ENV_FILE='./config/local_env.sh'
+fi
+
+if [ -f $GALAXY_LOCAL_ENV_FILE ];
+then
+ . $GALAXY_LOCAL_ENV_FILE
+fi
+
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
https://bitbucket.org/galaxy/galaxy-central/commits/725252d2e51f/
Changeset: 725252d2e51f
Branch: trevorw/add-template_cache_path-to-reports_wsgii-1422042129382
User: davebgx
Date: 2015-01-28 16:53:07+00:00
Summary: Close merged branch trevorw/add-template_cache_path-to-reports_wsgii-1422042129382
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/f24d1447157e/
Changeset: f24d1447157e
Branch: compressed_upload
User: davebgx
Date: 2015-01-28 16:53:35+00:00
Summary: Close merged branch compressed_upload
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/751a0bbe3363/
Changeset: 751a0bbe3363
Branch: snpeff_datatype
User: davebgx
Date: 2015-01-28 16:53:51+00:00
Summary: Close merged branch snpeff_datatype
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/0ead515a64b2/
Changeset: 0ead515a64b2
Branch: toolshed_blacklist_additions
User: davebgx
Date: 2015-01-28 16:54:03+00:00
Summary: Close merged branch toolshed_blacklist_additions
Affected #: 0 files
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: natefoo: Update tag latest_2015.01.13 for changeset 1b96d3a4ff28
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/837baf8a92ad/
Changeset: 837baf8a92ad
Branch: stable
User: natefoo
Date: 2015-01-28 14:00:26+00:00
Summary: Update tag latest_2015.01.13 for changeset 1b96d3a4ff28
Affected #: 1 file
diff -r 1b96d3a4ff28da2bd547b65ad86c5ad5a9bbfb90 -r 837baf8a92add3084c7e230cf537016192a78b55 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -22,4 +22,4 @@
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
9bd6f8b5b8153db752f4e61ed62f2b6c01ae4a11 latest_2014.10.06
2e8dd2949dd3eee0f56f9a3a5ebf1b2baca24aee release_2015.01.13
-4039bfd5584aac053f686197a76ac176253e6f3d latest_2015.01.13
+1b96d3a4ff28da2bd547b65ad86c5ad5a9bbfb90 latest_2015.01.13
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: ToolForm: Fix configuration flag
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/01c1ca281fba/
Changeset: 01c1ca281fba
User: guerler
Date: 2015-01-27 23:31:20+00:00
Summary: ToolForm: Fix configuration flag
Affected #: 2 files
diff -r 98fd2a336caa70166c26e005f7198369b97e1645 -r 01c1ca281fba5d2fc38f7fcaec30c7c358bcf268 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -759,7 +759,7 @@
# -- Beta features
# Use new tool form
-#toolform_upgrade = False
+toolform_upgrade = True
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
diff -r 98fd2a336caa70166c26e005f7198369b97e1645 -r 01c1ca281fba5d2fc38f7fcaec30c7c358bcf268 templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -4,7 +4,7 @@
${h.css('base', 'jquery-ui/smoothness/jquery-ui')}
## skip new tool form code if disabled
-##%if trans.app.config.get('toolform_upgrade', False):
+##%if util.string_as_bool(trans.app.config.get('toolform_upgrade', False)):
<%
## TEMPORARY: create tool dictionary in mako while both tool forms are in use.
## This avoids making two separate requests since the classic form requires the mako anyway.
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/6d655c8a1633/
Changeset: 6d655c8a1633
User: martenson
Date: 2015-01-27 23:13:50+00:00
Summary: add pretty_print_time_interval to make time intervals more readable
Affected #: 1 file
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 6d655c8a163316b2af7f5fa9f49dbee5bf58073c lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py
+++ b/lib/galaxy/util/__init__.py
@@ -24,6 +24,7 @@
import threading
from galaxy.util import json
+from datetime import datetime
from email.MIMEText import MIMEText
@@ -336,6 +337,63 @@
return value
+def pretty_print_time_interval( time = False, precise = False ):
+ """
+ Get a datetime object or a int() Epoch timestamp and return a
+ pretty string like 'an hour ago', 'Yesterday', '3 months ago',
+ 'just now', etc
+ credit: http://stackoverflow.com/questions/1551382/user-friendly-time-format-in-pyt…
+ """
+ now = datetime.now()
+ if type( time ) is int:
+ diff = now - datetime.fromtimestamp( time )
+ elif isinstance( time, datetime ):
+ diff = now - time
+ elif not time:
+ diff = now - now
+ second_diff = diff.seconds
+ day_diff = diff.days
+
+ if day_diff < 0:
+ return ''
+
+ if precise:
+ if day_diff == 0:
+ if second_diff < 10:
+ return "just now"
+ if second_diff < 60:
+ return str(second_diff) + " seconds ago"
+ if second_diff < 120:
+ return "a minute ago"
+ if second_diff < 3600:
+ return str(second_diff / 60) + " minutes ago"
+ if second_diff < 7200:
+ return "an hour ago"
+ if second_diff < 86400:
+ return str(second_diff / 3600) + " hours ago"
+ if day_diff == 1:
+ return "Yesterday"
+ if day_diff < 7:
+ return str( day_diff ) + " days ago"
+ if day_diff < 31:
+ return str( day_diff / 7 ) + " weeks ago"
+ if day_diff < 365:
+ return str( day_diff / 30 ) + " months ago"
+ return str( day_diff / 365 ) + " years ago"
+ else:
+ if day_diff == 0:
+ return "Today"
+ if day_diff == 1:
+ return "Yesterday"
+ if day_diff < 7:
+ return "this week"
+ if day_diff < 31:
+ return "this month"
+ if day_diff < 365:
+ return "this year"
+ return str( day_diff / 365 ) + " years ago"
+
+
def pretty_print_json(json_data, is_json_string=False):
if is_json_string:
json_data = json.loads(json_data)
https://bitbucket.org/galaxy/galaxy-central/commits/39483e4a5cbf/
Changeset: 39483e4a5cbf
User: martenson
Date: 2015-01-27 23:14:27+00:00
Summary: use the new pretty_print_time_interval method from utils
Affected #: 1 file
diff -r 6d655c8a163316b2af7f5fa9f49dbee5bf58073c -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd lib/galaxy/webapps/tool_shed/search/repo_search.py
--- a/lib/galaxy/webapps/tool_shed/search/repo_search.py
+++ b/lib/galaxy/webapps/tool_shed/search/repo_search.py
@@ -1,8 +1,8 @@
"""Module for searching the toolshed repositories"""
import datetime
-import dateutil.relativedelta
from galaxy import exceptions
from galaxy import eggs
+from galaxy.util import pretty_print_time_interval
from galaxy.web.base.controller import BaseAPIController
from galaxy.webapps.tool_shed import model
from tool_shed.util.shed_util_common import generate_sharable_link_for_repository_in_tool_shed
@@ -117,18 +117,9 @@
hit_dict[ 'url'] = generate_sharable_link_for_repository_in_tool_shed( repo )
# Format the time since last update to be nicely readable.
- dt1 = repo.update_time
- dt2 = datetime.datetime.now()
- rd = dateutil.relativedelta.relativedelta (dt2, dt1)
- time_ago = ''
- if rd.years > 0:
- time_ago += str( rd.years ) + 'years'
- if rd.months > 0:
- time_ago += str( rd.months ) + ' months'
- if rd.days > 0:
- time_ago += str( rd.days ) + ' days ago'
+ time_ago = pretty_print_time_interval( repo.update_time )
hit_dict[ 'last_updated' ] = time_ago
-
+ hit_dict[ 'full_last_updated' ] = repo.update_time.strftime( "%Y-%m-%d %I:%M %p" )
hit_dict[ 'times_downloaded' ] = repo.times_downloaded
hit_dict[ 'approved' ] = approved
results[ 'hits' ].append( {'repository': hit_dict, 'matched_terms': hit.matched_terms() } )
https://bitbucket.org/galaxy/galaxy-central/commits/98fd2a336caa/
Changeset: 98fd2a336caa
User: martenson
Date: 2015-01-27 23:15:10+00:00
Summary: Merge
Affected #: 14 files
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -18,7 +18,9 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false
+ initial_errors : false,
+ // use default value for disabled fields
+ use_defaults : false
};
// configure options
@@ -280,8 +282,7 @@
// create tool form section
this.section = new ToolSection.View(self, {
- inputs : options.inputs,
- cls : 'ui-table-plain'
+ inputs : options.inputs
});
// switch to classic tool form mako if the form definition is incompatible
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 client/galaxy/scripts/mvc/tools/tools-form-workflow.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
@@ -21,6 +21,7 @@
// set labels
this.options.text_enable = 'In Advance';
this.options.text_disable = 'At Runtime';
+ this.options.use_defaults = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 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
@@ -14,10 +14,13 @@
// link inputs
this.inputs = options.inputs;
+ // fix table style
+ options.cls = 'ui-table-plain';
+
// add table class for tr tag
// this assist in transforming the form into a json structure
options.cls_tr = 'section-row';
-
+
// create table
this.table = new Table.View(options);
@@ -132,8 +135,7 @@
// create sub section
var sub_section = new View(this.app, {
- inputs : input_def.cases[i].inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.cases[i].inputs
});
// displays as grouped subsection
@@ -181,8 +183,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : inputs,
- cls : 'ui-table-plain'
+ inputs : inputs
});
// add tab
@@ -255,8 +256,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : input_def.inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.inputs
});
// delete button
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -123,8 +123,16 @@
}
// validate value
- if ((field.skip && input.optional) || (field.validate && !field.validate())) {
- value = null;
+ var skipped = field.skip && input.optional;
+ var unvalidated = field.validate && !field.validate();
+ if (!self.app.options.use_defaults) {
+ if (skipped || unvalidated) {
+ value = null;
+ }
+ } else {
+ if (!skipped && unvalidated) {
+ value = null;
+ }
}
// ignore certain values
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -18,7 +18,9 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false
+ initial_errors : false,
+ // use default value for disabled fields
+ use_defaults : false
};
// configure options
@@ -280,8 +282,7 @@
// create tool form section
this.section = new ToolSection.View(self, {
- inputs : options.inputs,
- cls : 'ui-table-plain'
+ inputs : options.inputs
});
// switch to classic tool form mako if the form definition is incompatible
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/mvc/tools/tools-form-workflow.js
--- a/static/scripts/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/mvc/tools/tools-form-workflow.js
@@ -21,6 +21,7 @@
// set labels
this.options.text_enable = 'In Advance';
this.options.text_disable = 'At Runtime';
+ this.options.use_defaults = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -14,10 +14,13 @@
// link inputs
this.inputs = options.inputs;
+ // fix table style
+ options.cls = 'ui-table-plain';
+
// add table class for tr tag
// this assist in transforming the form into a json structure
options.cls_tr = 'section-row';
-
+
// create table
this.table = new Table.View(options);
@@ -132,8 +135,7 @@
// create sub section
var sub_section = new View(this.app, {
- inputs : input_def.cases[i].inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.cases[i].inputs
});
// displays as grouped subsection
@@ -181,8 +183,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : inputs,
- cls : 'ui-table-plain'
+ inputs : inputs
});
// add tab
@@ -255,8 +256,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : input_def.inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.inputs
});
// delete button
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -123,8 +123,16 @@
}
// validate value
- if ((field.skip && input.optional) || (field.validate && !field.validate())) {
- value = null;
+ var skipped = field.skip && input.optional;
+ var unvalidated = field.validate && !field.validate();
+ if (!self.app.options.use_defaults) {
+ if (skipped || unvalidated) {
+ value = null;
+ }
+ } else {
+ if (!skipped && unvalidated) {
+ value = null;
+ }
}
// ignore certain values
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","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-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","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-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false,use_defaults:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/packed/mvc/tools/tools-form-workflow.js
--- a/static/scripts/packed/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/packed/mvc/tools/tools-form-workflow.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.use_defaults=true;b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 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/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs,cls:"ui-table-plain"});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i,cls:"ui-table-plain"});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs,cls:"ui-table-plain"});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls="ui-table-plain";i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if((t.skip&&u.optional)||(t.validate&&!t.validate())){v=null}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(l,n){for(var p in n){var w=n[p];if(w.input){var s=w.input;var t=l;if(l!=""){t+="|"}t+=s.name;switch(s.type){case"repeat":var k="section-";var q=[];var m=null;for(var r in w){var o=r.indexOf(k);if(o!=-1){o+=k.length;q.push(parseInt(r.substr(o)));if(!m){m=r.substr(0,o)}}}q.sort(function(A,i){return A-i});var p=0;for(var x in q){c(t+"_"+p++,w[m+q[x]])}break;case"conditional":var v=b.app.field_list[s.id].value();if(g[s.test_param.type]){v=g[s.test_param.type](v)}d(t+"|"+s.test_param.name,s.id,v);var u=b.matchCase(s,v);if(u!=-1){c(t,n[s.id+"-section-"+u])}break;case"section":c("",w);break;default:var j=b.app.field_list[s.id];if(j&&j.value){var v=j.value();if(g[s.type]){v=g[s.type](v)}var z=j.skip&&s.optional;var h=j.validate&&!j.validate();if(!b.app.options.use_defaults){if(z||h){v=null}}else{if(!z&&h){v=null}}if(s.ignore===undefined||(v!==null&&s.ignore!=v)){d(t,s.id,v);if(s.payload){for(var y in s.payload){d(y,s.id,s.payload[y])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1397,7 +1397,7 @@
.ui-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px}
.ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px}
.ui-table tbody{cursor:pointer}
-.ui-table-plain tbody td{padding:5px 0px 5px 0px !important;border:none !important}
+.ui-table-plain{table-layout:fixed}.ui-table-plain tbody td{padding:5px 0px 5px 0px !important;border:none !important}
.ui-table-plain tbody{cursor:auto !important}
.ui-table-form-element .ui-table-form-title-optional{font-weight:bold;text-decoration:underline;cursor:pointer}
.ui-table-form-element .ui-table-form-field{margin-top:5px}
diff -r 39483e4a5cbfbec5d0603b3e910a315ed52768dd -r 98fd2a336caa70166c26e005f7198369b97e1645 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -33,6 +33,7 @@
.ui-table-plain {
&:extend(.grid);
+ table-layout:fixed;
tbody td {
padding: 5px 0px 5px 0px !important;
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: ToolForm: Fix select2 width, adjust argument parsing
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/08bacc9d402e/
Changeset: 08bacc9d402e
User: guerler
Date: 2015-01-27 23:02:09+00:00
Summary: ToolForm: Fix select2 width, adjust argument parsing
Affected #: 14 files
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -18,7 +18,9 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false
+ initial_errors : false,
+ // use default value for disabled fields
+ use_defaults : false
};
// configure options
@@ -280,8 +282,7 @@
// create tool form section
this.section = new ToolSection.View(self, {
- inputs : options.inputs,
- cls : 'ui-table-plain'
+ inputs : options.inputs
});
// switch to classic tool form mako if the form definition is incompatible
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f client/galaxy/scripts/mvc/tools/tools-form-workflow.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
@@ -21,6 +21,7 @@
// set labels
this.options.text_enable = 'In Advance';
this.options.text_disable = 'At Runtime';
+ this.options.use_defaults = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f 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
@@ -14,10 +14,13 @@
// link inputs
this.inputs = options.inputs;
+ // fix table style
+ options.cls = 'ui-table-plain';
+
// add table class for tr tag
// this assist in transforming the form into a json structure
options.cls_tr = 'section-row';
-
+
// create table
this.table = new Table.View(options);
@@ -132,8 +135,7 @@
// create sub section
var sub_section = new View(this.app, {
- inputs : input_def.cases[i].inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.cases[i].inputs
});
// displays as grouped subsection
@@ -181,8 +183,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : inputs,
- cls : 'ui-table-plain'
+ inputs : inputs
});
// add tab
@@ -255,8 +256,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : input_def.inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.inputs
});
// delete button
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -123,8 +123,16 @@
}
// validate value
- if ((field.skip && input.optional) || (field.validate && !field.validate())) {
- value = null;
+ var skipped = field.skip && input.optional;
+ var unvalidated = field.validate && !field.validate();
+ if (!self.app.options.use_defaults) {
+ if (skipped || unvalidated) {
+ value = null;
+ }
+ } else {
+ if (!skipped && unvalidated) {
+ value = null;
+ }
}
// ignore certain values
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -18,7 +18,9 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false
+ initial_errors : false,
+ // use default value for disabled fields
+ use_defaults : false
};
// configure options
@@ -280,8 +282,7 @@
// create tool form section
this.section = new ToolSection.View(self, {
- inputs : options.inputs,
- cls : 'ui-table-plain'
+ inputs : options.inputs
});
// switch to classic tool form mako if the form definition is incompatible
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/mvc/tools/tools-form-workflow.js
--- a/static/scripts/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/mvc/tools/tools-form-workflow.js
@@ -21,6 +21,7 @@
// set labels
this.options.text_enable = 'In Advance';
this.options.text_disable = 'At Runtime';
+ this.options.use_defaults = true;
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -14,10 +14,13 @@
// link inputs
this.inputs = options.inputs;
+ // fix table style
+ options.cls = 'ui-table-plain';
+
// add table class for tr tag
// this assist in transforming the form into a json structure
options.cls_tr = 'section-row';
-
+
// create table
this.table = new Table.View(options);
@@ -132,8 +135,7 @@
// create sub section
var sub_section = new View(this.app, {
- inputs : input_def.cases[i].inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.cases[i].inputs
});
// displays as grouped subsection
@@ -181,8 +183,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : inputs,
- cls : 'ui-table-plain'
+ inputs : inputs
});
// add tab
@@ -255,8 +256,7 @@
// create sub section
var sub_section = new View(self.app, {
- inputs : input_def.inputs,
- cls : 'ui-table-plain'
+ inputs : input_def.inputs
});
// delete button
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -123,8 +123,16 @@
}
// validate value
- if ((field.skip && input.optional) || (field.validate && !field.validate())) {
- value = null;
+ var skipped = field.skip && input.optional;
+ var unvalidated = field.validate && !field.validate();
+ if (!self.app.options.use_defaults) {
+ if (skipped || unvalidated) {
+ value = null;
+ }
+ } else {
+ if (!skipped && unvalidated) {
+ value = null;
+ }
}
// ignore certain values
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","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-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","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-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false,use_defaults:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/packed/mvc/tools/tools-form-workflow.js
--- a/static/scripts/packed/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/packed/mvc/tools/tools-form-workflow.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";this.options.use_defaults=true;b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f 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/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs,cls:"ui-table-plain"});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i,cls:"ui-table-plain"});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs,cls:"ui-table-plain"});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls="ui-table-plain";i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if((t.skip&&u.optional)||(t.validate&&!t.validate())){v=null}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(l,n){for(var p in n){var w=n[p];if(w.input){var s=w.input;var t=l;if(l!=""){t+="|"}t+=s.name;switch(s.type){case"repeat":var k="section-";var q=[];var m=null;for(var r in w){var o=r.indexOf(k);if(o!=-1){o+=k.length;q.push(parseInt(r.substr(o)));if(!m){m=r.substr(0,o)}}}q.sort(function(A,i){return A-i});var p=0;for(var x in q){c(t+"_"+p++,w[m+q[x]])}break;case"conditional":var v=b.app.field_list[s.id].value();if(g[s.test_param.type]){v=g[s.test_param.type](v)}d(t+"|"+s.test_param.name,s.id,v);var u=b.matchCase(s,v);if(u!=-1){c(t,n[s.id+"-section-"+u])}break;case"section":c("",w);break;default:var j=b.app.field_list[s.id];if(j&&j.value){var v=j.value();if(g[s.type]){v=g[s.type](v)}var z=j.skip&&s.optional;var h=j.validate&&!j.validate();if(!b.app.options.use_defaults){if(z||h){v=null}}else{if(!z&&h){v=null}}if(s.ignore===undefined||(v!==null&&s.ignore!=v)){d(t,s.id,v);if(s.payload){for(var y in s.payload){d(y,s.id,s.payload[y])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1397,7 +1397,7 @@
.ui-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px}
.ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px}
.ui-table tbody{cursor:pointer}
-.ui-table-plain tbody td{padding:5px 0px 5px 0px !important;border:none !important}
+.ui-table-plain{table-layout:fixed}.ui-table-plain tbody td{padding:5px 0px 5px 0px !important;border:none !important}
.ui-table-plain tbody{cursor:auto !important}
.ui-table-form-element .ui-table-form-title-optional{font-weight:bold;text-decoration:underline;cursor:pointer}
.ui-table-form-element .ui-table-form-field{margin-top:5px}
diff -r 73a261a75185704a35a05350a31a7d5169cbc9b0 -r 08bacc9d402e75a70ddc249c959ccac846e0512f static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -33,6 +33,7 @@
.ui-table-plain {
&:extend(.grid);
+ table-layout:fixed;
tbody td {
padding: 5px 0px 5px 0px !important;
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/2228c58015cb/
Changeset: 2228c58015cb
User: martenson
Date: 2015-01-27 00:45:33+00:00
Summary: query parser experiments, better formatted time delta
Affected #: 1 file
diff -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 -r 2228c58015cb928e8c2819614e2a69b70ea4f448 lib/galaxy/webapps/tool_shed/search/repo_search.py
--- a/lib/galaxy/webapps/tool_shed/search/repo_search.py
+++ b/lib/galaxy/webapps/tool_shed/search/repo_search.py
@@ -1,11 +1,11 @@
"""Module for searching the toolshed repositories"""
+import datetime
+import dateutil.relativedelta
from galaxy import exceptions
from galaxy import eggs
from galaxy.web.base.controller import BaseAPIController
from galaxy.webapps.tool_shed import model
from tool_shed.util.shed_util_common import generate_sharable_link_for_repository_in_tool_shed
-
-
import logging
log = logging.getLogger( __name__ )
@@ -34,6 +34,7 @@
search_ready = False
schema = None
+
class RepoSearch ( object ):
def search( self, trans, search_term, **kwd ):
@@ -72,9 +73,15 @@
'remote_repository_url',
'repo_owner_username' ], schema=schema )
- hits = searcher.search( parser.parse( '*' + search_term + '*' ), terms = True )
+ # user_query = parser.parse( search_term )
+ user_query = parser.parse( '*' + search_term + '*' )
+
+ # hits = searcher.search( user_query, terms = True )
+ hits = searcher.search_page( user_query, 1, pagelen = 1, terms = True )
+ log.debug( 'total hits: ' + str( len( hits ) ) )
+ log.debug( 'scored hits: ' + str( hits.scored_length() ) )
results = {}
- results[ 'length'] = len( hits )
+ results[ 'total_results'] = len( hits )
results[ 'hits' ] = []
for hit in hits:
repo = trans.sa_session.query( model.Repository ).filter_by( id=hit[ 'id' ] ).one()
@@ -85,7 +92,20 @@
break
hit_dict = repo.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id, 'user_id': trans.security.encode_id } )
hit_dict[ 'url'] = generate_sharable_link_for_repository_in_tool_shed( repo )
- hit_dict[ 'last_updated' ] = repo.update_time.strftime( "%Y-%m-%d %I:%M %p" )
+
+ # Format the time since last update to be nicely readable.
+ dt1 = repo.update_time
+ dt2 = datetime.datetime.now()
+ rd = dateutil.relativedelta.relativedelta (dt2, dt1)
+ time_ago = ''
+ if rd.years > 0:
+ time_ago += str( rd.years ) + 'years'
+ if rd.months > 0:
+ time_ago += str( rd.months ) + ' months'
+ if rd.days > 0:
+ time_ago += str( rd.days ) + ' days ago'
+ hit_dict[ 'last_updated' ] = time_ago
+
hit_dict[ 'times_downloaded' ] = repo.times_downloaded
hit_dict[ 'approved' ] = approved
results[ 'hits' ].append( {'repository': hit_dict, 'matched_terms': hit.matched_terms() } )
https://bitbucket.org/galaxy/galaxy-central/commits/5877dc562874/
Changeset: 5877dc562874
User: martenson
Date: 2015-01-27 22:15:18+00:00
Summary: adjust schema, start dynamic scoring
Affected #: 2 files
diff -r 2228c58015cb928e8c2819614e2a69b70ea4f448 -r 5877dc562874b894a83393bc54ba671d397909c9 lib/galaxy/webapps/tool_shed/search/repo_search.py
--- a/lib/galaxy/webapps/tool_shed/search/repo_search.py
+++ b/lib/galaxy/webapps/tool_shed/search/repo_search.py
@@ -15,27 +15,47 @@
try:
eggs.require( "Whoosh" )
import whoosh.index
- from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT
+ from whoosh import scoring
+ from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT, STORED
from whoosh.scoring import BM25F
from whoosh.qparser import MultifieldParser
from whoosh.index import Index
search_ready = True
schema = Schema(
- id=STORED,
- name=TEXT,
- description=TEXT,
- long_description=TEXT,
- repo_type=TEXT,
- homepage_url=TEXT,
- remote_repository_url=TEXT,
- repo_owner_username=TEXT )
+ id = STORED,
+ name = TEXT( field_boost = 1.7 ),
+ description = TEXT( field_boost = 1.5 ),
+ long_description = TEXT,
+ repo_type = TEXT,
+ homepage_url = TEXT,
+ remote_repository_url = TEXT,
+ repo_owner_username = TEXT,
+ times_downloaded = STORED )
+
except ImportError, e:
search_ready = False
schema = None
+
+class RepoWeighting( scoring.BM25F ):
+ """
+ Affect the BM25G scoring model through the final method.
+ source: https://groups.google.com/forum/#!msg/whoosh/1AKNbW8R_l8/XySW0OecH6gJ
+ """
+ use_final = True
-class RepoSearch ( object ):
+ def final( self, searcher, docnum, score ):
+
+ maxhits = 300
+ hitcount = searcher.stored_fields( docnum )[ "times_downloaded" ]
+ log.debug( 'hitcount: ' + str( hitcount ) )
+
+ # Multiply the computed score for this document by the popularity
+ return score * ( hitcount / maxhits )
+
+
+class RepoSearch( object ):
def search( self, trans, search_term, **kwd ):
"""
@@ -43,8 +63,7 @@
:param search_term: unicode encoded string with the search term(s)
- :returns results: dictionary containing number of hits,
- hits themselves and matched terms for each
+ :returns results: dictionary containing number of hits, hits themselves and matched terms for each
"""
if search_ready:
toolshed_whoosh_index_dir = trans.app.config.toolshed_whoosh_index_dir
@@ -55,42 +74,46 @@
# Some literature about BM25F:
# http://trec.nist.gov/pubs/trec13/papers/microsoft-cambridge.web.hard.pdf
# http://en.wikipedia.org/wiki/Okapi_BM25
- # Basically the higher number the bigger weight.
- searcher = index.searcher( weighting=BM25F( field_B={
- 'name_B' : 0.9,
- 'description_B' : 0.6,
- 'long_description_B' : 0.5,
- 'homepage_url_B' : 0.3,
- 'remote_repository_url_B' : 0.2,
- 'repo_owner_username' : 0.3,
- 'repo_type_B' : 0.1 } ) )
+ # __Basically__ the higher number the bigger weight.
+ repo_weighting = RepoWeighting( field_B = { 'name_B' : 0.9,
+ 'description_B' : 0.6,
+ 'long_description_B' : 0.5,
+ 'homepage_url_B' : 0.3,
+ 'remote_repository_url_B' : 0.2,
+ 'repo_owner_username' : 0.3,
+ 'repo_type_B' : 0.1 } )
+
+ # log.debug(repo_weighting.__dict__)
+ searcher = index.searcher( weighting = repo_weighting )
+
parser = MultifieldParser( [
- 'name',
- 'description',
- 'long_description',
- 'repo_type',
- 'homepage_url',
- 'remote_repository_url',
- 'repo_owner_username' ], schema=schema )
+ 'name',
+ 'description',
+ 'long_description',
+ 'repo_type',
+ 'homepage_url',
+ 'remote_repository_url',
+ 'repo_owner_username' ], schema = schema )
# user_query = parser.parse( search_term )
user_query = parser.parse( '*' + search_term + '*' )
- # hits = searcher.search( user_query, terms = True )
- hits = searcher.search_page( user_query, 1, pagelen = 1, terms = True )
+ hits = searcher.search( user_query, terms = True )
+ # hits = searcher.search_page( user_query, 1, pagelen = 1, terms = True )
+ log.debug( 'searching for: #' + str( search_term ) )
log.debug( 'total hits: ' + str( len( hits ) ) )
log.debug( 'scored hits: ' + str( hits.scored_length() ) )
results = {}
results[ 'total_results'] = len( hits )
results[ 'hits' ] = []
for hit in hits:
- repo = trans.sa_session.query( model.Repository ).filter_by( id=hit[ 'id' ] ).one()
+ repo = trans.sa_session.query( model.Repository ).filter_by( id = hit[ 'id' ] ).one()
approved = 'no'
for review in repo.reviews:
if review.approved == 'yes':
approved = 'yes'
break
- hit_dict = repo.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id, 'user_id': trans.security.encode_id } )
+ hit_dict = repo.to_dict( view = 'element', value_mapper = { 'id': trans.security.encode_id, 'user_id': trans.security.encode_id } )
hit_dict[ 'url'] = generate_sharable_link_for_repository_in_tool_shed( repo )
# Format the time since last update to be nicely readable.
diff -r 2228c58015cb928e8c2819614e2a69b70ea4f448 -r 5877dc562874b894a83393bc54ba671d397909c9 scripts/tool_shed/build_ts_whoosh_index.py
--- a/scripts/tool_shed/build_ts_whoosh_index.py
+++ b/scripts/tool_shed/build_ts_whoosh_index.py
@@ -17,7 +17,7 @@
import whoosh.index
import galaxy.webapps.tool_shed.model.mapping
from whoosh.filedb.filestore import FileStorage
- from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT
+ from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT, STORED
from whoosh.scoring import BM25F
from whoosh.qparser import MultifieldParser
from whoosh.index import Index
@@ -25,14 +25,15 @@
whoosh_ready = True
schema = Schema(
- id=STORED,
- name=TEXT,
- description=TEXT,
- long_description=TEXT,
- repo_type=TEXT,
- homepage_url=TEXT,
- remote_repository_url=TEXT,
- repo_owner_username=TEXT )
+ id = STORED,
+ name = TEXT( field_boost = 1.7 ),
+ description = TEXT( field_boost = 1.5 ),
+ long_description = TEXT,
+ repo_type = TEXT,
+ homepage_url = TEXT,
+ remote_repository_url = TEXT,
+ repo_owner_username = TEXT,
+ times_downloaded = STORED )
except ImportError, e:
print 'import error'
@@ -50,15 +51,16 @@
return a_basestr
repos_indexed = 0
- for id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username in get_repos( sa_session ):
- writer.add_document( id=id,
- name=to_unicode( name ),
- description=to_unicode( description ),
- long_description=to_unicode( long_description ),
- repo_type=to_unicode( repo_type ),
- homepage_url=to_unicode( homepage_url ),
- remote_repository_url=to_unicode( remote_repository_url ),
- repo_owner_username=to_unicode( repo_owner_username ) )
+ for id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username, times_downloaded in get_repos( sa_session ):
+ writer.add_document( id = id,
+ name = to_unicode( name ),
+ description = to_unicode( description ),
+ long_description = to_unicode( long_description ),
+ repo_type = to_unicode( repo_type ),
+ homepage_url = to_unicode( homepage_url ),
+ remote_repository_url = to_unicode( remote_repository_url ),
+ repo_owner_username = to_unicode( repo_owner_username ),
+ times_downloaded = times_downloaded )
repos_indexed += 1
writer.commit()
print "Number of repos indexed: ", repos_indexed
@@ -72,13 +74,14 @@
repo_type = repo.type
homepage_url = repo.homepage_url
remote_repository_url = repo.remote_repository_url
+ times_downloaded = repo.times_downloaded
repo_owner_username = ""
if repo.user_id is not None:
user = sa_session.query( model.User ).filter( model.User.id == repo.user_id ).one()
repo_owner_username = user.username
- yield id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username
+ yield id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username, times_downloaded
def get_sa_session_and_needed_config_settings( ini_file ):
conf_parser = ConfigParser.ConfigParser( { 'here' : os.getcwd() } )
https://bitbucket.org/galaxy/galaxy-central/commits/73a261a75185/
Changeset: 73a261a75185
User: martenson
Date: 2015-01-27 22:19:07+00:00
Summary: Merge
Affected #: 7 files
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -764,6 +764,25 @@
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
+
+# Enable beta workflow modules that should not yet be considered part of Galaxy's
+# stable API.
+#enable_beta_workflow_modules = False
+
+# Force usage of Galaxy's beta workflow scheduler under certain circumstances -
+# this workflow scheduling forces Galaxy to schedule workflows in the background
+# so initial submission of the workflows is signficantly sped up. This does
+# however force the user to refresh their history manually to see newly scheduled
+# steps (for "normal" workflows - steps are still scheduled far in advance of
+# them being queued and scheduling here doesn't refer to actual cluster job
+# scheduling).
+# Workflows containing more than the specified number of steps will always use
+# the Galaxy's beta workflow scheduling.
+#force_beta_workflow_scheduled_min_steps=250
+# Switch to using Galaxy's beta workflow scheduling for all workflows involving
+# ccollections.
+#force_beta_workflow_scheduled_for_collections=False
+
# Enable authentication via OpenID. Allows users to log in to their Galaxy
# account by authenticating with an OpenID provider.
#enable_openid = False
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 config/tool_data_table_conf.xml.sample
--- a/config/tool_data_table_conf.xml.sample
+++ b/config/tool_data_table_conf.xml.sample
@@ -60,4 +60,9 @@
<columns>value, dbkey, name, path</columns><file path="tool-data/mosaik_index.loc" /></table>
+ <!-- Locations of indexes in the 2bit format -->
+ <table name="twobit" comment_char="#">
+ <columns>value, path</columns>
+ <file path="tool-data/twobit.loc" />
+ </table></tables>
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 lib/galaxy/visualization/genomes.py
--- a/lib/galaxy/visualization/genomes.py
+++ b/lib/galaxy/visualization/genomes.py
@@ -179,33 +179,59 @@
"""
def __init__( self, app ):
+ self.app = app
# Create list of genomes from app.genome_builds
self.genomes = {}
- for key, description in app.genome_builds.get_genome_build_names():
+ # Store internal versions of data tables for twobit and __dbkey__
+ self._table_versions = { 'twobit': None, '__dbkeys__': None }
+ self.reload_genomes()
+
+ def reload_genomes( self ):
+ self.genomes = {}
+ # Store table versions for later
+ for table_name in self._table_versions.keys():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None:
+ self._table_versions[ table_name ] = table._loaded_content_version
+
+ twobit_table = self.app.tool_data_tables.get( 'twobit', None )
+ twobit_fields = {}
+ if twobit_table is None:
+ # Add genome data (twobit files) to genomes, directly from twobit.loc
+ try:
+ for line in open( os.path.join( self.app.config.tool_data_path, "twobit.loc" ) ):
+ if line.startswith("#"): continue
+ val = line.split()
+ if len( val ) == 2:
+ key, path = val
+ twobit_fields[ key ] = path
+ except IOError, e:
+ # Thrown if twobit.loc does not exist.
+ log.exception( "Error reading twobit.loc: %s", e )
+ for key, description in self.app.genome_builds.get_genome_build_names():
self.genomes[ key ] = Genome( key, description )
+ # Add len files to genomes.
+ self.genomes[ key ].len_file = self.app.genome_builds.get_chrom_info( key )[0]
+ if self.genomes[ key ].len_file:
+ if not os.path.exists( self.genomes[ key ].len_file ):
+ self.genomes[ key ].len_file = None
+ # Add genome data (twobit files) to genomes.
+ if twobit_table is not None:
+ self.genomes[ key ].twobit_file = twobit_table.get_entry( 'value', key, 'path', default=None )
+ elif key in twobit_fields:
+ self.genomes[ key ].twobit_file = twobit_fields[ key ]
+
- # Add len files to genomes.
- len_files = glob.glob( os.path.join( app.config.len_file_path, "*.len" ) )
- for f in len_files:
- key = os.path.split( f )[1].split( ".len" )[0]
- if key in self.genomes:
- self.genomes[ key ].len_file = f
-
- # Add genome data (twobit files) to genomes.
- try:
- for line in open( os.path.join( app.config.tool_data_path, "twobit.loc" ) ):
- if line.startswith("#"): continue
- val = line.split()
- if len( val ) == 2:
- key, path = val
- if key in self.genomes:
- self.genomes[ key ].twobit_file = path
- except IOError, e:
- # Thrown if twobit.loc does not exist.
- log.exception( str( e ) )
+ def check_and_reload( self ):
+ # Check if tables have been modified, if so reload
+ for table_name, table_version in self._table_versions.iteritems():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None and not table.is_current_version( table_version ):
+ return self.reload_genomes()
def get_build( self, dbkey ):
""" Returns build for the given key. """
+ self.check_and_reload()
rval = None
if dbkey in self.genomes:
rval = self.genomes[ dbkey ]
@@ -214,6 +240,7 @@
def get_dbkeys( self, trans, chrom_info=False, **kwd ):
""" Returns all known dbkeys. If chrom_info is True, only dbkeys with
chromosome lengths are returned. """
+ self.check_and_reload()
dbkeys = []
# Add user's custom keys to dbkeys.
@@ -241,7 +268,7 @@
Returns a naturally sorted list of chroms/contigs for a given dbkey.
Use either chrom or low to specify the starting chrom in the return list.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
@@ -303,6 +330,7 @@
Returns true if there is reference data for the specified dbkey. If dbkey is custom,
dbkey_owner is needed to determine if there is reference data.
"""
+ self.check_and_reload()
# Look for key in built-in builds.
if dbkey in self.genomes and self.genomes[ dbkey ].twobit_file:
# There is built-in reference data.
@@ -323,7 +351,7 @@
"""
Return reference data for a build.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -1351,31 +1351,46 @@
id = galaxy.util.listify( id )
name = galaxy.util.listify( name )
histories = []
- cur_names = []
+
for history_id in id:
history = self.history_manager.get_owned( trans, self.decode_id( history_id ), trans.user )
if history and history.user_id == user.id:
histories.append( history )
- cur_names.append( history.get_display_name() )
if not name or len( histories ) != len( name ):
return trans.fill_template( "/history/rename.mako", histories=histories )
- change_msg = ""
- for i in range(len(histories)):
- if histories[i].user_id == user.id:
- if name[i] == histories[i].get_display_name():
- change_msg = change_msg + "<p>History: "+cur_names[i]+" is already named: "+name[i]+"</p>"
- elif name[i] not in [None,'',' ']:
- name[i] = escape(name[i])
- histories[i].name = sanitize_html( name[i] )
- trans.sa_session.add( histories[i] )
- trans.sa_session.flush()
- change_msg = change_msg + "<p>History: "+cur_names[i]+" renamed to: "+name[i]+"</p>"
- trans.log_event( "History renamed: id: %s, renamed to: '%s'" % (str(histories[i].id), name[i] ) )
- else:
- change_msg = change_msg + "<p>You must specify a valid name for History: "+cur_names[i]+"</p>"
- else:
- change_msg = change_msg + "<p>History: "+cur_names[i]+" does not appear to belong to you.</p>"
- return trans.show_message( "<p>%s" % change_msg, refresh_frames=['history'] )
+
+ change_msgs = []
+ for i in range( len( histories ) ):
+ cur_name = histories[i].get_display_name()
+ new_name = name[i]
+
+ # skip if name is empty
+ if not isinstance( new_name, basestring ) or not new_name.strip():
+ change_msgs.append( "You must specify a valid name for History: " + cur_name )
+ continue
+
+ # skip if not the owner
+ #??: isn't this already handled in get_history/if statement above?
+ if histories[i].user_id != user.id:
+ change_msgs.append( "History: " + cur_name + " does not appear to belong to you." )
+ continue
+
+ # skip if it wouldn't be a change
+ if new_name == cur_name:
+ change_msgs.append( "History: " + cur_name + " is already named: " + new_name )
+ continue
+
+ # escape, sanitize, set, and log the change
+ new_name = escape( new_name )
+ histories[i].name = sanitize_html( new_name )
+ trans.sa_session.add( histories[i] )
+ trans.sa_session.flush()
+
+ trans.log_event( "History renamed: id: %s, renamed to: '%s'" % ( str( histories[i].id ), new_name ) )
+ change_msgs.append( "History: " + cur_name + " renamed to: " + new_name )
+
+ change_msg = '<br />'.join( change_msgs )
+ return trans.show_message( change_msg, refresh_frames=['history'] )
@web.expose
@web.require_login( "copy shared Galaxy history" )
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 templates/admin/jobs.mako
--- a/templates/admin/jobs.mako
+++ b/templates/admin/jobs.mako
@@ -55,11 +55,7 @@
</tr>
%for job in jobs:
<td>
- %if job.state == 'upload':
-
- %else:
- <input type="checkbox" name="stop" value="${job.id}"/>
- %endif
+ <input type="checkbox" name="stop" value="${job.id}"/></td><td>${job.id}</td>
%if job.history and job.history.user:
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 templates/user/register.mako
--- a/templates/user/register.mako
+++ b/templates/user/register.mako
@@ -17,7 +17,7 @@
## An admin user may be creating a new user account, in which case we want to display the registration form.
## But if the current user is not an admin user, then don't display the registration form.
-%if trans.user_is_admin() or not trans.user:
+%if ( cntrller=='admin' and trans.user_is_admin() ) or not trans.user:
${render_registration_form()}
%if trans.app.config.get( 'terms_url', None ) is not None:
diff -r 5877dc562874b894a83393bc54ba671d397909c9 -r 73a261a75185704a35a05350a31a7d5169cbc9b0 test/api/test_tools.py
--- a/test/api/test_tools.py
+++ b/test/api/test_tools.py
@@ -201,6 +201,27 @@
response = self._run( "validation_default", history_id, inputs )
self._assert_status_code_is( response, 400 )
+ @skip_without_tool( "multi_select" )
+ def test_select_legal_values( self ):
+ history_id = self.dataset_populator.new_history()
+ inputs = {
+ 'select_ex': 'not_option',
+ }
+ response = self._run( "multi_select", history_id, inputs )
+ self._assert_status_code_is( response, 400 )
+
+ @skip_without_tool( "column_param" )
+ def test_column_legal_values( self ):
+ history_id = self.dataset_populator.new_history()
+ new_dataset1 = self.dataset_populator.new_dataset( history_id, content='#col1\tcol2' )
+ inputs = {
+ 'input1': { "src": "hda", "id": new_dataset1["id"] },
+ 'col': "' ; echo 'moo",
+ }
+ response = self._run( "column_param", history_id, inputs )
+ # TODO: make this test pass...
+ self._assert_status_code_is( response, 400 )
+
@skip_without_tool( "collection_paired_test" )
def test_collection_parameter( self ):
history_id = self.dataset_populator.new_history()
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
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/21e5bf79d769/
Changeset: 21e5bf79d769
User: dannon
Date: 2015-01-27 20:34:24+00:00
Summary: Merge from stable.
Affected #: 1 file
diff -r 4e6216506b6f480742d94b0ec0b6206c0e8ebc3d -r 21e5bf79d7690bc0ad0b3a4cca684327809caf60 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -1351,31 +1351,46 @@
id = galaxy.util.listify( id )
name = galaxy.util.listify( name )
histories = []
- cur_names = []
+
for history_id in id:
history = self.history_manager.get_owned( trans, self.decode_id( history_id ), trans.user )
if history and history.user_id == user.id:
histories.append( history )
- cur_names.append( history.get_display_name() )
if not name or len( histories ) != len( name ):
return trans.fill_template( "/history/rename.mako", histories=histories )
- change_msg = ""
- for i in range(len(histories)):
- if histories[i].user_id == user.id:
- if name[i] == histories[i].get_display_name():
- change_msg = change_msg + "<p>History: "+cur_names[i]+" is already named: "+name[i]+"</p>"
- elif name[i] not in [None,'',' ']:
- name[i] = escape(name[i])
- histories[i].name = sanitize_html( name[i] )
- trans.sa_session.add( histories[i] )
- trans.sa_session.flush()
- change_msg = change_msg + "<p>History: "+cur_names[i]+" renamed to: "+name[i]+"</p>"
- trans.log_event( "History renamed: id: %s, renamed to: '%s'" % (str(histories[i].id), name[i] ) )
- else:
- change_msg = change_msg + "<p>You must specify a valid name for History: "+cur_names[i]+"</p>"
- else:
- change_msg = change_msg + "<p>History: "+cur_names[i]+" does not appear to belong to you.</p>"
- return trans.show_message( "<p>%s" % change_msg, refresh_frames=['history'] )
+
+ change_msgs = []
+ for i in range( len( histories ) ):
+ cur_name = histories[i].get_display_name()
+ new_name = name[i]
+
+ # skip if name is empty
+ if not isinstance( new_name, basestring ) or not new_name.strip():
+ change_msgs.append( "You must specify a valid name for History: " + cur_name )
+ continue
+
+ # skip if not the owner
+ #??: isn't this already handled in get_history/if statement above?
+ if histories[i].user_id != user.id:
+ change_msgs.append( "History: " + cur_name + " does not appear to belong to you." )
+ continue
+
+ # skip if it wouldn't be a change
+ if new_name == cur_name:
+ change_msgs.append( "History: " + cur_name + " is already named: " + new_name )
+ continue
+
+ # escape, sanitize, set, and log the change
+ new_name = escape( new_name )
+ histories[i].name = sanitize_html( new_name )
+ trans.sa_session.add( histories[i] )
+ trans.sa_session.flush()
+
+ trans.log_event( "History renamed: id: %s, renamed to: '%s'" % ( str( histories[i].id ), new_name ) )
+ change_msgs.append( "History: " + cur_name + " renamed to: " + new_name )
+
+ change_msg = '<br />'.join( change_msgs )
+ return trans.show_message( change_msg, refresh_frames=['history'] )
@web.expose
@web.require_login( "copy shared Galaxy history" )
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: carlfeberhard: Remove paragraph tags from history/rename feedback messages
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1b96d3a4ff28/
Changeset: 1b96d3a4ff28
Branch: stable
User: carlfeberhard
Date: 2015-01-27 19:32:16+00:00
Summary: Remove paragraph tags from history/rename feedback messages
Affected #: 1 file
diff -r 11e14ac45c7ece4d6484f37be1123d7796cac599 -r 1b96d3a4ff28da2bd547b65ad86c5ad5a9bbfb90 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -1371,31 +1371,46 @@
id = galaxy.util.listify( id )
name = galaxy.util.listify( name )
histories = []
- cur_names = []
+
for history_id in id:
history = self.get_history( trans, history_id )
if history and history.user_id == user.id:
histories.append( history )
- cur_names.append( history.get_display_name() )
if not name or len( histories ) != len( name ):
return trans.fill_template( "/history/rename.mako", histories=histories )
- change_msg = ""
- for i in range(len(histories)):
- if histories[i].user_id == user.id:
- if name[i] == histories[i].get_display_name():
- change_msg = change_msg + "<p>History: "+cur_names[i]+" is already named: "+name[i]+"</p>"
- elif name[i] not in [None,'',' ']:
- name[i] = escape(name[i])
- histories[i].name = sanitize_html( name[i] )
- trans.sa_session.add( histories[i] )
- trans.sa_session.flush()
- change_msg = change_msg + "<p>History: "+cur_names[i]+" renamed to: "+name[i]+"</p>"
- trans.log_event( "History renamed: id: %s, renamed to: '%s'" % (str(histories[i].id), name[i] ) )
- else:
- change_msg = change_msg + "<p>You must specify a valid name for History: "+cur_names[i]+"</p>"
- else:
- change_msg = change_msg + "<p>History: "+cur_names[i]+" does not appear to belong to you.</p>"
- return trans.show_message( "<p>%s" % change_msg, refresh_frames=['history'] )
+
+ change_msgs = []
+ for i in range( len( histories ) ):
+ cur_name = histories[i].get_display_name()
+ new_name = name[i]
+
+ # skip if name is empty
+ if not isinstance( new_name, basestring ) or not new_name.strip():
+ change_msgs.append( "You must specify a valid name for History: " + cur_name )
+ continue
+
+ # skip if not the owner
+ #??: isn't this already handled in get_history/if statement above?
+ if histories[i].user_id != user.id:
+ change_msgs.append( "History: " + cur_name + " does not appear to belong to you." )
+ continue
+
+ # skip if it wouldn't be a change
+ if new_name == cur_name:
+ change_msgs.append( "History: " + cur_name + " is already named: " + new_name )
+ continue
+
+ # escape, sanitize, set, and log the change
+ new_name = escape( new_name )
+ histories[i].name = sanitize_html( new_name )
+ trans.sa_session.add( histories[i] )
+ trans.sa_session.flush()
+
+ trans.log_event( "History renamed: id: %s, renamed to: '%s'" % ( str( histories[i].id ), new_name ) )
+ change_msgs.append( "History: " + cur_name + " renamed to: " + new_name )
+
+ change_msg = '<br />'.join( change_msgs )
+ return trans.show_message( change_msg, refresh_frames=['history'] )
@web.expose
@web.require_login( "copy shared Galaxy history" )
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: dan: Fix for re-displaying user registration form when registering as an email of an admin_user that is already declared in galaxy.ini (cntrller r dmb). NB: Automatic refresh of masthead after success did not seem to be occuring.
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4e6216506b6f/
Changeset: 4e6216506b6f
User: dan
Date: 2015-01-27 19:52:55+00:00
Summary: Fix for re-displaying user registration form when registering as an email of an admin_user that is already declared in galaxy.ini (cntrller r dmb). NB: Automatic refresh of masthead after success did not seem to be occuring.
Affected #: 1 file
diff -r df3b9b974104f827e8e50e7996a396ffdf2bc5bd -r 4e6216506b6f480742d94b0ec0b6206c0e8ebc3d templates/user/register.mako
--- a/templates/user/register.mako
+++ b/templates/user/register.mako
@@ -17,7 +17,7 @@
## An admin user may be creating a new user account, in which case we want to display the registration form.
## But if the current user is not an admin user, then don't display the registration form.
-%if trans.user_is_admin() or not trans.user:
+%if ( cntrller=='admin' and trans.user_is_admin() ) or not trans.user:
${render_registration_form()}
%if trans.app.config.get( 'terms_url', None ) is not None:
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: Add comments to config/galaxy.ini.sample about recent workflow changes.
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/df3b9b974104/
Changeset: df3b9b974104
User: jmchilton
Date: 2015-01-27 18:48:01+00:00
Summary: Add comments to config/galaxy.ini.sample about recent workflow changes.
Thanks for Philip Mabon for letting me know there were not included along with the original changes.
Affected #: 1 file
diff -r 5f59c9e4d36d796b40a4817c38b66f5def94dc2d -r df3b9b974104f827e8e50e7996a396ffdf2bc5bd config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -764,6 +764,25 @@
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
+
+# Enable beta workflow modules that should not yet be considered part of Galaxy's
+# stable API.
+#enable_beta_workflow_modules = False
+
+# Force usage of Galaxy's beta workflow scheduler under certain circumstances -
+# this workflow scheduling forces Galaxy to schedule workflows in the background
+# so initial submission of the workflows is signficantly sped up. This does
+# however force the user to refresh their history manually to see newly scheduled
+# steps (for "normal" workflows - steps are still scheduled far in advance of
+# them being queued and scheduling here doesn't refer to actual cluster job
+# scheduling).
+# Workflows containing more than the specified number of steps will always use
+# the Galaxy's beta workflow scheduling.
+#force_beta_workflow_scheduled_min_steps=250
+# Switch to using Galaxy's beta workflow scheduling for all workflows involving
+# ccollections.
+#force_beta_workflow_scheduled_for_collections=False
+
# Enable authentication via OpenID. Allows users to log in to their Galaxy
# account by authenticating with an OpenID provider.
#enable_openid = False
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: bc784c1bfc309ec59471dfcf2f928da0733562e9
https://github.com/galaxyproject/usegalaxy-playbook/commit/bc784c1bfc309ec5…
Author: Dannon <dannon.baker(a)gmail.com>
Date: 2015-01-27 (Tue, 27 Jan 2015)
Changed paths:
M stage/group_vars/all.yml
Log Message:
-----------
Update test.
1
0
commit/galaxy-central: jmchilton: Test cases for select validation handling.
by commits-noreply@bitbucket.org 27 Jan '15
by commits-noreply@bitbucket.org 27 Jan '15
27 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5f59c9e4d36d/
Changeset: 5f59c9e4d36d
User: jmchilton
Date: 2015-01-27 17:14:56+00:00
Summary: Test cases for select validation handling.
Normal selects seem to be prevented from execution with invalid parameter values, but not columns. Values are escaped properly so shell exploitation isn't the problem - but as a usability thing Galaxy should prevent execution and provide a warning message.
Affected #: 1 file
diff -r 1096077cabbd4046b7da9ce45cecf1151b7ebc75 -r 5f59c9e4d36d796b40a4817c38b66f5def94dc2d test/api/test_tools.py
--- a/test/api/test_tools.py
+++ b/test/api/test_tools.py
@@ -201,6 +201,27 @@
response = self._run( "validation_default", history_id, inputs )
self._assert_status_code_is( response, 400 )
+ @skip_without_tool( "multi_select" )
+ def test_select_legal_values( self ):
+ history_id = self.dataset_populator.new_history()
+ inputs = {
+ 'select_ex': 'not_option',
+ }
+ response = self._run( "multi_select", history_id, inputs )
+ self._assert_status_code_is( response, 400 )
+
+ @skip_without_tool( "column_param" )
+ def test_column_legal_values( self ):
+ history_id = self.dataset_populator.new_history()
+ new_dataset1 = self.dataset_populator.new_dataset( history_id, content='#col1\tcol2' )
+ inputs = {
+ 'input1': { "src": "hda", "id": new_dataset1["id"] },
+ 'col': "' ; echo 'moo",
+ }
+ response = self._run( "column_param", history_id, inputs )
+ # TODO: make this test pass...
+ self._assert_status_code_is( response, 400 )
+
@skip_without_tool( "collection_paired_test" )
def test_collection_parameter( self ):
history_id = self.dataset_populator.new_history()
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/a439922a4956/
Changeset: a439922a4956
User: dannon
Date: 2015-01-26 21:25:19+00:00
Summary: Allow cancelling of upload jobs. This won't cancel the actual upload, but it'll kill (or prevent) the processing job if it exists. This also allows one to clean up 'zombie' upload jobs that never leave 'upload' state via the admin panel.
Affected #: 1 file
diff -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 -r a439922a4956cdef237925540f4a70922ae8a74c templates/admin/jobs.mako
--- a/templates/admin/jobs.mako
+++ b/templates/admin/jobs.mako
@@ -55,11 +55,7 @@
</tr>
%for job in jobs:
<td>
- %if job.state == 'upload':
-
- %else:
- <input type="checkbox" name="stop" value="${job.id}"/>
- %endif
+ <input type="checkbox" name="stop" value="${job.id}"/></td><td>${job.id}</td>
%if job.history and job.history.user:
https://bitbucket.org/galaxy/galaxy-central/commits/1096077cabbd/
Changeset: 1096077cabbd
User: dannon
Date: 2015-01-26 21:25:29+00:00
Summary: Merge.
Affected #: 2 files
diff -r a439922a4956cdef237925540f4a70922ae8a74c -r 1096077cabbd4046b7da9ce45cecf1151b7ebc75 config/tool_data_table_conf.xml.sample
--- a/config/tool_data_table_conf.xml.sample
+++ b/config/tool_data_table_conf.xml.sample
@@ -60,4 +60,9 @@
<columns>value, dbkey, name, path</columns><file path="tool-data/mosaik_index.loc" /></table>
+ <!-- Locations of indexes in the 2bit format -->
+ <table name="twobit" comment_char="#">
+ <columns>value, path</columns>
+ <file path="tool-data/twobit.loc" />
+ </table></tables>
diff -r a439922a4956cdef237925540f4a70922ae8a74c -r 1096077cabbd4046b7da9ce45cecf1151b7ebc75 lib/galaxy/visualization/genomes.py
--- a/lib/galaxy/visualization/genomes.py
+++ b/lib/galaxy/visualization/genomes.py
@@ -179,33 +179,59 @@
"""
def __init__( self, app ):
+ self.app = app
# Create list of genomes from app.genome_builds
self.genomes = {}
- for key, description in app.genome_builds.get_genome_build_names():
+ # Store internal versions of data tables for twobit and __dbkey__
+ self._table_versions = { 'twobit': None, '__dbkeys__': None }
+ self.reload_genomes()
+
+ def reload_genomes( self ):
+ self.genomes = {}
+ # Store table versions for later
+ for table_name in self._table_versions.keys():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None:
+ self._table_versions[ table_name ] = table._loaded_content_version
+
+ twobit_table = self.app.tool_data_tables.get( 'twobit', None )
+ twobit_fields = {}
+ if twobit_table is None:
+ # Add genome data (twobit files) to genomes, directly from twobit.loc
+ try:
+ for line in open( os.path.join( self.app.config.tool_data_path, "twobit.loc" ) ):
+ if line.startswith("#"): continue
+ val = line.split()
+ if len( val ) == 2:
+ key, path = val
+ twobit_fields[ key ] = path
+ except IOError, e:
+ # Thrown if twobit.loc does not exist.
+ log.exception( "Error reading twobit.loc: %s", e )
+ for key, description in self.app.genome_builds.get_genome_build_names():
self.genomes[ key ] = Genome( key, description )
+ # Add len files to genomes.
+ self.genomes[ key ].len_file = self.app.genome_builds.get_chrom_info( key )[0]
+ if self.genomes[ key ].len_file:
+ if not os.path.exists( self.genomes[ key ].len_file ):
+ self.genomes[ key ].len_file = None
+ # Add genome data (twobit files) to genomes.
+ if twobit_table is not None:
+ self.genomes[ key ].twobit_file = twobit_table.get_entry( 'value', key, 'path', default=None )
+ elif key in twobit_fields:
+ self.genomes[ key ].twobit_file = twobit_fields[ key ]
+
- # Add len files to genomes.
- len_files = glob.glob( os.path.join( app.config.len_file_path, "*.len" ) )
- for f in len_files:
- key = os.path.split( f )[1].split( ".len" )[0]
- if key in self.genomes:
- self.genomes[ key ].len_file = f
-
- # Add genome data (twobit files) to genomes.
- try:
- for line in open( os.path.join( app.config.tool_data_path, "twobit.loc" ) ):
- if line.startswith("#"): continue
- val = line.split()
- if len( val ) == 2:
- key, path = val
- if key in self.genomes:
- self.genomes[ key ].twobit_file = path
- except IOError, e:
- # Thrown if twobit.loc does not exist.
- log.exception( str( e ) )
+ def check_and_reload( self ):
+ # Check if tables have been modified, if so reload
+ for table_name, table_version in self._table_versions.iteritems():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None and not table.is_current_version( table_version ):
+ return self.reload_genomes()
def get_build( self, dbkey ):
""" Returns build for the given key. """
+ self.check_and_reload()
rval = None
if dbkey in self.genomes:
rval = self.genomes[ dbkey ]
@@ -214,6 +240,7 @@
def get_dbkeys( self, trans, chrom_info=False, **kwd ):
""" Returns all known dbkeys. If chrom_info is True, only dbkeys with
chromosome lengths are returned. """
+ self.check_and_reload()
dbkeys = []
# Add user's custom keys to dbkeys.
@@ -241,7 +268,7 @@
Returns a naturally sorted list of chroms/contigs for a given dbkey.
Use either chrom or low to specify the starting chrom in the return list.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
@@ -303,6 +330,7 @@
Returns true if there is reference data for the specified dbkey. If dbkey is custom,
dbkey_owner is needed to determine if there is reference data.
"""
+ self.check_and_reload()
# Look for key in built-in builds.
if dbkey in self.genomes and self.genomes[ dbkey ].twobit_file:
# There is built-in reference data.
@@ -323,7 +351,7 @@
"""
Return reference data for a build.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
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: dan: Load genomes list from data tables for visualizations. Based off of Pull Request: https://bitbucket.org/galaxy/galaxy-central/pull-request/601/load-genomes-list-from-data-tables-for/diff
by commits-noreply@bitbucket.org 26 Jan '15
by commits-noreply@bitbucket.org 26 Jan '15
26 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1ab223c3860e/
Changeset: 1ab223c3860e
User: dan
Date: 2015-01-26 20:11:06+00:00
Summary: Load genomes list from data tables for visualizations. Based off of Pull Request: https://bitbucket.org/galaxy/galaxy-central/pull-request/601/load-genomes-l…
Affected #: 2 files
diff -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 -r 1ab223c3860e533785527074f36e2d1e16a596f0 config/tool_data_table_conf.xml.sample
--- a/config/tool_data_table_conf.xml.sample
+++ b/config/tool_data_table_conf.xml.sample
@@ -60,4 +60,9 @@
<columns>value, dbkey, name, path</columns><file path="tool-data/mosaik_index.loc" /></table>
+ <!-- Locations of indexes in the 2bit format -->
+ <table name="twobit" comment_char="#">
+ <columns>value, path</columns>
+ <file path="tool-data/twobit.loc" />
+ </table></tables>
diff -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 -r 1ab223c3860e533785527074f36e2d1e16a596f0 lib/galaxy/visualization/genomes.py
--- a/lib/galaxy/visualization/genomes.py
+++ b/lib/galaxy/visualization/genomes.py
@@ -179,33 +179,59 @@
"""
def __init__( self, app ):
+ self.app = app
# Create list of genomes from app.genome_builds
self.genomes = {}
- for key, description in app.genome_builds.get_genome_build_names():
+ # Store internal versions of data tables for twobit and __dbkey__
+ self._table_versions = { 'twobit': None, '__dbkeys__': None }
+ self.reload_genomes()
+
+ def reload_genomes( self ):
+ self.genomes = {}
+ # Store table versions for later
+ for table_name in self._table_versions.keys():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None:
+ self._table_versions[ table_name ] = table._loaded_content_version
+
+ twobit_table = self.app.tool_data_tables.get( 'twobit', None )
+ twobit_fields = {}
+ if twobit_table is None:
+ # Add genome data (twobit files) to genomes, directly from twobit.loc
+ try:
+ for line in open( os.path.join( self.app.config.tool_data_path, "twobit.loc" ) ):
+ if line.startswith("#"): continue
+ val = line.split()
+ if len( val ) == 2:
+ key, path = val
+ twobit_fields[ key ] = path
+ except IOError, e:
+ # Thrown if twobit.loc does not exist.
+ log.exception( "Error reading twobit.loc: %s", e )
+ for key, description in self.app.genome_builds.get_genome_build_names():
self.genomes[ key ] = Genome( key, description )
+ # Add len files to genomes.
+ self.genomes[ key ].len_file = self.app.genome_builds.get_chrom_info( key )[0]
+ if self.genomes[ key ].len_file:
+ if not os.path.exists( self.genomes[ key ].len_file ):
+ self.genomes[ key ].len_file = None
+ # Add genome data (twobit files) to genomes.
+ if twobit_table is not None:
+ self.genomes[ key ].twobit_file = twobit_table.get_entry( 'value', key, 'path', default=None )
+ elif key in twobit_fields:
+ self.genomes[ key ].twobit_file = twobit_fields[ key ]
+
- # Add len files to genomes.
- len_files = glob.glob( os.path.join( app.config.len_file_path, "*.len" ) )
- for f in len_files:
- key = os.path.split( f )[1].split( ".len" )[0]
- if key in self.genomes:
- self.genomes[ key ].len_file = f
-
- # Add genome data (twobit files) to genomes.
- try:
- for line in open( os.path.join( app.config.tool_data_path, "twobit.loc" ) ):
- if line.startswith("#"): continue
- val = line.split()
- if len( val ) == 2:
- key, path = val
- if key in self.genomes:
- self.genomes[ key ].twobit_file = path
- except IOError, e:
- # Thrown if twobit.loc does not exist.
- log.exception( str( e ) )
+ def check_and_reload( self ):
+ # Check if tables have been modified, if so reload
+ for table_name, table_version in self._table_versions.iteritems():
+ table = self.app.tool_data_tables.get( table_name, None )
+ if table is not None and not table.is_current_version( table_version ):
+ return self.reload_genomes()
def get_build( self, dbkey ):
""" Returns build for the given key. """
+ self.check_and_reload()
rval = None
if dbkey in self.genomes:
rval = self.genomes[ dbkey ]
@@ -214,6 +240,7 @@
def get_dbkeys( self, trans, chrom_info=False, **kwd ):
""" Returns all known dbkeys. If chrom_info is True, only dbkeys with
chromosome lengths are returned. """
+ self.check_and_reload()
dbkeys = []
# Add user's custom keys to dbkeys.
@@ -241,7 +268,7 @@
Returns a naturally sorted list of chroms/contigs for a given dbkey.
Use either chrom or low to specify the starting chrom in the return list.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
@@ -303,6 +330,7 @@
Returns true if there is reference data for the specified dbkey. If dbkey is custom,
dbkey_owner is needed to determine if there is reference data.
"""
+ self.check_and_reload()
# Look for key in built-in builds.
if dbkey in self.genomes and self.genomes[ dbkey ].twobit_file:
# There is built-in reference data.
@@ -323,7 +351,7 @@
"""
Return reference data for a build.
"""
-
+ self.check_and_reload()
# If there is no dbkey owner, default to current user.
dbkey_owner, dbkey = decode_dbkey( dbkey )
if dbkey_owner:
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: martenson: initial version of TS search API and Index builder script
by commits-noreply@bitbucket.org 26 Jan '15
by commits-noreply@bitbucket.org 26 Jan '15
26 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0733c87123cb/
Changeset: 0733c87123cb
User: martenson
Date: 2015-01-26 18:08:16+00:00
Summary: initial version of TS search API and Index builder script
beware: always returns jsonp for now
Affected #: 7 files
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 lib/galaxy/webapps/tool_shed/api/search.py
--- /dev/null
+++ b/lib/galaxy/webapps/tool_shed/api/search.py
@@ -0,0 +1,34 @@
+"""API for searching the toolshed repositories"""
+from galaxy import exceptions
+from galaxy import eggs
+from galaxy.web import _future_expose_api as expose_api
+# from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
+from galaxy.web import _future_expose_api_raw_anonymous as expose_api_raw_anonymous
+from galaxy.web.base.controller import BaseAPIController
+from galaxy.webapps.tool_shed.search.repo_search import RepoSearch
+import json
+import logging
+log = logging.getLogger( __name__ )
+
+
+class SearchController ( BaseAPIController ):
+
+ @expose_api_raw_anonymous
+ def search( self, trans, search_term, **kwd ):
+ """
+ Perform a search over the Whoosh index.
+ The index has to be pre-created with build_ts_whoosh_index.sh.
+ TS config option toolshed_search_on has to be turned on and
+ toolshed_whoosh_index_dir has to be specified and existing.
+ """
+ if not self.app.config.toolshed_search_on:
+ raise exceptions.ConfigDoesNotAllowException( 'Searching the TS through the API is turned off for this instance.' )
+ if not self.app.config.toolshed_whoosh_index_dir:
+ raise exceptions.ConfigDoesNotAllowException( 'There is no directory for the search index specified. Please ontact the administrator.' )
+
+ repo_search = RepoSearch()
+ results = repo_search.search( trans, search_term )
+
+ response = '%s(%s);' % ( kwd.get('callback'), json.dumps(results) )
+ log.debug(response)
+ return response
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 lib/galaxy/webapps/tool_shed/buildapp.py
--- a/lib/galaxy/webapps/tool_shed/buildapp.py
+++ b/lib/galaxy/webapps/tool_shed/buildapp.py
@@ -85,6 +85,11 @@
controller='authenticate',
action='get_tool_shed_api_key',
conditions=dict( method=[ "GET" ] ) )
+ webapp.mapper.connect( 'repo_search',
+ '/api/search/',
+ controller='search',
+ action='search',
+ conditions=dict( method=[ "GET" ] ) )
webapp.mapper.resource( 'category',
'categories',
controller='categories',
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 lib/galaxy/webapps/tool_shed/config.py
--- a/lib/galaxy/webapps/tool_shed/config.py
+++ b/lib/galaxy/webapps/tool_shed/config.py
@@ -40,6 +40,9 @@
self.database_connection = kwargs.get( "database_connection", False )
self.database_engine_options = get_database_engine_options( kwargs )
self.database_create_tables = string_as_bool( kwargs.get( "database_create_tables", "True" ) )
+ # Whoosh search
+ self.toolshed_search_on = string_as_bool( kwargs.get( "toolshed_search_on", False ) )
+ self.toolshed_whoosh_index_dir = kwargs.get( "toolshed_whoosh_index_dir", None )
# Analytics
self.ga_code = kwargs.get( "ga_code", None )
# Where dataset files are stored
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 lib/galaxy/webapps/tool_shed/search/repo_search.py
--- /dev/null
+++ b/lib/galaxy/webapps/tool_shed/search/repo_search.py
@@ -0,0 +1,98 @@
+"""Module for searching the toolshed repositories"""
+from galaxy import exceptions
+from galaxy import eggs
+from galaxy.web.base.controller import BaseAPIController
+from galaxy.webapps.tool_shed import model
+from tool_shed.util.shed_util_common import generate_sharable_link_for_repository_in_tool_shed
+
+
+import logging
+log = logging.getLogger( __name__ )
+
+# Whoosh is compatible with Python 2.5+
+# Try to import Whoosh and set flag to indicate whether
+# the tool search is ready.
+try:
+ eggs.require( "Whoosh" )
+ import whoosh.index
+ from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT
+ from whoosh.scoring import BM25F
+ from whoosh.qparser import MultifieldParser
+ from whoosh.index import Index
+ search_ready = True
+
+ schema = Schema(
+ id=STORED,
+ name=TEXT,
+ description=TEXT,
+ long_description=TEXT,
+ repo_type=TEXT,
+ homepage_url=TEXT,
+ remote_repository_url=TEXT,
+ repo_owner_username=TEXT )
+except ImportError, e:
+ search_ready = False
+ schema = None
+
+class RepoSearch ( object ):
+
+ def search( self, trans, search_term, **kwd ):
+ """
+ Perform the search on the given search_term
+
+ :param search_term: unicode encoded string with the search term(s)
+
+ :returns results: dictionary containing number of hits,
+ hits themselves and matched terms for each
+ """
+ if search_ready:
+ toolshed_whoosh_index_dir = trans.app.config.toolshed_whoosh_index_dir
+ index_exists = whoosh.index.exists_in( toolshed_whoosh_index_dir )
+ if index_exists:
+ index = whoosh.index.open_dir( toolshed_whoosh_index_dir )
+ try:
+ # Some literature about BM25F:
+ # http://trec.nist.gov/pubs/trec13/papers/microsoft-cambridge.web.hard.pdf
+ # http://en.wikipedia.org/wiki/Okapi_BM25
+ # Basically the higher number the bigger weight.
+ searcher = index.searcher( weighting=BM25F( field_B={
+ 'name_B' : 0.9,
+ 'description_B' : 0.6,
+ 'long_description_B' : 0.5,
+ 'homepage_url_B' : 0.3,
+ 'remote_repository_url_B' : 0.2,
+ 'repo_owner_username' : 0.3,
+ 'repo_type_B' : 0.1 } ) )
+ parser = MultifieldParser( [
+ 'name',
+ 'description',
+ 'long_description',
+ 'repo_type',
+ 'homepage_url',
+ 'remote_repository_url',
+ 'repo_owner_username' ], schema=schema )
+
+ hits = searcher.search( parser.parse( '*' + search_term + '*' ), terms = True )
+ results = {}
+ results[ 'length'] = len( hits )
+ results[ 'hits' ] = []
+ for hit in hits:
+ repo = trans.sa_session.query( model.Repository ).filter_by( id=hit[ 'id' ] ).one()
+ approved = 'no'
+ for review in repo.reviews:
+ if review.approved == 'yes':
+ approved = 'yes'
+ break
+ hit_dict = repo.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id, 'user_id': trans.security.encode_id } )
+ hit_dict[ 'url'] = generate_sharable_link_for_repository_in_tool_shed( repo )
+ hit_dict[ 'last_updated' ] = repo.update_time.strftime( "%Y-%m-%d %I:%M %p" )
+ hit_dict[ 'times_downloaded' ] = repo.times_downloaded
+ hit_dict[ 'approved' ] = approved
+ results[ 'hits' ].append( {'repository': hit_dict, 'matched_terms': hit.matched_terms() } )
+ return results
+ finally:
+ searcher.close()
+ else:
+ raise exceptions.InternalServerError( 'The search index file is missing.' )
+ else:
+ raise exceptions.InternalServerError( 'Could not initialize search.' )
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 scripts/tool_shed/build_ts_whoosh_index.py
--- /dev/null
+++ b/scripts/tool_shed/build_ts_whoosh_index.py
@@ -0,0 +1,101 @@
+# !/usr/bin/env python
+""" Build indeces for searching the TS """
+import sys, os, csv, urllib, urllib2, ConfigParser
+
+new_path = [ os.path.join( os.getcwd(), "lib" ) ]
+new_path.extend( sys.path[1:] ) # remove scripts/ from the path
+sys.path = new_path
+
+from galaxy import eggs
+
+# Whoosh is compatible with Python 2.5+ Try to import Whoosh and set flag to indicate whether search is enabled.
+try:
+ eggs.require( "Whoosh" )
+ import pkg_resources
+ pkg_resources.require( "SQLAlchemy >= 0.4" )
+
+ import whoosh.index
+ import galaxy.webapps.tool_shed.model.mapping
+ from whoosh.filedb.filestore import FileStorage
+ from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT
+ from whoosh.scoring import BM25F
+ from whoosh.qparser import MultifieldParser
+ from whoosh.index import Index
+ from galaxy.webapps.tool_shed import config, model
+
+ whoosh_ready = True
+ schema = Schema(
+ id=STORED,
+ name=TEXT,
+ description=TEXT,
+ long_description=TEXT,
+ repo_type=TEXT,
+ homepage_url=TEXT,
+ remote_repository_url=TEXT,
+ repo_owner_username=TEXT )
+
+except ImportError, e:
+ print 'import error'
+ whoosh_ready = False
+ schema = None
+
+def build_index( sa_session, toolshed_whoosh_index_dir ):
+ storage = FileStorage( toolshed_whoosh_index_dir )
+ index = storage.create_index( schema )
+ writer = index.writer()
+ def to_unicode( a_basestr ):
+ if type( a_basestr ) is str:
+ return unicode( a_basestr, 'utf-8' )
+ else:
+ return a_basestr
+
+ repos_indexed = 0
+ for id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username in get_repos( sa_session ):
+ writer.add_document( id=id,
+ name=to_unicode( name ),
+ description=to_unicode( description ),
+ long_description=to_unicode( long_description ),
+ repo_type=to_unicode( repo_type ),
+ homepage_url=to_unicode( homepage_url ),
+ remote_repository_url=to_unicode( remote_repository_url ),
+ repo_owner_username=to_unicode( repo_owner_username ) )
+ repos_indexed += 1
+ writer.commit()
+ print "Number of repos indexed: ", repos_indexed
+
+def get_repos( sa_session ):
+ for repo in sa_session.query( model.Repository ).filter_by( deleted=False ).filter_by( deprecated=False ).filter( model.Repository.type != 'tool_dependency_definition' ):
+ id = repo.id
+ name = repo.name
+ description = repo.description
+ long_description = repo.long_description
+ repo_type = repo.type
+ homepage_url = repo.homepage_url
+ remote_repository_url = repo.remote_repository_url
+
+ repo_owner_username = ""
+ if repo.user_id is not None:
+ user = sa_session.query( model.User ).filter( model.User.id == repo.user_id ).one()
+ repo_owner_username = user.username
+
+ yield id, name, description, long_description, repo_type, homepage_url, remote_repository_url, repo_owner_username
+
+def get_sa_session_and_needed_config_settings( ini_file ):
+ conf_parser = ConfigParser.ConfigParser( { 'here' : os.getcwd() } )
+ conf_parser.read( ini_file )
+ kwds = dict()
+ for key, value in conf_parser.items( "app:main" ):
+ kwds[ key ] = value
+ config_settings = config.Configuration( **kwds )
+ db_con = config_settings.database_connection
+ if not db_con:
+ db_con = "sqlite:///%s?isolation_level=IMMEDIATE" % config_settings.database
+ model = galaxy.webapps.tool_shed.model.mapping.init( config_settings.file_path, db_con, engine_options={}, create_tables=False )
+ return model.context.current, config_settings
+
+if __name__ == "__main__":
+ if whoosh_ready:
+ ini_file = sys.argv[ 1 ]
+ sa_session, config_settings = get_sa_session_and_needed_config_settings( ini_file )
+ toolshed_whoosh_index_dir = config_settings.get( 'toolshed_whoosh_index_dir', None )
+ build_index( sa_session, toolshed_whoosh_index_dir )
diff -r 418633a366083e171f2a3583b591d81a7b333c41 -r 0733c87123cbc2f7009a125c5e57d630bb8296a6 scripts/tool_shed/build_ts_whoosh_index.sh
--- /dev/null
+++ b/scripts/tool_shed/build_ts_whoosh_index.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd `dirname $0`/../..
+# Make sure your config is at config/tool_shed.ini
+# and that you specified toolshed_whoosh_index_dir in it.
+python scripts/tool_shed/build_ts_whoosh_index.py config/tool_shed.ini
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: dannon: One more path permission increase for admins under remote_user.
by commits-noreply@bitbucket.org 26 Jan '15
by commits-noreply@bitbucket.org 26 Jan '15
26 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/418633a36608/
Changeset: 418633a36608
User: dannon
Date: 2015-01-26 15:43:02+00:00
Summary: One more path permission increase for admins under remote_user.
Affected #: 1 file
diff -r 39f3f0586c48f81452e3a7a6af1f5e97c4ef8ed0 -r 418633a366083e171f2a3583b591d81a7b333c41 lib/galaxy/web/framework/middleware/remoteuser.py
--- a/lib/galaxy/web/framework/middleware/remoteuser.py
+++ b/lib/galaxy/web/framework/middleware/remoteuser.py
@@ -116,6 +116,8 @@
pass # Admin users may be impersonating, allow logout.
elif path_info.startswith( '/user/manage_user_info' ) and environ[ self.remote_user_header ] in self.admin_users:
pass # Admin users need to be able to change user information
+ elif path_info.startswith( '/user/edit_info' ) and environ[ self.remote_user_header ] in self.admin_users:
+ pass # Admin users need to be able to change user information
elif path_info.startswith( '/user/api_keys' ):
pass # api keys can be managed when remote_user is in use
elif path_info.startswith( '/user/edit_username' ):
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/2ea487b70602/
Changeset: 2ea487b70602
User: dannon
Date: 2015-01-26 13:54:29+00:00
Summary: Log when using virtualenv at Galaxy startup.
Affected #: 1 file
diff -r 36a5b25e0d33efdaaa0a6abb96468f648ee206f5 -r 2ea487b70602bd94f442243e27f00fca92693c33 run.sh
--- a/run.sh
+++ b/run.sh
@@ -6,6 +6,7 @@
# should run this instance in.
if [ -d .venv ];
then
+ printf "Activating virtualenv at %s/.venv\n" $(pwd)
. .venv/bin/activate
fi
https://bitbucket.org/galaxy/galaxy-central/commits/39f3f0586c48/
Changeset: 39f3f0586c48
User: dannon
Date: 2015-01-26 13:58:29+00:00
Summary: Allow admin users to change user information (like email addresses) when using remote_auth; otherwise should a user email address change you had to manually edit the database.
Affected #: 1 file
diff -r 2ea487b70602bd94f442243e27f00fca92693c33 -r 39f3f0586c48f81452e3a7a6af1f5e97c4ef8ed0 lib/galaxy/web/framework/middleware/remoteuser.py
--- a/lib/galaxy/web/framework/middleware/remoteuser.py
+++ b/lib/galaxy/web/framework/middleware/remoteuser.py
@@ -64,7 +64,7 @@
# If the secret header is enabled, we expect upstream to send along some key
# in HTTP_GX_SECRET, so we'll need to compare that here to the correct value
- #
+ #
# This is not an ideal location for this function. The reason being
# that because this check is done BEFORE the REMOTE_USER check, it is
# possible to attack the GX_SECRET key without having correct
@@ -79,8 +79,8 @@
title = "Access to Galaxy is denied"
message = """
Galaxy is configured to authenticate users via an external
- method (such as HTTP authentication in Apache), but an
- incorrect shared secret key was provided by the
+ method (such as HTTP authentication in Apache), but an
+ incorrect shared secret key was provided by the
upstream (proxy) server.</p><p>Please contact your local Galaxy administrator. The
variable <code>remote_user_secret</code> and
@@ -88,7 +88,7 @@
access Galaxy.
"""
return self.error( start_response, title, message )
-
+
if not environ.get(self.remote_user_header, '(null)').startswith('(null)'):
if not environ[ self.remote_user_header ].count( '@' ):
if self.maildomain is not None:
@@ -114,6 +114,8 @@
pass # admins can create users
elif path_info.startswith( '/user/logout' ) and environ[ self.remote_user_header ] in self.admin_users:
pass # Admin users may be impersonating, allow logout.
+ elif path_info.startswith( '/user/manage_user_info' ) and environ[ self.remote_user_header ] in self.admin_users:
+ pass # Admin users need to be able to change user information
elif path_info.startswith( '/user/api_keys' ):
pass # api keys can be managed when remote_user is in use
elif path_info.startswith( '/user/edit_username' ):
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: Toolbox: Watch even empty directories if they are explicitly tool_dir specified.
by commits-noreply@bitbucket.org 25 Jan '15
by commits-noreply@bitbucket.org 25 Jan '15
25 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/36a5b25e0d33/
Changeset: 36a5b25e0d33
User: jmchilton
Date: 2015-01-26 00:18:53+00:00
Summary: Toolbox: Watch even empty directories if they are explicitly tool_dir specified.
Affected #: 1 file
diff -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 -r 36a5b25e0d33efdaaa0a6abb96468f648ee206f5 lib/galaxy/tools/toolbox/base.py
--- a/lib/galaxy/tools/toolbox/base.py
+++ b/lib/galaxy/tools/toolbox/base.py
@@ -759,9 +759,9 @@
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 )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=True )
- def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=False ):
def quick_load( tool_file, async=True ):
try:
@@ -793,7 +793,7 @@
elif name.endswith( ".xml" ):
quick_load( child_path, async=False )
tool_loaded = True
- if tool_loaded:
+ if tool_loaded or force_watch:
self._tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
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
24 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/31cb0fdae229/
Changeset: 31cb0fdae229
User: guerler
Date: 2015-01-24 08:53:07+00:00
Summary: Upload: Remove spaces
Affected #: 7 files
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -458,25 +458,25 @@
class_partial : 'fa fa-minus-square-o',
value : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement($('<div/>'));
-
+
// set initial value
this.value(Boolean(this.options.value));
-
+
// add event handler
var self = this;
this.$el.on('click', function() {
self.value(!self.current);
});
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select',],
+ 'mvc/ui/ui-select'],
function( Utils,
UploadModel,
@@ -125,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/upload/upload-view.js
--- a/client/galaxy/scripts/mvc/upload/upload-view.js
+++ b/client/galaxy/scripts/mvc/upload/upload-view.js
@@ -40,7 +40,7 @@
// extension selector
select_extension : null,
-
+
// genome selector
select_genome: null,
@@ -226,7 +226,7 @@
container : self.$el.parent().find('#header-extension'),
value : self.list_extensions[0]
});
-
+
// handle extension info popover
self.$el.parent().find('#header-extension-info').on('click' , function(e) {
self.showExtensionInfo({
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -458,25 +458,25 @@
class_partial : 'fa fa-minus-square-o',
value : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement($('<div/>'));
-
+
// set initial value
this.value(Boolean(this.options.value));
-
+
// add event handler
var self = this;
this.$el.on('click', function() {
self.value(!self.current);
});
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select',],
+ 'mvc/ui/ui-select'],
function( Utils,
UploadModel,
@@ -125,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -40,7 +40,7 @@
// extension selector
select_extension : null,
-
+
// genome selector
select_genome: null,
@@ -226,7 +226,7 @@
container : self.$el.parent().find('#header-extension'),
value : self.list_extensions[0]
});
-
+
// handle extension info popover
self.$el.parent().find('#header-extension-info').on('click' , function(e) {
self.showExtensionInfo({
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/packed/mvc/upload/upload-row.js
--- a/static/scripts/packed/mvc/upload/upload-row.js
+++ b/static/scripts/packed/mvc/upload/upload-row.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select",],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})});
\ 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
commit/galaxy-central: guerler: Upload: Add additional options, revise merged pull request
by commits-noreply@bitbucket.org 24 Jan '15
by commits-noreply@bitbucket.org 24 Jan '15
24 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dc3357ffb6d9/
Changeset: dc3357ffb6d9
User: guerler
Date: 2015-01-24 08:49:12+00:00
Summary: Upload: Add additional options, revise merged pull request
Affected #: 15 files
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -448,6 +448,54 @@
}
});
+// plugin
+var CheckButton = Backbone.View.extend({
+
+ // default options
+ optionsDefault: {
+ class_add : 'fa fa-square-o',
+ class_remove : 'fa fa-check-square-o',
+ class_partial : 'fa fa-minus-square-o',
+ value : false
+ },
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement($('<div/>'));
+
+ // set initial value
+ this.value(Boolean(this.options.value));
+
+ // add event handler
+ var self = this;
+ this.$el.on('click', function() {
+ self.value(!self.current);
+ });
+ },
+
+ // value
+ value : function (new_val) {
+ if (new_val !== undefined) {
+ this.current = new_val;
+ if (new_val) {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_remove);
+ } else {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_add);
+ }
+ this.options.onchange && this.options.onchange(new_val);
+ }
+ return this.current;
+ }
+});
+
// return
return {
Anchor : Anchor,
@@ -463,6 +511,7 @@
RadioButton : Options.RadioButton,
Checkbox : Options.Checkbox,
Radio : Options.Radio,
+ CheckButton : CheckButton,
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-model.js
--- a/client/galaxy/scripts/mvc/upload/upload-model.js
+++ b/client/galaxy/scripts/mvc/upload/upload-model.js
@@ -14,8 +14,6 @@
file_type : null,
file_path : '',
percentage : 0,
- row : null,
- // settings
space_to_tabs : false,
to_posix_lines : true
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select'],
+ 'mvc/ui/ui-select',],
function( Utils,
UploadModel,
@@ -42,9 +42,6 @@
// link app
this.app = app;
- // default value for extension of files
- var default_ext = 'Auto-detect';
-
// link this
var self = this;
@@ -64,6 +61,9 @@
placement : 'bottom'
});
+ // initialize default genome through default select field
+ var default_genome = this.app.select_genome.value();
+
// select genomes
this.select_genome = new Select.View({
css: 'genome',
@@ -72,39 +72,29 @@
},
data: self.app.list_genomes,
container: it.find('#genome'),
- value: self.model.get('genome')
+ value: default_genome
});
// initialize genome
- this.model.set('genome', self.select_genome.value());
+ this.model.set('genome', default_genome);
- // ensure files added after an individual row has changed
- // default to Auto-detect instead of ---
- if(!(this.app.select_extension.value() === '---')){
- this.default_ext = this.app.select_extension.value();
- }
-
+ // initialize default extension through default select field
+ var default_extension = this.app.select_extension.value();
+
// select extension
this.select_extension = new Select.View({
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
- // type to '---'
- if(!(self.select_extension.value() === app.select_extension.value()))
- {
- var newExte = '---';
- app.select_extension.value(newExte);
- }
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.default_ext
+ value: default_extension
});
// initialize extension
- this.model.set('extension', self.select_extension.value());
-
+ this.model.set('extension', default_extension);
+
//
// ui events
//
@@ -113,8 +103,13 @@
it.find('#symbol').on('click', function() { self._removeRow(); });
// handle extension info popover
- it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ it.find('#extension-info').on('click' , function(e) {
+ self.app.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
// handle settings popover
it.find('#settings').on('click' , function(e) { self._showSettings(); })
@@ -130,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -146,6 +141,9 @@
this.model.on('change:genome', function() {
self._refreshGenome();
});
+ this.model.on('change:extension', function() {
+ self._refreshExtension();
+ });
this.model.on('change:file_size', function() {
self._refreshFileSize();
});
@@ -155,7 +153,6 @@
this.app.collection.on('reset', function() {
self.remove();
});
- self.model.set('row', self);
},
// render
@@ -175,8 +172,9 @@
it.find('#size').html(Utils.bytesToString (file_size));
// remove mode class
- it.find('#mode').removeClass()
- .addClass('mode');
+ it.find('#mode')
+ .removeClass()
+ .addClass('mode');
// activate text field if file is new
if (file_mode == 'new') {
@@ -229,11 +227,14 @@
// handle model events
//
- // genome
+ // update extension
+ _refreshExtension: function() {
+ this.select_extension.value(this.model.get('extension'));
+ },
+
+ // update genome
_refreshGenome: function() {
- // update genome info on screen
- var genome = this.model.get('genome');
- this.select_genome.value(genome);
+ this.select_genome.value(this.model.get('genome'));
},
// progress
@@ -327,33 +328,6 @@
},
// attach file info popup
- _showExtensionInfo : function() {
- // initialize
- var $el = $(this.el).find('#extension-info');
- var extension = this.model.get('extension');
- var title = this.select_extension.text();
- var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
- // create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- // attach file info popup
_showSettings : function() {
// check if popover is visible
if (!this.settings.visible) {
@@ -368,23 +342,10 @@
},
// template
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
- },
-
- // template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
'<td>' +
- '<div style="position: relative;">' +
+ '<div class="name-column">' +
'<div id="mode"></div>' +
'<div id="title" class="title"></div>' +
'<div id="text" class="text">' +
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-view.js
--- a/client/galaxy/scripts/mvc/upload/upload-view.js
+++ b/client/galaxy/scripts/mvc/upload/upload-view.js
@@ -23,7 +23,7 @@
return Backbone.View.extend({
// options
options : {
- nginx_upload_path : ''
+ nginx_upload_path : ''
},
// own modal
@@ -40,6 +40,9 @@
// extension selector
select_extension : null,
+
+ // genome selector
+ select_genome: null,
// current upload size
upload_size: 0,
@@ -130,14 +133,6 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // add the '---' extension for use when the row types are changed individually
- self.list_extensions.push({
- id : "---",
- text : "---",
- description : "",
- description_url : ""
- });
-
// add auto field
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
@@ -167,14 +162,6 @@
this.collection.on('remove', function(item) {
self._eventRemove(item);
});
- this.collection.on('change:genome', function(item) {
- var genome = item.get('genome');
- self.collection.each(function(item) {
- if (item.get('status') == 'init' && item.get('genome') == '?') {
- item.set('genome', genome);
- }
- });
- });
},
//
@@ -232,28 +219,30 @@
container : button
});
- // select extension
+ // select extension
this.select_extension = new Select.View({
- css: 'extension',
- onchange : function() {
- var newExten = self.select_extension.value()
- var len = self.collection.models.length;
- // Only trigger changing the rows if the "set all" isn't set to '---'
- // Prevents recursively changing the rows after an individual row has been changed
- if(!(newExten === '---')){
- for(i = 0; i < len; i++){
- self.collection.models[i].attributes['row'].select_extension.value(newExten);
- }
- }
- },
- data: self.list_extensions,
- container: self.$el.parents().find('#extension'),
- value: self.list_extensions[0]
+ css : 'header-selection',
+ data : self.list_extensions,
+ container : self.$el.parent().find('#header-extension'),
+ value : self.list_extensions[0]
});
-
+
// handle extension info popover
- self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ self.$el.parent().find('#header-extension-info').on('click' , function(e) {
+ self.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
+
+ // genome extension
+ this.select_genome = new Select.View({
+ css : 'header-selection',
+ data : self.list_genomes,
+ container : self.$el.parent().find('#header-genome'),
+ value : self.list_genomes[0]
+ });
}
// show modal
@@ -266,45 +255,27 @@
this._updateScreen();
},
- _showExtensionInfo : function() {
+ showExtensionInfo : function(options) {
// initialize
var self = this;
- var $el = $(this.el).parents().find('#extension-info_out');
- var extension = self.select_extension.value();
-
- var title = this.select_extension.text();
-
+ var $el = options.$el;
+ var extension = options.extension;
+ var title = options.title;
var description = _.findWhere(self.list_extensions, {'id': extension});
// create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
+ this.extension_popup && this.extension_popup.remove();
+ this.extension_popup = new Popover.View({
+ placement: 'bottom',
+ container: $el,
+ destroy: true
+ });
+
+ // add content and show popup
+ this.extension_popup.title(title);
+ this.extension_popup.empty();
+ this.extension_popup.append(this._templateDescription(description));
+ this.extension_popup.show();
},
//
@@ -593,6 +564,7 @@
// reset value for universal type drop-down
this.select_extension.value(this.list_extensions[0]);
+ this.select_genome.value(this.list_genomes[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -684,12 +656,28 @@
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
+
+ // template for extensions description
+ _templateDescription: function(options) {
+ if (options.description) {
+ var tmpl = options.description;
+ if (options.description_url) {
+ tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
+ }
+ return tmpl;
+ } else {
+ return 'There is no description available for this file extension.';
+ }
+ },
+
// load html template
_template: function(id, idInfo) {
- return '<div id="uploadhead" class="uploadhead">' +
- '<span class="fftext">"Set All" Types:  </span>' +
- '<span id="extension" class="extension"/>  ' +
- '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' +
+ return '<div id="upload-header" class="upload-header">' +
+ '<span class="header-title">Type (default):</span>' +
+ '<span id="header-extension"/>' +
+ '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' +
+ '<span class="header-title">Genome (default):</span>' +
+ '<span id="header-genome"/>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -707,7 +695,7 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="uploadfoot">' +
+ '<div class="upload-footer">' +
'<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' ;
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -448,6 +448,54 @@
}
});
+// plugin
+var CheckButton = Backbone.View.extend({
+
+ // default options
+ optionsDefault: {
+ class_add : 'fa fa-square-o',
+ class_remove : 'fa fa-check-square-o',
+ class_partial : 'fa fa-minus-square-o',
+ value : false
+ },
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement($('<div/>'));
+
+ // set initial value
+ this.value(Boolean(this.options.value));
+
+ // add event handler
+ var self = this;
+ this.$el.on('click', function() {
+ self.value(!self.current);
+ });
+ },
+
+ // value
+ value : function (new_val) {
+ if (new_val !== undefined) {
+ this.current = new_val;
+ if (new_val) {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_remove);
+ } else {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_add);
+ }
+ this.options.onchange && this.options.onchange(new_val);
+ }
+ return this.current;
+ }
+});
+
// return
return {
Anchor : Anchor,
@@ -463,6 +511,7 @@
RadioButton : Options.RadioButton,
Checkbox : Options.Checkbox,
Radio : Options.Radio,
+ CheckButton : CheckButton,
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-model.js
--- a/static/scripts/mvc/upload/upload-model.js
+++ b/static/scripts/mvc/upload/upload-model.js
@@ -14,8 +14,6 @@
file_type : null,
file_path : '',
percentage : 0,
- row : null,
- // settings
space_to_tabs : false,
to_posix_lines : true
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select'],
+ 'mvc/ui/ui-select',],
function( Utils,
UploadModel,
@@ -42,9 +42,6 @@
// link app
this.app = app;
- // default value for extension of files
- var default_ext = 'Auto-detect';
-
// link this
var self = this;
@@ -64,6 +61,9 @@
placement : 'bottom'
});
+ // initialize default genome through default select field
+ var default_genome = this.app.select_genome.value();
+
// select genomes
this.select_genome = new Select.View({
css: 'genome',
@@ -72,39 +72,29 @@
},
data: self.app.list_genomes,
container: it.find('#genome'),
- value: self.model.get('genome')
+ value: default_genome
});
// initialize genome
- this.model.set('genome', self.select_genome.value());
+ this.model.set('genome', default_genome);
- // ensure files added after an individual row has changed
- // default to Auto-detect instead of ---
- if(!(this.app.select_extension.value() === '---')){
- this.default_ext = this.app.select_extension.value();
- }
-
+ // initialize default extension through default select field
+ var default_extension = this.app.select_extension.value();
+
// select extension
this.select_extension = new Select.View({
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
- // type to '---'
- if(!(self.select_extension.value() === app.select_extension.value()))
- {
- var newExte = '---';
- app.select_extension.value(newExte);
- }
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.default_ext
+ value: default_extension
});
// initialize extension
- this.model.set('extension', self.select_extension.value());
-
+ this.model.set('extension', default_extension);
+
//
// ui events
//
@@ -113,8 +103,13 @@
it.find('#symbol').on('click', function() { self._removeRow(); });
// handle extension info popover
- it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ it.find('#extension-info').on('click' , function(e) {
+ self.app.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
// handle settings popover
it.find('#settings').on('click' , function(e) { self._showSettings(); })
@@ -130,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -146,6 +141,9 @@
this.model.on('change:genome', function() {
self._refreshGenome();
});
+ this.model.on('change:extension', function() {
+ self._refreshExtension();
+ });
this.model.on('change:file_size', function() {
self._refreshFileSize();
});
@@ -155,7 +153,6 @@
this.app.collection.on('reset', function() {
self.remove();
});
- self.model.set('row', self);
},
// render
@@ -175,8 +172,9 @@
it.find('#size').html(Utils.bytesToString (file_size));
// remove mode class
- it.find('#mode').removeClass()
- .addClass('mode');
+ it.find('#mode')
+ .removeClass()
+ .addClass('mode');
// activate text field if file is new
if (file_mode == 'new') {
@@ -229,11 +227,14 @@
// handle model events
//
- // genome
+ // update extension
+ _refreshExtension: function() {
+ this.select_extension.value(this.model.get('extension'));
+ },
+
+ // update genome
_refreshGenome: function() {
- // update genome info on screen
- var genome = this.model.get('genome');
- this.select_genome.value(genome);
+ this.select_genome.value(this.model.get('genome'));
},
// progress
@@ -327,33 +328,6 @@
},
// attach file info popup
- _showExtensionInfo : function() {
- // initialize
- var $el = $(this.el).find('#extension-info');
- var extension = this.model.get('extension');
- var title = this.select_extension.text();
- var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
- // create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- // attach file info popup
_showSettings : function() {
// check if popover is visible
if (!this.settings.visible) {
@@ -368,23 +342,10 @@
},
// template
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
- },
-
- // template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
'<td>' +
- '<div style="position: relative;">' +
+ '<div class="name-column">' +
'<div id="mode"></div>' +
'<div id="title" class="title"></div>' +
'<div id="text" class="text">' +
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -23,7 +23,7 @@
return Backbone.View.extend({
// options
options : {
- nginx_upload_path : ''
+ nginx_upload_path : ''
},
// own modal
@@ -40,6 +40,9 @@
// extension selector
select_extension : null,
+
+ // genome selector
+ select_genome: null,
// current upload size
upload_size: 0,
@@ -130,14 +133,6 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // add the '---' extension for use when the row types are changed individually
- self.list_extensions.push({
- id : "---",
- text : "---",
- description : "",
- description_url : ""
- });
-
// add auto field
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
@@ -167,14 +162,6 @@
this.collection.on('remove', function(item) {
self._eventRemove(item);
});
- this.collection.on('change:genome', function(item) {
- var genome = item.get('genome');
- self.collection.each(function(item) {
- if (item.get('status') == 'init' && item.get('genome') == '?') {
- item.set('genome', genome);
- }
- });
- });
},
//
@@ -232,28 +219,30 @@
container : button
});
- // select extension
+ // select extension
this.select_extension = new Select.View({
- css: 'extension',
- onchange : function() {
- var newExten = self.select_extension.value()
- var len = self.collection.models.length;
- // Only trigger changing the rows if the "set all" isn't set to '---'
- // Prevents recursively changing the rows after an individual row has been changed
- if(!(newExten === '---')){
- for(i = 0; i < len; i++){
- self.collection.models[i].attributes['row'].select_extension.value(newExten);
- }
- }
- },
- data: self.list_extensions,
- container: self.$el.parents().find('#extension'),
- value: self.list_extensions[0]
+ css : 'header-selection',
+ data : self.list_extensions,
+ container : self.$el.parent().find('#header-extension'),
+ value : self.list_extensions[0]
});
-
+
// handle extension info popover
- self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ self.$el.parent().find('#header-extension-info').on('click' , function(e) {
+ self.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
+
+ // genome extension
+ this.select_genome = new Select.View({
+ css : 'header-selection',
+ data : self.list_genomes,
+ container : self.$el.parent().find('#header-genome'),
+ value : self.list_genomes[0]
+ });
}
// show modal
@@ -266,45 +255,27 @@
this._updateScreen();
},
- _showExtensionInfo : function() {
+ showExtensionInfo : function(options) {
// initialize
var self = this;
- var $el = $(this.el).parents().find('#extension-info_out');
- var extension = self.select_extension.value();
-
- var title = this.select_extension.text();
-
+ var $el = options.$el;
+ var extension = options.extension;
+ var title = options.title;
var description = _.findWhere(self.list_extensions, {'id': extension});
// create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
+ this.extension_popup && this.extension_popup.remove();
+ this.extension_popup = new Popover.View({
+ placement: 'bottom',
+ container: $el,
+ destroy: true
+ });
+
+ // add content and show popup
+ this.extension_popup.title(title);
+ this.extension_popup.empty();
+ this.extension_popup.append(this._templateDescription(description));
+ this.extension_popup.show();
},
//
@@ -593,6 +564,7 @@
// reset value for universal type drop-down
this.select_extension.value(this.list_extensions[0]);
+ this.select_genome.value(this.list_genomes[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -684,12 +656,28 @@
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
+
+ // template for extensions description
+ _templateDescription: function(options) {
+ if (options.description) {
+ var tmpl = options.description;
+ if (options.description_url) {
+ tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
+ }
+ return tmpl;
+ } else {
+ return 'There is no description available for this file extension.';
+ }
+ },
+
// load html template
_template: function(id, idInfo) {
- return '<div id="uploadhead" class="uploadhead">' +
- '<span class="fftext">"Set All" Types:  </span>' +
- '<span id="extension" class="extension"/>  ' +
- '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' +
+ return '<div id="upload-header" class="upload-header">' +
+ '<span class="header-title">Type (default):</span>' +
+ '<span id="header-extension"/>' +
+ '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' +
+ '<span class="header-title">Genome (default):</span>' +
+ '<span id="header-genome"/>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -707,7 +695,7 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="uploadfoot">' +
+ '<div class="upload-footer">' +
'<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' ;
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/ui/ui-misc.js
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,o,l,q,m){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="'+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var r=this;$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick&&!r.disabled){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(r){this.$("i").removeClass(this.options.icon).addClass(r);this.options.icon=r},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="'+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var n=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(s){this.options=k.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!s.persistent){var r=this;this.timeout=window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){if(r.area){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'"></textarea>'}else{return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}}});var p=Backbone.View.extend({initialize:function(r){this.options=r;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(r){if(r!==undefined){this.$("hidden").val(r)}return this.$("hidden").val()},_template:function(s){var r='<div id="'+s.id+'" >';if(s.info){r+="<label>"+s.info+"</label>"}r+='<hidden value="'+s.value+'"/></div>';return r}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:i,Label:j,Message:n,Modal:m,RadioButton:o.RadioButton,Checkbox:o.Checkbox,Radio:o.Radio,Searchbox:a,Select:b,Hidden:p,Slider:e,Drilldown:l}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(d,g,h,l,k,r,b){var p=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return'<img class="ui-image '+s.cls+'" src="'+s.url+'"/>'}});var i=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'<label class="ui-label '+s.cls+'">'+s.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'<div><span class="fa '+s.icon+'" class="ui-icon"/> '+s.title+"</div>"}});var f=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){var t='<button id="'+s.id+'" type="submit" style="float: '+s.floating+';" type="button" class="'+s.cls+'">';if(s.icon){t+='<i class="icon fa '+s.icon+'"></i> '}t+=s.title+"</button>";return t}});var n=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var s=this;$(this.el).on("click",function(){$(".tooltip").hide();if(t.onclick&&!s.disabled){t.onclick()}});$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(s){this.$("i").removeClass(this.options.icon).addClass(s);this.options.icon=s},_template:function(s){var t="";if(s.title){t="width: auto;"}var u='<div id="'+s.id+'" style="float: '+s.floating+"; "+t+'" class="'+s.cls+'">';if(s.title){u+='<div class="button"><i class="icon fa '+s.icon+'"/> <span class="title">'+s.title+"</span></div>"}else{u+='<i class="icon fa '+s.icon+'"/>'}u+="</div>";return u}});var o=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick)},_template:function(s){return'<div><a href="javascript:void(0)" class="ui-anchor '+s.cls+'">'+s.title+"</a></div>"}});var a=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(t){this.options=d.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(t.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!t.persistent){var s=this;this.timeout=window.setTimeout(function(){if(s.$el.is(":visible")){s.$el.fadeOut()}else{s.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(s){return'<div class="ui-message alert alert-'+s.status+'"/>'}});var e=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));var s=this;if(this.options.onclick){this.$el.on("submit",function(v){var u=s.$el.find("#search");s.options.onclick(u.val())})}},_template:function(s){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+s.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var m=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var s=this;this.$el.on("input",function(){if(s.options.onchange){s.options.onchange(s.$el.val())}})},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){if(s.area){return'<textarea id="'+s.id+'" class="ui-textarea '+s.cls+'"></textarea>'}else{return'<input id="'+s.id+'" type="'+s.type+'" value="'+s.value+'" placeholder="'+s.placeholder+'" class="ui-input '+s.cls+'">'}}});var j=Backbone.View.extend({initialize:function(s){this.options=s;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(s){if(s!==undefined){this.$("hidden").val(s)}return this.$("hidden").val()},_template:function(t){var s='<div id="'+t.id+'" >';if(t.info){s+="<label>"+t.info+"</label>"}s+='<hidden value="'+t.value+'"/></div>';return s}});var q=Backbone.View.extend({optionsDefault:{class_add:"fa fa-square-o",class_remove:"fa fa-check-square-o",class_partial:"fa fa-minus-square-o",value:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement($("<div/>"));this.value(Boolean(this.options.value));var s=this;this.$el.on("click",function(){s.value(!s.current)})},value:function(s){if(s!==undefined){this.current=s;if(s){this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_remove)}else{this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_add)}this.options.onchange&&this.options.onchange(s)}return this.current}});return{Anchor:o,Button:f,ButtonIcon:n,ButtonMenu:r,Icon:c,Image:p,Input:m,Label:i,Message:a,Modal:b,RadioButton:l.RadioButton,Checkbox:l.Checkbox,Radio:l.Radio,CheckButton:q,Searchbox:e,Select:g,Hidden:j,Slider:h,Drilldown:k}});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-model.js
--- a/static/scripts/packed/mvc/upload/upload-model.js
+++ b/static/scripts/packed/mvc/upload/upload-model.js
@@ -1,1 +1,1 @@
-define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,row:null,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}});
\ No newline at end of file
+define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-row.js
--- a/static/scripts/packed/mvc/upload/upload-row.js
+++ b/static/scripts/packed/mvc/upload/upload-row.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(j,h){this.app=j;var g="Auto-detect";var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var i=this.$el;this.settings=new c.View({title:"Upload configuration",container:i.find("#settings"),placement:"bottom"});this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:i.find("#genome"),value:f.model.get("genome")});this.model.set("genome",f.select_genome.value());if(!(this.app.select_extension.value()==="---")){this.default_ext=this.app.select_extension.value()}this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value());if(!(f.select_extension.value()===j.select_extension.value())){var k="---";j.select_extension.value(k)}},data:f.app.list_extensions,container:i.find("#extension"),value:f.default_ext});this.model.set("extension",f.select_extension.value());i.find("#symbol").on("click",function(){f._removeRow()});i.find("#extension-info").on("click",function(k){f._showExtensionInfo()}).on("mousedown",function(k){k.preventDefault()});i.find("#settings").on("click",function(k){f._showSettings()}).on("mousedown",function(k){k.preventDefault()});i.find("#text-content").on("keyup",function(k){f.model.set("url_paste",$(k.target).val());f.model.set("file_size",$(k.target).val().length)});i.find("#space_to_tabs").on("change",function(k){f.model.set("space_to_tabs",$(k.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()});f.model.set("row",f)},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshGenome:function(){var f=this.model.get("genome");this.select_genome.value(f)},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showExtensionInfo:function(){var f=$(this.el).find("#extension-info");var i=this.model.get("extension");var h=this.select_extension.text();var g=_.findWhere(this.app.list_extensions,{id:i});if(!this.extension_popup){this.extension_popup=new c.View({placement:"bottom",container:f})}if(!this.extension_popup.visible){this.extension_popup.title(h);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(g));this.extension_popup.show()}else{this.extension_popup.hide()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_templateDescription:function(g){if(g.description){var f=g.description;if(g.description_url){f+=' (<a href="'+g.description_url+'" target="_blank">read more</a>)'}return f}else{return"There is no description available for this file extension."}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div style="position: relative;"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select",],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-view.js
--- a/static/scripts/packed/mvc/upload/upload-view.js
+++ b/static/scripts/packed/mvc/upload/upload-view.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(k){var j=this;if(k){this.options=_.defaults(k,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(l){if(l){l.preventDefault();j.show()}},onunload:function(){if(j.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var j=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(l){for(key in l){j.list_extensions.push({id:l[key].extension,text:l[key].extension,description:l[key].description,description_url:l[key].description_url})}j.list_extensions.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0});j.list_extensions.push({id:"---",text:"---",description:"",description_url:""});if(!j.options.datatypes_disable_auto){j.list_extensions.unshift(j.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(l){for(key in l){j.list_genomes.push({id:l[key][1],text:l[key][0]})}j.list_genomes.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0})}});this.collection.on("remove",function(l){j._eventRemove(l)});this.collection.on("change:genome",function(m){var l=m.get("genome");j.collection.each(function(n){if(n.get("status")=="init"&&n.get("genome")=="?"){n.set("genome",l)}})})},show:function(){var j=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){j.show()},500);return}if(!this.modal){var j=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){j.uploadbox.select()},"Choose FTP file":function(){j._eventFtp()},"Paste/Fetch data":function(){j._eventCreate()},Start:function(){j._eventStart()},Pause:function(){j._eventStop()},Reset:function(){j._eventReset()},Close:function(){j.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var j=this;this.uploadbox=this.$el.uploadbox({announce:function(l,m,n){j._eventAnnounce(l,m,n)},initialize:function(l,m,n){return j._eventInitialize(l,m,n)},progress:function(l,m,n){j._eventProgress(l,m,n)},success:function(l,m,n){j._eventSuccess(l,m,n)},error:function(l,m,n){j._eventError(l,m,n)},complete:function(){j._eventComplete()}});var k=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:k});this.select_extension=new h.View({css:"extension",onchange:function(){var m=j.select_extension.value();var l=j.collection.models.length;if(!(m==="---")){for(i=0;i<l;i++){j.collection.models[i].attributes.row.select_extension.value(m)}}},data:j.list_extensions,container:j.$el.parents().find("#extension"),value:j.list_extensions[0]});j.$el.parents().find("#extension-info_out").on("click",function(l){j._showExtensionInfo()}).on("mousedown",function(l){l.preventDefault()})}this.modal.show();this._updateUser();this._updateScreen()},_showExtensionInfo:function(){var j=this;var k=$(this.el).parents().find("#extension-info_out");var n=j.select_extension.value();var m=this.select_extension.text();var l=_.findWhere(j.list_extensions,{id:n});if(!this.extension_popup){this.extension_popup=new d.View({placement:"bottom",container:k})}if(!this.extension_popup.visible){this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()}else{this.extension_popup.hide()}},_templateDescription:function(k){if(k.description){var j=k.description;if(k.description_url){j+=' (<a href="'+k.description_url+'" target="_blank">read more</a>)'}return j}else{return"There is no description available for this file extension."}},_eventRemove:function(k){var j=k.get("status");if(j=="success"){this.counter.success--}else{if(j=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(k.id)},_eventAnnounce:function(j,k,m){this.counter.announce++;this._updateScreen();var l=new b(this,{id:j,file_name:k.name,file_size:k.size,file_mode:k.mode,file_path:k.path});this.collection.add(l.model);$(this.el).find("tbody:first").append(l.$el);l.render()},_eventInitialize:function(o,l,u){var m=this.collection.get(o);m.set("status","running");var q=m.get("file_name");var p=m.get("file_path");var j=m.get("file_mode");var r=m.get("extension");var t=m.get("genome");var s=m.get("url_paste");var n=m.get("space_to_tabs");var k=m.get("to_posix_lines");if(!s&&!(l.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(j=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(j=="new"){tool_input["files_0|url_paste"]=s}if(j=="ftp"){tool_input["files_0|ftp_files"]=p}tool_input.dbkey=t;tool_input.file_type=r;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=n&&"Yes"||null;tool_input["files_0|to_posix_lines"]=k&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(k,l,j){var m=this.collection.get(k);m.set("percentage",j);this.ui_button.set("percentage",this._upload_percentage(j,l.size))},_eventSuccess:function(k,l,n){var m=this.collection.get(k);m.set("percentage",100);m.set("status","success");var j=m.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,j));this.upload_completed+=j*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","error");l.set("info",m);this.ui_button.set("percentage",this._upload_percentage(100,k.size));this.ui_button.set("status","danger");this.upload_completed+=k.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(j){if(j.get("status")=="queued"){j.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var j=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(k){if(k.get("status")=="init"){k.set("status","queued");j.upload_size+=k.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.select_extension.value(this.list_extensions[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(j,k){return(this.upload_completed+(j*k))/this.upload_size},_template:function(k,j){return'<div id="uploadhead" class="uploadhead"><span class="fftext">"Set All" Types:  </span><span id="extension" class="extension"/>  <span id="extension-info_out" class="upload-icon-button fa fa-search"/></div><div id="'+k+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="uploadfoot"><h6 id="'+j+'" class="upload-info"></h6></div>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,select_genome:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(j){var i=this;if(j){this.options=_.defaults(j,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(k){if(k){k.preventDefault();i.show()}},onunload:function(){if(i.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var i=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(k){for(key in k){i.list_extensions.push({id:k[key].extension,text:k[key].extension,description:k[key].description,description_url:k[key].description_url})}i.list_extensions.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0});if(!i.options.datatypes_disable_auto){i.list_extensions.unshift(i.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(k){for(key in k){i.list_genomes.push({id:k[key][1],text:k[key][0]})}i.list_genomes.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0})}});this.collection.on("remove",function(k){i._eventRemove(k)})},show:function(){var i=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){i.show()},500);return}if(!this.modal){var i=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){i.uploadbox.select()},"Choose FTP file":function(){i._eventFtp()},"Paste/Fetch data":function(){i._eventCreate()},Start:function(){i._eventStart()},Pause:function(){i._eventStop()},Reset:function(){i._eventReset()},Close:function(){i.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var i=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){i._eventAnnounce(k,l,m)},initialize:function(k,l,m){return i._eventInitialize(k,l,m)},progress:function(k,l,m){i._eventProgress(k,l,m)},success:function(k,l,m){i._eventSuccess(k,l,m)},error:function(k,l,m){i._eventError(k,l,m)},complete:function(){i._eventComplete()}});var j=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:j});this.select_extension=new h.View({css:"header-selection",data:i.list_extensions,container:i.$el.parent().find("#header-extension"),value:i.list_extensions[0]});i.$el.parent().find("#header-extension-info").on("click",function(k){i.showExtensionInfo({$el:$(k.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(k){k.preventDefault()});this.select_genome=new h.View({css:"header-selection",data:i.list_genomes,container:i.$el.parent().find("#header-genome"),value:i.list_genomes[0]})}this.modal.show();this._updateUser();this._updateScreen()},showExtensionInfo:function(j){var i=this;var k=j.$el;var n=j.extension;var m=j.title;var l=_.findWhere(i.list_extensions,{id:n});this.extension_popup&&this.extension_popup.remove();this.extension_popup=new d.View({placement:"bottom",container:k,destroy:true});this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()},_eventRemove:function(j){var i=j.get("status");if(i=="success"){this.counter.success--}else{if(i=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(j.id)},_eventAnnounce:function(i,j,l){this.counter.announce++;this._updateScreen();var k=new b(this,{id:i,file_name:j.name,file_size:j.size,file_mode:j.mode,file_path:j.path});this.collection.add(k.model);$(this.el).find("tbody:first").append(k.$el);k.render()},_eventInitialize:function(n,k,t){var l=this.collection.get(n);l.set("status","running");var p=l.get("file_name");var o=l.get("file_path");var i=l.get("file_mode");var q=l.get("extension");var s=l.get("genome");var r=l.get("url_paste");var m=l.get("space_to_tabs");var j=l.get("to_posix_lines");if(!r&&!(k.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(i=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(i=="new"){tool_input["files_0|url_paste"]=r}if(i=="ftp"){tool_input["files_0|ftp_files"]=o}tool_input.dbkey=s;tool_input.file_type=q;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=m&&"Yes"||null;tool_input["files_0|to_posix_lines"]=j&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(j,k,i){var l=this.collection.get(j);l.set("percentage",i);this.ui_button.set("percentage",this._upload_percentage(i,k.size))},_eventSuccess:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","success");var i=l.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,i));this.upload_completed+=i*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","error");k.set("info",l);this.ui_button.set("percentage",this._upload_percentage(100,j.size));this.ui_button.set("status","danger");this.upload_completed+=j.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(i){if(i.get("status")=="queued"){i.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var i=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(j){if(j.get("status")=="init"){j.set("status","queued");i.upload_size+=j.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.select_extension.value(this.list_extensions[0]);this.select_genome.value(this.list_genomes[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(i,j){return(this.upload_completed+(i*j))/this.upload_size},_templateDescription:function(j){if(j.description){var i=j.description;if(j.description_url){i+=' (<a href="'+j.description_url+'" target="_blank">read more</a>)'}return i}else{return"There is no description available for this file extension."}},_template:function(j,i){return'<div id="upload-header" class="upload-header"><span class="header-title">Type (default):</span><span id="header-extension"/><span id="header-extension-info" class="upload-icon-button fa fa-search"/><span class="header-title">Genome (default):</span><span id="header-genome"/></div><div id="'+j+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="upload-footer"><h6 id="'+i+'" class="upload-info"></h6></div>'}})});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -119,12 +119,6 @@
.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}
.table tbody+tbody{border-top:2px solid #d6b161}
.table .table{background-color:#fff}
-.uploadhead{height:10%; text-align:left; max-height:20px; line-height:18px; margin-bottom: 5px;}
-.uploadfoot{height:5%; text-align:center;}
-.uploadhead .fftext{font-weight: bold;}
-.uploadhead .select2-container .select2-choice .select2-arrow b{background-position:0 -3px}
-.uploadhead .extension{width:100px;min-width:100px;font-size:11px}
-.uploadhead .select2-container .select2-choice{max-height:20px;line-height:18px;text-align:center; font-weight: normal;}
.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}
.table-bordered{border:1px solid #d6b161}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #d6b161}
.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}
@@ -1375,13 +1369,13 @@
.upload-button .label{position:absolute;top:2px;width:inherit;text-align:center;line-height:19px;font-size:1.2em}
.upload-icon{font-size:1.2em;width:1.2em}
.upload-icon-button{font-size:1.2em;width:1.2em;cursor:pointer}
-.upload-info{font-weight:normal;text-align:center}
-.upload-box{width:100%;height:85%;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:10px;overflow-x:hidden;-ms-overflow-style:none}.upload-box .table{width:100%}
+.upload-box{width:100%;height:90%;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:10px;overflow-x:hidden;-ms-overflow-style:none}.upload-box .table{width:100%}
.upload-box .table th{text-align:center;white-space:nowrap}
.upload-box .table td{margin:0px}
.upload-box .upload-item .select2-arrow b{background-position:0 -3px}
.upload-box .upload-item .select2-choice{max-height:20px;line-height:18px;background:transparent}
.upload-box .upload-item .select2-container-disabled .select2-arrow{background:transparent}
+.upload-box .name-column{position:relative}
.upload-box .mode{float:left;font-size:1.2em;width:1.2em;color:#555}
.upload-box .title{width:130px;word-wrap:break-word;font-size:11px;float:left}
.upload-box .text{position:absolute;display:none}.upload-box .text .text-content{font-size:11px;width:100%;height:50px;resize:none;background:inherit;color:#000}
@@ -1395,6 +1389,10 @@
.upload-ftp .upload-ftp-help{margin-bottom:10px}
.upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px}
.upload-settings .upload-settings-cover{position:absolute;width:100%;height:100%;top:0px;left:0px;background:#fff;opacity:0.4;cursor:no-drop}
+.upload-header{height:5%;text-align:left;max-height:20px;line-height:18px;margin-bottom:15px}.upload-header .header-title{font-weight:bold;padding-left:60px;padding-right:20px}
+.upload-header .header-selection{width:200px;min-width:200px;font-size:11px;padding-right:10px}
+.upload-header .select2-choice{max-height:20px;line-height:18px;background:transparent;text-align:center;font-weight:normal}.upload-header .select2-choice .select2-arrow b{background-position:0 -3px}
+.upload-footer{height:5%;text-align:center}.upload-footer .upload-info{font-weight:normal;text-align:center}
.no-highlight,.ui-button-icon,.ui-portlet,.ui-portlet-slim,.ui-portlet-repeat,.ui-portlet-section{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;}
.ui-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px}
.ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px}
@@ -1435,6 +1433,7 @@
.ui-form-slider .ui-form-slider-element{width:calc(100% - 110px);float:left;top:8px;left:10px}
.ui-radiobutton{width:100%}.ui-radiobutton label{height:23px;line-height:1em}
.ui-radiobutton i{padding-right:5px}
+.ui-checkbutton{font-size:1.2em;width:1.2em;cursor:pointer}
.ui-select{position:relative}.ui-select .button{position:absolute;top:5px;right:5px}
.ui-select .select2-container{width:100%}
.ui-select select{position:relative;top:0px;height:27px;width:100%;padding-left:5px;padding-right:20px;cursor:pointer;background:transparent;-webkit-appearance:none;border:1px solid #bfbfbf;-moz-border-radius:3px;border-radius:3px}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -298,6 +298,12 @@
}
}
+.ui-checkbutton {
+ font-size: 1.2em;
+ width: 1.2em;
+ cursor: pointer;
+}
+
.ui-select {
position: relative;
.button {
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/upload.less
--- a/static/style/src/less/upload.less
+++ b/static/style/src/less/upload.less
@@ -52,14 +52,9 @@
cursor: pointer;
}
-.upload-info {
- font-weight: normal;
- text-align: center;
-}
-
.upload-box {
width : 100%;
- height : 95%;
+ height : 90%;
text-align : center;
overflow : scroll;
font-size : @font-size-base;
@@ -102,6 +97,10 @@
}
}
+ .name-column {
+ position: relative;
+ }
+
.mode {
float: left;
font-size: 1.2em;
@@ -214,3 +213,41 @@
cursor: no-drop;
}
}
+
+.upload-header {
+ height:5%;
+ text-align:left;
+ max-height:20px;
+ line-height:18px;
+ margin-bottom: 15px;
+ .header-title {
+ font-weight: bold;
+ padding-left: 60px;
+ padding-right: 20px;
+ }
+ .header-selection{
+ width:200px;
+ min-width:200px;
+ font-size:11px;
+ padding-right: 10px;
+ }
+ .select2-choice {
+ .select2-arrow b {
+ background-position: 0 -3px;
+ }
+ max-height: 20px;
+ line-height: 18px;
+ background: transparent;
+ text-align:center;
+ font-weight: normal;
+ }
+}
+
+.upload-footer {
+ height:5%;
+ text-align:center;
+ .upload-info {
+ font-weight: normal;
+ text-align: center;
+ }
+}
\ 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
commit/galaxy-central: dannon: Remove more trailing space from upload.js's.
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/49d651198b3a/
Changeset: 49d651198b3a
User: dannon
Date: 2015-01-23 20:30:28+00:00
Summary: Remove more trailing space from upload.js's.
Affected #: 4 files
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -4,7 +4,7 @@
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
'mvc/ui/ui-select'],
-
+
function( Utils,
UploadModel,
UploadSettings,
@@ -18,7 +18,7 @@
options: {
padding : 8
},
-
+
// states
status_classes : {
init : 'upload-icon-button fa fa-trash-o',
@@ -27,36 +27,36 @@
success : 'upload-icon-button fa fa-check',
error : 'upload-icon-button fa fa-exclamation-triangle'
},
-
+
// handle for settings popover
settings: null,
-
+
// genome selector
select_genome : null,
-
+
// extension selector
select_extension : null,
-
+
// render
initialize: function(app, options) {
// link app
this.app = app;
-
+
// default value for extension of files
var default_ext = 'Auto-detect';
// link this
var self = this;
-
+
// create model
this.model = new UploadModel.Model(options);
-
+
// add upload item
this.setElement(this._template(options));
// link item
var it = this.$el;
-
+
// append popup to settings icon
this.settings = new Popover.View({
title : 'Upload configuration',
@@ -74,11 +74,11 @@
container: it.find('#genome'),
value: self.model.get('genome')
});
-
+
// initialize genome
this.model.set('genome', self.select_genome.value());
- // ensure files added after an individual row has changed
+ // ensure files added after an individual row has changed
// default to Auto-detect instead of ---
if(!(this.app.select_extension.value() === '---')){
this.default_ext = this.app.select_extension.value();
@@ -89,7 +89,7 @@
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
+ // if user has changed individual row type, then change "set all"
// type to '---'
if(!(self.select_extension.value() === app.select_extension.value()))
{
@@ -101,17 +101,17 @@
container: it.find('#extension'),
value: self.default_ext
});
-
+
// initialize extension
this.model.set('extension', self.select_extension.value());
-
+
//
// ui events
//
-
+
// handle click event
it.find('#symbol').on('click', function() { self._removeRow(); });
-
+
// handle extension info popover
it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
.on('mousedown', function(e) { e.preventDefault(); });
@@ -125,12 +125,12 @@
self.model.set('url_paste', $(e.target).val());
self.model.set('file_size', $(e.target).val().length);
});
-
+
// handle space to tabs button
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -157,57 +157,57 @@
});
self.model.set('row', self);
},
-
+
// render
render: function() {
// read model
var file_name = this.model.get('file_name');
var file_size = this.model.get('file_size');
var file_mode = this.model.get('file_mode');
-
+
// link item
var it = this.$el;
-
+
// update title
it.find('#title').html(file_name);
-
+
// update info
it.find('#size').html(Utils.bytesToString (file_size));
-
+
// remove mode class
it.find('#mode').removeClass()
.addClass('mode');
-
+
// activate text field if file is new
if (file_mode == 'new') {
// get text component
var text = it.find('#text');
-
+
// get padding
var padding = this.options.padding;
-
+
// get dimensions
var width = it.width() - 2 * padding;
var height = it.height() - padding;
-
+
// set dimensions
text.css('width', width + 'px');
text.css('top', height + 'px');
it.height(height + text.height() + 2 * padding);
-
+
// show text field
text.show();
-
+
// update icon
it.find('#mode').addClass('fa fa-pencil');
}
-
+
// file from local disk
if (file_mode == 'local') {
// update icon
it.find('#mode').addClass('fa fa-laptop');
}
-
+
// file from ftp
if (file_mode == 'ftp') {
// update icon
@@ -220,7 +220,7 @@
// trigger remove event
this.select_genome.remove();
this.select_extension.remove();
-
+
// call the base class remove method
Backbone.View.prototype.remove.apply(this);
},
@@ -228,14 +228,14 @@
//
// handle model events
//
-
+
// genome
_refreshGenome: function() {
// update genome info on screen
var genome = this.model.get('genome');
this.select_genome.value(genome);
},
-
+
// progress
_refreshInfo: function() {
// write error message
@@ -246,7 +246,7 @@
this.$el.find('#info').hide();
}
},
-
+
// progress
_refreshPercentage : function() {
var percentage = parseInt(this.model.get('percentage'));
@@ -256,29 +256,29 @@
else
this.$el.find('#percentage').html('Adding to history...');
},
-
+
// status
_refreshStatus : function() {
// get element
var it = this.$el;
-
+
// identify new status
var status = this.model.get('status');
var status_class = this.status_classes[status];
-
+
// identify symbol and reset classes
var sy = this.$el.find('#symbol');
sy.removeClass();
-
+
// set new status class
sy.addClass(status_class);
-
+
// enable form fields
if (status == 'init') {
// select fields
this.select_genome.enable();
this.select_extension.enable();
-
+
// default fields
it.find('#text-content').attr('disabled', false);
it.find('#space_to_tabs').attr('disabled', false);
@@ -286,18 +286,18 @@
// select fields
this.select_genome.disable();
this.select_extension.disable();
-
+
// default fields
it.find('#text-content').attr('disabled', true);
it.find('#space_to_tabs').attr('disabled', true);
}
-
+
// success
if (status == 'success') {
it.addClass('success');
it.find('#percentage').html('100%');
}
-
+
// error
if (status == 'error') {
it.addClass('danger');
@@ -314,18 +314,18 @@
//
// handle ui events
//
-
+
// remove row
_removeRow: function() {
// get current status
var status = this.model.get('status');
-
+
// only remove from queue if not in processing line
if (status == 'init' || status == 'success' || status == 'error') {
this.app.collection.remove(this.model);
}
},
-
+
// attach file info popup
_showExtensionInfo : function() {
// initialize
@@ -333,7 +333,7 @@
var extension = this.model.get('extension');
var title = this.select_extension.text();
var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
+
// create popup
if (!this.extension_popup) {
this.extension_popup = new Popover.View({
@@ -341,7 +341,7 @@
container: $el
});
}
-
+
// show / hide popup
if (!this.extension_popup.visible) {
this.extension_popup.title(title);
@@ -366,7 +366,7 @@
this.settings.hide();
}
},
-
+
// template
_templateDescription: function(options) {
if (options.description) {
@@ -379,7 +379,7 @@
return 'There is no description available for this file extension.';
}
},
-
+
// template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
@@ -417,7 +417,7 @@
'</td>' +
'</tr>';
}
-
+
});
});
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e client/galaxy/scripts/mvc/upload/upload-settings.js
--- a/client/galaxy/scripts/mvc/upload/upload-settings.js
+++ b/client/galaxy/scripts/mvc/upload/upload-settings.js
@@ -8,35 +8,35 @@
class_check : 'upload-icon-button fa fa-check-square-o',
class_uncheck : 'upload-icon-button fa fa-square-o'
},
-
+
// render
initialize: function(app) {
// link app
this.app = app;
-
+
// link this
var self = this;
-
+
// set template
this.setElement(this._template());
-
+
// link model
this.model = this.app.model;
-
+
// ui event: space to tabs
this.$el.find('#upload-space-to-tabs').on('click', function() {
self._switchState('#upload-space-to-tabs', 'space_to_tabs');
});
-
+
// ui event: to posix
this.$el.find('#upload-to-posix-lines').on('click', function() {
self._switchState('#upload-to-posix-lines', 'to_posix_lines');
});
-
+
// render
this.render();
},
-
+
// events
events: {
'mousedown' : function(e) { e.preventDefault(); }
@@ -47,7 +47,7 @@
// render states
this._renderState('#upload-space-to-tabs', this.model.get('space_to_tabs'));
this._renderState('#upload-to-posix-lines', this.model.get('to_posix_lines'));
-
+
// disable options
var $cover = this.$el.find('#upload-settings-cover');
if (this.model.get('status') != 'init') {
@@ -56,7 +56,7 @@
$cover.hide();
}
},
-
+
// switch state
_switchState: function (element_id, parameter_id) {
if (this.model.get('status') == 'init') {
@@ -65,7 +65,7 @@
this._renderState(element_id, checked);
}
},
-
+
// render state
_renderState: function (element_id, checked) {
// swith icon class
@@ -77,7 +77,7 @@
$it.addClass(this.options.class_uncheck);
}
},
-
+
// load template
_template: function() {
return '<div class="upload-settings" style="position: relative;">' +
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -4,7 +4,7 @@
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
'mvc/ui/ui-select'],
-
+
function( Utils,
UploadModel,
UploadSettings,
@@ -18,7 +18,7 @@
options: {
padding : 8
},
-
+
// states
status_classes : {
init : 'upload-icon-button fa fa-trash-o',
@@ -27,36 +27,36 @@
success : 'upload-icon-button fa fa-check',
error : 'upload-icon-button fa fa-exclamation-triangle'
},
-
+
// handle for settings popover
settings: null,
-
+
// genome selector
select_genome : null,
-
+
// extension selector
select_extension : null,
-
+
// render
initialize: function(app, options) {
// link app
this.app = app;
-
+
// default value for extension of files
var default_ext = 'Auto-detect';
// link this
var self = this;
-
+
// create model
this.model = new UploadModel.Model(options);
-
+
// add upload item
this.setElement(this._template(options));
// link item
var it = this.$el;
-
+
// append popup to settings icon
this.settings = new Popover.View({
title : 'Upload configuration',
@@ -74,11 +74,11 @@
container: it.find('#genome'),
value: self.model.get('genome')
});
-
+
// initialize genome
this.model.set('genome', self.select_genome.value());
- // ensure files added after an individual row has changed
+ // ensure files added after an individual row has changed
// default to Auto-detect instead of ---
if(!(this.app.select_extension.value() === '---')){
this.default_ext = this.app.select_extension.value();
@@ -89,7 +89,7 @@
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
+ // if user has changed individual row type, then change "set all"
// type to '---'
if(!(self.select_extension.value() === app.select_extension.value()))
{
@@ -101,17 +101,17 @@
container: it.find('#extension'),
value: self.default_ext
});
-
+
// initialize extension
this.model.set('extension', self.select_extension.value());
-
+
//
// ui events
//
-
+
// handle click event
it.find('#symbol').on('click', function() { self._removeRow(); });
-
+
// handle extension info popover
it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
.on('mousedown', function(e) { e.preventDefault(); });
@@ -125,12 +125,12 @@
self.model.set('url_paste', $(e.target).val());
self.model.set('file_size', $(e.target).val().length);
});
-
+
// handle space to tabs button
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -157,57 +157,57 @@
});
self.model.set('row', self);
},
-
+
// render
render: function() {
// read model
var file_name = this.model.get('file_name');
var file_size = this.model.get('file_size');
var file_mode = this.model.get('file_mode');
-
+
// link item
var it = this.$el;
-
+
// update title
it.find('#title').html(file_name);
-
+
// update info
it.find('#size').html(Utils.bytesToString (file_size));
-
+
// remove mode class
it.find('#mode').removeClass()
.addClass('mode');
-
+
// activate text field if file is new
if (file_mode == 'new') {
// get text component
var text = it.find('#text');
-
+
// get padding
var padding = this.options.padding;
-
+
// get dimensions
var width = it.width() - 2 * padding;
var height = it.height() - padding;
-
+
// set dimensions
text.css('width', width + 'px');
text.css('top', height + 'px');
it.height(height + text.height() + 2 * padding);
-
+
// show text field
text.show();
-
+
// update icon
it.find('#mode').addClass('fa fa-pencil');
}
-
+
// file from local disk
if (file_mode == 'local') {
// update icon
it.find('#mode').addClass('fa fa-laptop');
}
-
+
// file from ftp
if (file_mode == 'ftp') {
// update icon
@@ -220,7 +220,7 @@
// trigger remove event
this.select_genome.remove();
this.select_extension.remove();
-
+
// call the base class remove method
Backbone.View.prototype.remove.apply(this);
},
@@ -228,14 +228,14 @@
//
// handle model events
//
-
+
// genome
_refreshGenome: function() {
// update genome info on screen
var genome = this.model.get('genome');
this.select_genome.value(genome);
},
-
+
// progress
_refreshInfo: function() {
// write error message
@@ -246,7 +246,7 @@
this.$el.find('#info').hide();
}
},
-
+
// progress
_refreshPercentage : function() {
var percentage = parseInt(this.model.get('percentage'));
@@ -256,29 +256,29 @@
else
this.$el.find('#percentage').html('Adding to history...');
},
-
+
// status
_refreshStatus : function() {
// get element
var it = this.$el;
-
+
// identify new status
var status = this.model.get('status');
var status_class = this.status_classes[status];
-
+
// identify symbol and reset classes
var sy = this.$el.find('#symbol');
sy.removeClass();
-
+
// set new status class
sy.addClass(status_class);
-
+
// enable form fields
if (status == 'init') {
// select fields
this.select_genome.enable();
this.select_extension.enable();
-
+
// default fields
it.find('#text-content').attr('disabled', false);
it.find('#space_to_tabs').attr('disabled', false);
@@ -286,18 +286,18 @@
// select fields
this.select_genome.disable();
this.select_extension.disable();
-
+
// default fields
it.find('#text-content').attr('disabled', true);
it.find('#space_to_tabs').attr('disabled', true);
}
-
+
// success
if (status == 'success') {
it.addClass('success');
it.find('#percentage').html('100%');
}
-
+
// error
if (status == 'error') {
it.addClass('danger');
@@ -314,18 +314,18 @@
//
// handle ui events
//
-
+
// remove row
_removeRow: function() {
// get current status
var status = this.model.get('status');
-
+
// only remove from queue if not in processing line
if (status == 'init' || status == 'success' || status == 'error') {
this.app.collection.remove(this.model);
}
},
-
+
// attach file info popup
_showExtensionInfo : function() {
// initialize
@@ -333,7 +333,7 @@
var extension = this.model.get('extension');
var title = this.select_extension.text();
var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
+
// create popup
if (!this.extension_popup) {
this.extension_popup = new Popover.View({
@@ -341,7 +341,7 @@
container: $el
});
}
-
+
// show / hide popup
if (!this.extension_popup.visible) {
this.extension_popup.title(title);
@@ -366,7 +366,7 @@
this.settings.hide();
}
},
-
+
// template
_templateDescription: function(options) {
if (options.description) {
@@ -379,7 +379,7 @@
return 'There is no description available for this file extension.';
}
},
-
+
// template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
@@ -417,7 +417,7 @@
'</td>' +
'</tr>';
}
-
+
});
});
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e static/scripts/mvc/upload/upload-settings.js
--- a/static/scripts/mvc/upload/upload-settings.js
+++ b/static/scripts/mvc/upload/upload-settings.js
@@ -8,35 +8,35 @@
class_check : 'upload-icon-button fa fa-check-square-o',
class_uncheck : 'upload-icon-button fa fa-square-o'
},
-
+
// render
initialize: function(app) {
// link app
this.app = app;
-
+
// link this
var self = this;
-
+
// set template
this.setElement(this._template());
-
+
// link model
this.model = this.app.model;
-
+
// ui event: space to tabs
this.$el.find('#upload-space-to-tabs').on('click', function() {
self._switchState('#upload-space-to-tabs', 'space_to_tabs');
});
-
+
// ui event: to posix
this.$el.find('#upload-to-posix-lines').on('click', function() {
self._switchState('#upload-to-posix-lines', 'to_posix_lines');
});
-
+
// render
this.render();
},
-
+
// events
events: {
'mousedown' : function(e) { e.preventDefault(); }
@@ -47,7 +47,7 @@
// render states
this._renderState('#upload-space-to-tabs', this.model.get('space_to_tabs'));
this._renderState('#upload-to-posix-lines', this.model.get('to_posix_lines'));
-
+
// disable options
var $cover = this.$el.find('#upload-settings-cover');
if (this.model.get('status') != 'init') {
@@ -56,7 +56,7 @@
$cover.hide();
}
},
-
+
// switch state
_switchState: function (element_id, parameter_id) {
if (this.model.get('status') == 'init') {
@@ -65,7 +65,7 @@
this._renderState(element_id, checked);
}
},
-
+
// render state
_renderState: function (element_id, checked) {
// swith icon class
@@ -77,7 +77,7 @@
$it.addClass(this.options.class_uncheck);
}
},
-
+
// load template
_template: function() {
return '<div class="upload-settings" style="position: relative;">' +
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