From 710df2e42bb5558a611577ee6f374b4450b37f84 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 18 Oct 2015 12:31:16 +0400 Subject: discussion board polls. --- data/js/polls.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 data/js/polls.js (limited to 'data') diff --git a/data/js/polls.js b/data/js/polls.js new file mode 100644 index 00000000..b34f0f7b --- /dev/null +++ b/data/js/polls.js @@ -0,0 +1,26 @@ +function addPoll() { + var a = byId('poll_add'); + setClass(a, 'hidden', false); + var parentNode = function(n, tag) { + while(n && n.nodeName.toLowerCase() != tag) + n = n.parentNode; + return n; + }; + var show = function(v) { + setClass(parentNode(byId('poll_q'), 'tr'), 'hidden', !v); + setClass(parentNode(byId('poll_opt'), 'tr'), 'hidden', !v); + setClass(parentNode(byId('poll_max'), 'tr'), 'hidden', !v); + setClass(parentNode(byId('poll_preview'),'tr'), 'hidden', !v); + setClass(parentNode(byId('poll_recast'), 'tr'), 'hidden', !v); + setClass(parentNode(a, 'tr'), 'hidden', v); + }; + a.onclick = function() { + show(true); + return true; + }; + show(false); +} + +// Discussion board polls +if(byId('poll_add')) + addPoll(); -- cgit v1.2.3 From ddbf3ae0ae530954b0e105e99819c85cfe4de17c Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 18 Oct 2015 12:32:05 +0400 Subject: discussion board polls. --- data/global.pl | 1 + data/js/main.js | 1 + data/lang.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ data/style.css | 18 ++++++++++++++++++ 4 files changed, 74 insertions(+) (limited to 'data') diff --git a/data/global.pl b/data/global.pl index de810926..a11c6869 100644 --- a/data/global.pl +++ b/data/global.pl @@ -115,6 +115,7 @@ our %S; posts => [ 25, 'VNDB Recent Posts', '/t' ], }, staff_roles => [qw|scenario chardesign art music songs director staff|], + poll_options => 20, # max number of options in discussion board polls ); diff --git a/data/js/main.js b/data/js/main.js index dc1d3b27..79a280c1 100644 --- a/data/js/main.js +++ b/data/js/main.js @@ -48,6 +48,7 @@ VARS = /*VARS*/; //include charops.js //include filter.js //include misc.js +//include polls.js // VN editing (/v+/edit) //include vnrel.js diff --git a/data/lang.txt b/data/lang.txt index ccfee14c..4827b981 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -4568,6 +4568,24 @@ es : Avanzado... tr : Gelişmiş... uk : Розширений режим it : Avanzate... + +:_poll_novote_login +en : You must be logged in to be able to vote. + +:_poll_choose +en : You may choose up to [_1] options + +:_poll_vote +en : Vote + +:_poll_no_votes +en : Nobody voted yet. + +:_poll_results +en : View results + +:_poll_total_votes +en : [_1] [quant,_1,vote,votes] total # Post edit/reply/new thread form @@ -4727,6 +4745,30 @@ es : Mirar [url,/d9.3,d9.3] para ver los formatos permitidos tr : Biçimlendirme kodları için [url,/d9.3,d9.3]'e bakınız. uk : Правила розмітки читай у [url,/d9.3,d9.3]. it : Vedi [url,/d9.3,d9.3] per i codici di formattazione + +:_postedit_form_poll_add +en : Add poll + +:_postedit_form_poll_q +en : Poll question + +:_postedit_form_poll_warning +en : All votes will be reset if any changes to the poll fields are made! + +:_postedit_form_poll_opt +en : Poll options + +:_postedit_form_poll_optmax +en : one per line,[br][_1] max + +:_postedit_form_poll_max +en : Number of options voter is allowed to choose + +:_postedit_form_poll_view +en : Allow users to view poll results before voting + +:_postedit_form_poll_recast +en : Allow users to change their vote # Browsing threads by board (/t/{board_id}) @@ -4980,6 +5022,9 @@ es : Último mensaje tr : Son gönderi uk : Останнє повідомлення it : Ultimo messaggio + +:_threadlist_poll +en : poll @@ -16225,6 +16270,9 @@ es : Personaje principal inválido. Asgúrate que la ID es correcta, que el pers tr : Geçersiz ana karakter. ID'nin doğruluğundan, ana karakterin bir başka karakterin örneği olmadığından, ve bu girdinin başka bir yerde ana karakter olarak kullanılmadığından emin olun. uk : Неправильний головний герой. Переконайтеся у правильності ID, головний персонаж — це не втілення іншого персонажа, і що цей запис не використовується в якості головного персонажа десь ще. it : Personaggio principale non valido. Assicurati che ID sia corretto, che il personaggio non sia un'instanza di un altro personaggio, e che questa pagina non è utilizzata come personaggio principale da un'altra parte. + +:_formerr_e_poll +en : Inappropriate number of options in a poll. :_formerr_title en : Error @@ -16261,6 +16309,12 @@ es : ¡[_1] es un campo requerido! tr : [_1] alanı gereklidir! uk : [_1] — обов’язкове поле! it : [_1] è un campo obbligatorio! + +:_formerr_min +en : [_1]: minimum number is [_2] + +:_formerr_max +en : [_1]: maximum number is [_2] :_formerr_minlength en : [_1]: should have at least [_2] characters diff --git a/data/style.css b/data/style.css index 736fb910..5cc054ef 100644 --- a/data/style.css +++ b/data/style.css @@ -314,6 +314,7 @@ div.mainbox.discussions b.boards a { color: $grayedout$; } div.discussions td.tc2 { width: 50px; } div.discussions td.tc3 { width: 90px; } div.discussions td.tc4 { width: 170px; } +div.discussions .pollflag { color: $grayedout$; padding-right: 6px; } div.postsearch td.tc1_1 { width: 60px; padding-left: 0; padding-right: 0; text-align: right } div.postsearch td.tc1_2 { width: 25px; padding-left: 0 } div.postsearch td.tc2 { width: 65px; } @@ -401,6 +402,23 @@ div#vntags { margin: 15px 30px 0 30px; border-top: 1px solid +/***** Polls ****/ + +.votebooth thead td { font-weight: normal; background: transparent; padding-bottom: 5px; } +.votebooth tfoot td { padding-top: 5px } +.votebooth td { vertical-align: middle; padding: 0 8px; } +.votebooth { margin: 0 30px } +.votebooth td.tc1 { padding-right: 20px } +.votebooth td.tc2 { min-width: 220px } +.votebooth td.tc2 div { margin: 2px; } +.votebooth td.tc2 div.graph { float: left; height: 14px; background-color: $border$; padding: 0; } +.votebooth td.tc3 { text-align: right; padding-right: 16px; } +.votebooth .submit { width: 100px } +.votebooth .option { margin-left: 8px } +.votebooth .option.own { font-weight: bold } + + + /***** VN edit *****/ #jt_box_vn_rel table { margin-bottom: 10px; } -- cgit v1.2.3 From 721f22030f2f87c291bde088bf96648e9cdedc0d Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 10 Nov 2015 08:11:15 +0400 Subject: added poll error message. --- data/lang.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'data') diff --git a/data/lang.txt b/data/lang.txt index 5cb34a3e..5ebafdeb 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -4575,6 +4575,9 @@ en : View results :_poll_total_votes en : [_1] [quant,_1,vote,votes] total +:_poll_error +en : Poll error + # Post edit/reply/new thread form -- cgit v1.2.3