diff options
| -rw-r--r-- | app/controllers/evaluation/profiles.php | 1 | ||||
| -rw-r--r-- | app/views/evaluation/profiles/preedit.php | 29 |
2 files changed, 17 insertions, 13 deletions
diff --git a/app/controllers/evaluation/profiles.php b/app/controllers/evaluation/profiles.php index 7c89c09..06e7555 100644 --- a/app/controllers/evaluation/profiles.php +++ b/app/controllers/evaluation/profiles.php @@ -14,6 +14,7 @@ class Evaluation_ProfilesController extends AuthenticatedController public function preedit_action() { $this->semesters = $this->getAvailableSemesters(true); + $this->total_sem_count = Semester::countBySql(); $this->render_template('evaluation/profiles/preedit'); } diff --git a/app/views/evaluation/profiles/preedit.php b/app/views/evaluation/profiles/preedit.php index ac503ec..1972c38 100644 --- a/app/views/evaluation/profiles/preedit.php +++ b/app/views/evaluation/profiles/preedit.php @@ -4,10 +4,10 @@ */ ?> -<form method="post"> - <?= CSRFProtection::tokenTag() ?> - <h2><?= _('Neues Profil anlegen') ?></h2> - <div> +<?php if ($controller->total_sem_count > count($controller->semesters)) :?> + <form method="post"> + <?= CSRFProtection::tokenTag() ?> + <h2><?= _('Neues Profil anlegen') ?></h2> <div class="clickable"> <button class="as-link" @@ -19,22 +19,22 @@ <p><?= _('Neu anlegen') ?></p> </button> </div> -</form> + </form> -<?php if (count($controller->semesters)) : ?> - <form method="post"> - <?= CSRFProtection::tokenTag() ?> + <?php if (count($controller->semesters)) : ?> + <form method="post"> + <?= CSRFProtection::tokenTag() ?> <h2><?= _('Profildaten übernehmen') ?></h2> <label> - <?= _('Aus Profil von Semester') ?></br> + <?= _('Aus Profil von Semester') ?><br/> <select name="sem_select"> <?php foreach ($controller->semesters as $key => $semester) : ?> <option value="<?= $key ?>"><?= htmlReady($semester) ?></option> <?php endforeach ?> </select> </label> - </br> - </br> + <br/> + <br/> <div class="clickable"> <button class="as-link" @@ -45,6 +45,9 @@ <p><?= _('Daten übernehmen') ?></p> </button> </div> - </div> - </form> + </form> + <?php endif ?> +<?php else : ?> + <br/> + <p><?= _('Es ist kein Semester ohne Profil vorhanden.') ?></p> <?php endif ?> |
