summaryrefslogtreecommitdiffstats
path: root/app/view
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-09-08 08:08:22 -0400
committerMalf Furious <m@lfurio.us>2018-09-08 08:08:22 -0400
commit54782f88a2987ef2d0a5a530cfd0f027c38be396 (patch)
treed808e1bfc65437ac7de95cfbf0b8b2687273952e /app/view
parent5aa9a93c6e399d2a1d91c408502b9b5a191f61c5 (diff)
downloadscrott-54782f88a2987ef2d0a5a530cfd0f027c38be396.tar.gz
scrott-54782f88a2987ef2d0a5a530cfd0f027c38be396.zip
Add 'New Pad' modal
Diffstat (limited to 'app/view')
-rw-r--r--app/view/datamods.php55
-rw-r--r--app/view/stdpage.php7
2 files changed, 61 insertions, 1 deletions
diff --git a/app/view/datamods.php b/app/view/datamods.php
index e27404c..e700043 100644
--- a/app/view/datamods.php
+++ b/app/view/datamods.php
@@ -64,3 +64,58 @@ require_once "class/user.class.php";
</div>
<?php } ?>
+<?php function newPad() : void { ?>
+
+ <div id="newPadModal" 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">&times;</span>
+ </button>
+
+ <h4 class="modal-title">
+ <span class="glyphicon glyphicon-edit"></span> Create new Pad
+ </h4>
+ </div>
+
+ <div class="modal-body">
+ <form method="post" action="<?=ap()?>">
+ <?=\formctrl\formname( "dm-pad-add" )?>
+
+ <div class="form-group">
+ <label>Owner</label>
+
+ <select name="input[owner]" class="form-control selectpicker">
+ <optgroup label="Users">
+ <option data-icon="glyphicon-user" value="<?=\user::getCurrent()->guid?>">
+ <?=\user::getCurrent()->getDisplayName()?>
+ </option>
+ </optgroup>
+
+ <optgroup label="Groups">
+ <?php foreach (\user::getCurrent()->getGroups_ordByOwnByName() as $g) { ?>
+ <?php if (\user::getCurrent()->canCreateSub($g)) { ?>
+ <option data-icon="glyphicon-th" value="<?=$g->guid?>">
+ <?=$g->getDisplayName()?>
+ </option>
+ <?php } ?>
+ <?php } ?>
+ </optgroup>
+ </select>
+ </div>
+
+ <?=\formctrl\text( "Pad Name", "name" )?>
+
+ <button type="submit" class="btn btn-success pull-right">
+ <span class="glyphicon glyphicon-plus"></span> Add
+ </button>
+
+ <p>&nbsp;</p>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+
+<?php } ?>
diff --git a/app/view/stdpage.php b/app/view/stdpage.php
index 478c414..1629dbf 100644
--- a/app/view/stdpage.php
+++ b/app/view/stdpage.php
@@ -164,7 +164,11 @@ require_once "view/datamods.php";
<?php function nav() : void { ?>
<?=about()?>
- <?=\datamods\newGroup()?>
+
+ <?php if (\user::getCurrent()) { ?>
+ <?=\datamods\newGroup()?>
+ <?=\datamods\newPad()?>
+ <?php } ?>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
@@ -208,6 +212,7 @@ require_once "view/datamods.php";
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#newGroupModal">New Group</a></li>
+ <li><a href="#" data-toggle="modal" data-target="#newPadModal">New Pad</a></li>
</ul>
</li>
</ul>