De-conflict asset bundles
This commit is contained in:
25
assets/organisations/js/pages/organisation.js
Normal file
25
assets/organisations/js/pages/organisation.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
|
||||
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
|
||||
*
|
||||
* This script depends on uf-table.js, moment.js, handlebars-helpers.js, widgets/users.js
|
||||
*
|
||||
* Target page: /organisations/o/{slug}
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Control buttons
|
||||
bindOrganisationButtons($("#view-organisation"), { delete_redirect: page.delete_redirect, leave_redirect: page.leave_redirect });
|
||||
|
||||
// Table of users in this organisation
|
||||
$("#widget-organisation-members").ufTable({
|
||||
dataUrl: site.uri.public + '/api/organisations/o/' + page.organisation_slug + '/members',
|
||||
useLoadingTransition: site.uf_table.use_loading_transition
|
||||
});
|
||||
|
||||
// Bind user table buttons
|
||||
$("#widget-organisation-members").on("pagerComplete.ufTable", function () {
|
||||
bindMemberButtons($(this));
|
||||
bindUserButtons($(this));
|
||||
});
|
||||
});
|
||||
38
assets/organisations/js/pages/organisations.js
Normal file
38
assets/organisations/js/pages/organisations.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
|
||||
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
|
||||
*
|
||||
* This script depends on widgets/organisations.js, uf-table.js, moment.js, handlebars-helpers.js
|
||||
*
|
||||
* Target page: /organisations
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($("#widget-organisations").length) {
|
||||
$("#widget-organisations").ufTable({
|
||||
dataUrl: site.uri.public + "/api/organisations",
|
||||
useLoadingTransition: site.uf_table.use_loading_transition
|
||||
});
|
||||
|
||||
// Bind creation button
|
||||
bindOrganisationCreationButton($("#widget-organisations"));
|
||||
|
||||
// Bind registration button
|
||||
bindOrganisationRegistrationButton($("#widget-organisations"));
|
||||
|
||||
// Bind table buttons
|
||||
$("#widget-organisations").on("pagerComplete.ufTable", function () {
|
||||
bindOrganisationButtons($(this));
|
||||
});
|
||||
} else {
|
||||
$("#widget-deleted-organisations").ufTable({
|
||||
dataUrl: site.uri.public + "/api/organisations/deleted",
|
||||
useLoadingTransition: site.uf_table.use_loading_transition
|
||||
});
|
||||
|
||||
// Bind table buttons
|
||||
$("#widget-deleted-organisations").on("pagerComplete.ufTable", function () {
|
||||
bindOrganisationButtons($(this));
|
||||
});
|
||||
}
|
||||
});
|
||||
13
assets/organisations/js/pages/user.js
Normal file
13
assets/organisations/js/pages/user.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
|
||||
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
|
||||
*
|
||||
* This script depends on uf-table.js, moment.js, handlebars-helpers.js
|
||||
*
|
||||
* Target page: /users/u/{user_name}
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Control buttons
|
||||
bindUserButtonsExtra($("#view-user"), { delete_redirect: page.delete_redirect });
|
||||
});
|
||||
15
assets/organisations/js/pages/users.js
Normal file
15
assets/organisations/js/pages/users.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
|
||||
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
|
||||
*
|
||||
* This script depends on widgets/users.js, uf-table.js, moment.js, handlebars-helpers.js
|
||||
*
|
||||
* Target page: /users
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Bind table buttons
|
||||
$("#widget-users").on("pagerComplete.ufTable", function () {
|
||||
bindUserButtonsExtra($(this));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user