Move project templates to a subfolder

This commit is contained in:
Frédéric Guillot
2014-12-01 21:23:46 -05:00
parent 67eae33fb8
commit 50a9e2ba7d
22 changed files with 85 additions and 95 deletions

View File

@@ -0,0 +1,16 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-search fa-fw"></i><?= Helper\a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-check-square-o fa-fw"></i><?= Helper\a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<section>
<?php if ($project['is_public']): ?>
<p class="pull-right"><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></p>
<?php endif ?>
<?= Helper\template('project/events', array('events' => $events)) ?>
</section>
</section>

View File

@@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Project activation') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to disable this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Clone this project') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to duplicate this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,15 @@
<div class="page-header">
<h2><?= t('Edit project') ?></h2>
</div>
<form method="post" action="<?= Helper\u('project', 'update', array('project_id' => $values['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>

View File

@@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Project activation') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to enable this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<?php if (empty($events)): ?>
<p class="alert"><?= t('No activity.') ?></p>
<?php else: ?>
<?php foreach ($events as $event): ?>
<div class="activity-event">
<p class="activity-datetime">
<?php if (Helper\contains($event['event_name'], 'subtask')): ?>
<i class="fa fa-tasks"></i>
<?php elseif (Helper\contains($event['event_name'], 'task')): ?>
<i class="fa fa-newspaper-o"></i>
<?php elseif (Helper\contains($event['event_name'], 'comment')): ?>
<i class="fa fa-comments-o"></i>
<?php endif ?>
&nbsp;<?= dt('%B %e, %Y at %k:%M %p', $event['date_creation']) ?>
</p>
<div class="activity-content"><?= $event['event_content'] ?></div>
</div>
<?php endforeach ?>
<?php endif ?>

View File

@@ -0,0 +1,27 @@
<?= '<?xml version="1.0" encoding="utf-8"?>' ?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
<title><?= t('%s\'s activity', $project['name']) ?></title>
<link rel="alternate" type="text/html" href="<?= Helper\get_current_base_url() ?>"/>
<link rel="self" type="application/atom+xml" href="<?= Helper\get_current_base_url().Helper\u('project', 'feed', array('token' => $project['token'])) ?>"/>
<updated><?= date(DATE_ATOM) ?></updated>
<id><?= Helper\get_current_base_url() ?></id>
<icon><?= Helper\get_current_base_url() ?>assets/img/favicon.png</icon>
<?php foreach ($events as $e): ?>
<entry>
<title type="text"><?= $e['event_title'] ?></title>
<link rel="alternate" href="<?= Helper\get_current_base_url().Helper\u('task', 'show', array('task_id' => $e['task_id'])) ?>"/>
<id><?= $e['id'].'-'.$e['event_name'].'-'.$e['task_id'].'-'.$e['date_creation'] ?></id>
<published><?= date(DATE_ATOM, $e['date_creation']) ?></published>
<updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated>
<author>
<name><?= Helper\escape($e['author']) ?></name>
</author>
<content type="html">
<![CDATA[
<?= $e['event_content'] ?>
]]>
</content>
</entry>
<?php endforeach ?>
</feed>

View File

