diff options
Diffstat (limited to 'app/view')
-rw-r--r-- | app/view/common/group.setting.modal.view.php | 96 | ||||
-rw-r--r-- | app/view/common/newgroup.modal.view.php | 49 | ||||
-rw-r--r-- | app/view/common/ownership.setting.modal.view.php | 35 | ||||
-rw-r--r-- | app/view/common/permissions.setting.modal.view.php | 82 | ||||
-rw-r--r-- | app/view/common/setting.modal.view.php | 14 | ||||
-rw-r--r-- | app/view/common/topp.view.php | 26 | ||||
-rw-r--r-- | app/view/except/default.view.php | 12 | ||||
-rw-r--r-- | app/view/obj/group.view.php | 43 |
8 files changed, 351 insertions, 6 deletions
diff --git a/app/view/common/group.setting.modal.view.php b/app/view/common/group.setting.modal.view.php new file mode 100644 index 0000000..d0e11ca --- /dev/null +++ b/app/view/common/group.setting.modal.view.php @@ -0,0 +1,96 @@ +<?php + +/* + * SCROTT Copyright (C) 2016 Malf Furious + * + * Scrott is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Scrott is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + */ + +?> + +<?php require_once "view/common/permissions.setting.modal.view.php"; ?> + +<div class="tab-pane fade <?=$mod->getSettingModalTabDispClasses()?>" id="settGroupTab"> + <p> </p> + + <form method="post" action="<?=$mod->ap()?>" enctype="multipart/form-data"> + <input type="hidden" name="input[action]" value="common-setting-group" /> + <input type="hidden" name="input[guid]" value="<?=$mod->group->guid?>" /> + + <div class="row"> + <div class="col-md-8"> + <div class="form-group"> + <label>Group name</label> + <input type="text" name="input[name]" class="form-control" value="<?=$mod->group->name?>" required="true" maxlength="50" <?=($mod->group->canModify($mod->getCurrentUser()) ? "" : "disabled")?> /> + </div> + </div> + + <div class="col-md-4 text-center"> + <img src="<?=$mod->group->getHeadImage()?>" alt="<?=$mod->group->name?>" class="img-circle" height="100" /> + + <?php if ($mod->group->canModify($mod->getCurrentUser())) { ?> + <br /> + <br /> + <button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#inputGroupImageCollapse"> + <span class="glyphicon glyphicon-camera"></span> Upload new image + </button> + <br /> + <button type="submit" name="input[rmImage]" class="btn btn-danger btn-xs" onclick="return assertConfirm()"> + <span class="glyphicon glyphicon-remove"></span> Remove image + </button> + <?php } ?> + </div> + </div> + + <div class="collapse" id="inputGroupImageCollapse"> + <div class="form-group"> + <label>Group Image</label> + <input type="file" name="attachment" /> + </div> + </div> + + <?php common_setting_permissions($mod, $mod->group); ?> + + <?php if ($mod->group->canModify($mod->getCurrentUser())) { ?> + <p> </p> + <button type="submit" class="btn btn-success pull-right">Save</button> + <?php } ?> + </form> + + <p> </p> + <p> </p> + + <div class="btn-toolbar pull-right"> + <?php if ($mod->group->canModifyMembers($mod->getCurrentUser())) { ?> + <div class="btn-group"> + <a href="<?=$mod->group->getURL()?>/members" class="btn btn-primary btn-xs"> + <span class="glyphicon glyphicon-user"></span> Manage Members + </a> + </div> + <?php } ?> + + <?php if ($mod->group->isOwner($mod->getCurrentUser())) { ?> + <div class="btn-group"> + <a href="<?=$mod->group->getURL()?>/transfer" class="btn btn-danger btn-xs"> + <span class="glyphicon glyphicon-new-window"></span> Transfer Ownership + </a> + </div> + + <div class="btn-group"> + <a href="<?=$mod->group->getURL()?>/delete" class="btn btn-danger btn-xs"> + <span class="glyphicon glyphicon-trash"></span> Delete Group + </a> + </div> + <?php } ?> + </div> + + <p> </p> +</div> diff --git a/app/view/common/newgroup.modal.view.php b/app/view/common/newgroup.modal.view.php new file mode 100644 index 0000000..3dd631c --- /dev/null +++ b/app/view/common/newgroup.modal.view.php @@ -0,0 +1,49 @@ +<?php + +/* + * SCROTT Copyright (C) 2016 Malf Furious + * + * Scrott is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Scrott is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + */ + +?> + +<div id="newgroupModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog modal-sm" role="document"> + <div class="modal-content"> + <div class="modal-header"> + + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"><span class="glyphicon glyphicon-th"></span> Create new Group</h4> + + </div> + + <div class="modal-body"> + <form method="post" action="<?=$mod->ap()?>"> + <input type="hidden" name="input[action]" value="common-group-add" /> + <div class="form-group"> + <label>Group Name</label> + <input type="text" name="input[name]" class="form-control" required="true" maxlength="50" /> + </div> + + <button type="submit" class="btn btn-success pull-right"> + <span class="glyphicon glyphicon-plus"></span> Add + </button> + </form> + + <p> </p> + </div> + </div> + </div> +</div> diff --git a/app/view/common/ownership.setting.modal.view.php b/app/view/common/ownership.setting.modal.view.php new file mode 100644 index 0000000..3f7c382 --- /dev/null +++ b/app/view/common/ownership.setting.modal.view.php @@ -0,0 +1,35 @@ +<?php + +/* + * SCROTT Copyright (C) 2016 Malf Furious + * + * Scrott is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Scrott is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + */ + +?> + +<?php function common_setting_ownership($mod, $obj) { ?> + <?php if ($obj->isOwner($mod->getCurrentUser())) { ?> + <label class="text-danger">Change Owner</label> + <div class="checkbox"> + <label data-toggle="collapse" data-target="#inputGroupOwnerCollapse"> + <input type="checkbox" name="input[setOwner]" value="1" /> Transfer Ownership + </label> + </div> + + <div class="collapse" id="inputGroupOwnerCollapse"> + <div class="form-group has-error"> + <label class="control-label">Owner Username</label> + <input type="text" name="input[newOwner]" class="form-control" value="<?=$obj->getOwner()->name?>" /> + </div> + </div> + <?php } ?> +<?php } ?> diff --git a/app/view/common/permissions.setting.modal.view.php b/app/view/common/permissions.setting.modal.view.php new file mode 100644 index 0000000..55e4157 --- /dev/null +++ b/app/view/common/permissions.setting.modal.view.php @@ -0,0 +1,82 @@ +<?php + +/* + * SCROTT Copyright (C) 2016 Malf Furious + * + * Scrott is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Scrott is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + */ + +?> + +<?php function common_setting_permissions($mod, $obj) { ?> + <?php if ($obj->canModifyPermissions($mod->getCurrentUser())) { ?> + <label>Permissions</label> + <div class="row"> + <div class="col-md-6"> + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm0]" value="1" <?=($obj->perms & 0x100 ? "checked" : "")?> /> Members can modify + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm1]" value="1" <?=($obj->perms & 0x080 ? "checked" : "")?> /> Members can modify members + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm2]" value="1" <?=($obj->perms & 0x040 ? "checked" : "")?> /> Members can access children + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm3]" value="1" <?=($obj->perms & 0x020 ? "checked" : "")?> /> Members can create children + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm4]" value="1" <?=($obj->perms & 0x010 ? "checked" : "")?> /> Members can modify children + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm5]" value="1" <?=($obj->perms & 0x008 ? "checked" : "")?> /> Members can modify children's members + </label> + </div> + </div> + + <div class="col-md-6"> + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm6]" value="1" <?=($obj->perms & 0x004 ? "checked" : "")?> /> Public can access + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm7]" value="1" <?=($obj->perms & 0x002 ? "checked" : "")?> /> Public can access children + </label> + </div> + + <div class="checkbox"> + <label> + <input type="checkbox" name="input[perm8]" value="1" <?=($obj->perms & 0x001 ? "checked" : "")?> /> Public can create children + </label> + </div> + </div> + </div> + <?php } ?> +<?php } ?> diff --git a/app/view/common/setting.modal.view.php b/app/view/common/setting.modal.view.php index 68d3e2d..2217805 100644 --- a/app/view/common/setting.modal.view.php +++ b/app/view/common/setting.modal.view.php @@ -31,7 +31,13 @@ <div class="modal-body"> <ul class="nav nav-tabs" role="tablist"> - <li class="active"><a href="#settUserTab" aria-controls="settUserTab" data-toggle="tab"> + <?php if ($mod->common_settingShowTab['group']) { ?> + <li class="<?=$mod->getSettingModalTabActiveClass()?>"><a href="#settGroupTab" aria-controls="settGroupTab" data-toggle="tab"> + <span class="glyphicon glyphicon-th"></span> <?=$mod->group->name?> + </a></li> + <?php } ?> + + <li class="<?=$mod->getSettingModalTabActiveClass()?>"><a href="#settUserTab" aria-controls="settUserTab" data-toggle="tab"> <span class="glyphicon glyphicon-user"></span> <?=$mod->getCurrentUser()->getDisplayName()?> </a></li> @@ -42,7 +48,11 @@ </ul> <div class="tab-content"> - <div class="tab-pane fade in active" id="settUserTab"> + <?php if ($mod->common_settingShowTab['group']) { ?> + <?php include "view/common/group.setting.modal.view.php"; ?> + <?php } ?> + + <div class="tab-pane fade <?=$mod->getSettingModalTabDispClasses()?>" id="settUserTab"> <p> </p> <form method="post" action="<?=$mod->ap()?>" enctype="multipart/form-data"> diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php index 5908462..d9e0df0 100644 --- a/app/view/common/topp.view.php +++ b/app/view/common/topp.view.php @@ -20,6 +20,7 @@ <?php if ($mod->getCurrentUser()) { ?> <?php include "view/common/setting.modal.view.php"; ?> + <?php include "view/common/newgroup.modal.view.php"; ?> <?php } ?> <nav class="navbar navbar-inverse navbar-fixed-top"> @@ -39,6 +40,31 @@ <?php if (!$mod->getCurrentUser()) { ?> <p class="navbar-text navbar-right"><i>Not Logged In </i></p> <?php } else { ?> + <ul class="nav navbar-nav"> + <li><a href="<?=$mod->ap()?>"><span class="glyphicon glyphicon-refresh"></span></a></li> + + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> + <?=(isset($mod->obj) ? $mod->obj->name : "<i>Dashboard</i>")?> <span class="caret"></span> + </a> + + <ul class="dropdown-menu"> + <?php foreach ($mod->getCurrentUser()->getGroups() as $group) { ?> + <li><a href="<?=$mod->ar()?>/<?=$group->guid?>"><?=$group->name?></a></li> + <?php } ?> + </ul> + </li> + + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> + <span class="glyphicon glyphicon-plus"></span> <span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li><a href="#" data-toggle="modal" data-target="#newgroupModal">New Group</a></li> + </ul> + </li> + </ul> + <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> diff --git a/app/view/except/default.view.php b/app/view/except/default.view.php index 8738a37..01cf123 100644 --- a/app/view/except/default.view.php +++ b/app/view/except/default.view.php @@ -28,13 +28,17 @@ <?php include "view/master/topp.view.php"; ?> <div class="container"> - <div class="jumbotron"> - <h1 class="text-center">Scrott derped</h1> - <h5 class="text-center">System internals reported this:</h5> + <div class="jumbotron text-center"> + <h1>Scrott derped</h1> + <h5>System internals reported this:</h5> - <div class="well well-sm text-center text-danger"> + <div class="well well-sm text-danger"> <h3><?=$mod->message?></h3> </div> + + <a href="<?=$mod->ar()?>/" class="btn btn-primary btn-lg"> + <span class="glyphicon glyphicon-pencil"></span> Go to Scrott Dashboard + </a> </div> </div> diff --git a/app/view/obj/group.view.php b/app/view/obj/group.view.php new file mode 100644 index 0000000..dde4df1 --- /dev/null +++ b/app/view/obj/group.view.php @@ -0,0 +1,43 @@ +<!-- + * SCROTT Copyright (C) 2016 Malf Furious + * + * Scrott is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Scrott is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. +--> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?php include "view/common/head.view.php"; ?> + <title>Scrott - <?=$mod->group->name?></title> + </head> + + <body> + <?php include "view/common/topp.view.php"; ?> + + <div class="container"> + <div class="well well-lg"> + <h1><?=$mod->group->name?></h1> + <img src="<?=$mod->owner->getHeadImage()?>" alt="<?=$mod->owner->getDisplayName()?>" class="img-circle" height="50" /> + + <?php if (count($mod->members)) { ?> + <span class="glyphicon glyphicon-plus"></span> + <?php } ?> + + <?php foreach ($mod->members as $member) { ?> + <img src="<?=$member->getHeadImage()?>" alt="<?=$member->getDisplayName()?>" class="img-circle" height="50" /> + <?php } ?> + </div> + </div> + + <?php include "view/common/foot.view.php"; ?> + </body> +</html> |