Skip to content

Commit

Permalink
Issue #12 completed: 'Hide permissions if inherits from page is selec…
Browse files Browse the repository at this point in the history
…ted'
  • Loading branch information
emfluenceindia committed Oct 12, 2016
1 parent ce9bc78 commit ed5cc73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Weapsy/Areas/Admin/Views/Page/EditModule.cshtml
@@ -1,6 +1,6 @@
@model Weapsy.Reporting.Pages.PageModuleAdminModel

@{
@{
Layout = "";
}

Expand All @@ -13,12 +13,12 @@
<div class="col-md-12">
<label class="checkbox-inline">
<input asp-for="InheritPermissions" type="checkbox" />
Inherit Permissions From Page
</label>
Inherit Permissions From Page
</label>
</div>
</div>

<div class="form-group has-feedback">
<div class="form-group has-feedback" id="form-group-role-grid">
<div class="col-md-12">
<table class="table table-bordered" style="width:auto;">
<tr>
Expand Down Expand Up @@ -53,4 +53,5 @@
</span>
</div>
</div>
<script type="text/javascript" src="~/js/admin/pages/module-settings.js"></script>
</form>
1 change: 1 addition & 0 deletions src/Weapsy/wwwroot/_references.js
Expand Up @@ -22,6 +22,7 @@
/// <reference path="js/admin/pages/create.js" />
/// <reference path="js/admin/pages/edit.js" />
/// <reference path="js/admin/pages/index.js" />
/// <reference path="js/admin/pages/module-settings.js" />
/// <reference path="js/admin/pages/shared.js" />
/// <reference path="js/admin/roles/create.js" />
/// <reference path="js/admin/roles/edit.js" />
Expand Down
12 changes: 12 additions & 0 deletions src/Weapsy/wwwroot/js/admin/pages/module-settings.js
@@ -0,0 +1,12 @@
var inheritPermissions = $("#InheritPermissions");
var formGroupRoleGrid = $("#form-group-role-grid");
document.getElementById("InheritPermissions").checked = false;

$(inheritPermissions).bind("click", function () {
if ($(inheritPermissions).is(":checked")) {
$(formGroupRoleGrid).slideUp(500);
}
else {
$(formGroupRoleGrid).slideDown(500);
}
});

0 comments on commit ed5cc73

Please sign in to comment.