Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Updated UI form for create Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
githubjeka committed Jul 2, 2019
1 parent 796dcf2 commit cb29b69
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 98 deletions.
5 changes: 4 additions & 1 deletion views/issue/__item_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<?= StatusIssueWidget::widget(['status' => $issue->status]) ?>
</div>
<h5 class="panel-title">
<?= Html::a(Html::tag('strong', Html::encode($issue->title)), $issue->content->getUrl()) ?>
<?= Html::a(
Html::tag('strong', $issue->title ? Html::encode($issue->title) : "#$issue->id"),
$issue->content->getUrl()
) ?>
</h5>
</div>
<div class="panel-body">
Expand Down
2 changes: 1 addition & 1 deletion views/issue/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
?>

<div class="modal-dialog modal-dialog-normal animated fadeIn" data-backdrop="static">
<div class="modal-dialog modal-dialog-large animated fadeIn" data-backdrop="static">
<div class="modal-content">

<div class="modal-header">
Expand Down
221 changes: 127 additions & 94 deletions views/issue/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @var boolean $submitAjax
*/

use tracker\models\Issue;
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;

Expand All @@ -27,36 +28,103 @@
<?= $form->field($issueForm, 'cancelFinish')->checkbox(); ?>
<?php else : ?>
<div class="row">
<div class="col-md-6">
<?= $form->field($issueForm, 'visibility')
->dropDownList(\tracker\enum\ContentVisibilityEnum::getList()); ?>
</div>
<div class="col-md-6">
<?= $form->field($issueForm, 'priority')
->dropDownList(\tracker\enum\IssuePriorityEnum::getList()); ?>
<div class="col-md-8">

<?= $form->field($issueForm, 'title')
->textInput([
'id' => 'itemTask',
'class' => 'form-control input-lg',
'maxlength' => true,
'placeholder' => Yii::t('TrackerIssuesModule.views', 'What is to do?'),
]); ?>

<?= $form->field($issueForm, 'description')
->widget(
\humhub\modules\content\widgets\richtext\RichTextField::class,
[
'id' => 'issue_description_' . $issueForm->id,
'placeholder' => Yii::t('TrackerIssuesModule.views', 'More details, please...'),
])
->label(true) ?>

<hr>

<div class="row">
<div class="col-md-6">

<div>
<strong><?= Yii::t('TrackerIssuesModule.views', 'Started Date') ?></strong>
<small class="help-block">
<?= Yii::t('TrackerIssuesModule.views', 'From this time recommended begin to start work'); ?>
</small>
<hr>

<div class="row">
<div class="col-md-12">
<?= $form->field($issueForm, 'constantly')->checkbox() ?>
</div>
</div>

<div class="form-group">
<?= $form->field($issueForm, 'startedDate')
->widget(yii\jui\DatePicker::className(), [
'dateFormat' => 'php:Y-m-d',
'clientOptions' => [],
'options' => [
'class' => 'form-control',
'placeholder' => Yii::t('TrackerIssuesModule.views', 'Date'),
],
])->label(false); ?>
</div>

<div class="form-group">
<?= $form->field($issueForm, 'startedTime')->input('time')->label(false); ?>
</div>
</div>
</div>

<div class="col-md-6">
<div>
<strong><?= Yii::t('TrackerIssuesModule.views', 'Deadline') ?></strong>
<small class="help-block">
<?= Yii::t('TrackerIssuesModule.views', 'The planned time by which you should end work.'); ?>
</small>

<button type="button" class="btn btn-link btn-sm"
onclick="$('#issuerequest-deadlinedate').datepicker('setDate', null);$('#issuerequest-deadlinetime').val('');">
<?= Yii::t('TrackerIssuesModule.views', 'Has not deadline') ?>
</button>

<hr>
<div class="form-group">
<?= $form->field($issueForm, 'deadlineDate')
->widget(yii\jui\DatePicker::className(), [
'dateFormat' => 'php:Y-m-d',
'clientOptions' => [],
'options' => [
'class' => 'form-control',
'placeholder' => Yii::t('TrackerIssuesModule.views', 'Date'),
],
])->label(false); ?>
</div>

<div class="form-group">
<?= $form->field($issueForm, 'deadlineTime')->input('time')->label(false); ?>
</div>

</div>
</div>

</div>
</div>
</div>

<?= $form->field($issueForm, 'title')
->textInput([
'id' => 'itemTask',
'class' => 'form-control',
'maxlength' => true,
'placeholder' => Yii::t('TrackerIssuesModule.views', 'What is to do?'),
]); ?>

<?= $form->field($issueForm, 'description')
->widget(
\humhub\modules\content\widgets\richtext\RichTextField::class,
[
'id' => 'issue_description_' . $issueForm->id,
'placeholder' => Yii::t('TrackerIssuesModule.views', 'More details, please...'),
])
->label(true) ?>
<div class="col-md-4">

<div class="row">
<?= $form->field($issueForm, 'visibility')
->dropDownList(\tracker\enum\ContentVisibilityEnum::getList()); ?>

