move select via external JS (CSP fix); rows show id/owner/config + ws counts
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<?php foreach ($groups as $workspace => $projects): ?>
|
||||
<div class="wso-group">
|
||||
<h3 class="wso-group-title">
|
||||
<?= $this->text->e($workspace) ?>
|
||||
<?= $this->text->e($workspace) ?> (<?= count($projects) ?>)
|
||||
<?php if ($workspace !== $default): ?>
|
||||
<span class="wso-group-actions">
|
||||
<?= $this->modal->medium('edit', t('Rename'), 'WorkspaceOrgController', 'edit', array('plugin' => 'WorkspaceOrg', 'name' => $workspace)) ?>
|
||||
@@ -22,27 +22,45 @@
|
||||
<?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">
|
||||
<?php foreach ($projects as $project): ?>
|
||||
<div class="wso-row">
|
||||
<div class="wso-row-main">
|
||||
<?php if ($this->user->hasProjectAccess('ProjectViewController', 'show', $project['id'])): ?>
|
||||
<span class="dropdown wso-id">
|
||||
<a href="#" class="dropdown-menu"><strong>#<?= (int) $project['id'] ?></strong> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<?= $this->url->link(t('Configure this project'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<strong class="wso-id">#<?= (int) $project['id'] ?></strong>
|
||||
<?php endif ?>
|
||||
|
||||
<span class="wso-title">
|
||||
<?= $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>
|
||||
</span>
|
||||
|
||||
<?php if (! empty($project['owner_id'])): ?>
|
||||
<span class="wso-owner"><?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?></span>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<div 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">
|
||||
<?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>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
|
||||
Reference in New Issue
Block a user