mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'dev' of https://github.com/galaxyproject/galaxy into smash_eggs
This commit is contained in:
@@ -3,43 +3,49 @@
|
||||
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
|
||||
define([
|
||||
"galaxy.masthead",
|
||||
"utils/utils",
|
||||
"libs/toastr",
|
||||
"mvc/base-mvc",
|
||||
"mvc/library/library-model",
|
||||
"mvc/library/library-folderlist-view",
|
||||
"mvc/library/library-librarylist-view",
|
||||
"mvc/library/library-librarytoolbar-view",
|
||||
"mvc/library/library-foldertoolbar-view",
|
||||
"mvc/library/library-dataset-view",
|
||||
"mvc/library/library-library-view",
|
||||
"mvc/library/library-folder-view"
|
||||
],
|
||||
function(mod_masthead,
|
||||
mod_utils,
|
||||
mod_toastr,
|
||||
mod_baseMVC,
|
||||
mod_library_model,
|
||||
mod_folderlist_view,
|
||||
mod_librarylist_view,
|
||||
mod_librarytoolbar_view,
|
||||
mod_foldertoolbar_view,
|
||||
mod_library_dataset_view,
|
||||
mod_library_library_view,
|
||||
mod_library_folder_view
|
||||
) {
|
||||
"galaxy.masthead",
|
||||
"utils/utils",
|
||||
"libs/toastr",
|
||||
"mvc/base-mvc",
|
||||
"mvc/library/library-model",
|
||||
"mvc/library/library-folderlist-view",
|
||||
"mvc/library/library-librarylist-view",
|
||||
"mvc/library/library-librarytoolbar-view",
|
||||
"mvc/library/library-foldertoolbar-view",
|
||||
"mvc/library/library-dataset-view",
|
||||
"mvc/library/library-library-view",
|
||||
"mvc/library/library-folder-view"
|
||||
],
|
||||
function(mod_masthead,
|
||||
mod_utils,
|
||||
mod_toastr,
|
||||
mod_baseMVC,
|
||||
mod_library_model,
|
||||
mod_folderlist_view,
|
||||
mod_librarylist_view,
|
||||
mod_librarytoolbar_view,
|
||||
mod_foldertoolbar_view,
|
||||
mod_library_dataset_view,
|
||||
mod_library_library_view,
|
||||
mod_library_folder_view
|
||||
) {
|
||||
|
||||
// ============================================================================
|
||||
// ROUTER
|
||||
/**
|
||||
* The Data Libraries router. Takes care about triggering routes
|
||||
* and sends users to proper pieces of the application.
|
||||
*/
|
||||
var LibraryRouter = Backbone.Router.extend({
|
||||
|
||||
initialize: function() {
|
||||
this.routesHit = 0;
|
||||
//keep count of number of routes handled by the application
|
||||
// keep count of number of routes handled by the application
|
||||
Backbone.history.on( 'route', function() { this.routesHit++; }, this );
|
||||
},
|
||||
|
||||
routes: {
|
||||
this.bind( 'route', this.trackPageview );
|
||||
},
|
||||
|
||||
routes: {
|
||||
"" : "libraries",
|
||||
"page/:show_page" : "libraries_page",
|
||||
"library/:library_id/permissions" : "library_permissions",
|
||||
@@ -51,18 +57,35 @@ routes: {
|
||||
"folders/:folder_id/datasets/:dataset_id/versions/:ldda_id" : "dataset_version",
|
||||
"folders/:folder_id/download/:format" : "download",
|
||||
"folders/:folder_id/import/:source" : "import_datasets"
|
||||
},
|
||||
},
|
||||
|
||||
back: function() {
|
||||
/**
|
||||
* If more than one route has been hit the user did not land on current
|
||||
* page directly so we can go back safely. Otherwise go to the home page.
|
||||
* Use replaceState if available so the navigation doesn't create an
|
||||
* extra history entry
|
||||
*/
|
||||
back: function() {
|
||||
if( this.routesHit > 1 ) {
|
||||
//more than one route hit -> user did not land to current page directly
|
||||
window.history.back();
|
||||
} else {
|
||||
//otherwise go to the home page. Use replaceState if available so
|
||||
//the navigation doesn't create an extra history entry
|
||||
} else {
|
||||
this.navigate( '#', { trigger:true, replace:true } );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Track every route change as a page view in Google Analytics.
|
||||
*/
|
||||
trackPageview: function () {
|
||||
var url = Backbone.history.getFragment();
|
||||
//prepend slash
|
||||
if (!/^\//.test(url) && url != "") {
|
||||
url = "/" + url;
|
||||
}
|
||||
if ( typeof ga !== 'undefined' ) {
|
||||
ga( 'send', 'pageview', galaxy_config.root + 'library/list' + url );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
@@ -78,7 +101,10 @@ var LibraryPrefs = mod_baseMVC.SessionStorageModel.extend({
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
// Main controller of Galaxy Library
|
||||
/**
|
||||
* Main view of the Galaxy Data Libraries. Stores pointers to other subviews
|
||||
* and defines what router should do on the route triggers.
|
||||
*/
|
||||
var GalaxyLibrary = Backbone.View.extend({
|
||||
|
||||
libraryToolbarView: null,
|
||||
@@ -90,6 +116,17 @@ var GalaxyLibrary = Backbone.View.extend({
|
||||
datasetView: null,
|
||||
|
||||
initialize : function(){
|
||||
|
||||
// This should go upstream in the js app once available
|
||||
if ( window.Galaxy.config.ga_code ){
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', window.Galaxy.config.ga_code, 'auto');
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
|
||||
Galaxy.libraries = this;
|
||||
|
||||
this.preferences = new LibraryPrefs( { id: 'global-lib-prefs' } );
|
||||
|
||||
@@ -56,6 +56,7 @@ class ConfigSerializer( base.ModelSerializer ):
|
||||
'remote_user_logout_href' : _defaults_to( '' ),
|
||||
'datatypes_disable_auto' : _defaults_to( False ),
|
||||
'allow_user_dataset_purge' : _defaults_to( False ),
|
||||
'ga_code' : _defaults_to( None ),
|
||||
'enable_unique_workflow_defaults' : _defaults_to( False ),
|
||||
|
||||
'nginx_upload_path' : _defaults_to( self.url_for( controller='api', action='tools' ) ),
|
||||
|
||||
@@ -29,7 +29,7 @@ except ImportError:
|
||||
import sys
|
||||
import json
|
||||
|
||||
from pip.pep425tags import get_platform, get_supported
|
||||
from pip.pep425tags import get_supported
|
||||
from pip.platform import get_specific_platform
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ compatible_platforms = {
|
||||
|
||||
|
||||
def install_compat():
|
||||
this_plat = get_specific_platform()[0]
|
||||
spec_plat = get_specific_platform()
|
||||
if spec_plat is None:
|
||||
return None
|
||||
this_plat = spec_plat[0]
|
||||
compat_plat = compatible_platforms.get(this_plat, None)
|
||||
rval = {}
|
||||
if compat_plat:
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user