Files
WorkspaceOrg/Template/workspace/index.php

67 lines
3.5 KiB
PHP
Raw Normal View History

<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) ?> (<?= count($projects) ?>)
<?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: ?>
<?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'])) ?>
</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 ?>