@@ -0,0 +1,48 @@
<section id="main">
<div class="page-header">
<ul>
<?php if (Helper\is_admin()): ?>
<li><i class="fa fa-plus fa-fw"></i><?= Helper\a(t('New project'), 'project', 'create') ?></li>
<?php endif ?>
<li><i class="fa fa-lock fa-fw"></i><?= Helper\a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
</ul>
</div>
<section>
<?php if (empty($active_projects) && empty($inactive_projects)): ?>
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
<?php if (! empty($active_projects)): ?>
<h3><?= t('Active projects') ?></h3>
<ul class="project-listing">
<?php foreach ($active_projects as $project): ?>
<li>
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw"></i>
<?php endif ?>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock fa-fw"></i>
<?php endif ?>
<?= Helper\a(Helper\escape($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if (! empty($inactive_projects)): ?>
<h3><?= t('Inactive projects') ?></h3>
<ul class="project-listing">
<?php foreach ($inactive_projects as $project): ?>
<li>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock"></i>
<?php endif ?>
<?= Helper\a(Helper\escape($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php endif ?>
</section>
</section>

View File

@@ -0,0 +1,16 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-folder fa-fw"></i><?= Helper\a(t('All projects'), 'project', 'index') ?></li>
</ul>
</div>
<section class="sidebar-container" id="project-section">
<?= Helper\template('project/sidebar', array('project' => $project)) ?>
<div class="sidebar-content">
<?= $project_content_for_layout ?>
</div>
</section>
</section>

View File

@@ -0,0 +1,21 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-folder fa-fw"></i><?= Helper\a(t('All projects'), 'project', 'index') ?></li>
</ul>
</div>
<section>
<form method="post" action="<?= Helper\u('project', 'save') ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('is_private', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus', 'required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'index') ?>
</div>
</form>
</section>
</section>

View File

@@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Remove project') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-check-square-o fa-fw"></i><?= Helper\a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-dashboard fa-fw"></i><?= Helper\a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<section>
<form method="get" action="?" autocomplete="off">
<?= Helper\form_hidden('controller', $values) ?>
<?= Helper\form_hidden('action', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?>
<input type="submit" value="<?= t('Search') ?>" class="btn btn-blue"/>
</form>
<?php if (empty($tasks) && ! empty($values['search'])): ?>
<p class="alert"><?= t('Nothing found.') ?></p>
<?php elseif (! empty($tasks)): ?>
<?= Helper\template('task_table', array(
'tasks' => $tasks,
'categories' => $categories,
'columns' => $columns,
'pagination' => $pagination,
)) ?>
<?php endif ?>
</section>
</section>

View File

@@ -0,0 +1,19 @@
<div class="page-header">
<h2><?= t('Public access') ?></h2>
</div>
<?php if ($project['is_public']): ?>
<div class="listing">
<ul class="no-bullet">
<li><strong><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token'])) ?></strong></li>
<li><strong><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></strong></li>
</ul>
<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('board', 'readonly', array('token' => $project['token'])) ?>"/>
</div>
<?= Helper\a(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?>
<?php else: ?>
<?= Helper\a(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?>
<?php endif ?>

View File

@@ -0,0 +1,66 @@
<div class="page-header">
<h2><?= t('Summary') ?></h2>
</div>
<ul class="listing">
<li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
<?php if ($project['is_private']): ?>
<li><i class="fa fa-lock"></i> <?= t('This project is private') ?></li>
<?php endif ?>
<?php if ($project['is_public']): ?>
<li><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token'])) ?></li>
<li><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></li>
<?php else: ?>
<li><?= t('Public access disabled') ?></li>
<?php endif ?>
<?php if ($project['last_modified']): ?>
<li><?= dt('Last modified on %B %e, %Y at %k:%M %p', $project['last_modified']) ?></li>
<?php endif ?>
<?php if ($stats['nb_tasks'] > 0): ?>
<?php if ($stats['nb_active_tasks'] > 0): ?>
<li><?= Helper\a(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<?php endif ?>
<?php if ($stats['nb_inactive_tasks'] > 0): ?>
<li><?= Helper\a(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
<?php endif ?>
<li><?= t('%d tasks in total', $stats['nb_tasks']) ?></li>
<?php else: ?>
<li><?= t('No task for this project') ?></li>
<?php endif ?>
</ul>
<div class="page-header">
<h2><?= t('Board') ?></h2>
</div>
<table class="table-stripped">
<tr>
<th width="50%"><?= t('Column') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Active tasks') ?></th>
</tr>
<?php foreach ($stats['columns'] as $column): ?>
<tr>
<td><?= Helper\escape($column['title']) ?></td>
<td><?= $column['task_limit'] ?: '∞' ?></td>
<td><?= $column['nb_active_tasks'] ?></td>
</tr>
<?php endforeach ?>
</table>
<?php if (Helper\is_admin()): ?>
<div class="page-header">
<h2><?= t('Integration') ?></h2>
</div>
<h3><i class="fa fa-github fa-fw"></i><?= t('Github webhook') ?></h3>
<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/github-webhooks" target="_blank"><?= t('Help on Github webhook') ?></a></p>
<?php endif ?>

View File

@@ -0,0 +1,56 @@
<div class="sidebar">
<h2><?= t('Actions') ?></h2>
<ul>
<li>
<?= Helper\a(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if (Helper\is_admin() || $project['is_private']): ?>
<li>
<?= Helper\a(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
</li>
<li>
<?= Helper\a(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?>
</li>
<li>
<?= Helper\a(t('Edit board'), 'board', 'edit', array('project_id' => $project['id'])) ?>
</li>
<li>
<?= Helper\a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php if (Helper\is_admin()): ?>
<li>
<?= Helper\a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
<li>
<?= Helper\a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?>
</li>
<li>
<?= Helper\a(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id']), true) ?>
</li>
<li>
<?php if ($project['is_active']): ?>
<?= Helper\a(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?>
<?php else: ?>
<?= Helper\a(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?>
<?php endif ?>
</li>
<li>
<?= Helper\a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
</ul>
<?php if (Helper\is_admin() || $project['is_private']): ?>
<h2><?= t('Exports') ?></h2>
<ul>
<li>
<?= Helper\a(t('Tasks'), 'project', 'exportTasks', array('project_id' => $project['id'])) ?>
</li>
<li>
<?= Helper\a(t('Daily project summary'), 'project', 'exportDailyProjectSummary', array('project_id' => $project['id'])) ?>
</li>
</li>
<?php endif ?>
</div>

View File

@@ -0,0 +1,21 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-search fa-fw"></i><?= Helper\a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?></li>
<li><i class="fa fa-dashboard fa-fw"></i><?= Helper\a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<section>
<?php if (empty($tasks)): ?>
<p class="alert"><?= t('No task') ?></p>
<?php else: ?>
<?= Helper\template('task_table', array(
'tasks' => $tasks,
'categories' => $categories,
'columns' => $columns,
'pagination' => $pagination,
)) ?>
<?php endif ?>
</section>
</section>

View File

@@ -0,0 +1,59 @@
<div class="page-header">
<h2><?= t('List of authorized users') ?></h2>
</div>
<?php if ($project['is_everybody_allowed']): ?>
<div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
<?php else: ?>
<?php if (empty($users['allowed'])): ?>
<div class="alert alert-error"><?= t('Nobody have access to this project.') ?></div>
<?php else: ?>
<div class="alert alert-info">
<p><?= t('Only those users have access to this project:') ?></p>
<ul>
<?php foreach ($users['allowed'] as $user_id => $username): ?>
<li>
<strong><?= Helper\escape($username) ?></strong>
<?php if ($project['is_private'] == 0): ?>
(<?= Helper\a(t('revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?>)
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
<p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
</div>
<?php endif ?>
<?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?>
<hr/>
<form method="post" action="<?= Helper\u('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
<?= Helper\form_label(t('User'), 'user_id') ?>
<?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
</div>
</form>
<?php endif ?>
<?php endif ?>
<?php if ($project['is_private'] == 0): ?>
<hr/>
<form method="post" action="<?= Helper\u('project', 'allowEverybody', array('project_id' => $project['id'])) ?>">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', array('id' => $project['id'])) ?>
<?= Helper\form_checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
<?php endif ?>