Revise main view handling

This commit is contained in:
guerler
2016-10-17 13:43:23 -04:00
parent 1eeb21f344
commit fdff89596e
3 changed files with 11 additions and 16 deletions
@@ -4,7 +4,7 @@ define( [ 'mvc/user/change-user-information', 'mvc/user/change-password', 'mvc/u
initialize: function ( ) {
this.setElement( '<div/>' );
this.getUserPreferencesData();
this.render();
},
/** Redirect to manage user information view */
@@ -74,24 +74,19 @@ define( [ 'mvc/user/change-user-information', 'mvc/user/change-password', 'mvc/u
var self = this;
var url = Galaxy.root + 'api/user_preferences/change_communication';
$.getJSON( url, function( response ) {
changeCommunication = new ChangeCommunication.ChangeCommunication( self, response );
changeCommunication = new ChangeCommunication( self, response );
self.$( '.user-preferences-all' ).append( changeCommunication.$el );
});
},
/** Fetch data for user preferences */
getUserPreferencesData: function() {
var url = Galaxy.root + 'api/user_preferences',
self = this;
$.getJSON( url, function( data ) {
self.render(data);
});
},
/** Render the user preferences list */
render: function( data ) {
var template = "",
self = this;
render: function() {
var self = this;
$.getJSON( Galaxy.root + 'api/user_preferences', function( data ) {
self.render(data);
});
var template = "";
if( data["id"] !== null ) {
template = "<div class='user-preferences-all'>"
template = template + '<div class="user-pref"> <h2> User preferences </h2>' +
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"user-preferences.js","sources":["../../../src/mvc/user/user-preferences.js"],"names":["define","Manage","Password","Permissions","Keys","ToolboxFilter","ChangeCommunication","UserPreferences","Backbone","View","extend","initialize","this","setElement","getUserPreferencesData","callManageInfo","self","$","hide","getJSON","Galaxy","root","data","userInfo","ManageUserInformation","append","$el","callChangePassword","changePassword","ChangePassword","showPreferences","show","callChangePermissions","url","changePermissions","ChangePermissions","callApiKeys","message","status","response","apiKey","APIKeys","callManageToolboxFilter","toolbox","callChangeCommunication","changeCommunication","render","template","empty","on"],"mappings":"AACAA,QAAU,mCAAoC,2BAA4B,8BAA+B,0BAA2B,iCAAkC,iCAAmC,SAAUC,EAAQC,EAAUC,EAAaC,EAAMC,EAAeC,GACnQ,GAAI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":["../../../src/mvc/user/user-preferences.js"],"names":["define","Manage","Password","Permissions","Keys","ToolboxFilter","ChangeCommunication","UserPreferences","Backbone","View","extend","initialize","this","setElement","render","callManageInfo","self","$","hide","getJSON","Galaxy","root","data","userInfo","ManageUserInformation","append","$el","callChangePassword","changePassword","ChangePassword","showPreferences","show","callChangePermissions","url","changePermissions","ChangePermissions","callApiKeys","message","status","response","apiKey","APIKeys","callManageToolboxFilter","toolbox","callChangeCommunication","changeCommunication","template","empty","on"],"mappings":"AACAA,QAAU,mCAAoC,2BAA4B,8BAA+B,0BAA2B,iCAAkC,iCAAmC,SAAUC,EAAQC,EAAUC,EAAaC,EAAMC,EAAeC,GACnQ,GAAIC,GAAkBC,SAASC,KAAKC,QAEhCC,WAAY,WACRC,KAAKC,WAAY,UACjBD,KAAKE,UAITC,eAAgB,WACZ,GAAIC,GAAOJ,IACXK,GAAG,cAAeC,OAClBD,EAAEE,QAASC,OAAOC,KAAO,uCAAwC,SAAUC,GACvE,GAAIC,GAAW,GAAItB,GAAOuB,sBAAuBR,EAAMM,EACvDN,GAAKC,EAAG,yBAA0BQ,OAAQF,EAASG,QAK3DC,mBAAoB,WAChB,GAAIX,GAAOJ,IACXK,GAAG,cAAeC,OAClBD,EAAEE,QAASC,OAAOC,KAAO,uCAAwC,SAAUC,GACvE,GAAIM,GAAiB,GAAI1B,GAAS2B,eAAgBb,EAAMM,EACxDN,GAAKC,EAAG,yBAA0BQ,OAAQG,EAAeF,QAKjEI,gBAAiB,WACblB,KAAKK,EAAG,cAAec,QAI3BC,sBAAuB,WACnB,GAAIC,GAAMb,OAAOC,KAAO,0CACpBL,EAAOJ,KACPc,EAAMT,EAAG,wBACbA,GAAG,cAAeC,OAClBD,EAAEE,QAASc,EAAK,SAAUX,GACtBY,kBAAoB,GAAI/B,GAAYgC,kBAAmBnB,EAAMM,EAAMI,MAK3EU,YAAa,WACT,GAAIH,GAAMb,OAAOC,KAAO,sCACpBC,KACAN,EAAOJ,IACXK,GAAG,c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B7B,EAAG,oBAAqB+B,GAAI,QAAS,WAAahC,EAAKD,mBACvDE,EAAG,oBAAqB+B,GAAI,QAAS,WAAahC,EAAKW,uBACvDV,EAAG,uBAAwB+B,GAAI,QAAS,WAAahC,EAAKgB,0BAC1Df,EAAG,oBAAqB+B,GAAI,QAAS,WAAahC,EAAKoB,gBACvDnB,EAAG,2BAA4B+B,GAAI,QAAS,WAAahC,EAAK0B,4BAC9DzB,EAAG,iCAAkC+B,GAAI,QAAS,WAAahC,EAAK4B,8BAI5E,QACIrC,gBAAiBA"}
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/user/change-user-information","mvc/user/change-password","mvc/user/change-permissions","mvc/user/change-api-key","mvc/user/change-toolbox-filter","mvc/user/change-communication"],function(a,b,c,d,e,f){var g=Backbone.View.extend({initialize:function(){this.setElement("<div/>"),this.getUserPreferencesData()},callManageInfo:function(){var b=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/get_information",function(c){var d=new a.ManageUserInformation(b,c);b.$(".user-preferences-all").append(d.$el)})},callChangePassword:function(){var a=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/change_password",function(c){var d=new b.ChangePassword(a,c);a.$(".user-preferences-all").append(d.$el)})},showPreferences:function(){this.$(".user-pref").show()},callChangePermissions:function(){var a=Galaxy.root+"api/user_preferences/change_permissions",b=this,d=$(".user-preferences-all");$(".user-pref").hide(),$.getJSON(a,function(a){changePermissions=new c.ChangePermissions(b,a,d)})},callApiKeys:function(){var a=Galaxy.root+"api/user_preferences/change_api_key",b={},c=this;$(".user-pref").hide(),b={message:"",status:""},$.getJSON(a,b,function(a){apiKey=new d.APIKeys(c,a),c.$(".user-preferences-all").append(apiKey.$el)})},callManageToolboxFilter:function(){var a=Galaxy.root+"api/user_preferences/change_toolbox_filters",b=this;$(".user-pref").hide(),$.getJSON(a,function(a){toolbox=new e.ToolboxFilter(b,a),b.$(".user-preferences-all").append(toolbox.$el)})},callChangeCommunication:function(){$(".user-pref").hide();var a=this,b=Galaxy.root+"api/user_preferences/change_communication";$.getJSON(b,function(b){changeCommunication=new f.ChangeCommunication(a,b),a.$(".user-preferences-all").append(changeCommunication.$el)})},getUserPreferencesData:function(){var a=Galaxy.root+"api/user_preferences",b=this;$.getJSON(a,function(a){b.render(a)})},render:function(a){var b="",c=this;null!==a.id?(b="<div class='user-preferences-all'>",b=b+'<div class="user-pref"> <h2> User preferences </h2><p>You are currently logged in as '+a.email+".</p>",b+="<ul>","galaxy"===a.webapp?(a.remote_user||(b+="<li><a target='galaxy_main' class='manage-userinfo'>Manage your information</a> (email, address, etc.) </li><li><a target='galaxy_main' class='change-password'>Change your password</a> </li>"),b+="<li><a target='galaxy_main' class='change-communication-setting'>Change your communication settings</a></li><li><a target='galaxy_main' class='change-permissions'>Change default permissions</a> for new histories </li><li><a target='galaxy_main' class='manage-api-keys'>Manage your API keys</a></li><li><a target='galaxy_main' class='manage-toolbox-filters'>Manage your ToolBox filters</a></li>",a.openid&&!a.remote_user&&(b+="<li><a target='galaxy_main' class='manage-openid'>Manage OpenIDs</a> linked to your account </li>")):b+="<li><a target='galaxy_main' class='manage-userinfo'> Manage your information </a> for new histories </li><li><a target='galaxy_main' class='change-password'> Change your password </a> </li><li><a target='galaxy_main' class='manage-api-keys'> Manage your API keys </a> </li><li><a target='galaxy_main' class='manage-email-alert'> Manage your email alerts </a> </li>",b+="</ul>","galaxy"===a.webapp&&(b=b+"<p>You are using <strong>"+a.disk_usage+"</strong> of disk space in this Galaxy instance.",a.enable_quotas&&(b=b+"Your disk quota is: <strong>"+a.quota+"</strong>."),b+='Is your usage more than expected? See the <a href="https://wiki.galaxyproject.org/Learn/ManagingDatasets" target="_blank">documentation</a> for tips on how to find all of the data in your account.',b+="</p>")):(a.message||(b+="<p>You are currently not logged in.</p>"),b+="<ul><li> <a target=\"galaxy_main\" class=\"user-login\"> Login </a></li><li> <a target='galaxy_main' class='user-register'> Register </a></li></ul>"),b+="</div></div>",this.$el.empty().append(b),$(".manage-userinfo").on("click",function(){c.callManageInfo()}),$(".change-password").on("click",function(){c.callChangePassword()}),$(".change-permissions").on("click",function(){c.callChangePermissions()}),$(".manage-api-keys").on("click",function(){c.callApiKeys()}),$(".manage-toolbox-filters").on("click",function(){c.callManageToolboxFilter()}),$(".change-communication-setting").on("click",function(){c.callChangeCommunication()})}});return{UserPreferences:g}});
define(["mvc/user/change-user-information","mvc/user/change-password","mvc/user/change-permissions","mvc/user/change-api-key","mvc/user/change-toolbox-filter","mvc/user/change-communication"],function(a,b,c,d,e,f){var g=Backbone.View.extend({initialize:function(){this.setElement("<div/>"),this.render()},callManageInfo:function(){var b=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/get_information",function(c){var d=new a.ManageUserInformation(b,c);b.$(".user-preferences-all").append(d.$el)})},callChangePassword:function(){var a=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/change_password",function(c){var d=new b.ChangePassword(a,c);a.$(".user-preferences-all").append(d.$el)})},showPreferences:function(){this.$(".user-pref").show()},callChangePermissions:function(){var a=Galaxy.root+"api/user_preferences/change_permissions",b=this,d=$(".user-preferences-all");$(".user-pref").hide(),$.getJSON(a,function(a){changePermissions=new c.ChangePermissions(b,a,d)})},callApiKeys:function(){var a=Galaxy.root+"api/user_preferences/change_api_key",b={},c=this;$(".user-pref").hide(),b={message:"",status:""},$.getJSON(a,b,function(a){apiKey=new d.APIKeys(c,a),c.$(".user-preferences-all").append(apiKey.$el)})},callManageToolboxFilter:function(){var a=Galaxy.root+"api/user_preferences/change_toolbox_filters",b=this;$(".user-pref").hide(),$.getJSON(a,function(a){toolbox=new e.ToolboxFilter(b,a),b.$(".user-preferences-all").append(toolbox.$el)})},callChangeCommunication:function(){$(".user-pref").hide();var a=this,b=Galaxy.root+"api/user_preferences/change_communication";$.getJSON(b,function(b){changeCommunication=new f(a,b),a.$(".user-preferences-all").append(changeCommunication.$el)})},render:function(){var a=this;$.getJSON(Galaxy.root+"api/user_preferences",function(b){a.render(b)});var b="";null!==data.id?(b="<div class='user-preferences-all'>",b=b+'<div class="user-pref"> <h2> User preferences </h2><p>You are currently logged in as '+data.email+".</p>",b+="<ul>","galaxy"===data.webapp?(data.remote_user||(b+="<li><a target='galaxy_main' class='manage-userinfo'>Manage your information</a> (email, address, etc.) </li><li><a target='galaxy_main' class='change-password'>Change your password</a> </li>"),b+="<li><a target='galaxy_main' class='change-communication-setting'>Change your communication settings</a></li><li><a target='galaxy_main' class='change-permissions'>Change default permissions</a> for new histories </li><li><a target='galaxy_main' class='manage-api-keys'>Manage your API keys</a></li><li><a target='galaxy_main' class='manage-toolbox-filters'>Manage your ToolBox filters</a></li>",data.openid&&!data.remote_user&&(b+="<li><a target='galaxy_main' class='manage-openid'>Manage OpenIDs</a> linked to your account </li>")):b+="<li><a target='galaxy_main' class='manage-userinfo'> Manage your information </a> for new histories </li><li><a target='galaxy_main' class='change-password'> Change your password </a> </li><li><a target='galaxy_main' class='manage-api-keys'> Manage your API keys </a> </li><li><a target='galaxy_main' class='manage-email-alert'> Manage your email alerts </a> </li>",b+="</ul>","galaxy"===data.webapp&&(b=b+"<p>You are using <strong>"+data.disk_usage+"</strong> of disk space in this Galaxy instance.",data.enable_quotas&&(b=b+"Your disk quota is: <strong>"+data.quota+"</strong>."),b+='Is your usage more than expected? See the <a href="https://wiki.galaxyproject.org/Learn/ManagingDatasets" target="_blank">documentation</a> for tips on how to find all of the data in your account.',b+="</p>")):(data.message||(b+="<p>You are currently not logged in.</p>"),b+="<ul><li> <a target=\"galaxy_main\" class=\"user-login\"> Login </a></li><li> <a target='galaxy_main' class='user-register'> Register </a></li></ul>"),b+="</div></div>",this.$el.empty().append(b),$(".manage-userinfo").on("click",function(){a.callManageInfo()}),$(".change-password").on("click",function(){a.callChangePassword()}),$(".change-permissions").on("click",function(){a.callChangePermissions()}),$(".manage-api-keys").on("click",function(){a.callApiKeys()}),$(".manage-toolbox-filters").on("click",function(){a.callManageToolboxFilter()}),$(".change-communication-setting").on("click",function(){a.callChangeCommunication()})}});return{UserPreferences:g}});
//# sourceMappingURL=../../../maps/mvc/user/user-preferences.js.map