Add buttons in project overview sections
This commit is contained in:
@@ -67,7 +67,7 @@ class ProjectEdit extends Base
|
|||||||
if ($valid) {
|
if ($valid) {
|
||||||
if ($this->project->update($values)) {
|
if ($this->project->update($values)) {
|
||||||
$this->flash->success(t('Project updated successfully.'));
|
$this->flash->success(t('Project updated successfully.'));
|
||||||
$this->response->redirect($this->helper->url->to('ProjectEdit', $redirect, array('project_id' => $project['id'])));
|
$this->response->redirect($this->helper->url->to('ProjectEdit', $redirect, array('project_id' => $project['id'])), true);
|
||||||
} else {
|
} else {
|
||||||
$this->flash->failure(t('Unable to update this project.'));
|
$this->flash->failure(t('Unable to update this project.'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,18 +29,37 @@ class UrlHelper extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML Link tag
|
* Button Link Element
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $label Link label
|
* @param string $icon Font-Awesome icon
|
||||||
|
* @param string $label Link label
|
||||||
* @param string $controller Controller name
|
* @param string $controller Controller name
|
||||||
* @param string $action Action name
|
* @param string $action Action name
|
||||||
* @param array $params Url parameters
|
* @param array $params Url parameters
|
||||||
* @param boolean $csrf Add a CSRF token
|
* @param string $class CSS class attribute
|
||||||
* @param string $class CSS class attribute
|
* @return string
|
||||||
|
*/
|
||||||
|
public function button($icon, $label, $controller, $action, array $params = array(), $class = '')
|
||||||
|
{
|
||||||
|
$icon = '<i class="fa '.$icon.' fa-fw"></i> ';
|
||||||
|
$class = 'btn '.$class;
|
||||||
|
return $this->link($icon.$label, $controller, $action, $params, false, $class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Link element
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $label Link label
|
||||||
|
* @param string $controller Controller name
|
||||||
|
* @param string $action Action name
|
||||||
|
* @param array $params Url parameters
|
||||||
|
* @param boolean $csrf Add a CSRF token
|
||||||
|
* @param string $class CSS class attribute
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @param boolean $new_tab Open the link in a new tab
|
* @param boolean $new_tab Open the link in a new tab
|
||||||
* @param string $anchor Link Anchor
|
* @param string $anchor Link Anchor
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')
|
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Edit project') ?></h2>
|
<h2><?= t('Edit project') ?></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
<li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
|
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
|
||||||
<?= $this->form->csrf() ?>
|
<?= $this->form->csrf() ?>
|
||||||
<?= $this->form->hidden('id', $values) ?>
|
<?= $this->form->hidden('id', $values) ?>
|
||||||
<?= $this->form->hidden('name', $values) ?>
|
<?= $this->form->hidden('name', $values) ?>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Edit project') ?></h2>
|
<h2><?= t('Edit project') ?></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
<li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
|
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
|
||||||
<?= $this->form->csrf() ?>
|
<?= $this->form->csrf() ?>
|
||||||
<?= $this->form->hidden('id', $values) ?>
|
<?= $this->form->hidden('id', $values) ?>
|
||||||
<?= $this->form->hidden('name', $values) ?>
|
<?= $this->form->hidden('name', $values) ?>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Edit project') ?></h2>
|
<h2><?= t('Edit project') ?></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
<li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
|
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
|
||||||
<?= $this->form->csrf() ?>
|
<?= $this->form->csrf() ?>
|
||||||
<?= $this->form->hidden('id', $values) ?>
|
<?= $this->form->hidden('id', $values) ?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Edit project') ?></h2>
|
<h2><?= t('Edit project') ?></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
<li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
<li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
|
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
|
||||||
<?= $this->form->csrf() ?>
|
<?= $this->form->csrf() ?>
|
||||||
<?= $this->form->hidden('id', $values) ?>
|
<?= $this->form->hidden('id', $values) ?>
|
||||||
<?= $this->form->hidden('name', $values) ?>
|
<?= $this->form->hidden('name', $values) ?>
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="accordion-content">
|
<div class="accordion-content">
|
||||||
<?php if ($this->user->hasProjectAccess('ProjectFile', 'create', $project['id'])): ?>
|
<?php if ($this->user->hasProjectAccess('ProjectFile', 'create', $project['id'])): ?>
|
||||||
<p style="margin-bottom: 15px;">
|
<div class="buttons-header">
|
||||||
<i class="fa fa-plus fa-fw"></i>
|
<?= $this->url->button('fa-plus', t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), 'popover') ?>
|
||||||
<?= $this->url->link(t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), false, 'popover') ?>
|
</div>
|
||||||
</p>
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->render('project_overview/images', array('project' => $project, 'images' => $images)) ?>
|
<?= $this->render('project_overview/images', array('project' => $project, 'images' => $images)) ?>
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3>
|
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-content">
|
<div class="accordion-content">
|
||||||
|
<?php if ($this->user->hasProjectAccess('ProjectEdit', 'description', $project['id'])): ?>
|
||||||
|
<div class="buttons-header">
|
||||||
|
<?= $this->url->button('fa-edit', t('Edit Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), 'popover') ?>
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
<article class="markdown">
|
<article class="markdown">
|
||||||
<?= $this->text->markdown($project['description']) ?>
|
<?= $this->text->markdown($project['description']) ?>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,8 @@
|
|||||||
/* alerts */
|
/* alerts */
|
||||||
#main .alert,
|
|
||||||
.page .alert {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.alert {
|
.alert {
|
||||||
padding: 8px 35px 8px 14px;
|
padding: 8px 35px 8px 14px;
|
||||||
margin-bottom: 10px;
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
color: #c09853;
|
color: #c09853;
|
||||||
background-color: #fcf8e3;
|
background-color: #fcf8e3;
|
||||||
border: 1px solid #fbeed5;
|
border: 1px solid #fbeed5;
|
||||||
|
|||||||
@@ -1,28 +1,27 @@
|
|||||||
/* buttons */
|
/* buttons */
|
||||||
.btn {
|
.btn {
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: normal;
|
||||||
|
cursor: pointer;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
color: #333;
|
color: #333;
|
||||||
border: 1px solid #ccc;
|
background: #f5f5f5;
|
||||||
background: #efefef;
|
border: 1px solid #ddd;
|
||||||
padding: 5px;
|
|
||||||
padding-left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
padding: 3px 10px;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.btn {
|
a.btn {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-small {
|
.btn:hover {
|
||||||
padding: 2px;
|
border: 1px solid #bbb;
|
||||||
padding-left: 5px;
|
color: #000;
|
||||||
padding-right: 5px;
|
background: #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-red {
|
.btn-red {
|
||||||
@@ -31,30 +30,32 @@ a.btn {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.btn-red:hover,
|
|
||||||
.btn-red:hover,
|
.btn-red:hover,
|
||||||
.btn-red:focus {
|
.btn-red:focus {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #c53727;
|
background: #c53727;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.btn-blue,
|
|
||||||
.btn-blue {
|
.btn-blue {
|
||||||
border-color: #3079ed;
|
border-color: #3079ed;
|
||||||
background: #4d90fe;
|
background: #4d90fe;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.btn-blue:hover,
|
|
||||||
.btn-blue:hover,
|
.btn-blue:hover,
|
||||||
a.btn-blue:focus,
|
|
||||||
.btn-blue:focus {
|
.btn-blue:focus {
|
||||||
border-color: #2f5bb7;
|
border-color: #2f5bb7;
|
||||||
background: #357ae8;
|
background: #357ae8;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-blue:disabled {
|
.btn:disabled {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttons-header {
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -14,8 +14,6 @@ Popover.prototype.open = function(link) {
|
|||||||
|
|
||||||
$.get(link, function(content) {
|
$.get(link, function(content) {
|
||||||
$("body").prepend('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
|
$("body").prepend('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
|
||||||
self.app.refresh();
|
|
||||||
self.router.dispatch(this.app);
|
|
||||||
self.afterOpen();
|
self.afterOpen();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -58,6 +56,9 @@ Popover.prototype.afterOpen = function() {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var popoverForm = $("#popover-content .popover-form");
|
var popoverForm = $("#popover-content .popover-form");
|
||||||
|
|
||||||
|
self.app.refresh();
|
||||||
|
self.router.dispatch(this.app);
|
||||||
|
|
||||||
// Submit forms with Ajax request
|
// Submit forms with Ajax request
|
||||||
if (popoverForm) {
|
if (popoverForm) {
|
||||||
popoverForm.on("submit", function(e) {
|
popoverForm.on("submit", function(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user