format overview of all Quests as list instead of table
This commit is contained in:
parent
95837803a1
commit
07c678a9f1
3 changed files with 36 additions and 48 deletions
|
|
@ -340,7 +340,7 @@
|
||||||
$questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']);
|
$questmedia = $this->Media->getSeminaryMediaById($quest['questsmedia_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get submitted Character submissions
|
// Get submitted Character submissions waiting for approval
|
||||||
$submittedSubmissionCharacters = $this->Characters->getCharactersSubmittedQuest($quest['id']);
|
$submittedSubmissionCharacters = $this->Characters->getCharactersSubmittedQuest($quest['id']);
|
||||||
|
|
||||||
// Get unsolved Character submissions
|
// Get unsolved Character submissions
|
||||||
|
|
|
||||||
|
|
@ -379,17 +379,15 @@
|
||||||
'SELECT characters.id, characters.created, characters.charactertype_id, characters.name, characters.url, characters.user_id, characters.xps, characters.xplevel, charactertypes.name AS charactertype_name, charactertypes.url AS charactertype_url '.
|
'SELECT characters.id, characters.created, characters.charactertype_id, characters.name, characters.url, characters.user_id, characters.xps, characters.xplevel, charactertypes.name AS charactertype_name, charactertypes.url AS charactertype_url '.
|
||||||
'FROM v_characters AS characters '.
|
'FROM v_characters AS characters '.
|
||||||
'LEFT JOIN charactertypes ON charactertypes.id = characters.charactertype_id '.
|
'LEFT JOIN charactertypes ON charactertypes.id = characters.charactertype_id '.
|
||||||
'WHERE EXISTS ('.
|
'WHERE ('.
|
||||||
'SELECT character_id FROM quests_characters WHERE character_id = characters.id AND quest_id = ? AND status = ?'.
|
'SELECT status '.
|
||||||
') AND NOT EXISTS ('.
|
'FROM quests_characters '.
|
||||||
'SELECT character_id FROM quests_characters WHERE character_id = characters.id AND quest_id = ? AND status = ?'.
|
'WHERE quest_id = ? AND character_id = characters.id '.
|
||||||
') AND NOT EXISTS ('.
|
'ORDER BY created DESC '.
|
||||||
'SELECT character_id FROM quests_characters WHERE character_id = characters.id AND quest_id = ? AND status = ?'.
|
'LIMIT 1'.
|
||||||
')',
|
') = ?',
|
||||||
'iiiiii',
|
'ii',
|
||||||
$questId, QuestsModel::QUEST_STATUS_SUBMITTED,
|
$questId, QuestsModel::QUEST_STATUS_SUBMITTED
|
||||||
$questId, QuestsModel::QUEST_STATUS_UNSOLVED,
|
|
||||||
$questId, QuestsModel::QUEST_STATUS_SOLVED
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,43 +7,33 @@
|
||||||
<h2><?=_('Quests')?></h2>
|
<h2><?=_('Quests')?></h2>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<table>
|
<fieldset>
|
||||||
<thead>
|
<legend>Filter</legend>
|
||||||
<tr>
|
<label for="filters[questgroup]"><?=_('Questgroup')?>:</label>
|
||||||
<th>
|
<select name="filters[questgroup]">
|
||||||
<select name="filters[questgroup]">
|
<option value="0">alle</option>
|
||||||
<option value="0"><?=_('Questgroup')?></option>
|
<?php foreach($filters['questgroups'] as &$filter) : ?>
|
||||||
<?php foreach($filters['questgroups'] as &$filter) : ?>
|
<option value="<?=$filter['id']?>" <?php if($filter['id'] == $selectedFilters['questgroup']) : ?>selected="selected"<?php endif ?>><?=$filter['title']?></option>
|
||||||
<option value="<?=$filter['id']?>" <?php if($filter['id'] == $selectedFilters['questgroup']) : ?>selected="selected"<?php endif ?>><?=$filter['title']?></option>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</select>
|
|
||||||
</th>
|
|
||||||
<th><?=_('Questname')?></th>
|
|
||||||
<th>
|
|
||||||
<select name="filters[questtype]">
|
|
||||||
<option value=""><?=_('Questtype')?></option>
|
|
||||||
<?php foreach($filters['questtypes'] as &$filter) : ?>
|
|
||||||
<option value="<?=$filter['classname']?>" <?php if($filter['classname'] == $selectedFilters['questtype']) : ?>selected="selected"<?php endif ?>><?=$filter['title']?></option>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</select>
|
|
||||||
</th>
|
|
||||||
<th>XPs</th>
|
|
||||||
<th><?=('Submissions')?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach($quests as &$quest) : ?>
|
|
||||||
<tr>
|
|
||||||
<td><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$quest['questgroup']['url']))?>"><?=$quest['questgroup']['title']?></a></td>
|
|
||||||
<td><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$quest['questgroup']['url'],$quest['url']))?>"><?=$quest['title']?></a></td>
|
|
||||||
<td><?=$quest['questtype']['title']?></td>
|
|
||||||
<td><?=$quest['xps']?></td>
|
|
||||||
<td><?=$quest['opensubmissionscount']?></td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</select><br />
|
||||||
</table>
|
<label for="filters[questtype]"><?=_('Questtype')?>:</label>
|
||||||
|
<select name="filters[questtype]">
|
||||||
|
<option value="">alle</option>
|
||||||
|
<?php foreach($filters['questtypes'] as &$filter) : ?>
|
||||||
|
<option value="<?=$filter['classname']?>" <?php if($filter['classname'] == $selectedFilters['questtype']) : ?>selected="selected"<?php endif ?>><?=$filter['title']?></option>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
<input type="submit" name="filter" value="<?=_('Apply filters')?>" />
|
<input type="submit" name="filter" value="<?=_('Apply filters')?>" />
|
||||||
<input type="submit" name="reset" value="<?=_('Reset filters')?>" />
|
<input type="submit" name="reset" value="<?=_('Reset filters')?>" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<?php foreach($quests as &$quest) : ?>
|
||||||
|
<li>
|
||||||
|
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$quest['questgroup']['url']))?>"><?=$quest['questgroup']['title']?></a><br />
|
||||||
|
<h3><a href="<?=$linker->link(array('quest',$seminary['url'],$quest['questgroup']['url'],$quest['url']),1)?>"><?=$quest['title']?></a></h3>
|
||||||
|
<?=$quest['questtype']['title']?>, <?=$quest['xps']?> XPs, <a href="<?=$linker->link(array('submissions',$seminary['url'],$quest['questgroup']['url'],$quest['url']),1)?>"><?=$quest['opensubmissionscount']?> open submissions</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue