My WorkspaceOrg main page, personal per-user project workspaces -- dashboard page, badges, CRUD + assign

This commit is contained in:
2026-07-12 21:54:03 -03:00
parent 52355428c4
commit 5728cf37b2
14 changed files with 638 additions and 67 deletions

View 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>

View 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>

View 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 ?>

View 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>