概要
投票 - poll:カテゴリに作成される、通常のRate以外でVoteシステムを投票に用いるためのページに付与されるタグです。
タグリストより
poll
- サイト上で投票を行う際、専用の個別Rateモジュールを設置するために作成されるページが属するカテゴリです。
- このカテゴリに作成されるページ(_404, _templateを除く)には、"投票"タグが付与されている必要があります。
- このカテゴリにページを作成する際は、サイトスタッフから許可を受ける必要があります。
- 許可なくこのカテゴリにページを作成した場合、予告なく削除される場合があります。
投票は、編集禁止タグに指定されているメジャータグであり、ページ分類です。殆どの場合において、スタッフが作成・管理します。
このページでは、それら投票ページの作り方・使い方を解説します。
用途
Wikidotのページは、通常1ページにつき1つのRate値しか持てません。そのため、フォーラム上での投票(通常、フォーラムスレッドではModule Rateを含むをModule機能を使用できません)や、コンテストの決選投票(その記事の通常のRateとはまた別に評価を付与したいケース)を行う際には、投票対象ごとに投票ページを作成することで、その投票専用の一時的なRateモジュールを使用できます。
提案スレッドで用いることで、気軽に賛否を表明できるようにするなどの効果も期待できます。
使い方
ページを作成する
投票対象ごとに、専用の投票ページを作成します。
必ずpollカテゴリに作成してください(URLがhttp://scp-jp.wikidot.com/poll:〜〜〜となるようにしてください)。
作成したら、タグを付与してください。基本的に必要なものはjp 投票のみです。
作成報告は基本的に不要です。
作成したページには、以下のコードをコピペすると同時に、そのページが何の投票に用いられているかが分かるような文章を入れてください。
[[>]]
[[module Rate]]
[[/>]]
[[div class="blockquote pollNote"]]
このページはの決選投票に使用されているSCP-XXX-JP用のページです。
[[/div]]
[[moduleCSS]] :root{ --info-circle-size:150px; --info-up-bg: lightgreen; --info-down-bg: pink; --info-border-color:#b01; }.onlyvisible{padding:0.25em; }.onlyvisible.page-rate-widget-box{align-items:center; display: flex; flex-wrap: wrap; font-size:1.2em; justify-content:center; vertical-align:middle; }.onlyvisiblediv.page-rate-widget-box.rate-points{background:#633; border-radius:5px5px00; box-shadow:002px#633; text-align:center; padding:.5em; width:100%; }.onlyvisible.page-rate-widget-box.rateup, .onlyvisible.page-rate-widget-box.ratedown, .onlyvisible.page-rate-widget-box.cancel{background-color:transparent; border:none; display:block; flex-grow:1; font-weight:bold; margin:1px00; text-align:center; }.onlyvisible.page-rate-widget-box.cancel{width:100%; }.onlyvisible.page-rate-widget-box.rateupa, .onlyvisible.page-rate-widget-box.ratedowna, .onlyvisible.page-rate-widget-box.cancela{background:#fff; box-shadow:002px#633; color:#633; display:block; margin:0; padding:.25em; transition:all.25s; }.onlyvisible.page-rate-widget-box.cancela{color:#966; }.onlyvisible.page-rate-widget-box.rateupa:hover{background: var(--info-up-bg); color:#fff; }.onlyvisible.page-rate-widget-box.ratedowna:hover{background: var(--info-down-bg); color:#fff; }.onlyvisible.page-rate-widget-box.cancela:hover{background:#966; color:#fff; }.onlyvisible.page-rate-widget-box.rateupa::before{content: '提案に賛成 ('; }.onlyvisible.page-rate-widget-box.ratedowna::before{content: '提案に反対 ('; }.onlyvisible.page-rate-widget-box.cancela::before{content: '投票をキャンセル ('; }.onlyvisible.page-rate-widget-box.rateupa::after, .onlyvisible.page-rate-widget-box.ratedowna::after, .onlyvisible.page-rate-widget-box.cancela::after{content: ')'; }.list-pages-box.rate_t3{display:inline-block; margin:1em00; }.list-pages-box.rate_t3.wrap{border-bottom:1pxsolid var(--info-border-color); display:inline-block; width: var(--info-circle-size); height: calc(var(--info-circle-size) / 2); overflow:hidden; }.list-pages-box.rate_t3.cir{width: var(--info-circle-size); height: var(--info-circle-size); margin:0; padding:0; transform: rotate(-90deg); }.list-pages-box.rate_t3.rad{width: calc(100% - 2px); height:0; padding: calc(50% - 1px) 00; margin:0; border:solid var(--info-border-color); }.list-pages-box.rate_t3.rad_def{background:gray; border-radius:50%; width: calc(100% - 2px); height:0; padding: calc(100% - 2px) 00; margin:0; border:1pxsolid var(--info-border-color); }.list-pages-box.rate_t3.uv{border-radius:100rem 100rem 00; background: var(--info-up-bg); border-width:1px1px0; }.list-pages-box.rate_t3.dv{border-radius:00100rem 100rem; background: var(--info-down-bg); border-width:01px1px; }[[/module]] [[divclass="onlyvisible"]] [[moduleRate]] [[moduleListPagesname="="]] [[=]] [[tableclass="rate_t3"]] [[row]] [[cellcolspan="2"style="display:[[#ifexpr %%rating_votes%% == 0 | none | table-cell ]];"]] [[divclass="wrap"]] [[divclass="cir"style="transform: rotate([[#expr (%%rating_votes%%-%%rating%%)/2/%%rating_votes%%*(-180)]]deg)"]] [[divclass="rad uv"]] [[/div]] [[divclass="rad dv"]] [[/div]] [[/div]] [[/div]] [[/cell]] [[cellcolspan="2"style="display:[[#ifexpr %%rating_votes%% == 0 | table-cell | none ]];"]] [[divclass="wrap"]] [[divclass="cir"]] [[divclass="rad_def"]] [[/div]] [[/div]] [[/div]] [[/cell]] [[/row]] [[rowstyle="display:[[#ifexpr %%rating_votes%% == 0 | none | table-row ]];"]] [[cellstyle="text-align: left;"]] 提案に賛成 [[#expr100- (%%rating_votes%%-%%rating%%)/2/%%rating_votes%%*100*100%10000/100]]% ([[#expr (%%rating%%+%%rating_votes%%)/2]]票) [[/cell]] [[cellstyle="text-align: right;"]] 提案に反対 [[#expr (%%rating_votes%%-%%rating%%)/2/%%rating_votes%%*100*100%10000/100]]% ([[#expr (%%rating_votes%%-%%rating%%)/2]]票) [[/cell]] [[/row]] [[rowstyle="display:[[#ifexpr %%rating_votes%% == 0 | table-row | none ]];"]] [[cellstyle="text-align: left;"]] 提案に賛成 -% (0票) [[/cell]] [[cellstyle="text-align: right;"]] 提案に反対 -% (0票) [[/cell]] [[/row]] [[/table]] [[/=]] [[/module]] [[/div]] [[divclass="hiddenDisclaimer"]] 提案の内容は、[ このスレッド]を参照してください。 [[/div]]
フォーラムに投票モジュールを表示させる
フォーラムに以下をコピペしてください。必要に応じて構文でデコレーションしてください。
[[div style="border-radius: 10px;border: 1px solid #497285;padding:8px;margin-bottom:8px;"]]
[ここに投票対象を入力]
**獲得票数**
[[>]]
[[iframe [投票対象用の投票ページのURL]?theme_url=http://05command-ja.wikidot.com/local--code_/how-to-poll/2 scrolling="no" style="width:180px; height:26px;overflow:hidden;"frameborder="0"]]
[[/>]]
[[/div]]
[[iframe [投票対象用の投票ページのURL]?theme_url=http://05command-ja.wikidot.com/local--code_/how-to-poll/3 style="width: 100%; height: 400px; overflow: hidden;"]]
投票終了後
使用した投票ページの最下部のメニューから、評価(Rate)をクリックし、表示される投票者を見る(Look who rated this page)を更にクリックしてください。
二重投票の有無等を軽くチェックしたら、最終的な投票結果として投票者の一覧とその票が+か-かを記録するためにコピーします。
ただ単純にコピーしただけだと、[[*user]]構文のアイコン部分のせいで名前が連続してコピーされてしまいます(「Nanigashi Sato Nanigashi Sato 」をコピペすると、「Nanigashi SatoNanigashi Sato」となります)。F12ボタンなどで検証画面を開き、コンソールに以下をコピペしてエンターキーを押してください。
document.querySelectorAll("#who-rated-page-area .printuser.avatarhover a:nth-of-type(1)").forEach(elem => {elem.remove()})
するとアイコン画像が消えるので、簡単にコピペできます。
2023年06月11日追記: サイトCSSの変更により名前の連続コピーが起きなくなったため、現在はそのままコピーしても問題ありません。
投票に用いたフォーラムやコンテストハブなどを開き、Editして投票モジュールを撤去したら、代わりに最終的な得点と先程コピーした投票者の記録を折り畳み構文などを使った上で記入してください。
これは投票期間後に投票されて点数が変わってしまうのを防ぐための措置です。
この作業が完了したら、使用済みの投票ページを削除してください。投票期間が終了した後、投票ページはなるべく早く削除するようにしてください。
コード置き場
#navi-bar, #navi-bar-shadow, #header, #side-bar, #page-title, #breadcrumbs, #page-info, .page-watch-options, .page-options-bottom, .page-tags, #footer, #license-area, #footer-bar, .odialog-shader, .hide-embed, .hiddenDisclaimer, .pollNote, .wikisys--template-dialog{display:none;}#main-content{margin:0!important; padding:0!important; width:100%!important; }body{margin:0!important; padding:0!important; }.owindow{position:static!important; width:0px; height:0px}#ohandle-1{font-size:0px!important; }.modal-header{font-size:0px!important; }.button-bar{position:absolute; top:0px; right:0px; } /*PageRatingModuleCustomizations*/ .page-rate-widget-box{display:inline; border-radius:5px; box-shadow:1px1px3px rgba(0,0,0,.5); margin:0; }div.page-rate-widget-box.rate-points{background-color:#633; border:solid1px#633; border-right:0; border-radius:5px005px; }.page-rate-widget-box.rateup, .page-rate-widget-box.ratedown{background-color:#fff6f0; border-top:solid1px#633; border-bottom:solid1px#633; font-weight:bold; }.page-rate-widget-box.rateupa, .page-rate-widget-box.ratedowna{background:transparent; color:#633; padding:04px; margin:01px; }.page-rate-widget-box.rateupa:hover, .page-rate-widget-box.ratedowna:hover{background:#633; color:#fffff0; text-decoration:none; }.page-rate-widget-box.cancel{background-color:#633 !important; border:solid1px#633; border-left:0; border-radius:05px5px0; }.page-rate-widget-box.cancela{background:transparent; text-transform:uppercase; color:#966; }.page-rate-widget-box.cancela:hover{border-radius:03px3px0; background:#633; color:#fffff0; text-decoration:none; }.owindow.button-bar{text-align: unset; padding: unset; margin: unset; } /*HeritageCollectionRatingModule*/ .heritage-rating-module{float:right; background-color:#633; padding:2px8px2px5px; border:solid1px#ccc066; border-radius:8px; box-shadow:01px3px rgba(0,0,0,.25); }.heritage-rating-module.page-rate-widget-box{float:right; box-shadow:none; margin-bottom:0; margin-right:0; }.heritage-rating-module.heritage-emblem{float:right; position:relative; top: -2px; left:2px; height:16px; width:16px; overflow:visible; margin-right:2px; }.heritage-rating-module.heritage-emblemimg{width:20px; height:20px; border:0; }
#navi-bar, #navi-bar-shadow, #header, #side-bar, #page-title, #breadcrumbs, #page-info, .page-watch-options, .page-options-bottom, .page-tags, #footer, #license-area, #footer-bar, .odialog-shader, .hide-embed, .hiddenDisclaimer, #page-content > *:not(.onlyvisible) {display:none !important;}#main-content{margin:0!important; padding:0!important; width:100%!important; }body{margin:0!important; padding:0!important; }.owindow{position:static!important; width:0px; height:0px}#ohandle-1{font-size:0px!important; }.modal-header{font-size:0px!important; }.button-bar{position:absolute; top:0px; right:0px; }