diff --git a/app/templates/forum.forkbb.php b/app/templates/forum.forkbb.php index 2f973a3f..a1e16ae1 100644 --- a/app/templates/forum.forkbb.php +++ b/app/templates/forum.forkbb.php @@ -103,7 +103,7 @@ @if ($topic->closed) {!! __('Closed') !!} @endif - @if ($topic->poll_type) + @if ($topic->poll_type > 0) {!! __('Poll') !!} @endif {{ $topic->censorSubject }} diff --git a/app/templates/layouts/poll.forkbb.php b/app/templates/layouts/poll.forkbb.php new file mode 100644 index 00000000..e0e7711a --- /dev/null +++ b/app/templates/layouts/poll.forkbb.php @@ -0,0 +1,42 @@ +
+@if ($poll->canVote) +
+@endif +@foreach ($poll->question as $q => $question) +
+ {!! __('Question %s legend', $q) !!} +

{{ $question }}

+ @if ($poll->type[$q] > 1) +

{!! __('You can choose up to %s answers', $poll->type[$q]) !!}

+ @endif +
    + @foreach ($poll->answer[$q] as $a => $answer) +
  1. + @if ($poll->canVote || ! $poll->tid) + + @elseif ($poll->canSeeResult) + {{ $answer }} + (votes 1 [100%]) +

    100%

    + @else + + @endif +
  2. + @endforeach +
+

{!! __('In total voted: %s', 0) !!}

+
+@endforeach +@if ($poll->canVote) +
+@endif +
diff --git a/app/templates/post.forkbb.php b/app/templates/post.forkbb.php index 04b20de8..700df36e 100644 --- a/app/templates/post.forkbb.php +++ b/app/templates/post.forkbb.php @@ -10,6 +10,9 @@
{!! $p->previewHtml !!}
+ @if ($poll = $p->poll) + @include ('layouts/poll') + @endif @endif diff --git a/app/templates/topic.forkbb.php b/app/templates/topic.forkbb.php index 1fa5e1c9..9e6065e5 100644 --- a/app/templates/topic.forkbb.php +++ b/app/templates/topic.forkbb.php @@ -104,6 +104,9 @@
{!! $post->html() !!}
+ @if (1 === $post->postNumber && ($poll = $p->poll)) + @include ('layouts/poll') + @endif @if ($p->user->showSignature && $post->user->isSignature)