mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:03:57 +08:00
Mention history in permissions link
This commit is contained in:
@@ -25,7 +25,7 @@ define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
|
||||
icon : 'fa-child'
|
||||
},
|
||||
'permissions': {
|
||||
title : 'Change default permissions',
|
||||
title : 'Change default history permissions',
|
||||
description : 'Grant others default access to newly created histories.',
|
||||
url : 'api/users/' + Galaxy.user.id + '/permissions/inputs',
|
||||
icon : 'fa-users',
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"user-preferences.js","sources":["../../../src/mvc/user/user-preferences.js"],"names":["define","Form","Ui","UserPreferences","Backbone","View","extend","initialize","this","defs","information","title","description","url","Galaxy","user","id","icon","password","submit_title","communication","permissions","api_key","submit_icon","toolbox_filters","openids","onclick","$","attr","root","logout","modal","show","body","buttons","Cancel","hide","Sign out","window","location","href","message","Message","setElement","render","self","config","getJSON","data","$preferences","addClass","append","$el","_","escape","email","$table","use_remote_user","_link","communication_server_host","has_user_tool_filters","enable_openid","_templateFooter","empty","page","$page_item","_templateRow","find","on","ajax","type","done","response","options","form","inputs","operations","submit","ButtonIcon","tooltip","submit_tooltip","_submit","back","remove","fail","update","status","JSON","stringify","create","contentType","updated_values","matchModel","input","input_id","field_list","value","responseJSON","err_msg","nice_total_disk_usage","enable_quotas","quota"],"mappings":"AACAA,QAAU,qBAAsB,kBAAoB,SAAUC,EAAMC,GAEhE,GAAIC,GAAkBC,SAASC,KAAKC,QAEhCC,WAAY,WACRC,KAAKC,MACDC,aACIC,MAAkB,qBAClBC,YAAkB,4EAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,sBAClDC,KAAkB,kBAEtBC,UACIP,MAAkB,kBAClBC,YAAkB,+CAClBK,KAAkB,gBAClBJ,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,mBAClDG,aAAkB,iBAEtBC,eACIT,MAAkB,gCAClBC,YAAkB,wEAClBC,I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AS,2BAA6BuB,EAAKnD,IAAM,IAAKyE,OAAQ,aAGzFtB,EAAKtC,aAKjBuD,QAAS,SAAUP,EAAMD,GACrB,GAAI5B,GAAOrC,IACXmB,GAAE0C,MACExD,IAAc4D,EAAQ5D,IACtBmC,KAAcuC,KAAKC,UAAUd,EAAK1B,KAAKyC,UACvCnB,KAAc,MACdoB,YAAc,qBACfnB,KAAM,SAAUC,GACf,GAAImB,IAAiB,CACrBjB,GAAK1B,KAAK4C,WAAYpB,EAAU,SAAWqB,EAAOC,GAC9CpB,EAAKqB,WAAYD,GAAWE,MAAOH,EAAMG,OACzCL,GAAiB,IAEhBA,EACDjB,EAAKjC,QAAQ4C,QAAU5C,QAAS+B,EAAS/B,QAAS6C,OAAQ,aAE1DZ,EAAKS,SACLtC,EAAKI,aAAajB,OAClBa,EAAKJ,QAAQ4C,QAAU5C,QAAS+B,EAAS/B,QAAS6C,OAAQ,eAE/DF,KAAM,SAAUZ,GACfE,EAAKjC,QAAQ4C,QAAU5C,QAAS+B,EAASyB,aAAaC,QAASZ,OAAQ,cAI/EpB,aAAc,SAAUO,GACpB,MAAQ,wCAE0CA,EAAQxD,KAAO,mEAGSwD,EAAQ9D,MAAQ,iCAC3C8D,EAAQ7D,YAAc,oBAKzEkD,gBAAiB,SAAUW,GACvB,MAAQ,oDAC+BA,EAAQ0B,sBAAwB,qDACzDrF,OAAOgC,OAAOsD,cAAgB,+BAAiC3B,EAAQ4B,MAAQ,cAAgB,IACjG,6MAKpB,QACIlG,gBAAiBA"}
|
||||
{"version":3,"file":"user-preferences.js","sources":["../../../src/mvc/user/user-preferences.js"],"names":["define","Form","Ui","UserPreferences","Backbone","View","extend","initialize","this","defs","information","title","description","url","Galaxy","user","id","icon","password","submit_title","communication","permissions","api_key","submit_icon","toolbox_filters","openids","onclick","$","attr","root","logout","modal","show","body","buttons","Cancel","hide","Sign out","window","location","href","message","Message","setElement","render","self","config","getJSON","data","$preferences","addClass","append","$el","_","escape","email","$table","use_remote_user","_link","communication_server_host","has_user_tool_filters","enable_openid","_templateFooter","empty","page","$page_item","_templateRow","find","on","ajax","type","done","response","options","form","inputs","operations","submit","ButtonIcon","tooltip","submit_tooltip","_submit","back","remove","fail","update","status","JSON","stringify","create","contentType","updated_values","matchModel","input","input_id","field_list","value","responseJSON","err_msg","nice_total_disk_usage","enable_quotas","quota"],"mappings":"AACAA,QAAU,qBAAsB,kBAAoB,SAAUC,EAAMC,GAEhE,GAAIC,GAAkBC,SAASC,KAAKC,QAEhCC,WAAY,WACRC,KAAKC,MACDC,aACIC,MAAkB,qBAClBC,YAAkB,4EAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,sBAClDC,KAAkB,kBAEtBC,UACIP,MAAkB,kBAClBC,YAAkB,+CAClBK,KAAkB,gBAClBJ,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,mBAClDG,aAAkB,iBAEtBC,eACIT,MAAkB,gCAClBC,YAAkB,wEAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,wBAClDC,KAAkB,YAEtBI,aACIV,MAAkB,qCAClBC,YAAkB,0DAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,sBAClDC,KAAkB,WAClBE,aAAkB,oBAEtBG,SACIX,MAAkB,iBAClBC,YAAkB,mDAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,kBAClDC,KAAkB,SAClBE,aAAkB,mBAClBI,YAAkB,YAEtBC,iBACIb,MAAkB,yBAClBC,YAAkB,kEAClBC,IAAkB,aAAeC,OAAOC,KAAKC,GAAK,0BAClDC,KAAkB,YAClBE,aAAkB,gBAEtBM,SACId,MAAkB,iBAClBC,YAAkB,uCAClBK,KAAkB,YAClBS,QAAkB,WACdC,EAAG,gBAAiBC,KAAM,MAAOd,OAAOe,KAAO,sCAGvDC,QACInB,MAAkB,WAClBC,YAAkB,0CAClBK,KAAkB,cAClBS,QAAkB,WACdZ,OAAOiB,MAAMC,MACTrB,MAAU,WACVsB,KAAU,+DACVC,SACI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aC,QAASZ,OAAQ,cAI/EpB,aAAc,SAAUO,GACpB,MAAQ,wCAE0CA,EAAQxD,KAAO,mEAGSwD,EAAQ9D,MAAQ,iCAC3C8D,EAAQ7D,YAAc,oBAKzEkD,gBAAiB,SAAUW,GACvB,MAAQ,oDAC+BA,EAAQ0B,sBAAwB,qDACzDrF,OAAOgC,OAAOsD,cAAgB,+BAAiC3B,EAAQ4B,MAAQ,cAAgB,IACjG,6MAKpB,QACIlG,gBAAiBA"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["mvc/form/form-view","mvc/ui/ui-misc"],function(a,b){var c=Backbone.View.extend({initialize:function(){this.defs={information:{title:"Manage information",description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+Galaxy.user.id+"/information/inputs",icon:"fa-info-circle"},password:{title:"Change password",description:"Allows you to change your login credentials.",icon:"fa-unlock-alt",url:"api/users/"+Galaxy.user.id+"/password/inputs",submit_title:"Save password"},communication:{title:"Change communication settings",description:"Enable or disable the communication feature to chat with other users.",url:"api/users/"+Galaxy.user.id+"/communication/inputs",icon:"fa-child"},permissions:{title:"Change default permissions",description:"Grant others default access to newly created histories.",url:"api/users/"+Galaxy.user.id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions"},api_key:{title:"Manage API key",description:"Access your current API key or create a new one.",url:"api/users/"+Galaxy.user.id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:"Manage Toolbox filters",description:"Customize your Toolbox by displaying or omitting sets of Tools.",url:"api/users/"+Galaxy.user.id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters"},openids:{title:"Manage OpenIDs",description:"Associate OpenIDs with your account.",icon:"fa-openid",onclick:function(){$("#galaxy_main").attr("src",Galaxy.root+"user/openid_manage?cntrller=user")}},logout:{title:"Sign out",description:"Click here to sign out of all sessions.",icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:"Sign out",body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout"}}})}}},this.message=new b.Message,this.setElement("<div/>"),this.render()},render:function(){var a=this,b=Galaxy.config;$.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(c){a.$preferences=$("<div/>").addClass("ui-panel").append(a.message.$el).append($("<h2/>").append("User preferences")).append($("<p/>").append("You are logged in as <strong>"+_.escape(c.email)+"</strong>.")).append(a.$table=$("<table/>").addClass("ui-panel-table")),b.use_remote_user||(a._link(a.defs.information),a._link(a.defs.password)),b.communication_server_host&&a._link(a.defs.communication),a._link(a.defs.permissions),a._link(a.defs.api_key),b.has_user_tool_filters&&a._link(a.defs.toolbox_filters),b.enable_openid&&!b.use_remote_user&&a._link(a.defs.openids),a._link(a.defs.logout),a.$preferences.append(a._templateFooter(c)),a.$el.empty().append(a.$preferences)})},_link:function(c){var d=this,e=$(this._templateRow(c));this.$table.append(e),e.find("a").on("click",function(){c.url?$.ajax({url:Galaxy.root+c.url,type:"GET"}).done(function(e){var f=$.extend({},c,e),g=new a({title:f.title,icon:f.icon,inputs:f.inputs,operations:{submit:new b.ButtonIcon({tooltip:f.submit_tooltip||"Store user preferences",title:f.submit_title||"Save settings",icon:f.submit_icon||"fa-save",onclick:function(){d._submit(g,f)}}),back:new b.ButtonIcon({icon:"fa-caret-left",tooltip:"Return to user preferences",title:"Preferences",onclick:function(){g.remove(),d.$preferences.show()}})}});d.$preferences.hide(),d.$el.append(g.$el)}).fail(function(){d.message.update({message:"Failed to load resource "+c.url+".",status:"danger"})}):c.onclick()})},_submit:function(a,b){var c=this;$.ajax({url:b.url,data:JSON.stringify(a.data.create()),type:"PUT",contentType:"application/json"}).done(function(b){var d=!1;a.data.matchModel(b,function(b,c){a.field_list[c].value(b.value),d=!0}),d?a.message.update({message:b.message,status:"success"}):(a.remove(),c.$preferences.show(),c.message.update({message:b.message,status:"success"}))}).fail(function(b){a.message.update({message:b.responseJSON.err_msg,status:"danger"})})},_templateRow:function(a){return'<tr><td><div class="ui-panel-icon fa '+a.icon+'"></td><td><a class="ui-panel-anchor" href="javascript:void(0)">'+a.title+'</a><div class="ui-form-info">'+a.description+"</div></td></tr>"},_templateFooter:function(a){return'<p class="ui-panel-footer">You are using <strong>'+a.nice_total_disk_usage+"</strong> of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: <strong>"+a.quota+"</strong>. ":"")+'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.</p>'}});return{UserPreferences:c}});
|
||||
define(["mvc/form/form-view","mvc/ui/ui-misc"],function(a,b){var c=Backbone.View.extend({initialize:function(){this.defs={information:{title:"Manage information",description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+Galaxy.user.id+"/information/inputs",icon:"fa-info-circle"},password:{title:"Change password",description:"Allows you to change your login credentials.",icon:"fa-unlock-alt",url:"api/users/"+Galaxy.user.id+"/password/inputs",submit_title:"Save password"},communication:{title:"Change communication settings",description:"Enable or disable the communication feature to chat with other users.",url:"api/users/"+Galaxy.user.id+"/communication/inputs",icon:"fa-child"},permissions:{title:"Change default history permissions",description:"Grant others default access to newly created histories.",url:"api/users/"+Galaxy.user.id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions"},api_key:{title:"Manage API key",description:"Access your current API key or create a new one.",url:"api/users/"+Galaxy.user.id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:"Manage Toolbox filters",description:"Customize your Toolbox by displaying or omitting sets of Tools.",url:"api/users/"+Galaxy.user.id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters"},openids:{title:"Manage OpenIDs",description:"Associate OpenIDs with your account.",icon:"fa-openid",onclick:function(){$("#galaxy_main").attr("src",Galaxy.root+"user/openid_manage?cntrller=user")}},logout:{title:"Sign out",description:"Click here to sign out of all sessions.",icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:"Sign out",body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout"}}})}}},this.message=new b.Message,this.setElement("<div/>"),this.render()},render:function(){var a=this,b=Galaxy.config;$.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(c){a.$preferences=$("<div/>").addClass("ui-panel").append(a.message.$el).append($("<h2/>").append("User preferences")).append($("<p/>").append("You are logged in as <strong>"+_.escape(c.email)+"</strong>.")).append(a.$table=$("<table/>").addClass("ui-panel-table")),b.use_remote_user||(a._link(a.defs.information),a._link(a.defs.password)),b.communication_server_host&&a._link(a.defs.communication),a._link(a.defs.permissions),a._link(a.defs.api_key),b.has_user_tool_filters&&a._link(a.defs.toolbox_filters),b.enable_openid&&!b.use_remote_user&&a._link(a.defs.openids),a._link(a.defs.logout),a.$preferences.append(a._templateFooter(c)),a.$el.empty().append(a.$preferences)})},_link:function(c){var d=this,e=$(this._templateRow(c));this.$table.append(e),e.find("a").on("click",function(){c.url?$.ajax({url:Galaxy.root+c.url,type:"GET"}).done(function(e){var f=$.extend({},c,e),g=new a({title:f.title,icon:f.icon,inputs:f.inputs,operations:{submit:new b.ButtonIcon({tooltip:f.submit_tooltip||"Store user preferences",title:f.submit_title||"Save settings",icon:f.submit_icon||"fa-save",onclick:function(){d._submit(g,f)}}),back:new b.ButtonIcon({icon:"fa-caret-left",tooltip:"Return to user preferences",title:"Preferences",onclick:function(){g.remove(),d.$preferences.show()}})}});d.$preferences.hide(),d.$el.append(g.$el)}).fail(function(){d.message.update({message:"Failed to load resource "+c.url+".",status:"danger"})}):c.onclick()})},_submit:function(a,b){var c=this;$.ajax({url:b.url,data:JSON.stringify(a.data.create()),type:"PUT",contentType:"application/json"}).done(function(b){var d=!1;a.data.matchModel(b,function(b,c){a.field_list[c].value(b.value),d=!0}),d?a.message.update({message:b.message,status:"success"}):(a.remove(),c.$preferences.show(),c.message.update({message:b.message,status:"success"}))}).fail(function(b){a.message.update({message:b.responseJSON.err_msg,status:"danger"})})},_templateRow:function(a){return'<tr><td><div class="ui-panel-icon fa '+a.icon+'"></td><td><a class="ui-panel-anchor" href="javascript:void(0)">'+a.title+'</a><div class="ui-form-info">'+a.description+"</div></td></tr>"},_templateFooter:function(a){return'<p class="ui-panel-footer">You are using <strong>'+a.nice_total_disk_usage+"</strong> of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: <strong>"+a.quota+"</strong>. ":"")+'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.</p>'}});return{UserPreferences:c}});
|
||||
//# sourceMappingURL=../../../maps/mvc/user/user-preferences.js.map
|
||||
Reference in New Issue
Block a user