limit user and Character names to 12 chars
This commit is contained in:
commit
e242e976e8
3450 changed files with 592978 additions and 0 deletions
52
questtypes/submit/html/quest.tpl
Normal file
52
questtypes/submit/html/quest.tpl
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php if(!is_null($exception)) : ?>
|
||||
<p class="error">
|
||||
<?php if($exception->getNestedException() instanceof \hhu\z\exceptions\WrongFiletypeException) : ?>
|
||||
<?=sprintf(_('File has wrong type “%s”'), $exception->getNestedException()->getType())?>
|
||||
<?php elseif($exception->getNestedException() instanceof \hhu\z\exceptions\WrongFiletypeException) : ?>
|
||||
<?=_('File exceeds size maximum')?>
|
||||
<?php elseif($exception->getNestedException() instanceof \hhu\z\exceptions\FileUploadException) : ?>
|
||||
<?=sprintf(_('Error during file upload: %s'), $exception->getNestedException()->getNestedMessage())?>
|
||||
<?php else : ?>
|
||||
<?=$exception->getNestedException()->getMessage()?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?php if(!$solved && (is_null($lastStatus) || count($submissions) == 0 || $lastStatus['created'] > $submissions[count($submissions)-1]['created'])) : ?>
|
||||
<form method="post" enctype="multipart/form-data" class="submit">
|
||||
<input type="file" name="answers" required="required" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=$numberFormatter->format(round($mimetype['size']/(1024*1024),2))?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="submit" value="<?=_('solve')?>" />
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(count($submissions) > 0) : ?>
|
||||
<h2><?=_('Past submissions')?></h2>
|
||||
<ol>
|
||||
<?php foreach($submissions as &$submission) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'], $submission['upload']['url']))?>"><?=$submission['upload']['name']?></a><br />
|
||||
<?=sprintf(_('submitted at %s on %s h'), $dateFormatter->format(new \DateTime($submission['created'])), $timeFormatter->format(new \DateTime($submission['created'])))?><br />
|
||||
<?php if($lastStatus['status'] == 1) : ?>
|
||||
<?=_('This submission is waiting for approval')?>
|
||||
<?php endif ?>
|
||||
<?php if(count($submission['comments']) > 0) : ?>
|
||||
<ol>
|
||||
<?php foreach($submission['comments'] as &$comment) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('user', $comment) && array_key_exists('character', $comment['user'])) : ?>
|
||||
<?=sprintf(_('Comment from %s on %s at %s'), $comment['user']['character']['name'], $dateFormatter->format(new \DateTime($comment['created'])), $timeFormatter->format(new \DateTime($comment['created'])))?>:<br />
|
||||
<?php endif ?>
|
||||
<?=\hhu\z\Utils::t($comment['comment'])?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
33
questtypes/submit/html/submission.tpl
Normal file
33
questtypes/submit/html/submission.tpl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php if(count($submissions) > 0) : ?>
|
||||
<ol class="admnql">
|
||||
<?php foreach($submissions as &$submission) : ?>
|
||||
<li>
|
||||
<p><a href="<?=$linker->link(array('uploads','seminary',$seminary['url'], $submission['upload']['url']))?>"><?=$submission['upload']['name']?></a></p>
|
||||
<p><small><?=sprintf(_('submitted at %s on %s h'), $dateFormatter->format(new \DateTime($submission['created'])), $timeFormatter->format(new \DateTime($submission['created'])))?></small></p>
|
||||
<?php if(count($submission['comments']) > 0) : ?>
|
||||
<ol>
|
||||
<?php foreach($submission['comments'] as &$comment) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('user', $comment) && array_key_exists('character', $comment['user'])) : ?>
|
||||
<p class="fwb"><?=sprintf(_('Comment from %s on %s at %s'), $comment['user']['character']['name'], $dateFormatter->format(new \DateTime($comment['created'])), $timeFormatter->format(new \DateTime($comment['created'])))?>:</p>
|
||||
<?php endif ?>
|
||||
<p><?=\hhu\z\Utils::t($comment['comment'])?></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
|
||||
<form method="post">
|
||||
<?php $submission = array_pop($submissions); ?>
|
||||
<?php if(!$solved) : ?>
|
||||
<?=_('Comment')?><br />
|
||||
<textarea name="characterdata[comment]"></textarea><br />
|
||||
<input type="hidden" name="characterdata[submission_id]" value="<?=$submission['id']?>" />
|
||||
<input type="submit" name="submit" value="<?=_('solved')?>" />
|
||||
<input type="submit" name="submit" value="<?=_('unsolved')?>" />
|
||||
<?php endif ?>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue