forked from GNUsocial/gnu-social
[Poll] Restructured templates, added misssing poll related css
This commit is contained in:
parent
168b7d313a
commit
696ebe60e0
@ -69,7 +69,7 @@ class AnswerPoll
|
|||||||
|
|
||||||
$question = $poll->getQuestion();
|
$question = $poll->getQuestion();
|
||||||
$opts = $poll->getOptionsArr();
|
$opts = $poll->getOptionsArr();
|
||||||
$form = PollResponseForm::make($opts);
|
$form = PollResponseForm::make($poll, $poll->getNoteId());
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
if ($form->isSubmitted()) {
|
if ($form->isSubmitted()) {
|
||||||
if ($form->isValid()) {
|
if ($form->isValid()) {
|
||||||
|
@ -30,9 +30,7 @@ use App\Entity\Poll;
|
|||||||
use App\Util\Common;
|
use App\Util\Common;
|
||||||
use App\Util\Exception\InvalidFormException;
|
use App\Util\Exception\InvalidFormException;
|
||||||
use App\Util\Exception\RedirectException;
|
use App\Util\Exception\RedirectException;
|
||||||
use Plugin\Poll\Forms\NewPollForm;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -68,23 +66,13 @@ class NewPoll
|
|||||||
{
|
{
|
||||||
$user = Common::ensureLoggedIn();
|
$user = Common::ensureLoggedIn();
|
||||||
$numOptions = Common::clamp($num,MIN_OPTS,MAX_OPTS);
|
$numOptions = Common::clamp($num,MIN_OPTS,MAX_OPTS);
|
||||||
//$form = NewPollForm::make($numOptions);
|
$opts[] = ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'expanded' => true, 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]];
|
||||||
/*
|
$opts[] = ['Question', TextType::class, ['label' => _m(('Question'))]];
|
||||||
$opts =
|
|
||||||
['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'expanded' => true, 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]],
|
|
||||||
// ['to', ChoiceType::class, ['label' => _m('To:'), 'multiple' => true, 'expanded' => true, 'choices' => $to_tags]],
|
|
||||||
['post', SubmitType::class, ['label' => _m('Post')]],
|
|
||||||
];
|
|
||||||
*/
|
|
||||||
$opts[] = ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'expanded' => true, 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]];
|
|
||||||
$opts[] = ['Question', TextType::class, ['label' => _m(('Question'))]];
|
|
||||||
|
|
||||||
for ($i = 1; $i <= $numOptions; ++$i) {
|
for ($i = 1; $i <= $numOptions; ++$i) {
|
||||||
//['Option_i', TextType::class, ['label' => _m('Option i')]],
|
//['Option_i', TextType::class, ['label' => _m('Option i')]],
|
||||||
$opts[] = ['Option_' . $i, TextType::class, ['label' => _m(('Option ' . $i))]];
|
$opts[] = ['Option_' . $i, TextType::class, ['label' => _m(('Option ' . $i))]];
|
||||||
}
|
}
|
||||||
//$subForm = Form::create($subOpts);
|
|
||||||
//$opts[] = ['options',FormType::class,[$subForm]];
|
|
||||||
$opts[] = ['post_poll', SubmitType::class, ['label' => _m('Post')]];
|
$opts[] = ['post_poll', SubmitType::class, ['label' => _m('Post')]];
|
||||||
|
|
||||||
$form = Form::create($opts);
|
$form = Form::create($opts);
|
||||||
@ -107,7 +95,7 @@ class NewPoll
|
|||||||
$poll = Poll::create(['gsactor_id' => $user->getId(), 'question' => $question, 'options' => $options, 'note_id' => $note->getId()]);
|
$poll = Poll::create(['gsactor_id' => $user->getId(), 'question' => $question, 'options' => $options, 'note_id' => $note->getId()]);
|
||||||
DB::persist($poll);
|
DB::persist($poll);
|
||||||
DB::flush();
|
DB::flush();
|
||||||
throw new RedirectException('showpoll', ['id' => $poll->getId()]);
|
throw new RedirectException('root');
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidFormException();
|
throw new InvalidFormException();
|
||||||
}
|
}
|
||||||
|
@ -56,17 +56,16 @@ class ShowPoll
|
|||||||
$user = Common::ensureLoggedIn();
|
$user = Common::ensureLoggedIn();
|
||||||
|
|
||||||
$poll = Poll::getFromId((int) $id);
|
$poll = Poll::getFromId((int) $id);
|
||||||
|
if ($poll == null) {
|
||||||
|
throw new NotFoundException('Poll does not exist');
|
||||||
|
}
|
||||||
|
|
||||||
$note = Note::getFromId($poll->getNoteId());
|
$note = Note::getFromId($poll->getNoteId());
|
||||||
|
|
||||||
if (!$note->isVisibleTo($user)) {
|
if ($note == null || !$note->isVisibleTo($user)) {
|
||||||
throw new NoSuchNoteException();
|
throw new NoSuchNoteException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($poll == null) {
|
|
||||||
throw new NotFoundException('Poll does not exist');
|
|
||||||
}
|
|
||||||
|
|
||||||
return ['_template' => 'Poll/showpoll.html.twig', 'poll' => $poll];
|
return ['_template' => 'Poll/showpoll.html.twig', 'poll' => $poll];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// {{{ License
|
|
||||||
|
|
||||||
// This file is part of GNU social - https://www.gnu.org/software/social
|
|
||||||
//
|
|
||||||
// GNU social is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// GNU social is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
namespace Plugin\Poll\Forms;
|
|
||||||
|
|
||||||
use App\Core\Form;
|
|
||||||
use function App\Core\I18n\_m;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\Form as SymfForm;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Form to add a Poll
|
|
||||||
*
|
|
||||||
* @package GNUsocial
|
|
||||||
* @category PollPlugin
|
|
||||||
*
|
|
||||||
* @author Daniel Brandao <up201705812@fe.up.pt>
|
|
||||||
* @copyright 2020 Free Software Foundation, Inc http://www.fsf.org
|
|
||||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
|
||||||
*/
|
|
||||||
class NewPollForm extends Form
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Creates a form with variable num of fields
|
|
||||||
*
|
|
||||||
* @param int $optionNum
|
|
||||||
*
|
|
||||||
* @return SymfForm
|
|
||||||
*/
|
|
||||||
public static function make(int $optionNum): SymfForm
|
|
||||||
{
|
|
||||||
$options = [];
|
|
||||||
$options[0] = ['Question', TextType::class, ['label' => _m(('Question'))]];
|
|
||||||
$i = 1;
|
|
||||||
for ($i; $i <= $optionNum; ++$i) {
|
|
||||||
//['Option_i', TextType::class, ['label' => _m('Option i')]],
|
|
||||||
$options[$i] = ['Option_' . $i, TextType::class, ['label' => _m(('Option ' . $i))]];
|
|
||||||
}
|
|
||||||
$options[$i + 1] = ['save', SubmitType::class, ['label' => _m('Submit Poll')]];
|
|
||||||
|
|
||||||
return parent::create($options);
|
|
||||||
}
|
|
||||||
}
|
|
@ -51,9 +51,8 @@ class PollResponseForm extends Form
|
|||||||
*/
|
*/
|
||||||
public static function make(Poll $poll,int $noteId): SymfForm
|
public static function make(Poll $poll,int $noteId): SymfForm
|
||||||
{
|
{
|
||||||
$opts = $poll->getOptionsArr();
|
$opts = $poll->getOptionsArr();
|
||||||
$formOptions = [];
|
$options = [];
|
||||||
$options = [];
|
|
||||||
for ($i = 1; $i <= count($opts); ++$i) {
|
for ($i = 1; $i <= count($opts); ++$i) {
|
||||||
$options[$opts[$i - 1]] = $i;
|
$options[$opts[$i - 1]] = $i;
|
||||||
}
|
}
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// {{{ License
|
|
||||||
|
|
||||||
// This file is part of GNU social - https://www.gnu.org/software/social
|
|
||||||
//
|
|
||||||
// GNU social is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// GNU social is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
namespace Plugin\Poll\Forms;
|
|
||||||
|
|
||||||
use App\Core\Form;
|
|
||||||
use function App\Core\I18n\_m;
|
|
||||||
use App\Entity\Poll;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\Form as SymfForm;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Form to respond a Poll
|
|
||||||
*
|
|
||||||
* @package GNUsocial
|
|
||||||
* @category PollPlugin
|
|
||||||
*
|
|
||||||
* @author Daniel Brandao <up201705812@fe.up.pt>
|
|
||||||
* @copyright 2020 Free Software Foundation, Inc http://www.fsf.org
|
|
||||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
|
||||||
*/
|
|
||||||
class ShowPollForm extends Form
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Creates a radio form with the options given
|
|
||||||
*
|
|
||||||
* @param array $opts options
|
|
||||||
*
|
|
||||||
* @return SymfForm
|
|
||||||
*/
|
|
||||||
public static function make(Poll $poll): SymfForm
|
|
||||||
{
|
|
||||||
$opts = $poll->getOptionsArr();
|
|
||||||
$question = $poll->getQuestion();
|
|
||||||
$formOptions = [];
|
|
||||||
for ($i = 1; $i <= count($opts); ++$i) {
|
|
||||||
$options[$opts[$i - 1]] = $i;
|
|
||||||
}
|
|
||||||
$formOptions[] = ['Question', TextType::class, ['data' => $question, 'label' => _m(('Question')), 'disabled' => true]];
|
|
||||||
$formOptions[] = ['Options:', ChoiceType::class, [
|
|
||||||
'choices' => $options,
|
|
||||||
'expanded' => true,
|
|
||||||
]];
|
|
||||||
|
|
||||||
return parent::create($formOptions);
|
|
||||||
}
|
|
||||||
}
|
|
@ -76,6 +76,13 @@ class Poll extends Module
|
|||||||
return Event::next;
|
return Event::next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate twig vars
|
||||||
|
*
|
||||||
|
* @param array $vars
|
||||||
|
*
|
||||||
|
* @return bool hook value; true means continue processing, false means stop.
|
||||||
|
*/
|
||||||
public function onStartTwigPopulateVars(array &$vars): bool
|
public function onStartTwigPopulateVars(array &$vars): bool
|
||||||
{
|
{
|
||||||
$vars['tabs'] = [['title' => 'Poll',
|
$vars['tabs'] = [['title' => 'Poll',
|
||||||
@ -84,6 +91,13 @@ class Poll extends Module
|
|||||||
return Event::next;
|
return Event::next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output our dedicated stylesheet
|
||||||
|
*
|
||||||
|
* @param array $styles stylesheets path
|
||||||
|
*
|
||||||
|
* @return bool hook value; true means continue processing, false means stop.
|
||||||
|
*/
|
||||||
public function onStartShowStyles(array &$styles): bool
|
public function onStartShowStyles(array &$styles): bool
|
||||||
{
|
{
|
||||||
$styles[] = 'poll/poll.css';
|
$styles[] = 'poll/poll.css';
|
||||||
@ -91,9 +105,20 @@ class Poll extends Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a poll in the timeline
|
* Output our note content to the timeline
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
* @param Note $note
|
||||||
|
* @param array $otherContent content
|
||||||
|
*
|
||||||
|
* @throws InvalidFormException invalid forms
|
||||||
|
* @throws RedirectException
|
||||||
|
* @throws ServerException User already responded to poll
|
||||||
|
* @throws \App\Util\Exception\NoLoggedInUser user not logged in
|
||||||
|
*
|
||||||
|
* @return bool hook value; true means continue processing, false means stop.
|
||||||
*/
|
*/
|
||||||
public function onShowNoteContent(Request $request, Note $note, array &$test)
|
public function onShowNoteContent(Request $request, Note $note, array &$otherContent)
|
||||||
{
|
{
|
||||||
$responses = null;
|
$responses = null;
|
||||||
$formView = null;
|
$formView = null;
|
||||||
@ -138,8 +163,7 @@ class Poll extends Module
|
|||||||
} else {
|
} else {
|
||||||
$responses = $poll->countResponses();
|
$responses = $poll->countResponses();
|
||||||
}
|
}
|
||||||
//$test[] = $form->createView();
|
$otherContent[] = ['name' => 'Poll', 'vars' => ['question' => $poll->getQuestion(), 'responses' => $responses, 'form' => $formView]];
|
||||||
$test[] = ['name' => 'Poll', 'vars' => ['question' => $poll->getQuestion(), 'responses' => $responses, 'form' => $formView]];
|
|
||||||
return Event::next;
|
return Event::next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,41 @@
|
|||||||
|
|
||||||
.poll .form-single ,
|
.poll .form-single ,
|
||||||
.create-poll-notice .form-single{
|
.create-poll-notice .form-single{
|
||||||
padding: 0 var(--unit-size);
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: var(--small-size);
|
border-radius: var(--small-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.poll .result{
|
||||||
|
display:flex;
|
||||||
|
padding-top: var(--unit-size) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll .result-vote{
|
||||||
|
font-weight: 650;
|
||||||
|
padding-left: var(--unit-size);
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-poll-notice{
|
||||||
|
padding: var(--unit-size);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#post_poll_visibility {
|
||||||
|
font-size: var(--medium-size);
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#post_poll_visibility > *{
|
||||||
|
padding-right: var(--unit-size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#post_poll > *{
|
||||||
|
padding: calc(var(--unit-size) * 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* FORMS ------------------------------*/
|
/* FORMS ------------------------------*/
|
||||||
.poll label {
|
.poll label {
|
||||||
@ -60,24 +89,4 @@
|
|||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#post_poll_visibility {
|
|
||||||
font-size: var(--medium-size);
|
|
||||||
color: var(--fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-poll-notice{
|
|
||||||
padding: var(--unit-size);
|
|
||||||
}
|
|
||||||
|
|
||||||
#post_poll > *{
|
|
||||||
padding: calc(var(--unit-size) * 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#post_poll_visibility > *{
|
|
||||||
padding-right: calc(var(--unit-size) * 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-poll-notice {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -42,6 +42,11 @@ class Extension extends AbstractExtension
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get twig functions
|
||||||
|
*
|
||||||
|
* @return array|TwigFunction[]
|
||||||
|
*/
|
||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@ -49,7 +54,7 @@ class Extension extends AbstractExtension
|
|||||||
new TwigFunction('active', [Runtime::class, 'isCurrentRouteActive']),
|
new TwigFunction('active', [Runtime::class, 'isCurrentRouteActive']),
|
||||||
new TwigFunction('is_route', [Runtime::class, 'isCurrentRoute']),
|
new TwigFunction('is_route', [Runtime::class, 'isCurrentRoute']),
|
||||||
new TwigFunction('get_note_actions', [Runtime::class, 'getNoteActions']),
|
new TwigFunction('get_note_actions', [Runtime::class, 'getNoteActions']),
|
||||||
new TwigFunction('get_note_test', [Runtime::class, 'getNoteTest']),
|
new TwigFunction('get_note_other_content', [Runtime::class, 'getNoteOtherContent']),
|
||||||
new TwigFunction('get_show_styles', [Runtime::class, 'getShowStyles']),
|
new TwigFunction('get_show_styles', [Runtime::class, 'getShowStyles']),
|
||||||
new TwigFunction('config', [Runtime::class, 'getConfig']),
|
new TwigFunction('config', [Runtime::class, 'getConfig']),
|
||||||
new TwigFunction('icon', [Runtime::class, 'embedSvgIcon'], ['needs_environment' => true]),
|
new TwigFunction('icon', [Runtime::class, 'embedSvgIcon'], ['needs_environment' => true]),
|
||||||
|
@ -71,12 +71,19 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
|||||||
return $actions;
|
return $actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNoteTest(Note $note)
|
/**
|
||||||
|
* get extra note content
|
||||||
|
*
|
||||||
|
* @param Note $note
|
||||||
|
*
|
||||||
|
* @return array|mixed note content
|
||||||
|
*/
|
||||||
|
public function getNoteOtherContent(Note $note)
|
||||||
{
|
{
|
||||||
$test = [];
|
$other = [];
|
||||||
Event::handle('show_note_content', [$this->request, $note, &$test]);
|
Event::handle('show_note_content', [$this->request, $note, &$other]);
|
||||||
|
|
||||||
return $test;
|
return $other;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfig(...$args)
|
public function getConfig(...$args)
|
||||||
@ -84,6 +91,11 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
|||||||
return Common::config(...$args);
|
return Common::config(...$args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get stylesheets
|
||||||
|
*
|
||||||
|
* @return array|mixed
|
||||||
|
*/
|
||||||
public function getShowStyles()
|
public function getShowStyles()
|
||||||
{
|
{
|
||||||
$styles = [];
|
$styles = [];
|
||||||
|
@ -108,6 +108,11 @@ abstract class Common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if user is logged in
|
||||||
|
*
|
||||||
|
* @return bool true if user is logged; false if it isn't
|
||||||
|
*/
|
||||||
public static function isLoggedIn(): bool
|
public static function isLoggedIn(): bool
|
||||||
{
|
{
|
||||||
return self::user() != null;
|
return self::user() != null;
|
||||||
|
@ -26,9 +26,13 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div>
|
<div class="poll">
|
||||||
<h2>{{ question }}</h2>
|
<p class="poll-question">Q. {{ question }}</p>
|
||||||
{{ form(form) }}
|
{% block form %}
|
||||||
|
<div class='form-single'>
|
||||||
|
{{ form(form) }}
|
||||||
|
</div>
|
||||||
|
{% endblock form %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
|
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/poll/poll.css') }}">
|
||||||
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public.css') }}"
|
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public.css') }}"
|
||||||
media="screen and (min-width: 1300px)">
|
media="screen and (min-width: 1300px)">
|
||||||
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public_mid.css') }}"
|
<link rel='stylesheet' type='text/css' href="{{ asset('assets/css/network/public_mid.css') }}"
|
||||||
@ -26,13 +27,17 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ul>
|
<div class="poll">
|
||||||
<h2>{{ poll.question }}</h2>
|
<p class="poll-question">Q. {{ poll.question }}</p>
|
||||||
|
<ul>
|
||||||
{% for question, votes in poll.countResponses() %}
|
{% for question, votes in poll.countResponses() %}
|
||||||
<li>{{ question }}: {{ votes }}</li>
|
<li class="result">
|
||||||
{% endfor %}
|
<p class="result-option">{{ question }}</p>
|
||||||
</ul>
|
<p class="result-vote">{{ votes }} </p>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<div class="poll">
|
<div class="poll">
|
||||||
<p class="poll-question">{{ vars.question }}</p>
|
<p class="poll-question">Q. {{ vars.question }}</p>
|
||||||
{% if vars.form is not null %}
|
{% if vars.form is not null %}
|
||||||
{% block form %}
|
{% block form %}
|
||||||
<div class='form-single'>
|
<div class='form-single'>
|
||||||
@ -10,7 +10,10 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for question, votes in vars.responses %}
|
{% for question, votes in vars.responses %}
|
||||||
<li>{{ question }}: {{ votes }}</li>
|
<li class="result">
|
||||||
|
<p class="result-option">{{ question }}</p>
|
||||||
|
<p class="result-vote">{{ votes }} </p>
|
||||||
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="note-content">
|
<div class="note-content">
|
||||||
{{ note.getContent() }}
|
{{ note.getContent() }}
|
||||||
<div class="note-extra-content">
|
<div class="note-other-content">
|
||||||
{% for test in get_note_test(note) %}
|
{% for other in get_note_other_content(note) %}
|
||||||
{% include '/'~ test.name ~ '/view.html.twig' with {'vars': test.vars} only %}
|
{% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="note-attachments">
|
<div class="note-attachments">
|
||||||
|
Loading…
Reference in New Issue
Block a user