Skip to content

Commit

Permalink
Merge pull request #359 from jan-stanek/informacni-text
Browse files Browse the repository at this point in the history
informacni text pri nezaplaceni
  • Loading branch information
Jan Staněk authored Oct 9, 2017
2 parents fa269f0 + b80b7d2 commit 2c738f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/WebModule/components/ProgramsContentControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public function render($content)
$template->guestRole = $user->isInRole($this->roleRepository->findBySystemName(Role::GUEST)->getName());

$template->userHasPermission = $user->isAllowed(Resource::PROGRAM, Permission::CHOOSE_PROGRAMS);
$template->userWaitingForPayment = !$this->settingsRepository->getValue(Settings::IS_ALLOWED_REGISTER_PROGRAMS_BEFORE_PAYMENT)
&& $this->userRepository->findById($user->getId())->getWaitingForPaymentApplications()->count() > 0;

$template->render();
}
Expand Down
4 changes: 4 additions & 0 deletions app/WebModule/components/templates/programs_content.latte
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<div class="alert alert-warning alert-forever">
{_web.programs_content.register_programs_not_allowed}
</div>
{elseif $userWaitingForPayment}
<div class="alert alert-warning alert-forever">
{_web.programs_content.register_programs_allowed_after_payment}
</div>
{/if}

{var $userAllowedRegisterPrograms = $registerProgramsAllowed && $userHasPermission}
Expand Down
1 change: 1 addition & 0 deletions app/lang/web.cs_CZ.neon
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ programs_content:
login_required_end: "."
register_programs_not_allowed: "Zapisování programů není v tuto chvíli povoleno."
unapproved_register_programs: "Vaše role nemá právo zapisovat si programy."
register_programs_allowed_after_payment: "Zápis programů je možný až po zaplacení."
mandatory_programs_not_registered: "Máte nepřihlášené povinné programy (v kalendáři červeně). Prosíme, zapište si je."
category: "Kategorie"
lector: "Lektor"
Expand Down

0 comments on commit 2c738f2

Please sign in to comment.