Commit d7a4c3fc authored by Romain Courteaud's avatar Romain Courteaud

erp5_run_my_doc: allow viewing/editing the slide title with the comment

parent 4e97f824
...@@ -278,10 +278,11 @@ ...@@ -278,10 +278,11 @@
["bottom", [["your_slide_content"]]] ["bottom", [["your_slide_content"]]]
] ]
} }
}; },
// Show chapter_title and slide_type inputs only during slide editing extra_group_list = [];
if (title_html !== null && type !== null) {
// Show chapter_title and slide_type inputs only during slide editing
if (title_html !== null) {
ck_editor_json.erp5_document._embedded._view.your_chapter_title = { ck_editor_json.erp5_document._embedded._view.your_chapter_title = {
"title": translation_dict["Chapter Title"], "title": translation_dict["Chapter Title"],
"type": "StringField", "type": "StringField",
...@@ -290,7 +291,10 @@ ...@@ -290,7 +291,10 @@
"key": "title_html", "key": "title_html",
"value": title_html "value": title_html
}; };
extra_group_list.push(["your_chapter_title"]);
}
if (type !== null) {
ck_editor_json.erp5_document._embedded._view.your_slide_type = { ck_editor_json.erp5_document._embedded._view.your_slide_type = {
"title": translation_dict["Type of Slide"], "title": translation_dict["Type of Slide"],
"type": "ListField", "type": "ListField",
...@@ -305,6 +309,7 @@ ...@@ -305,6 +309,7 @@
], ],
value: type value: type
}; };
extra_group_list.push(["your_slide_type"]);
if (image_url !== null) { if (image_url !== null) {
ck_editor_json.erp5_document._embedded._view.your_image_url = { ck_editor_json.erp5_document._embedded._view.your_image_url = {
...@@ -324,25 +329,15 @@ ...@@ -324,25 +329,15 @@
"key": "image_caption", "key": "image_caption",
"value": image_caption "value": image_caption
}; };
extra_group_list.push(["your_image_url"], ["your_image_caption"]);
}
}
if (extra_group_list.length !== 0) {
ck_editor_json.form_definition.group_list = [ ck_editor_json.form_definition.group_list = [
["left", [ ["left", extra_group_list]
["your_chapter_title"],
["your_slide_type"],
["your_image_url"],
["your_image_caption"]
]]
].concat(ck_editor_json.form_definition.group_list); ].concat(ck_editor_json.form_definition.group_list);
} else {
ck_editor_json.form_definition.group_list = [
["left", [
["your_chapter_title"],
["your_slide_type"]
]]
].concat(ck_editor_json.form_definition.group_list);
}
} }
return ck_editor_json; return ck_editor_json;
} }
...@@ -384,7 +379,7 @@ ...@@ -384,7 +379,7 @@
translation_dict, translation_dict,
"comment_html", "comment_html",
slide_dict.comment_html, slide_dict.comment_html,
null, slide_dict.title_html,
null, null,
null, null,
null null
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementNotPresent</td> <td>waitForElementNotPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementNotPresent</td> <td>waitForElementNotPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementNotPresent</td> <td>waitForElementNotPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementNotPresent</td> <td>waitForElementNotPresent</td>
<td>title_html</td> <td>type</td>
<td></td> <td></td>
</tr> </tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment