Commit b006310f authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[FEATURE] Introduce Show action for elections

parent 2e32d073
......@@ -20,6 +20,7 @@ use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\Election\Domain\Model\Dto\ElectionVoting;
use TYPO3\Election\Domain\Model\ElectionInvitation;
use TYPO3\Election\Domain\Model\ElectionVote;
use TYPO3\Election\Domain\Model\Election;
/**
* Class FeElectionController
......@@ -28,6 +29,7 @@ class FeElectionController extends ActionController
{
const CONTROLLER_NAME = 'FeElection';
const ACTION_VOTE = 'vote';
const ACTION_SHOW = 'show';
const ACTION_SUBMIT_VOTE = 'submitVote';
/**
......@@ -161,12 +163,22 @@ class FeElectionController extends ActionController
$this->redirect(FeDashboardController::ACTION_INDEX, FeDashboardController::CONTROLLER_NAME);
}
/**
* @param Election $election
*/
public function showAction(Election $election)
{
$this->view->assign('election', $election);
}
/**
* @return string
*/
public static function getActionsForPluginConfiguration()
{
return implode(',', [self::ACTION_VOTE, self::ACTION_SUBMIT_VOTE]);
return implode(',', [self::ACTION_VOTE, self::ACTION_SUBMIT_VOTE, self::ACTION_SHOW]);
}
/**
......
<f:layout name="Frontend"/>
<f:section name="Main">
<h1>
{election.title}
</h1>
<f:if condition="{election.ElectionFinished}">
<f:then>
<h2>Result</h2>
</f:then>
<f:else>
active
</f:else>
</f:if>
</f:section>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment