My WorkspaceOrg main page, personal per-user project workspaces -- dashboard page, badges, CRUD + assign
This commit is contained in:
3
Template/dashboard/sidebar.php
Normal file
3
Template/dashboard/sidebar.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<li <?= $this->app->checkMenuSelection('WorkspaceOrgController', 'index') ?>>
|
||||
<?= $this->url->link(t('My workspaces'), 'WorkspaceOrgController', 'index', array('plugin' => 'WorkspaceOrg')) ?>
|
||||
</li>
|
||||
@@ -1 +0,0 @@
|
||||
<div class="skeleton-plugin-marker">Skeleton</div>
|
||||
14
Template/project/badge.php
Normal file
14
Template/project/badge.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// [Workspace] badge before a project title (dashboard overview, My projects tab, Projects list).
|
||||
// Hidden for projects in Default. Reflects the CURRENT user's personal workspace assignment.
|
||||
if (empty($project['id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$workspace = $this->WorkspaceOrgHelper->badge($project['id']);
|
||||
|
||||
if ($workspace === '') {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<span class="wso-badge" title="<?= $this->text->e(t('Workspace')) ?>">[<?= $this->text->e($workspace) ?>]</span>
|
||||
12
Template/workspace/create.php
Normal file
12
Template/workspace/create.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add workspace') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->url->href('WorkspaceOrgController', 'save', array('plugin' => 'WorkspaceOrg')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?= $this->form->label(t('Name'), 'name') ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
|
||||
<?= $this->modal->submitButtons() ?>
|
||||
</form>
|
||||
13
Template/workspace/edit.php
Normal file
13
Template/workspace/edit.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Rename workspace') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->url->href('WorkspaceOrgController', 'update', array('plugin' => 'WorkspaceOrg')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('old', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Name'), 'name') ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
|
||||
<?= $this->modal->submitButtons() ?>
|
||||
</form>
|
||||
48
Template/workspace/index.php
Normal file
48
Template/workspace/index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('My workspaces') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<?= $this->modal->medium('plus', t('Add workspace'), 'WorkspaceOrgController', 'create', array('plugin' => 'WorkspaceOrg')) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php foreach ($groups as $workspace => $projects): ?>
|
||||
<div class="wso-group">
|
||||
<h3 class="wso-group-title">
|
||||
<?= $this->text->e($workspace) ?>
|
||||
<?php if ($workspace !== $default): ?>
|
||||
<span class="wso-group-actions">
|
||||
<?= $this->modal->medium('edit', t('Rename'), 'WorkspaceOrgController', 'edit', array('plugin' => 'WorkspaceOrg', 'name' => $workspace)) ?>
|
||||
<?= $this->modal->confirm('trash-o', t('Remove'), 'WorkspaceOrgController', 'confirm', array('plugin' => 'WorkspaceOrg', 'name' => $workspace)) ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</h3>
|
||||
|
||||
<?php if (empty($projects)): ?>
|
||||
<p class="wso-empty"><?= t('(no projects yet)') ?></p>
|
||||
<?php else: ?>
|
||||
<table class="table-striped wso-table">
|
||||
<?php foreach ($projects as $project): ?>
|
||||
<tr>
|
||||
<td class="wso-project">
|
||||
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</td>
|
||||
<td class="wso-move">
|
||||
<form method="post" class="wso-move-form" action="<?= $this->url->href('WorkspaceOrgController', 'assign', array('plugin' => 'WorkspaceOrg')) ?>">
|
||||
<?= $this->form->csrf() ?>
|
||||
<input type="hidden" name="project_id" value="<?= (int) $project['id'] ?>">
|
||||
<select name="workspace" onchange="this.form.submit()">
|
||||
<?php foreach ($options as $option): ?>
|
||||
<option value="<?= $this->text->e($option) ?>"<?= $option === $workspace ? ' selected="selected"' : '' ?>><?= $this->text->e($option) ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<noscript><button type="submit" class="btn btn-blue"><?= t('Move') ?></button></noscript>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
11
Template/workspace/remove.php
Normal file
11
Template/workspace/remove.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Remove workspace') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove the workspace "%s"? Its projects will move to Default.', $name) ?>
|
||||
</p>
|
||||
|
||||
<?= $this->modal->confirmButtons('WorkspaceOrgController', 'remove', array('plugin' => 'WorkspaceOrg', 'name' => $name)) ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user