<div class="col-md-8">
<?= $form->field($issueForm, 'priority')
->dropDownList(\tracker\enum\IssuePriorityEnum::getList()); ?>

<?php if ($isSpace) : ?>
<?= $form->field($issueForm, 'assignedUsers')
Expand All @@ -68,6 +136,38 @@
); ?>
<?php endif; ?>

<hr>

<h4><?= Yii::t('AdminModule.base', 'Files') ?></h4>

<div class="row">
<div class="col-md-2">
<div id="post_upload_progress_<?= $issueForm->id ?>" style="display:none;margin:10px 0px;"></div>
<?=
\humhub\modules\file\widgets\UploadButton::widget([
'id' => 'post_upload_' . $issueForm->id,
'model' => new Issue,
'dropZone' => '#post_edit_' . $issueForm->id . ':parent',
'preview' => '#post_upload_preview_' . $issueForm->id,
'progress' => '#post_upload_progress_' . $issueForm->id,
'max' => Yii::$app->getModule('content')->maxAttachedFiles,
])
?>
</div>
<div class="col-md-10">
<?=
\humhub\modules\file\widgets\FilePreview::widget([
'id' => 'post_upload_preview_' . $issueForm->id,
'options' => ['style' => 'margin-top:10px'],
'model' => ($issue = Issue::findOne($issueForm->id)) !== null ? $issue : new Issue,
'edit' => true,
])
?>
</div>
</div>

<hr>

<?= $form->field($issueForm, 'tags')
->dropDownList(
\yii\helpers\ArrayHelper::map(
Expand All @@ -79,77 +179,10 @@
),
['text' => 'Please select', 'multiple' => true]
); ?>
</div>
</div>

<div class="row">
<div class="col-md-12">
<?= $form->field($issueForm, 'constantly')->checkbox() ?>
</div>
</div>

<div class="row">
<div class="col-md-6">

<div>
<strong><?= Yii::t('TrackerIssuesModule.views', 'Started Date') ?></strong>
<small class="help-block">
<?= Yii::t('TrackerIssuesModule.views', 'From this time recommended begin to start work'); ?>
</small>
<hr>

<div class="form-group">
<?= $form->field($issueForm, 'startedDate')
->widget(yii\jui\DatePicker::className(), [
'dateFormat' => 'php:Y-m-d',
'clientOptions' => [],
'options' => [
'class' => 'form-control',
'placeholder' => Yii::t('TrackerIssuesModule.views', 'Date'),
],
])->label(false); ?>
</div>

<div class="form-group">
<?= $form->field($issueForm, 'startedTime')->input('time')->label(false); ?>
</div>
</div>
</div>

<div class="col-md-6">
<div>
<strong><?= Yii::t('TrackerIssuesModule.views', 'Deadline') ?></strong>
<small class="help-block">
<?= Yii::t('TrackerIssuesModule.views', 'The planned time by which you should end work.'); ?>
</small>

<button type="button" class="btn btn-link btn-sm"
onclick="$('#issuerequest-deadlinedate').datepicker('setDate', null);$('#issuerequest-deadlinetime').val('');">
<?= Yii::t('TrackerIssuesModule.views', 'Has not deadline') ?>
</button>

<hr>
<div class="form-group">
<?= $form->field($issueForm, 'deadlineDate')
->widget(yii\jui\DatePicker::className(), [
'dateFormat' => 'php:Y-m-d',
'clientOptions' => [],
'options' => [
'class' => 'form-control',
'placeholder' => Yii::t('TrackerIssuesModule.views', 'Date'),
],
])->label(false); ?>
</div>

<div class="form-group">
<?= $form->field($issueForm, 'deadlineTime')->input('time')->label(false); ?>
</div>

</div>
</div>

</div>

<?php endif ?>

<div class="row">
Expand All @@ -158,7 +191,7 @@
<?= $form->field($issueForm, 'notifyAssignors')->checkbox() ?>
<?php endif; ?>

<button type="submit" class="btn btn-block btn-primary btn-sm"
<button type="submit" class="btn btn-block btn-primary"
<?php if ($submitAjax) : ?>
data-ui-loader
data-action-click="editSubmit"
Expand Down
2 changes: 1 addition & 1 deletion views/issue/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$formatter = Yii::$app->formatter;
?>

<div class="issue" id="issue_<?php echo $issue->id; ?>">
<div class="issue" id="issue_<?= $issue->id; ?>">

<div class="row">
<div class="col-md-8">
Expand Down
4 changes: 3 additions & 1 deletion widgets/views/wallEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@

<div class="stream-entry-addons clearfix">
<?php if ($canViewIssue) : ?>
<?= \humhub\modules\content\widgets\WallEntryAddons::widget(['object' => $object]); ?>
<?= \humhub\modules\content\widgets\WallEntryAddons::widget([
'object' => $object,
]); ?>
<?php endif; ?>
</div>
</div>
Expand Down

0 comments on commit cb29b69

Please sign in to comment.