Skip to content

Commit

Permalink
Only show contact header if relevant, remove bootstrap classes
Browse files Browse the repository at this point in the history
  • Loading branch information
CatoTH committed Sep 16, 2023
1 parent 0d32347 commit 8e5c8e3
Show file tree
Hide file tree
Showing 21 changed files with 116 additions and 74 deletions.
2 changes: 1 addition & 1 deletion plugins/dbwv/assets/layout-dbwv.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/dbwv/assets/layout-dbwv.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/egp/assets/layout-egp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/egp/assets/layout-egp.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/green_layout/assets/layout-green_layout.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/green_layout/assets/layout-green_layout.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/gruen_ci/assets/layout-gruen_ci1.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/gruen_ci/assets/layout-gruen_ci1.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/gruen_ci/assets/layout-gruen_ci2.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/gruen_ci/assets/layout-gruen_ci2.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/neos/assets/layout-neos.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/neos/assets/layout-neos.css.map

Large diffs are not rendered by default.

106 changes: 52 additions & 54 deletions views/shared/create_initiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

echo '<legend class="green">' . Yii::t('motion', 'initiators_head') . '</legend>';

echo '<div class="initiatorData form-horizontal content">';
echo '<div class="initiatorData content">';

if ($allowOther) {
if ($adminMode) {
Expand All @@ -71,9 +71,9 @@

if ($settings->initiatorCanBePerson && $settings->initiatorCanBeOrganization) {
?>
<fieldset class="form-group personTypeSelector">
<legend class="col-sm-3 control-label"><?= Yii::t('initiator', 'iAmA') ?></legend>
<div class="col-sm-9">
<div class="personTypeSelector stdTwoCols">
<div class="leftColumn"><?= Yii::t('initiator', 'iAmA') ?></div>
<div class="rightColumn">
<label class="radio-inline">
<?php
echo Html::radio(
Expand All @@ -95,7 +95,7 @@
<?= Yii::t('initiator', 'personOrganization') ?>
</label>
</div>
</fieldset>
</div>
<?php
}
if ($settings->initiatorCanBePerson && !$settings->initiatorCanBeOrganization) {
Expand All @@ -107,9 +107,9 @@

if ($adminMode) {
?>
<div class="form-group initiatorCurrentUsername">
<label class="col-sm-3 control-label" for="initiatorName"><?= Yii::t('initiator', 'username') ?></label>
<div class="col-sm-6 username">
<div class="stdTwoCols initiatorCurrentUsername">
<label class="leftColumn" for="initiatorName"><?= Yii::t('initiator', 'username') ?></label>
<div class="middleColumn username">
<?php
if ($initiator->user) {
echo Html::encode($initiator->user->getAuthName());
Expand All @@ -121,8 +121,8 @@
</button>
</div>
</div>
<div class="form-group initiatorSetUsername hidden">
<label class="col-sm-3 control-label" for="initiatorName"><?= Yii::t('initiator', 'username') ?></label>
<div class="stdTwoCols initiatorSetUsername hidden">
<label class="leftColumn" for="initiatorName"><?= Yii::t('initiator', 'username') ?></label>
<?php
$loginTypes = [
'email' => Yii::t('admin', 'siteacc_add_email') . ':',
Expand All @@ -137,11 +137,11 @@
}
}
?>
<div class="col-md-3 admin-type">
<div class="middleColumn admin-type">
<input type="hidden" name="initiatorSet" value="">
<?= Html::dropDownList('initiatorSetType', $logininit, $loginTypes, ['class' => 'stdDropdown']) ?>
</div>
<div class="col-md-4">
<div class="rightColumn">
<input type="text" name="initiatorSetUsername" id="initiatorSetUsername" class="form-control"
value="<?= Html::encode($initiator->user ? $initiator->user->getAuthUsername() : '') ?>"
title="<?= Html::encode(Yii::t('admin', 'siteacc_add_name_title')) ?>">
Expand All @@ -151,12 +151,12 @@
}

?>
<div class="form-group">
<label class="col-sm-3 control-label" for="initiatorPrimaryName">
<div class="stdTwoCols">
<label class="leftColumn" for="initiatorPrimaryName">
<span class="only-person"><?= Yii::t('initiator', 'name') ?></span>
<span class="only-organization"><?= Yii::t('initiator', 'nameOrga') ?></span>
</label>
<div class="col-sm-4">
<div class="middleColumn">
<input type="text" class="form-control" id="initiatorPrimaryName" name="Initiator[primaryName]"
value="<?= Html::encode($prePrimaryName ?: '') ?>" autocomplete="name" required>
<?php
Expand All @@ -175,11 +175,11 @@
if ($settings->hasOrganizations && $settings->initiatorCanBePerson) {
$preOrga = $initiator->organization;
?>
<div class="form-group organizationRow">
<label class="col-sm-3 control-label" for="initiatorOrga">
<div class="stdTwoCols organizationRow">
<label class="leftColumn" for="initiatorOrga">
<?= Yii::t('initiator', 'orgaName') ?>
</label>
<div class="col-sm-4">
<div class="middleColumn">
<?php
if (count($selectOrganisations) > 0) {
echo Html::dropDownList('Initiator[organization]', $preOrga, $selectOrganisations, [
Expand All @@ -202,11 +202,11 @@
if ($settings->hasResolutionDate !== InitiatorForm::CONTACT_NONE && $settings->initiatorCanBeOrganization) {
$preResolution = Tools::dateSql2bootstrapdate($initiator->resolutionDate);
?>
<div class="form-group resolutionRow">
<label class="col-sm-3 control-label" for="resolutionDate">
<div class="stdTwoCols resolutionRow">
<label class="leftColumn control-label" for="resolutionDate">
<?= Yii::t('initiator', 'orgaResolution') ?>
</label>
<div class="col-sm-4">
<div class="middleColumn">
<div class="input-group date" id="resolutionDateHolder">
<input type="text" class="form-control" id="resolutionDate" name="Initiator[resolutionDate]"
value="<?= Html::encode($preResolution) ?>" data-locale="<?= Html::encode($locale) ?>">
Expand All @@ -220,9 +220,9 @@
if ($settings->contactGender !== InitiatorForm::CONTACT_NONE && $settings->initiatorCanBePerson) {
$genderChoices = array_merge(['' => ''], SupportBase::getGenderSelection());
?>
<div class="form-group genderRow">
<label class="col-sm-3 control-label" for="initiatorGender"><?= Yii::t('initiator', 'gender') ?></label>
<div class="col-sm-4">
<div class="stdTwoCols genderRow">
<label class="leftColumn" for="initiatorGender"><?= Yii::t('initiator', 'gender') ?></label>
<div class="middleColumn">
<?php
echo Html::dropDownList('Initiator[gender]', $initiator->getExtraDataEntry(ISupporter::EXTRA_DATA_FIELD_GENDER), $genderChoices, [
'id' => 'initiatorGender',
Expand All @@ -235,18 +235,16 @@
}

?>
<div class="form-group row contact-head">
<div class="col-sm-9 col-sm-offset-3 contact-head">
<h3><?= Yii::t('initiator', 'contactHead') ?></h3>
<div class="hint">(<?= Yii::t('initiator', 'visibilityAdmins') ?>)</div>
</div>
<div class="contactHead">
<h3><?= Yii::t('initiator', 'contactHead') ?></h3>
<div class="hint">(<?= Yii::t('initiator', 'visibilityAdmins') ?>)</div>
</div>

<div class="form-group contactNameRow">
<label class="col-sm-3 control-label" for="initiatorContactName">
<div class="stdTwoCols contactNameRow">
<label class="leftColumn" for="initiatorContactName">
<?= Yii::t('initiator', 'orgaContactName') ?>
</label>
<div class="col-sm-4">
<div class="middleColumn">
<input type="text" class="form-control" id="initiatorContactName" name="Initiator[contactName]"
value="<?= Html::encode($preContactName ?: '') ?>" autocomplete="name">
</div>
Expand All @@ -256,9 +254,9 @@
if ($settings->contactEmail !== InitiatorForm::CONTACT_NONE) {
$preEmail = $initiator->contactEmail;
?>
<div class="form-group emailRow">
<label class="col-sm-3 control-label" for="initiatorEmail"><?= Yii::t('initiator', 'email') ?></label>
<div class="col-sm-4">
<div class="stdTwoCols emailRow">
<label class="leftColumn control-label" for="initiatorEmail"><?= Yii::t('initiator', 'email') ?></label>
<div class="middleColumn">
<input type="text" class="form-control" id="initiatorEmail" name="Initiator[contactEmail]"
<?php
if ($settings->contactEmail === InitiatorForm::CONTACT_REQUIRED && !$adminMode) {
Expand All @@ -274,9 +272,9 @@
if ($settings->contactPhone !== InitiatorForm::CONTACT_NONE) {
$prePhone = $initiator->contactPhone;
?>
<div class="form-group phoneRow">
<label class="col-sm-3 control-label" for="initiatorPhone"><?= Yii::t('initiator', 'phone') ?></label>
<div class="col-sm-4">
<div class="stdTwoCols phoneRow">
<label class="leftColumn" for="initiatorPhone"><?= Yii::t('initiator', 'phone') ?></label>
<div class="middleColumn">
<input type="text" class="form-control" id="initiatorPhone" name="Initiator[contactPhone]"
<?php
if ($settings->contactPhone === InitiatorForm::CONTACT_REQUIRED && !$adminMode) {
Expand All @@ -290,30 +288,30 @@


$getInitiatorRow = function (ISupporter $initiator, InitiatorForm $settings) {
$str = '<div class="form-group initiatorRow">';
$str .= '<div class="col-sm-3 control-label">' . Yii::t('initiator', 'moreInitiators') . '</div>';
$str .= '<div class="col-md-4">';
$str = '<div class="initiatorRow stdTwoCols">';
$str .= '<div class="leftColumn">' . Yii::t('initiator', 'moreInitiators') . '</div>';
$str .= '<div class="rightColumn"><div class="nameCol">';
$str .= Html::textInput(
'moreInitiators[name][]',
$initiator->name,
['class' => 'form-control name', 'placeholder' => Yii::t('initiator', 'name')]
);
$str .= '</div>';
if ($settings->hasOrganizations) {
$str .= '<div class="col-md-4">';
$str .= '<div class="orgaCal">';
$str .= Html::textInput(
'moreInitiators[organization][]',
$initiator->organization,
['class' => 'form-control organization', 'placeholder' => Yii::t('initiator', 'orgaName')]
);
$str .= '</div>';
}
$str .= '<div class="col-md-1"><button type="button" class="btn btn-link rowDeleter" title="' . Html::encode(Yii::t('initiator', 'removeInitiator')) . '">';
$str .= '<div class="delRow"><button type="button" class="btn btn-link rowDeleter" title="' . Html::encode(Yii::t('initiator', 'removeInitiator')) . '">';
$str .= '<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>';
$str .= '<span class="sr-only">' . Yii::t('initiator', 'removeInitiator') . '</span>';
$str .= '</button></div>';

$str .= '</div>';
$str .= '</div></div>';

return $str;
};
Expand Down Expand Up @@ -344,16 +342,16 @@

if ($hasSupporters && !$adminMode) {
$getSupporterRow = function (ISupporter $supporter, InitiatorForm $settings) {
$str = '<div class="form-group supporterRow">';
$str .= '<div class="col-md-6">';
$str = '<div class="supporterRow">';
$str .= '<div class="nameCol">';
$str .= Html::textInput(
'supporters[name][]',
$supporter->name,
['class' => 'form-control name', 'placeholder' => Yii::t('initiator', 'name')]
);
$str .= '</div>';
if ($settings->hasOrganizations) {
$str .= '<div class="col-md-5">';
$str .= '<div class="orgaCal">';
$str .= Html::textInput(
'supporters[organization][]',
$supporter->organization,
Expand All @@ -362,7 +360,7 @@
$str .= '</div>';
}
if ($settings->allowMoreSupporters) {
$str .= '<div class="col-md-1"><button type="button" class="btn btn-link rowDeleter" title="' . Html::encode(Yii::t('initiator', 'removeSupporter')) . '">';
$str .= '<div class="delCol"><button type="button" class="btn btn-link rowDeleter" title="' . Html::encode(Yii::t('initiator', 'removeSupporter')) . '">';
$str .= '<span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>';
$str .= '<span class="sr-only">' . Yii::t('initiator', 'removeSupporter') . '</span>';
$str .= '</button></div>';
Expand All @@ -381,7 +379,7 @@
echo '<div class="supporterData form-horizontal content" ';
echo 'data-min-supporters="' . Html::encode($settings->minSupporters) . '">';

echo '<div class="form-group"><div class="col-md-3">';
echo '<div class="stdTwoCols"><div class="leftColumn">';
if ($settings->allowMoreSupporters) {
if ($settings->minSupporters > 1) {
echo str_replace('%min%', $settings->minSupporters, Yii::t('initiator', 'minSupportersX'));
Expand All @@ -395,7 +393,7 @@
}
echo '</div>';

echo '<div class="col-md-9">';
echo '<div class="rightColumn">';
foreach ($supporters as $supporter) {
echo $getSupporterRow($supporter, $settings);
}
Expand All @@ -411,14 +409,14 @@
$fullTextSyntax = Yii::t('initiator', 'fullTextSyntax');
?>
<div class="fullTextAdder"><button type="button" class="btn btn-link"><?= Yii::t('initiator', 'fullTextField') ?></button></div>
<div class="form-group hidden" id="fullTextHolder">
<div class="col-md-9">
<div class="hidden" id="fullTextHolder">
<div class="textHolder">
<textarea class="form-control" placeholder="<?= Html::encode($fullTextSyntax) ?>" rows="10"
title="<?= Html::encode(Yii::t('initiator', 'fullTextField')) ?>"></textarea>
</div>
<div class="col-md-3">
<div class="btnHolder">
<button type="button" class="btn btn-success fullTextAdd">
<span class="glyphicon glyphicon-plus"></span> <?= Yii::t('initiator', 'fullTextAdd') ?>
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?= Yii::t('initiator', 'fullTextAdd') ?>
</button>
</div>
</div>
Expand Down
41 changes: 39 additions & 2 deletions web/css/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,16 @@

#fullTextHolder {
margin-top: 30px;
display: flex;
width: 100%;

.textHolder {
width: 70%;
}
.btnHolder {
width: 30%;
text-align: right;
}
}
}

Expand All @@ -345,10 +355,18 @@
.control-label {
font-weight: bold;
}
.leftColumn {
padding-top: 18px;
}

.contact-head {
.contactHead {
margin-top: 20px;
margin-bottom: 10px;
@media screen and (min-width: $screenMinWith) {
width: 70%;
text-align: center;
}

h3 {
font-size: 18px;
margin: 0;
Expand Down Expand Up @@ -391,7 +409,6 @@
.rowDeleter, .rowDeleter:link, .rowDeleter:visited {
color: $colorDelLink;
display: inline-block;
margin-top: 8px;
}
@media (hover: hover) {
& .rowDeleter {
Expand All @@ -402,6 +419,26 @@
}
}
}
.supporterRow {
margin-bottom: 10px;
}
.initiatorRow .rightColumn, .supporterRow {
display: flex;
width: 100%;

.nameCol { // Hint: does not exist for .supporterRow
flex-basis: 65%;
flex-grow: 0;
padding-right: 10px;
}
.orgaCal {
flex-grow: 1;
}
.delCol {
flex-basis: 20px;
flex-grow: 0;
}
}
.moreInitiatorsAdder {
text-align: right;
.adderBtn {
Expand Down
2 changes: 1 addition & 1 deletion web/css/layout-classic.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/css/layout-classic.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/css/layout-dbjr.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/css/layout-dbjr.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 8e5c8e3

Please sign in to comment.