Added an option to display polls across the full width
authorAlexander Ebert <ebert@woltlab.com>
Sat, 21 Oct 2017 11:37:55 +0000 (13:37 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 21 Oct 2017 11:37:55 +0000 (13:37 +0200)
Closes #2449

com.woltlab.wcf/option.xml
com.woltlab.wcf/templates/poll.tpl
constants.php
wcfsetup/install/files/style/ui/poll.scss
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 535a300d9d305f75c146e2eaf0cf3c73cc7245d1..12b35f82425abb78ebb51b2c56656a2f29650584 100644 (file)
@@ -1521,6 +1521,11 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
                                <minvalue>2</minvalue>
                                <maxvalue>100</maxvalue>
                        </option>
+                       <option name="poll_full_width">
+                               <categoryname>message.general.poll</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>0</defaultvalue>
+                       </option>
                        <!-- /message.general.poll -->
                        
                        <!-- cms.media.thumbnail -->
index 95b39ff48be045f65b9855687c6bee8aaf438572..0ecd3aa7dc02d75d169391c76316b34593720171 100644 (file)
@@ -7,7 +7,7 @@
        </script>
 {/if}
 
-<div class="pollContainer" data-poll-id="{@$poll->pollID}" data-can-vote="{if $poll->canVote()}1{else}0{/if}" data-can-view-result="{if $poll->canSeeResult()}1{else}0{/if}" data-can-view-participants="{if $poll->canViewParticipants()}true{else}false{/if}" data-in-vote="{if $poll->canVote() && !$poll->isParticipant()}1{else}0{/if}" data-question="{$poll->question}" data-max-votes="{@$poll->maxVotes}" data-is-public="{if $poll->isPublic}true{else}false{/if}">
+<div class="pollContainer{if POLL_FULL_WIDTH} pollContainerFullWidth{/if}" data-poll-id="{@$poll->pollID}" data-can-vote="{if $poll->canVote()}1{else}0{/if}" data-can-view-result="{if $poll->canSeeResult()}1{else}0{/if}" data-can-view-participants="{if $poll->canViewParticipants()}true{else}false{/if}" data-in-vote="{if $poll->canVote() && !$poll->isParticipant()}1{else}0{/if}" data-question="{$poll->question}" data-max-votes="{@$poll->maxVotes}" data-is-public="{if $poll->isPublic}true{else}false{/if}">
        <section>
                <h2>{$poll->question} <span class="badge jsTooltip" title="{lang}wcf.poll.totalVotes{/lang}">{#$poll->votes}</span></h2>
                
@@ -35,7 +35,7 @@
        </section>
        
        {hascontent}
-               <div class="formSubmit jsOnly"{if !$poll->canVote() && $__pollView === 'result' && !$poll->canSeeResult()} style="display: none"{/if}>
+               <div class="formSubmit jsOnly"{if !$poll->canVote() && $__pollView === 'result'} style="display: none"{/if}>
                        {content}
                                {if $__wcf->getUser()->userID}
                                        <button class="small jsButtonPollVote"{if $poll->canVote()} disabled{else} style="display: none;"{/if}>{lang}wcf.poll.button.vote{/lang}</button>
index ed9c59ba379afeca862046e326a0e9e938957710..272ac696bb6ec8797df7be059751ec043d955100 100644 (file)
@@ -198,6 +198,7 @@ define('SEARCH_RESULTS_PER_PAGE', 20);
 define('SEARCH_DEFAULT_SORT_FIELD', 'time');
 define('SEARCH_DEFAULT_SORT_ORDER', 'DESC');
 define('POLL_MAX_OPTIONS', 20);
+define('POLL_FULL_WIDTH', 0);
 define('MEDIA_SMALL_THUMBNAIL_WIDTH', 280);
 define('MEDIA_SMALL_THUMBNAIL_HEIGHT', 210);
 define('MEDIA_SMALL_THUMBNAIL_RETAIN_DIMENSIONS', 1);
index a82ec43d25c0cba349b58f1b452acf1907eddb75..366129c891619c91e018614299e35d819a526218 100644 (file)
        padding: 10px 0;
        
        @include screen-sm-up {
-               float: left;
-               margin-right: 20px;
-               max-width: 50%;
+               &.pollContainerFullWidth {
+                       margin-bottom: 20px;
+               }
+               
+               &:not(.pollContainerFullWidth) {
+                       float: left;
+                       margin-right: 20px;
+                       max-width: 50%;
+               }
        }
        
        h2 {
index 901d5e78abb2696c72f0b4fdf84f547a5b984fb1..6cf99459c58f02225009e287a711de6cef23837f 100644 (file)
                <item name="wcf.acp.option.category.message.general.poll"><![CDATA[Umfragen]]></item>
                <item name="wcf.acp.option.module_poll"><![CDATA[Umfragen]]></item>
                <item name="wcf.acp.option.poll_max_options"><![CDATA[Maximale Anzahl an Antworten]]></item>
+               <item name="wcf.acp.option.poll_full_width"><![CDATA[Umfrage über die gesamte Breite darstellen]]></item>
                <item name="wcf.acp.option.error.validationFailed"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} einen ungültigen Inhalt eingegeben.]]></item>
                <item name="wcf.acp.option.module_members_list"><![CDATA[Mitgliederliste]]></item>
                <item name="wcf.acp.option.footer_code"><![CDATA[Footer-Code]]></item>
index 624f658c31a45ce6cdb5768faa26091463bacb9c..1f538eb6c74c0f9a502a569e1ec8fa19065de9dd 100644 (file)
                <item name="wcf.acp.option.category.message.general.poll"><![CDATA[Polls]]></item>
                <item name="wcf.acp.option.module_poll"><![CDATA[Polls]]></item>
                <item name="wcf.acp.option.poll_max_options"><![CDATA[Maximum Poll Options]]></item>
+               <item name="wcf.acp.option.poll_full_width"><![CDATA[Display polls over the entire width]]></item>
                <item name="wcf.acp.option.error.validationFailed"><![CDATA[You have entered an invalid value.]]></item>
                <item name="wcf.acp.option.module_members_list"><![CDATA[Members list]]></item>
                <item name="wcf.acp.option.footer_code"><![CDATA[Footer Code]]></item>