Skip to content

Commit

Permalink
hide not necessary stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed Jan 22, 2019
1 parent 7186c00 commit d9760ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
36 changes: 34 additions & 2 deletions pages/property.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,18 +671,50 @@ function object_type_changer(value) {
$("dl[id='form[parking_type]']").hide();
};

// If engery pass is not necessary
// If engery pass an other stuff is is not necessary for "grundstueck" and
if (value === "grundstueck" || value === "parken") {
$("select[name='form[energy_pass]']").removeAttr('required');
$("input[name='form[energy_consumption]']").removeAttr('required');
$("input[name='form[energy_pass_valid_until]']").removeAttr('required');
$("dl[id='form[energy_pass]']").parent().parent().hide();
$("dl[id='form[flat_sharing_possible]']").parent().parent().hide();
$("dl[id='form[floor]']").slideUp();
$("dl[id='form[living_area]']").slideUp();
$("dl[id='form[total_area]']").slideUp();
$("dl[id='form[rooms]']").slideUp();
$("dl[id='form[parking_space_duplex]']").slideUp();
$("dl[id='form[parking_space_simple]']").slideUp();
$("dl[id='form[parking_space_garage]']").slideUp();
$("dl[id='form[parking_space_undergroundcarpark]']").slideUp();
$("dl[id='form[animals]']").slideUp();
if (value === "grundstueck") {
$("dl[id='form[construction_year]']").slideUp();
}
if (value === "parken") {
$("dl[id='form[land_area]']").slideUp();
}
}
else {
$("select[name='form[energy_pass]']").prop('required', true);
$("input[name='form[energy_consumption]']").prop('required', true);
$("input[name='form[energy_pass_valid_until]']").prop('required', true);
$("dl[id='form[energy_pass]']").parent().parent().fadeIn();
$("dl[id='form[flat_sharing_possible]']").parent().parent().fadeIn();
$("dl[id='form[floor]']").slideDown();
$("dl[id='form[living_area]']").slideDown();
$("dl[id='form[total_area]']").slideDown();
$("dl[id='form[rooms]']").slideDown();
$("dl[id='form[parking_space_duplex]']").slideDown();
$("dl[id='form[parking_space_simple]']").slideDown();
$("dl[id='form[parking_space_garage]']").slideDown();
$("dl[id='form[parking_space_undergroundcarpark]']").slideDown();
$("dl[id='form[animals]']").slideDown();
if (value === "grundstueck") {
$("dl[id='form[construction_year]']").slideDown();
}
if (value === "parken") {
$("dl[id='form[land_area]']").slideDown();
}
}
}

Expand Down Expand Up @@ -712,7 +744,7 @@ function market_type_changer(value) {
$("dl[id='form[rent_plus_vat]']").fadeIn();
$("dl[id='form[deposit]']").fadeIn();
$("input[name='form[deposit]']").prop('required', true);
};
}
}

// Hide on document load
Expand Down
1 change: 1 addition & 0 deletions pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<h2>Changelog</h2>
<p>1.0.9-DEV:</p>
<ul>
<li>Für Objektart Grundstück und Parken werden nicht benötigte Felder im Backend ausgeblendet.</li>
<li>Sprachdetails werden ausgeblendet, wenn Speicherung der Sprache nicht vorgesehen ist.</li>
<li>Bugfix: Prioritäten wurden beim Löschen nicht reorganisiert.</li>
<li>Bugfix OpenImmo Export: Kaltmiete wurde nicht übermittelt.</li>
Expand Down

0 comments on commit d9760ec

Please sign in to comment.