From 6d17b7eaf1843b7f199820a7feafbd52b931ee9c Mon Sep 17 00:00:00 2001 From: coderkun Date: Mon, 28 Apr 2014 23:16:36 +0200 Subject: [PATCH] correct description shorting for Seminaries and add values for XP progress bar --- controllers/SeminariesController.inc | 6 +++--- views/html/seminaries/index.tpl | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/controllers/SeminariesController.inc b/controllers/SeminariesController.inc index f9cb6f90..13259c75 100644 --- a/controllers/SeminariesController.inc +++ b/controllers/SeminariesController.inc @@ -64,15 +64,15 @@ // Get additional data foreach($seminaries as &$seminary) { - $seminary['description'] = \hhu\z\Utils::shortenString($seminary['description'], 100, 120).' …'; - - // Created user + $description = \hhu\z\Utils::shortenString($seminary['description'], 100, 120); + $seminary['description'] = $description.(strlen($description) < strlen($seminary['description']) ? ' …' : null); $seminary['creator'] = $this->Users->getUserById($seminary['created_user_id']); // Character of currently logged-in user try { $seminary['usercharacter'] = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); $seminary['usercharacter']['characterroles'] = $this->Characterroles->getCharacterrolesForCharacterById($seminary['usercharacter']['id']); + $seminary['xps'] = $this->Seminaries->getTotalXPs($seminary['id']); } catch(\nre\exceptions\IdNotFoundException $e) { } diff --git a/views/html/seminaries/index.tpl b/views/html/seminaries/index.tpl index 9aa52164..b9c5104e 100644 --- a/views/html/seminaries/index.tpl +++ b/views/html/seminaries/index.tpl @@ -15,18 +15,20 @@

- 0) : ?> - - - - + 0) : ?> + + + +

+
- +
-

25 / 100 XP

+

/

+

format(new \DateTime($seminary['created'])))?>