Skip to content

Commit

Permalink
hide tickets from profile if not active (#1115)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Staněk <[email protected]>
  • Loading branch information
jan-stanek and Jan Staněk authored Nov 21, 2023
1 parent 068ba88 commit c71c335
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 0 additions & 5 deletions app/Model/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ class Settings
*/
public const ACCOUNTANT = 'accountant';

/**
* Místo vystavení dokladu.
*/
public const PRINT_LOCATION = 'print_location';

/**
* Číslo účtu.
*/
Expand Down
2 changes: 2 additions & 0 deletions app/WebModule/Presenters/ProfilePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Model\Enums\PaymentType;
use App\Model\Settings\Exceptions\SettingsItemNotFoundException;
use App\Model\Settings\Queries\SettingDateTimeValueQuery;
use App\Model\Settings\Queries\SettingStringValueQuery;
use App\Model\Settings\Settings;
use App\Model\Structure\Repositories\SubeventRepository;
Expand Down Expand Up @@ -84,6 +85,7 @@ public function renderDefault(): void
$this->template->isAllowedEditCustomInputs = $this->applicationService->isAllowedEditCustomInputs();
$this->template->userPrograms = $this->queryBus->handle(new UserAttendsProgramsQuery($this->dbUser));
$this->template->accountNumber = $this->queryBus->handle(new SettingStringValueQuery(Settings::ACCOUNT_NUMBER));
$this->template->ticketsActive = $this->queryBus->handle(new SettingDateTimeValueQuery(Settings::TICKETS_FROM)) !== null;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions app/WebModule/Presenters/templates/Profile/default.latte
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@
</div>
</div>

<legend>{_web.profile.seminar.ticket.heading}</legend>
{control ticket}
{if $ticketsActive}
<legend>{_web.profile.seminar.ticket.heading}</legend>
{control ticket}
{/if}
</div>
</div>
</div>
Expand Down

0 comments on commit c71c335

Please sign in to comment.