diff options
| -rw-r--r-- | build/build.xml | 89 | ||||
| -rw-r--r-- | phpBB/composer.json | 4 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 2 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_body.html | 2 | ||||
| -rw-r--r-- | phpBB/styles/subsilver2/template/viewtopic_body.html | 2 | ||||
| -rw-r--r-- | phpBB/viewtopic.php | 2 |
6 files changed, 99 insertions, 2 deletions
diff --git a/build/build.xml b/build/build.xml index 3a2a66b113..c1f81fb947 100644 --- a/build/build.xml +++ b/build/build.xml @@ -273,6 +273,10 @@ <delete dir="${dir}/develop" /> <delete dir="${dir}/install/data" /> + <phingcall target="clean-vendor-dir"> + <property name="dir" value="${dir}" /> + </phingcall> + <echo msg="Setting permissions for checkout of ${revision} in ${dir}" /> <!-- set permissions of all files to 644, directories to 755 --> <exec dir="${dir}" command="find . -type f|xargs chmod 644" escape="false" /> @@ -284,6 +288,91 @@ <chmod mode="0777" file="${dir}/images/avatars/upload" /> </target> + <target name="clean-vendor-dir"> + <!-- Delete unrelated files from vendor/, see PHPBB3-12390 --> + <delete dir="${dir}/vendor/lusitanian/oauth/examples" /> + <delete dir="${dir}/vendor/lusitanian/oauth/tests" /> + <delete file="${dir}/vendor/lusitanian/oauth/.gitignore" /> + <delete file="${dir}/vendor/lusitanian/oauth/.travis.yml" /> + <delete file="${dir}/vendor/lusitanian/oauth/phpunit.xml.dist" /> + <delete file="${dir}/vendor/lusitanian/oauth/README.md" /> + + <delete dir="${dir}/vendor/psr/log/Psr/Log/Test" /> + <delete file="${dir}/vendor/psr/log/.gitignore" /> + <delete file="${dir}/vendor/psr/log/README.md" /> + + <delete dir="${dir}/vendor/symfony/config/Symfony/Component/Config/Tests" /> + <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/.gitignore" /> + <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/README.md" /> + <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/console/Symfony/Component/Console/Tests" /> + <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/.gitignore" /> + <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/README.md" /> + <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/debug/Symfony/Component/Debug/Tests" /> + <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/.gitignore" /> + <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/README.md" /> + <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests" /> + <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore" /> + <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md" /> + <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests" /> + <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore" /> + <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md" /> + <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests" /> + <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/.gitignore" /> + <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/README.md" /> + <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests" /> + <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/.gitignore" /> + <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md" /> + <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests" /> + <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore" /> + <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md" /> + <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/routing/Symfony/Component/Routing/Tests" /> + <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/.gitignore" /> + <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/README.md" /> + <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/Tests" /> + <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/.gitignore" /> + <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md" /> + <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/README.md" /> + <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist" /> + + <delete dir="${dir}/vendor/twig/twig/doc" /> + <delete dir="${dir}/vendor/twig/twig/ext" /> + <delete dir="${dir}/vendor/twig/twig/test" /> + <delete file="${dir}/vendor/twig/twig/.editorconfig" /> + <delete file="${dir}/vendor/twig/twig/.gitignore" /> + <delete file="${dir}/vendor/twig/twig/.travis.yml" /> + <delete file="${dir}/vendor/twig/twig/AUTHORS" /> + <delete file="${dir}/vendor/twig/twig/CHANGELOG" /> + <delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" /> + <delete file="${dir}/vendor/twig/twig/README.markdown" /> + </target> + <target name="clean-diff-dir"> <delete dir="${dir}/cache" /> <delete dir="${dir}/docs" /> diff --git a/phpBB/composer.json b/phpBB/composer.json index 3cf83a8fe9..2941293e81 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -1,4 +1,8 @@ { + "_readme": [ + "You MUST update the clean-vendor-dir target in build/build.xml", + "accordingly when adding or upgrading dependencies." + ], "minimum-stability": "beta", "require": { "lusitanian/oauth": "0.2.*", diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index d2a070d11b..4df38f4275 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -244,10 +244,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) { var option = $(this); var option_id = option.attr('data-poll-option-id'); var voted = (typeof res.user_votes[option_id] !== 'undefined') ? true : false; + var most_voted = (res.vote_counts[option_id] == most_votes) ? true : false; var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[option_id] / res.total_votes) * 100); var percent_rel = (most_votes == 0) ? 0 : Math.round((res.vote_counts[option_id] / most_votes) * 100); option.toggleClass('voted', voted); + option.toggleClass('most-votes', most_voted); // Update the bars var bar = option.find('.resultbar div'); diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 4e3561c4a2..649129923a 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -72,7 +72,7 @@ <fieldset class="polls"> <!-- BEGIN poll_option --> - <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}"> + <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}"> <dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt> <!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF --> <dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index a5a50780fe..307ed0f391 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -80,7 +80,7 @@ <!-- BEGIN poll_option --> <tr> <!-- IF S_CAN_VOTE --> - <td> + <td<!-- IF poll_option.POLL_OPTION_MOST_VOTES --> class="most-votes"<!-- ENDIF -->> <!-- IF S_IS_MULTI_CHOICE --> <input type="checkbox" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /> <!-- ELSE --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ad7e8c29bc..9dc965240f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -858,6 +858,7 @@ if (!empty($topic_data['poll_start'])) $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100)); $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0; $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); + $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; $template->assign_block_vars('poll_option', array( 'POLL_OPTION_ID' => $poll_option['poll_option_id'], @@ -868,6 +869,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_OPTION_PCT' => round($option_pct * 100), 'POLL_OPTION_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, + 'POLL_OPTION_MOST_VOTES' => $option_most_votes, )); } |
