implement managing of Character groups Quests
This commit is contained in:
parent
b9305b077f
commit
63ee9a9468
9 changed files with 283 additions and 73 deletions
|
|
@ -193,7 +193,7 @@
|
|||
array('^charactergroups/([^/]+)/([^/]+)/([^/]+)/(manage|edit|delete)/?$', 'charactergroups/$4group/$1/$2/$3', true),
|
||||
array('^charactergroupsquests/([^/]+)/([^/]+)/create/?$', 'charactergroupsquests/create/$1/$2', true),
|
||||
array('^charactergroupsquests/([^/]+)/([^/]+)/([^/]+)/?$', 'charactergroupsquests/quest/$1/$2/$3', true),
|
||||
array('^charactergroupsquests/([^/]+)/([^/]+)/([^/]+)/(edit|delete)/?$', 'charactergroupsquests/$4/$1/$2/$3', true),
|
||||
array('^charactergroupsquests/([^/]+)/([^/]+)/([^/]+)/(edit|delete|manage)/?$', 'charactergroupsquests/$4/$1/$2/$3', true),
|
||||
array('^achievements/([^/]+)/?$', 'achievements/index/$1', true),
|
||||
array('^library/([^/]+)/?$', 'library/index/$1', true),
|
||||
array('^library/([^/]+)/([^/]+)/?$', 'library/topic/$1/$2', true),
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
array('^charactergroups/(manage|edit|delete)group/([^/]+)/([^/]+)/([^/]+)$', 'charactergroups/$2/$3/$4/$1', true),
|
||||
array('^charactergroupsquests/create/([^/]+)/([^/]+)/?$', 'charactergroupsquests/$1/$2/create', true),
|
||||
array('^charactergroupsquests/quest/(.*)$', 'charactergroupsquests/$1', true),
|
||||
array('^charactergroupsquests/(edit|delete)/([^/]+)/([^/]+)/([^/]+)$', 'charactergroupsquests/$2/$3/$4/$1', true),
|
||||
array('^charactergroupsquests/(edit|delete|manage)/([^/]+)/([^/]+)/([^/]+)$', 'charactergroupsquests/$2/$3/$4/$1', true),
|
||||
array('^achievements/index/(.*)$', 'achievements/$1', true),
|
||||
array('^library/(index|topic)/(.*)$', 'library/$2', true)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,78 @@
|
|||
$questgroup['entered'] = $this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], self::$character['id']);
|
||||
|
||||
// Get Character groups-groups
|
||||
$groups = $this->Charactergroupsquests->getGroupsForQuest($quest['id']);
|
||||
$groups = $this->Charactergroups->getGroupsForQuest($quest['id']);
|
||||
|
||||
// Media
|
||||
$questmedia = null;
|
||||
if(!is_null($quest['questsmedia_id'])) {
|
||||
$questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']);
|
||||
}
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
$this->set('quest', $quest);
|
||||
$this->set('questgroup', $questgroup);
|
||||
$this->set('groups', $groups);
|
||||
$this->set('media', $questmedia);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action: manage.
|
||||
*
|
||||
* Manage a Character groups Quest for a Character groups-group
|
||||
* of a Seminary.
|
||||
*
|
||||
* @throws IdNotFoundException
|
||||
* @param string $seminaryUrl URL-Title of a Seminary
|
||||
* @param string $groupsgroupUrl URL-Title of a Character groups-group
|
||||
* @param string $questUrl URL-Title of a Character groups Quest
|
||||
*/
|
||||
public function manage($seminaryUrl, $groupsgroupUrl, $questUrl)
|
||||
{
|
||||
// Get seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Get Character groups-group
|
||||
$groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl);
|
||||
|
||||
// Get Character groups-group Quests
|
||||
$quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl);
|
||||
|
||||
// Get Questgroup
|
||||
$questgroup = $this->Questgroups->getQuestgroupById($quest['questgroups_id']);
|
||||
$questgroup['entered'] = $this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], self::$character['id']);
|
||||
|
||||
// Get Character groups
|
||||
$groups = $this->Charactergroups->getGroupsForGroupsgroup($groupsgroup['id']);
|
||||
|
||||
// Set XPs of Character groups for this Character groups Quest
|
||||
if($this->request->getRequestMethod() == 'POST' && !is_null($this->request->getPostParam('setxps')))
|
||||
{
|
||||
$xps = $this->request->getPostParam('xps');
|
||||
foreach($groups as &$group)
|
||||
{
|
||||
if(array_key_exists($group['url'], $xps) && $xps[$group['url']] != 'null')
|
||||
{
|
||||
$xpsFactor = intval($xps[$group['url']]) / $quest['xps'];
|
||||
$this->Charactergroupsquests->setXPsOfGroupForQuest($quest['id'], $group['id'], $xpsFactor);
|
||||
}
|
||||
else {
|
||||
$this->Charactergroupsquests->deleteGroupForQuest($quest['id'], $group['id']);
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to Quest page
|
||||
$this->redirect($this->linker->link(array('quest', $seminary['url'], $groupsgroup['url'], $quest['url']), 1));
|
||||
}
|
||||
|
||||
// Set XPs for Groups
|
||||
foreach($groups as &$group) {
|
||||
$group['quest_group'] = $this->Charactergroupsquests->getXPsOfGroupForQuest($quest['id'], $group['id']);
|
||||
}
|
||||
|
||||
// Media
|
||||
$questmedia = null;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,8 +1,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: The Legend of Z\n"
|
||||
"POT-Creation-Date: 2014-04-30 01:43+0100\n"
|
||||
"PO-Revision-Date: 2014-04-30 01:43+0100\n"
|
||||
"POT-Creation-Date: 2014-05-01 01:48+0100\n"
|
||||
"PO-Revision-Date: 2014-05-01 01:48+0100\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: de_DE\n"
|
||||
|
|
@ -195,6 +195,7 @@ msgstr "Spiele weiter, um diesen geheimen Erfolg freizuschalten"
|
|||
#: views/html/charactergroupsquests/create.tpl:8
|
||||
#: views/html/charactergroupsquests/delete.tpl:8
|
||||
#: views/html/charactergroupsquests/edit.tpl:8
|
||||
#: views/html/charactergroupsquests/manage.tpl:8
|
||||
#: views/html/charactergroupsquests/quest.tpl:8
|
||||
#: views/html/characters/character.tpl:85 views/html/seminarymenu/index.tpl:3
|
||||
msgid "Character Groups"
|
||||
|
|
@ -344,6 +345,22 @@ msgstr "Gruppengruppe bearbeiten"
|
|||
msgid "Manage Character group"
|
||||
msgstr "Gruppe verwalten"
|
||||
|
||||
#: views/html/charactergroups/group.tpl:31
|
||||
#: views/html/charactergroups/group.tpl:44
|
||||
#: views/html/charactergroupsquests/manage.tpl:21
|
||||
#: views/html/charactergroupsquests/manage.tpl:36
|
||||
#: views/html/charactergroupsquests/quest.tpl:29
|
||||
#: views/html/charactergroupsquests/quest.tpl:62
|
||||
#: views/html/characters/character.tpl:67
|
||||
#: views/html/characters/character.tpl:73
|
||||
#: views/html/characters/character.tpl:79
|
||||
#: views/html/characters/character.tpl:97 views/html/quests/index.tpl:37
|
||||
#: views/html/seminaries/index.tpl:29 views/html/seminarybar/index.tpl:6
|
||||
#: views/html/seminarybar/index.tpl:42
|
||||
#, php-format
|
||||
msgid "%d XPs"
|
||||
msgstr "%d XP"
|
||||
|
||||
#: views/html/charactergroups/group.tpl:32
|
||||
#: views/html/charactergroups/managegroup.tpl:25
|
||||
msgid "Members"
|
||||
|
|
@ -369,6 +386,16 @@ msgstr "Charaktere"
|
|||
msgid "%s-Quests"
|
||||
msgstr "%squests"
|
||||
|
||||
#: views/html/charactergroups/group.tpl:58
|
||||
#: views/html/charactergroupsquests/create.tpl:58
|
||||
#: views/html/charactergroupsquests/create.tpl:59
|
||||
#: views/html/charactergroupsquests/edit.tpl:58
|
||||
#: views/html/charactergroupsquests/edit.tpl:59
|
||||
#: views/html/characters/index.tpl:22 views/html/characters/manage.tpl:17
|
||||
#: views/html/quests/create.tpl:29 views/html/quests/create.tpl:30
|
||||
msgid "XPs"
|
||||
msgstr "XP"
|
||||
|
||||
#: views/html/charactergroups/groupsgroup.tpl:21
|
||||
msgid "Create new Character group"
|
||||
msgstr "Neue Gruppe"
|
||||
|
|
@ -458,18 +485,8 @@ msgstr "Die XP-Angabe ist ungültig"
|
|||
msgid "Title"
|
||||
msgstr "Titel"
|
||||
|
||||
#: views/html/charactergroupsquests/create.tpl:58
|
||||
#: views/html/charactergroupsquests/create.tpl:59
|
||||
#: views/html/charactergroupsquests/edit.tpl:58
|
||||
#: views/html/charactergroupsquests/edit.tpl:59
|
||||
#: views/html/characters/index.tpl:22 views/html/characters/manage.tpl:17
|
||||
#: views/html/quests/create.tpl:29 views/html/quests/create.tpl:30
|
||||
msgid "XPs"
|
||||
msgstr "XP"
|
||||
|
||||
#: views/html/charactergroupsquests/create.tpl:60
|
||||
#: views/html/charactergroupsquests/edit.tpl:60
|
||||
#: views/html/charactergroupsquests/quest.tpl:21
|
||||
#: views/html/quests/create.tpl:17 views/html/quests/index.tpl:14
|
||||
msgid "Questgroup"
|
||||
msgstr "Questgruppe"
|
||||
|
|
@ -478,7 +495,7 @@ msgstr "Questgruppe"
|
|||
#: views/html/charactergroupsquests/create.tpl:67
|
||||
#: views/html/charactergroupsquests/edit.tpl:66
|
||||
#: views/html/charactergroupsquests/edit.tpl:67
|
||||
#: views/html/charactergroupsquests/quest.tpl:24
|
||||
#: views/html/charactergroupsquests/quest.tpl:34
|
||||
msgid "Description"
|
||||
msgstr "Beschreibung"
|
||||
|
||||
|
|
@ -486,7 +503,7 @@ msgstr "Beschreibung"
|
|||
#: views/html/charactergroupsquests/create.tpl:69
|
||||
#: views/html/charactergroupsquests/edit.tpl:68
|
||||
#: views/html/charactergroupsquests/edit.tpl:69
|
||||
#: views/html/charactergroupsquests/quest.tpl:32
|
||||
#: views/html/charactergroupsquests/quest.tpl:37
|
||||
msgid "Rules"
|
||||
msgstr "Regeln"
|
||||
|
||||
|
|
@ -521,15 +538,24 @@ msgstr "Soll die %s-Quest „%s“ wirklich gelöscht werden?"
|
|||
msgid "Edit %s-Quest"
|
||||
msgstr "%s-Quest bearbeiten"
|
||||
|
||||
#: views/html/charactergroupsquests/quest.tpl:20
|
||||
msgid "Maximum reward"
|
||||
msgstr "Maximale Belohnung"
|
||||
#: views/html/charactergroupsquests/manage.tpl:34
|
||||
msgid "Not attended"
|
||||
msgstr "Nicht teilgenommen"
|
||||
|
||||
#: views/html/charactergroupsquests/quest.tpl:39
|
||||
#: views/html/charactergroupsquests/manage.tpl:43
|
||||
msgid "Set XPs"
|
||||
msgstr "Setze XP"
|
||||
|
||||
#: views/html/charactergroupsquests/quest.tpl:16
|
||||
#, php-format
|
||||
msgid "Manage %s-Quest"
|
||||
msgstr "%s-Quest Verwalten"
|
||||
|
||||
#: views/html/charactergroupsquests/quest.tpl:44
|
||||
msgid "Won Quest"
|
||||
msgstr "Gewonnene Quest"
|
||||
|
||||
#: views/html/charactergroupsquests/quest.tpl:45
|
||||
#: views/html/charactergroupsquests/quest.tpl:50
|
||||
msgid "Lost Quest"
|
||||
msgstr "Verlorene Quest"
|
||||
|
||||
|
|
@ -553,16 +579,6 @@ msgstr "Meilensteine"
|
|||
msgid "Ranking"
|
||||
msgstr "Ranking"
|
||||
|
||||
#: views/html/characters/character.tpl:67
|
||||
#: views/html/characters/character.tpl:73
|
||||
#: views/html/characters/character.tpl:79
|
||||
#: views/html/characters/character.tpl:97 views/html/quests/index.tpl:37
|
||||
#: views/html/seminaries/index.tpl:29 views/html/seminarybar/index.tpl:6
|
||||
#: views/html/seminarybar/index.tpl:42
|
||||
#, php-format
|
||||
msgid "%d XPs"
|
||||
msgstr "%d XP"
|
||||
|
||||
#: views/html/characters/character.tpl:106 views/html/seminarybar/index.tpl:14
|
||||
msgid "Last Quest"
|
||||
msgstr "Letzter Speicherpunkt"
|
||||
|
|
@ -1021,16 +1037,15 @@ msgstr "Registrieren"
|
|||
msgid "Roles"
|
||||
msgstr "Rollen"
|
||||
|
||||
#~ msgid "Maximum reward"
|
||||
#~ msgstr "Maximale Belohnung"
|
||||
|
||||
#~ msgid "Set properties"
|
||||
#~ msgstr "Setze Eigenschaften"
|
||||
|
||||
#~ msgid "Selection"
|
||||
#~ msgstr "Auswahl"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "%d XPs"
|
||||
#~ msgstr "%d XP"
|
||||
|
||||
#~ msgid "Properties"
|
||||
#~ msgstr "Eigenschaften"
|
||||
|
||||
|
|
|
|||
|
|
@ -200,7 +200,8 @@
|
|||
return $this->db->query(
|
||||
'SELECT id, name, url, xps, motto, seminaryupload_id '.
|
||||
'FROM v_charactergroups '.
|
||||
'WHERE charactergroupsgroup_id = ?',
|
||||
'WHERE charactergroupsgroup_id = ? '.
|
||||
'ORDER BY name',
|
||||
'i',
|
||||
$groupsgroupId
|
||||
);
|
||||
|
|
@ -278,6 +279,33 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the Character groups for a Quest.
|
||||
*
|
||||
* @param int $questId ID of the Character groups Quest
|
||||
* @return array Character groups
|
||||
*/
|
||||
public function getGroupsForQuest($questId)
|
||||
{
|
||||
$groups = $this->db->query(
|
||||
'SELECT charactergroups.id, charactergroups.name, charactergroups.url, charactergroupsquests_groups.created, charactergroupsquests_groups.xps_factor, charactergroupsquests.xps '.
|
||||
'FROM charactergroupsquests_groups '.
|
||||
'LEFT JOIN charactergroups ON charactergroups.id = charactergroupsquests_groups.charactergroup_id '.
|
||||
'LEFT JOIN charactergroupsquests ON charactergroupsquests.id = charactergroupsquests_groups.charactergroupsquest_id '.
|
||||
'WHERE charactergroupsquests_groups.charactergroupsquest_id = ? '.
|
||||
'ORDER BY xps_factor DESC',
|
||||
'i',
|
||||
$questId
|
||||
);
|
||||
foreach($groups as &$group) {
|
||||
$group['xps'] = round($group['xps'] * $group['xps_factor'], 1);
|
||||
}
|
||||
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character group name already exists.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -105,32 +105,6 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the Character groups for a Quest.
|
||||
*
|
||||
* @param int $questId ID of the Character groups Quest
|
||||
* @return array Character groups
|
||||
*/
|
||||
public function getGroupsForQuest($questId)
|
||||
{
|
||||
$groups = $this->db->query(
|
||||
'SELECT charactergroups.id, charactergroups.name, charactergroups.url, charactergroupsquests_groups.created, charactergroupsquests_groups.xps_factor, charactergroupsquests.xps '.
|
||||
'FROM charactergroupsquests_groups '.
|
||||
'LEFT JOIN charactergroups ON charactergroups.id = charactergroupsquests_groups.charactergroup_id '.
|
||||
'LEFT JOIN charactergroupsquests ON charactergroupsquests.id = charactergroupsquests_groups.charactergroupsquest_id '.
|
||||
'WHERE charactergroupsquests_groups.charactergroupsquest_id = ?',
|
||||
'i',
|
||||
$questId
|
||||
);
|
||||
foreach($groups as &$group) {
|
||||
$group['xps'] = round($group['xps'] * $group['xps_factor'], 1);
|
||||
}
|
||||
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Character groups Quests for a Character group.
|
||||
*
|
||||
|
|
@ -156,6 +130,78 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get XPs of a Character group for a Character groups Quest.
|
||||
*
|
||||
* @param int $questId ID of Character groups Quest
|
||||
* @param int $groupId ID of Character group to get XPs of
|
||||
* @return array XP-record
|
||||
*/
|
||||
public function getXPsOfGroupForQuest($questId, $groupId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT charactergroupsquests_groups.created, charactergroupsquests_groups.xps_factor, charactergroupsquests.xps '.
|
||||
'FROM charactergroupsquests_groups '.
|
||||
'LEFT JOIN charactergroupsquests ON charactergroupsquests.id = charactergroupsquests_groups.charactergroupsquest_id '.
|
||||
'WHERE charactergroupsquests_groups.charactergroupsquest_id = ? AND charactergroupsquests_groups.charactergroup_id = ?',
|
||||
'ii',
|
||||
$questId,
|
||||
$groupId
|
||||
);
|
||||
if(empty($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = $data[0];
|
||||
$data['xps'] = round($data['xps'] * $data['xps_factor'], 1);
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set XPs of a Character group for a Character groups Quest.
|
||||
*
|
||||
* @param int $questId ID of Character groups Quest
|
||||
* @param int $groupId ID of Character group to set XPs of
|
||||
* @param float $xpsFactor XPs-factor
|
||||
*/
|
||||
public function setXPsOfGroupForQuest($questId, $groupId, $xpsFactor)
|
||||
{
|
||||
$this->db->query(
|
||||
'INSERT INTO charactergroupsquests_groups '.
|
||||
'(charactergroupsquest_id, charactergroup_id, xps_factor) '.
|
||||
'VALUES '.
|
||||
'(?, ?, ?) '.
|
||||
'ON DUPLICATE KEY UPDATE '.
|
||||
'xps_factor = ?',
|
||||
'iidd',
|
||||
$questId,
|
||||
$groupId,
|
||||
$xpsFactor,
|
||||
$xpsFactor
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a Character group from a Character groups Quest.
|
||||
*
|
||||
* @param int $questId ID of Character groups Quest
|
||||
* @param int $groupId ID of Character group to remove
|
||||
*/
|
||||
public function deleteGroupForQuest($questId, $groupId)
|
||||
{
|
||||
$this->db->query(
|
||||
'DELETE FROM charactergroupsquests_groups '.
|
||||
'WHERE charactergroupsquest_id = ? AND charactergroup_id = ?',
|
||||
'ii',
|
||||
$questId, $groupId
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character groups Quest title already exists.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><?=$group['rank']?>. <?=_('Rank')?></li>
|
||||
<li><?=$group['xps']?> XP</li>
|
||||
<li><?=sprintf(_('%d XPs'), $group['xps'])?></li>
|
||||
<li><?=count($group['characters'])?> <?=(count($group['characters']) == 0 || count($group['characters']) > 1) ? _('Members') : _('Member')?></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<p><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$character['small_avatar']['url']))?>"></p>
|
||||
<?php endif ?>
|
||||
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a></p>
|
||||
<p><small><?=$character['xps']?> XP</small></p>
|
||||
<p><small><?=sprintf(_('%d XPs'), $character['xps'])?></small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<p>
|
||||
<span class="date"><?=$dateFormatter->format(new \DateTime($quest['created']))?></span>
|
||||
<a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="fwb"><?=$quest['title']?></a>
|
||||
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> XP</span>
|
||||
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> <?=_('XPs')?></span>
|
||||
</p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
45
views/html/charactergroupsquests/manage.tpl
Normal file
45
views/html/charactergroupsquests/manage.tpl
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php if(!is_null($seminary['charactergroups_seminarymedia_id'])) : ?>
|
||||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url'], 'charactergroups'))?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','charactergroup.jpg'))?>" class="gbanner">
|
||||
<?php endif ?>
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<form method="post">
|
||||
<ul class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp">
|
||||
<select name="xps[<?=$group['url']?>]">
|
||||
<option value="null" <?php if(is_null($group['quest_group'])) : ?>selected="selected"<?php endif ?>><?=_('Not attended')?></option>
|
||||
<?php for($i=0; $i<=$quest['xps']; $i++) : ?>
|
||||
<option value="<?=$i?>" <?php if(!is_null($group['quest_group']) && $group['quest_group']['xps'] == $i) : ?>selected="selected"<?php endif ?>><?=sprintf(_('%d XPs'), $i)?></option>
|
||||
<?php endfor ?>
|
||||
</select>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="setxps" value="<?=_('Set XPs')?>" />
|
||||
</form>
|
||||
</section>
|
||||
|
|
@ -13,21 +13,26 @@
|
|||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Manage %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<h1><?=$quest['title']?></h1>
|
||||
<small><?=_('Maximum reward')?>: <span class="fwb"><?=$quest['xps']?> XP</span></small><br />
|
||||
<small><?=_('Questgroup')?>: <?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></small>
|
||||
<div class="gbanner cf">
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','charactergroup.jpg'))?>" class="gbanner">
|
||||
<?php endif ?>
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
|
||||
<p>
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
|
||||
<?php endif ?>
|
||||
<?=\hhu\z\Utils::t($quest['description'])?>
|
||||
</p>
|
||||
<p><?=\hhu\z\Utils::t($quest['description'])?></p>
|
||||
<?php if(!empty($quest['rules'])) : ?>
|
||||
<h1><i class="fa fa-exclamation-triangle fa-fw"></i><?=_('Rules')?></h1>
|
||||
<p><?=\hhu\z\Utils::t($quest['rules'])?></p>
|
||||
|
|
@ -54,7 +59,7 @@
|
|||
<li>
|
||||
<span class="date"><?=$dateFormatter->format(new \DateTime($group['created']))?></span>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp"><?=$group['xps']?> XP</span>
|
||||
<span class="xp"><?=sprintf(_('%d XPs'), $group['xps'])?></span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue