summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-09 11:45:32 +0200
committerYorhel <git@yorhel.nl>2009-10-09 11:47:54 +0200
commitd43ae33a587743fc0916930e0a39f561f3174a69 (patch)
treedb92a9126357b5cfc826a9506cfe89a6da98bda2 /data
parent9b379e376cbafc8408d8ff3318a39ca2631f510a (diff)
Added producer role (developer/publisher) to DB and release editor
They aren't displayed on the site yet, though.
Diffstat (limited to 'data')
-rw-r--r--data/lang.txt12
-rw-r--r--data/script.js37
-rw-r--r--data/style.css3
3 files changed, 37 insertions, 15 deletions
diff --git a/data/lang.txt b/data/lang.txt
index 0b00f7c5..e78bf30b 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -1942,6 +1942,18 @@ ru : Выбранные компании
en : Add producer
ru : Добавить компанию
+:_redit_form_prod_dev
+en : Developer
+ru*:
+
+:_redit_form_prod_pub
+en : Publisher
+ru*:
+
+:_redit_form_prod_both
+en : Both
+ru*:
+
:_redit_form_prod_addbut
en : add
ru*:
diff --git a/data/script.js b/data/script.js
index bd56f12e..cc984230 100644
--- a/data/script.js
+++ b/data/script.js
@@ -1426,8 +1426,10 @@ if(byId('jt_box_rel_vn'))
function rprLoad() {
var ps = byId('producers').value.split('|||');
- for(var i=0; i<ps.length && ps[i].length>1; i++)
- rprAdd(ps[i].split(',',2)[0], ps[i].split(',',2)[1]);
+ for(var i=0; i<ps.length && ps[i].length>1; i++) {
+ var val = ps[i].split(',',3);
+ rprAdd(val[0], val[1], val[2]);
+ }
rprEmpty();
dsInit(byId('producer_input'), '/xml/producers.xml?q=',
@@ -1442,12 +1444,17 @@ function rprLoad() {
byId('producer_add').onclick = rprFormAdd;
}
-function rprAdd(id, name) {
+function rprAdd(id, role, name) {
+ var roles = byId('producer_role').options;
+ var rl = tag('select', {onchange:rprSerialize});
+ for(var i=0; i<roles.length; i++)
+ rl.appendChild(tag('option', {value: roles[i].value, selected:role==roles[i].value}, getText(roles[i])));
+
byId('producer_tbl').appendChild(tag('tr', {id:'rpr_'+id, rpr_id:id},
tag('td', {'class':'tc_name'}, 'p'+id+':', tag('a', {href:'/p'+id}, shorten(name, 40))),
+ tag('td', {'class':'tc_role'}, rl),
tag('td', {'class':'tc_rm'}, tag('a', {href:'#', onclick:rprDel}, mt('_redit_form_prod_remove')))
));
- rprStripe();
rprEmpty();
}
@@ -1458,7 +1465,6 @@ function rprDel() {
tr.parentNode.removeChild(tr);
rprEmpty();
rprSerialize();
- rprStripe();
return false;
}
@@ -1470,12 +1476,6 @@ function rprEmpty() {
tbl.removeChild(byId('rpr_tr_none'));
}
-function rprStripe() {
- var l = byName(byId('producer_tbl'), 'tr');
- for(var i=0; i<l.length; i++)
- setClass(l[i], 'odd', i%2);
-}
-
function rprFormAdd() {
var txt = byId('producer_input');
var lnk = byId('producer_add');
@@ -1503,7 +1503,10 @@ function rprFormAdd() {
if(byId('rpr_'+id))
return alert(mt('_redit_form_prod_double'));
- rprAdd(id, items[0].firstChild.nodeValue);
+ var role = byId('producer_role');
+ role = role[role.selectedIndex].value;
+
+ rprAdd(id, role, items[0].firstChild.nodeValue);
rprSerialize();
});
return false;
@@ -1513,8 +1516,14 @@ function rprSerialize() {
var r = [];
var l = byName(byId('producer_tbl'), 'tr');
for(var i=0; i<l.length; i++)
- if(l[i].rpr_id)
- r[r.length] = l[i].rpr_id + ',' + getText(byName(byClass(l[i], 'td', 'tc_name')[0], 'a')[0]);
+ if(l[i].rpr_id) {
+ var role = byName(byClass(l[i], 'td', 'tc_role')[0], 'select')[0];
+ r[r.length] = [
+ l[i].rpr_id,
+ role.options[role.selectedIndex].value,
+ getText(byName(byClass(l[i], 'td', 'tc_name')[0], 'a')[0])
+ ].join(',');
+ }
byId('producers').value = r.join('|||');
}
diff --git a/data/style.css b/data/style.css
index af9370e3..56c68f3c 100644
--- a/data/style.css
+++ b/data/style.css
@@ -870,8 +870,9 @@ div.scr_uploader { visibility: hidden; overflow: hidden; width: 1px; height: 1px
#jt_box_rel_vn h2, #jt_box_rel_prod h2 { clear: left; padding-top: 10px; }
#jt_box_rel_vn div, #jt_box_rel_vn table,
#jt_box_rel_prod div, #jt_box_rel_prod table { margin-left: 20px }
-#jt_box_rel_vn input, #jt_box_rel_prod input { margin-right: 10px; width: 300px }
+#jt_box_rel_vn input, #jt_box_rel_prod input { margin-right: 10px; width: 295px }
#jt_box_rel_vn .tc_title, #jt_box_rel_prod .tc_name { width: 310px; padding: 2px }
+#jt_box_rel_prod .tc_role select { width: 100px; margin-right: 10px; }