Skip to content

Commit

Permalink
Prepare 1.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
luke- committed Oct 30, 2020
1 parent a8563b7 commit 624ff6e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

1.0.0 (Unreleased)
1.0.0 (November 30, 2020)
---------------------
- Enh #71: Wall Stream Layout Migration (HumHub 1.7+)
- Enh: Rename the attribute "Question" to "Description"
Expand Down
41 changes: 21 additions & 20 deletions views/poll/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
$disabled = ($poll->closed) ? 'disabled="disabled"' : '';
?>

<div data-poll="<?= $poll->id ?>" data-content-component="polls.Poll" data-content-key="<?= $poll->content->id ?>" class="content_edit" id="poll_edit_<?= $poll->id; ?>">
<div class="alert alert-danger" role="alert" style="display:none">
<div data-poll="<?= $poll->id ?>" data-content-component="polls.Poll" data-content-key="<?= $poll->content->id ?>"
class="content_edit" id="poll_edit_<?= $poll->id; ?>">
<div class="alert alert-danger" role="alert" style="display:none">
<span class="errorMessage"></span>
</div>

<?php $form = ActiveForm::begin(); ?>

<?= $form->field($poll,'question')->textInput($poll->closed ? ['disabled' => 'disabled'] : []) ?>
<?= $form->field($poll, 'question')->textInput($poll->closed ? ['disabled' => 'disabled'] : []) ?>

<?= $form->field($poll, 'description')->widget(RichTextField::class, ['disabled' => $poll->closed, 'placeholder' => Yii::t('PollsModule.widgets_views_pollForm', 'Edit your poll question...')]) ?>

<div class="contentForm_options">
<?= Html::activeLabel($poll, 'answersText', ['class' => 'control-label']); ?>
<?php foreach ($poll->answers as $answer) :?>
<?= Html::activeLabel($poll, 'answersText', ['label' => Yii::t('PollsModule.base', 'Answers'), 'class' => 'control-label']); ?>
<?php foreach ($poll->answers as $answer) : ?>
<div class="form-group">
<div class="input-group">
<input type="text" name="answers[<?= $answer->id ?>]" <?= $disabled ?>
title="<?= count($answer->votes) . ' ' . Yii::t('PollsModule.widgets_views_entry', 'votes') ?>"
title="<?= count($answer->votes) . ' ' . Yii::t('PollsModule.widgets_views_entry', 'votes') ?>"
value="<?= Html::encode($answer->answer) ?>"
class="form-control tt poll_answer_old_input"
placeholder="<?= Yii::t('PollsModule.widgets_views_pollForm', "Edit answer (empty answers will be removed)...") ?>"/>
Expand All @@ -40,28 +41,28 @@ class="form-control tt poll_answer_old_input"

<?php if (!$poll->closed) : ?>
<?= AddAnswerInput::widget(['name' => 'newAnswers[]', 'showTitle' => true]); ?>
<?php endif; ?>
<?php endif; ?>


<?= $form->field($poll, 'is_random')->checkbox(['id' => 'edit_poll_is_random_' . $poll->id]) ?>


<?= $form->field($poll, 'is_random')->checkbox(['id' => 'edit_poll_is_random_'.$poll->id]) ?>

<?php if (!$poll->anonymous) : ?>
<?= $form->field($poll, 'anonymous')->checkbox(['id' => 'edit_poll_anonymous'.$poll->id]) ?>
<?= $form->field($poll, 'anonymous')->checkbox(['id' => 'edit_poll_anonymous' . $poll->id]) ?>
<?php endif; ?>

<?= $form->field($poll, 'show_result_after_close')->checkbox(['id' => 'edit_poll_show_result_after_close'.$poll->id]) ?>
<?= $form->field($poll, 'show_result_after_close')->checkbox(['id' => 'edit_poll_show_result_after_close' . $poll->id]) ?>

</div>
<a href="#" class="btn btn-primary"
data-action-click="editSubmit" data-action-submit

<a href="#" class="btn btn-primary"
data-action-click="editSubmit" data-action-submit
data-action-url="<?= $poll->content->container->createUrl('/polls/poll/edit', ['id' => $poll->id]) ?>"
data-ui-loader>
<?= Yii::t('PollsModule.base', "Save") ?>
</a>
<a href="#" class="btn btn-danger"
data-action-click="editCancel"

<a href="#" class="btn btn-danger"
data-action-click="editCancel"
data-action-url="<?= $poll->content->container->createUrl('/polls/poll/reload', ['id' => $poll->id]) ?>"
data-ui-loader>
<?= Yii::t('PollsModule.base', "Cancel") ?>
Expand Down
6 changes: 3 additions & 3 deletions widgets/views/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use humhub\modules\polls\widgets\AddAnswerInput;
use yii\bootstrap\Html;

/** @var $model \yii\base\Model **/
/** @var $model \yii\base\Model * */

PollsAsset::register($this);

?>

<?= Html::activeTextInput($model,'question', [
<?= Html::activeTextInput($model, 'question', [
'placeholder' => Yii::t('PollsModule.widgets_views_pollForm', 'Question'),
'class' => 'form-control',
]) ?>
Expand All @@ -23,7 +23,7 @@
'options' => ['style' => 'margin:20px 0 15px'],
]); ?>

<?= Html::activeLabel($model, 'answersText', ['class' => 'control-label']); ?>
<?= Html::activeLabel($model, 'answersText', ['label' => Yii::t('PollsModule.base', 'Answers'), 'class' => 'control-label']); ?>
<?= AddAnswerInput::widget(['name' => 'newAnswers[]', 'showTitle' => false]); ?>

<div class="row">
Expand Down

0 comments on commit 624ff6e

Please sign in to comment.