Commit d9a502cb authored by Sven Franck's avatar Sven Franck

WIP commit

parent c6cc2035
......@@ -41,8 +41,9 @@ html body select.invalid ~ .ui-invalid-label {
span.static {
padding: 0 .5em;
}
/* TODO: don't use important!!! */
/* TODO: don't use important!!!, padding is for missing clear button! */
.ui-mask-input {
padding-right: 2.375em;
background: 0 none !important;
}
.ui-mask-input.ui-focus {
......@@ -58,6 +59,7 @@ span.static {
line-height: 100%;
display: inline-block;
text-transform: capitalize;
padding-top: .5em;
}
.info:after {
content: "|";
......@@ -466,7 +468,7 @@ form .span_1 {
@media (max-width: 40em) {
.span_1, .span_2, form .span_1, form .span_2 {
width: 100%;
padding: 0;
padding: .25em 0;
}
.span_1 textarea {
width: 100%;
......
......@@ -18,6 +18,14 @@ body .ui-controlgroup-label legend {
html .listview .ui-li-divider {
font-size: 80%;
}
body .ui-fieldcontain .ui-controlgroup-label legend {
font-size: 95%;
}
@media (max-width: 40em) {
body .ui-fieldcontain .ui-controlgroup-label legend {
font-size: 92.5%;
}
}
/* Watermark NOTE: breaks links if ui-content is kept position:static
.ui-page-active:before,
......@@ -101,6 +109,8 @@ html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-top .ui-plai
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-bottom .ui-btn,
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-bottom .ui-plain-text,
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn,
html .ui-page-theme-slapos-white .ui-controlbar ~ .ui-controlgroup .ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible h1 a.ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn,
html .ui-page-theme-slapos-white .ui-table thead a.ui-btn,
html .ui-page-theme-slapos-white .ui-table thead label,
......@@ -117,6 +127,7 @@ html .ui-page-theme-slapos-white .ui-table-wrapper,
html .ui-page-theme-slapos-white .ui-popup .ui-header,
html .ui-page-theme-slapos-white .ui-popup .ui-footer,
html .ui-page-theme-slapos-white .ui-table-wrapper .ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible h1 a.ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
background-image: -webkit-gradient(linear, left top, left bottom, from( #fff ), to( #f1f1f1 ));
background-image: -webkit-linear-gradient( #fff , #f1f1f1 );
......@@ -310,7 +321,8 @@ html .ui-page-theme-slapos-white table tr th:hover ~ td,
/* controlbars */
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn:hover,
/* tabs */
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn:hover {
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn:hover,
html .ui-page-theme-slapos-white .ui-collapsible h1 a.ui-btn:hover{
background-color: #e8e8e8;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#e8e8e8));
background: -webkit-linear-gradient(bottom, #fff, #e8e8e8);
......@@ -356,6 +368,8 @@ html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-top .ui-plai
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-bottom .ui-btn,
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-bottom .ui-plain-text,
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn,
html .ui-page-theme-slapos-black .ui-controlbar ~ .ui-controlgroup .ui-btn,
html .ui-page-theme-slapos-black .ui-collapsible h1 a.ui-btn,
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn,
html .ui-page-theme-slapos-black .ui-table thead a.ui-btn,
html .ui-page-theme-slapos-black .ui-table thead label,
......@@ -373,6 +387,7 @@ html .ui-page-theme-slapos-black .ui-table-wrapper,
html .ui-page-theme-slapos-black .ui-popup .ui-header,
html .ui-page-theme-slapos-black .ui-popup .ui-footer,
html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn,
html .ui-page-theme-slapos-black .ui-collapsible h1 a.ui-btn
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
......@@ -539,11 +554,13 @@ html body .ui-header .ui-group-theme-slapos-black .ui-btn:hover,
font-weight: normal;
line-height: 325% /* could also be 3.25em, but this is more flexible, while being crap! */;
}
/* Button special handling: listitem */
/* Button special handling: listitem , collapsibles */
.ui-page-theme-slapos-black .ui-panel-inner li .ui-btn,
html .ui-bar-slapos-black .ui-panel-inner li .ui-btn,
html .ui-body-slapos-black .ui-panel-inner li .ui-btn,
html .ui-body-slapos-black .ui-panel-inner li.ui-li-static,
html body .ui-panel-inner .ui-collapsible .ui-collapsible-heading a.ui-btn.ui-collapsible-heading-toggle,
html body .ui-panel-inner .ui-group-theme-slapos-black .ui-collapsible .ui-collapsible-heading a.ui-btn.ui-collapsible-heading-toggle,
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-black,
html body .ui-panel-inner li .ui-group-theme-slapos-black .ui-btn,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-black,
......@@ -551,6 +568,8 @@ html body .ui-panel-inner li .ui-group-theme-slapos-black .ui-btn,
.ui-page-theme-slapos-black .ui-panel-inner li .ui-btn:visited,
html .ui-bar-slapos-black .ui-panel-inner li .ui-btn:visited,
html .ui-body-slapos-black .ui-panel-inner li .ui-btn:visited,
html body .ui-panel-inner .ui-collapsible .ui-collapsible-heading a.ui-btn.ui-collapsible-heading-toggle:visited,
html body .ui-panel-inner .ui-group-theme-slapos-black .ui-collapsible .ui-collapsible-heading a.ui-btn.ui-collapsible-heading-toggle:visited
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-black:visited,
html body .ui-panel-inner li .ui-group-theme-slapos-black .ui-btn:visited,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-black:visited {
......@@ -583,6 +602,7 @@ html .ui-page-theme-slapos-black table tr th:hover ~ td,
/* controlbars */
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:hover,
/* tabs */
html .ui-page-theme-slapos-black .ui-collapsible h1 a.ui-btn:hover
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn:hover {
background: #222;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
......@@ -692,6 +712,8 @@ html .ui-page-theme-slapos-white .ui-table-wrapper .ui.btn.ui-btn-active,
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn:active,
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn.ui-btn-active,
/* Tab Buttons */
html .ui-page-theme-slapos-white .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-white .ui-collapsible h1 a.ui-btn.ui-btn-active,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn.ui-btn-active,
/* black */
......@@ -737,6 +759,8 @@ html table.ui-table tbody tr.linkable:hover th:not(.ui-no-result),
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:active,
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn.ui-btn-active,
/* Tab Buttons */
html .ui-page-theme-slapos-black .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-black .ui-collapsible h1 a.ui-btn.ui-btn-active
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn.ui-btn-active,
/* LOADER */
......@@ -884,13 +908,22 @@ html .ui-header .ui-last-wrap .ui-controlgroup-controls .ui-btn {
/* TODO: form fields should auto-expand to full width */
@media (min-width: 40em) {
.ui-fieldcontain label:not(.ui-btn),
.ui-fieldcontain div.ui-controlgroup-label,
.ui-fieldcontain div.ui-controlgroup,
.ui-fieldcontain div.ui-input-text,
.ui-fieldcontain div.ui-input-search,
.ui-fieldcontain div.ui-select {
display: inline-block;
vertical-align: middle;
}
.ui-fieldcontain label:not(.ui-btn) {
.ui-fieldcontain div.ui-controlgroup-label,
.ui-fieldcontain div.ui-controlgroup {
vertical-align: top;
padding-top: .5em;
padding-bottom: .5em;
}
.ui-fieldcontain label:not(.ui-btn),
.ui-fieldcontain div.ui-controlgroup-label {
/* width: 46% *//*40% not working either*/
max-width: 30%;
min-width: 30%;
......@@ -902,6 +935,9 @@ html .ui-header .ui-last-wrap .ui-controlgroup-controls .ui-btn {
.ui-fieldcontain div.ui-select {
width: 46%;
}
.ui-fieldcontain div.ui-controlgroup {
width: 57%;
}
.ui-fieldcontain div.ui-select .ui-btn {
-webkit-box-shadow: none;
-moz-box-shadow: none;
......@@ -1683,7 +1719,7 @@ html.ui-nosvg .ui-btn-icon-left:after {
bottom: 0;
top: 0;
box-shadow: none !important;
font-size: 1.25em;
font-size: 1.2em;
height: 100%;
left: 0.25em;
line-height: 1em;
......@@ -1693,7 +1729,7 @@ html.ui-nosvg .ui-btn-icon-left:after {
position: absolute;
text-align: center;
width: 22px;
top: 19%; /* no friend... */
top: 29%; /* no friend... */
}
.ui-listview li span.ui-li-icon-custom:after {
background: none repeat scroll 0 center transparent;
......@@ -1786,6 +1822,8 @@ html body .ui-input-search .ui-input-clear:active {
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
}
/* ================================== collapsibles ============================ */
/* collapsibles - fix default 200% font-size set by browser */
html .ui-collapsible h1 {
font-size: 100%; /* clean this up... should not be necessary */
......@@ -1793,6 +1831,17 @@ html .ui-collapsible h1 {
html .ui-collapsible .ui-collapsible-content .ui-listview li a.ui-btn {
font-weight: normal;
}
html .ui-collapsible {
margin: 0;
}
html .ui-collapsible h1 {
font-size: .9em;
}
html .ui-panel-inner .ui-collapsible h1 a.ui-collapsible-heading-toggle {
padding: 0.4em 2.75em !important;
font-weight: bold;
}
/* selectmenu - crap... */
.ui-select .ui-btn-corner-all,
......
......@@ -65,7 +65,7 @@
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "a", "direct": {"className": "action ui-btn ui-btn-icon-left ui-icon-sitemap ui-shadow ui-corner-all","href":"#global-popup"},"attributes": {"data-rel":"popup"},"logic": {"text":"Group"}}]
"children": [{"type": "a", "direct": {"className": "ui-btn ui-btn-icon-left action ui-icon-sitemap ui-shadow ui-corner-all","href":"#cedric"},"attributes": {"data-action": "show_tree", "data-rel":"panel"},"logic": {"text":"Group"}}]
}, {
"generate": "widget",
"type": "table",
......
......@@ -124,6 +124,25 @@
{"type": "item", "href": "#about", "left": {"icon": "book"}, "center": {"text": [{"type": "h1", "text": "About", "text_i18n": "global_dict.about"}, {"type": "p", "text": "Request further information", "text_i18n": "global_dict.about_subtitle"}]}}
]
}, {
"generate": "widget",
"type": "listview",
"class_list": null,
"theme": "slapos-black",
"children": [
{"type": "divider", "center": {"text": [{"type": "h1", "text": "Development", "text_i18n":"global_dict.dev"}]}}
]
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"theme": "slapos-black",
"content_theme": "slapos-black",
"text": "Test",
"text_i18n": "global_dict.test",
"inset": false,
"collapsed_icon": "dashboard"
},
"children": [{
"generate": "widget",
"type": "listview",
"class_list": null,
......@@ -131,9 +150,14 @@
"form": null,
"property_dict": {},
"children": [
{"type": "divider", "center": {"text": [{"type": "h1", "text": "Development", "text_i18n":"global_dict.dev"}]}},
{"type": "item", "href": "#test_page_module", "left": {"icon": "dashboard"}, "center": {"text": [{"type": "h1", "text": "Test", "text_i18n": "global_dict.test"}, {"type": "p", "text": "Test Environment", "text_i18n": "global_dict.test_environment"}]}}
{"type": "item", "href": "#", "left": {"icon": "video-camera"}, "center": {"text": [{"type": "h1", "text": "Cases", "text_i18n": "global_dict.cases"}, {"type": "p", "text": "<<nothing to see here>>", "text_i18n": "global_dict.test_cases"}]}},
{"type": "item", "href": "#", "left": {"icon": "code-fork"}, "center": {"text": [{"type": "h1", "text": "Nodes", "text_i18n": "global_dict.nodes"}, {"type": "p", "text": "<<nothing to see here>>", "text_i18n": "global_dict.test_nodes"}]}},
{"type": "item", "href": "#test_page_module", "left": {"icon": "file-o"}, "center": {"text": [{"type": "h1", "text": "Pages", "text_i18n": "global_dict.pages"}, {"type": "p", "text": "Create and run test pages locally", "text_i18n": "global_dict.test_pages"}]}},
{"type": "item", "href": "#", "left": {"icon": "folder-o"}, "center": {"text": [{"type": "h1", "text": "Reports", "text_i18n": "global_dict.reports"}, {"type": "p", "text": "<<nothing to see here>>", "text_i18n": "global_dict.test_results"}]}},
{"type": "item", "href": "#", "left": {"icon": "signal"}, "center": {"text": [{"type": "h1", "text": "Results", "text_i18n": "global_dict.results"}, {"type": "p", "text": "<<nothing to see here>>", "text_i18n": "global_dict.test_reports"}]}},
{"type": "item", "href": "#", "left": {"icon": "cog"}, "center": {"text": [{"type": "h1", "text": "Suites", "text_i18n": "global_dict.suites"}, {"type": "p", "text": "<<nothing to see here>>", "text_i18n": "global_dict.test_suites"}]}}
]
}]
}, {
"type": "a",
"direct": {"className": "unenhanced ui-btn", "href":"http://nexedi.com", "external": true },
......
......@@ -15,20 +15,6 @@
"generate": "gadget",
"type": "listbox",
"href": "person_overview"
},{
"generate": "widget",
"type": "panel",
"id": "cedric",
"theme": "slapos-white",
"property_dict": {
"close": null
},
"children": [{
"type": "p",
"direct": {},
"attributes": {},
"logic": {"text": "Hello Cedric"}
}]
}],
"new": [
{
......
......@@ -15,8 +15,21 @@
"generate": "gadget",
"type": "listbox",
"href": "computer_overview"
}
],
} ,{
"generate": "widget",
"type": "panel",
"id": "cedric",
"theme": "slapos-white",
"property_dict": {
"close": null
},
"children": [{
"type": "p",
"direct": {},
"attributes": {},
"logic": {"text": "Hello Cedric"}
}]
}],
"new": [
{
"generate": "gadget",
......
......@@ -93,7 +93,7 @@
"enabled": true,
"editable": true,
"external_validator": null,
"required": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
......@@ -115,9 +115,9 @@
"widget": {
"id": "description",
"title": "Description",
"title_i18n": "portal_type_dict.person_dict.field_dict.description.title",
"title_i18n": "portal_type_dict.test_page_dict.field_dict.description.title",
"description": "The description of this test page.",
"description_i18n": "portal_type_dict.person_dict.field_dict.description.description",
"description_i18n": "portal_type_dict.test_page_dict.field_dict.description.description",
"alternate_name": "description",
"css_class": null,
"hidden": null,
......@@ -253,7 +253,7 @@
"enabled": true,
"editable": true,
"external_validator": null,
"required": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
......@@ -356,14 +356,14 @@
"widget": {
"id": "state",
"title": "State",
"title_i18n": "portal_type_dict.person_dict.field_dict.state.title",
"title_i18n": "portal_type_dict.test_page_dict.field_dict.state.title",
"description": "The state of this test page.",
"description_i18n": "portal_type_dict.person_dict.field_dict.state.description",
"description_i18n": "portal_type_dict.test_page_dict.field_dict.state.description",
"alternate_name": "state",
"default_value": null,
"css_class": null,
"hidden": null,
"items": null,
"items": "getStateOfTestPage",
"size": null,
"extra": null,
"extra_per_item": null
......@@ -389,5 +389,94 @@
"i18n": "validation_dict.option_not_available"
}
}
},
"text_content": {
"type":"TextareaField",
"widget": {
"id": "text_content",
"title": "Test Instructions",
"title_i18n": "portal_type_dict.test_page_dict.field_dict.text_content.title",
"description": "The test instructions for this test page.",
"description_i18n": "portal_type_dict.test_page_dict.field_dict.text_content.description",
"alternate_name": "text_content",
"css_class": null,
"hidden": null,
"width":null,
"height":null,
"extra":null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": null,
"preserve_whitespace": null,
"unicode": null,
"maximum_lines": null,
"maximum_length_of_line": null,
"maximum_characters": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_many_lines": {
"message": "You have entered too many lines.",
"i18n": "validation_dict.too_many_lines"
},
"line_too_long": {
"message": "One or more lines you have entered are too long.",
"i18n": "validation_dict.too_long_lines"
},
"too_long": {
"message": "You have entered too many characters.",
"i18n": "validation_dict.too_many_chars"
}
}
},
"content_type": {
"type":"RadioField",
"widget": {
"id": "content_type",
"title": "Content Type",
"title_i18n": "portal_type_dict.test_page_dict.field_dict.content_type.title",
"description": "The content type of the test instructions.",
"description_i18n": "portal_type_dict.test_page_dict.field_dict.content_type.description",
"alternate_name": "content_type",
"css_class": null,
"hidden": null,
"size": 1,
"items": "getContentFormat",
"select_first_item": true,
"extra_per_item": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": null,
"preserve_whitespace": null,
"unicode": null
},
"messages": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input is required but no input given.",
"i18n": "validation_dict.required"
},
"unknown_selection": {
"message":"You selected on option not on the menu",
"i18n": "validation_dict.option_not_available"
}
}
}
}
\ No newline at end of file
......@@ -14,8 +14,133 @@
"generate": "gadget",
"type": "listbox",
"href": "test_page_overview"
}, {
"generate": "widget",
"type": "panel",
"id": "test_page_detail_search",
"theme": "slapos-white",
"property_dict": {
"close": null,
"local": true
},
"children": []
}
]
],
"new": [{
"generate": "gadget",
"type": "fieldlist",
"href": "test_page_new"
}]
}
}, {
"generate": "widget",
"type": "page",
"title": "Test Page",
"title_i18n": "portal_type_dict.test_page_dict.text_dict.page",
"theme": "slapos-white",
"view_dict": {
"default": [{
"generate": "widget",
"type": "collapsibleset",
"property_dict": {
"direction": "horizontal",
"inset": true
},
"children": [{
"generate": "widget",
"type": "collapsible",
"property_dict": {
"collapsed": false,
"text": "View",
"text_i18n": "page_dict.test_page_dict.text_dict.view"
},
"children": [{
"generate": "gadget",
"type":"fieldlist",
"href": "test_page_view"
}]
},{
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Edit",
"text_i18n": "page_dict.test_page_dict.text_dict.edit"
},
"children": []
},{
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Test Report",
"text_i18n": "page_dict.test_page_dict.text_dict.test_report"
},
"children": []
},{
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Edit Slideshow",
"text_i18n": "page_dict.test_page_dict.text_dict.edit_slideshow"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Edit Test",
"text_i18n": "page_dict.test_page_dict.text_dict.edit_test"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Related Documents",
"text_i18n": "page_dict.test_page_dict.text_dict.related"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Contents",
"text_i18n": "page_dict.test_page_dict.text_dict.contents"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Local Roles",
"text_i18n": "page_dict.test_page_dict.text_dict.roles"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Consistency",
"text_i18n": "page_dict.test_page_dict.text_dict.consistency"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "History",
"text_i18n": "page_dict.test_page_dict.text_dict.history"
},
"children": []
}, {
"generate": "widget",
"type": "collapsible",
"property_dict": {
"text": "Metadata",
"text_i18n": "page_dict.test_page_dict.text_dict.metadata"
},
"children": []
}]
}]
}
}
]
......
{
"portal_type_source": "Test Page",
"portal_type_title": "test",
"portal_type_fields": "test_page_fieldlist",
"initial_query": {"include_docs": true, "limit":[0,1]},
"form": true,
"view": "web_view",
"property_dict": {
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#test_page_module/__id__"
},
"scheme": [
{
"position": "left",
"fieldlist": [
{"field": "title"},
{"field": "short_title"}
]
}, {
"position": "right",
"fieldlist": [
{"field": "description"}
]
}
],
"children": [{
"generate": "widget",
"type": "form",
"class_list": "responsive",
"property_dict": {
"editable": true,
"secure": "default",
"secret_hash": "foo",
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA"
},
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "center",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "input", "direct": {"value": "Submit", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"new", "data-icon":"save", "data-i18n":"[value]portal_type_dict.test_page_dict.text_dict.add", "data-theme": "slapos-black"}}
]
}]
}
]
}
......@@ -6,7 +6,7 @@
"form": true,
"view": "web_view",
"property_dict": {
"dynamic_children": [1],
"dynamic_children": [2],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
......@@ -33,7 +33,7 @@
"search": {
"text": "Search Test Pages",
"text_i18n": "portal_type_dict.test_page_dict.text_dict.search",
"info_list": ["records", "filter", "selected"]
"info_list": ["records", "filter"]
},
"allow_new": true
},
......@@ -68,12 +68,23 @@
],
"children": [{
"type": "a",
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#test_page/new"},
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#test_page_module/new"},
"attributes": {
"data-i18n": "[value]portal_type_dict.test_page_dict.text_dict.add",
"data-i18n": "portal_type_dict.test_page_dict.text_dict.add",
"data-icon": "edit"
},
"logic": {"text":"Add a test page"}
"logic": {"text":"Add Test Page"}
}, {
"generate": "widget",
"type": "controlgroup",
"class_list": "right",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "a", "direct": {"href": "#test_page_detail_search", "className": "translate ui-btn ui-icon-sitemap ui-btn-icon-notext action"}, "attributes": {"data-action": "group", "data-rel":"panel", "data-i18n":"portal_type_dict.test_page_dict.text_dict.group"}, "logic": {"text":"Group Record Filter"}},
{"type": "a", "direct": {"href": "#test_page_detail_search", "className": "translate ui-btn ui-icon-filter ui-btn-icon-notext action"}, "attributes": {"data-action": "filter", "data-rel":"panel", "data-i18n":"portal_type_dict.test_page_dict.text_dict.filter"}, "logic": {"text":"Detail Search"}}
]
}, {
"generate": "widget",
"type": "table",
......
[
{
"_id": "foo",
"short_title": "bar",
"portal_type": "Test Page"
},
{
"_id": "baz",
"short_title": "bam",
"portal_type": "Test Page"
}
]
\ No newline at end of file
{
"portal_type_source": "Test Page",
"portal_type_title": "test",
"portal_type_fields": "test_page_fieldlist",
"initial_query": {"include_docs": true, "limit":[0,1]},
"form": true,
"view": "web_view",
"property_dict": {
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2
},
"scheme": [
{
"position": "left",
"fieldlist": [
{"field": "_id", "overrides": {"properties":{"editable": false}}},
{"field": "reference"},
{"field": "title"},
{"field": "short_title"}
]
}, {
"position": "right",
"fieldlist": [
{"field": "version"},
{"field": "language"},
{"field": "index"},
{"field": "state"},
{"field": "content_type"}
]
}, {
"position": "center",
"fieldlist": [
{"field": "description"}
]
}
],
"children": [{
"generate": "widget",
"type": "form",
"class_list": "responsive",
"property_dict": {
"editable": true,
"secure": "default",
"secret_hash": "foo",
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA"
},
"children": [{
"generate": "widget",
"type": "controlgroup",
"class_list": "center",
"property_dict": {
"direction": "horizontal"
},
"children": [
{"type": "input", "direct": {"value": "Submit", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"update", "data-icon":"check", "data-i18n":"[value]portal_type_dict.test_page_dict.text_dict.update", "data-theme": "slapos-black"}}
]
}]
}
]
}
......@@ -48,7 +48,6 @@
*/
ERP5Storage.prototype._getDoc = function (command, hal, param, options) {
var fetch, force, item = (param || {})._id || (hal._links.me || {}).href;
if (!item) {
command.error(401);
}
......@@ -176,14 +175,15 @@
* @param {Object} options The command options
*/
ERP5Storage.prototype.post = function (command, metadata, options) {
var that = this;
var hal, that = this;
return that._getBase()
.then(function (site_hal) {
return that._getDoc(command, site_hal, undefined, options);
hal = site_hal;
return that._getDoc(command, hal, undefined, options);
})
.then(function (result) {
var key, custom_action = result._actions[options._action],
post_action = custom_action || result._actions.add,
post_action = custom_action || hal._actions.add,
data = new FormData();
for (key in metadata) {
......@@ -262,7 +262,6 @@
}
}
}
return jIO.util.ajax({
"type": put_action.method,
"url": put_action.href,
......
......@@ -319,7 +319,7 @@
metadata._id = response.id;
method = "put";
} else {
// TODO: master 404/offline handling
// TODO: no-access master 404/offline handling
}
for (index = 0; index < length; index += 1) {
......@@ -347,6 +347,7 @@
// setup master storage or all
if (master !== undefined) {
console.log("INTO MASTER")
priority_list[0] = success(
command.storage(storages[master]).put(metadata, option)
);
......@@ -367,7 +368,11 @@
var subindex;
switch (true) {
case response.status >= 500: command.error(response); break;
// NOTE: this means if the master is 503, nothing will be saved on
// the slave? Is this what I would want?
case response.status >= 500:
// command.error(response);
// break;
// HACK: why does 204 return status code 0 on promises?
case response.status === 0:
default:
......
......@@ -574,14 +574,16 @@ html table tr td .ui-radio label.ui-btn {
white-space: pre-line;
line-height: 0;
display: block;
margin: 1em auto;
margin: 0 auto 1em;
}
/* TODO: no fan */
.ui-controlbar ~ a.ui-btn {
.ui-controlbar ~ a.ui-btn,
.ui-controlbar ~ .ui-controlgroup .ui-btn {
float: left;
padding-top: .4em;
padding-bottom: .4em;
line-height: 1.4em;
margin: 0 auto 1em;
}
.ui-controlbar > * {
display: inline-block;
......@@ -593,7 +595,7 @@ html table tr td .ui-radio label.ui-btn {
}
.ui-controlbar .ui-input-search {
display: block;
margin: 0.5em auto;
margin: 0 auto;
}
/* align multiple controlgroups in a controlbar on wide screens */
html body div.ui-content .ui-controlbar .ui-controlgroup {
......@@ -634,25 +636,21 @@ html body .ui-controlbar > .ui-btn:not(.ui-input-clear, .ui-input-action) {
width: 60%;
display: inline-block;
padding: 0 3%;
}
.ui-controlbar,
.ui-controlbar ~ a.ui-btn,
.ui-controlbar ~ .ui-controlgroup .ui-btn {
margin: 0 auto;
}
}
/* custom bar */
.ui-bar-plain {
padding: .7em 1em;
border: 1px solid;
font-size: 1em;
}
/* search filter bar?
.ui-controlbar {
margin-top: 1em;
margin-bottom: 1em;
}
*/
.ui-controlbar .ui-plain-text {
display: block;
font-size: 80%;
......
......@@ -5,6 +5,7 @@
* 4. add checkbox-on/off, radio on/off icons to fontawesome icons
* 5. add JQM compat at end
* 6. replace all updated name in code...
* 7. JQM uses carat-t/b/l/r, add those to caret-left/right/top/bottom
*/
/*!
......@@ -787,16 +788,20 @@ html .ui-icon-google-plus:after {
html .ui-icon-money:after {
content: "\f0d6";
}
html .ui-icon-caret-down:after {
html .ui-icon-caret-down:after,
html .ui-icon-carat-d:after {
content: "\f0d7";
}
html .ui-icon-caret-up:after {
html .ui-icon-caret-up:after,
hmtl .ui-icon-carat-u:after{
content: "\f0d8";
}
html .ui-icon-caret-left:after {
html .ui-icon-caret-left:after,
html .ui-icon-carat-l:after {
content: "\f0d9";
}
html .ui-icon-caret-right:after {
html .ui-icon-caret-right:after,
html .ui-icon-carat-r:after {
content: "\f0da";
}
html .ui-icon-columns:after {
......
This diff is collapsed.
{
"global_dict": {
"cases": "Cases",
"nodes": "Nodes",
"pages": "Pages",
"results": "Results",
"reports": "Reports",
"suites": "Suites",
"edit": "Edit",
"delete": "Delete",
"dev": "Developemnt",
"test": "Test",
"test_environment": "UI test environment",
"test_cases": "<<nothing to see here>>",
"test_nodes": "<<nothing to see here>>",
"test_pages": "Create and run test pages locally",
"test_results": "<<nothing to see here>>",
"test_reports": "<<nothing to see here>>",
"test_suites": "<<nothing to see here>>",
"classic_login": "Or use the default login form",
"classic_slapos": "Login/Password",
"connection_status": "Connection",
......@@ -426,6 +440,16 @@
},
"test_page_dict": {
"text_dict": {
"metadata": "Metadata",
"history": "History",
"consistency": "Consistency",
"roles": "Local Roles",
"contents": "Contents",
"documents": "Related Documents",
"update": "Update",
"page": "Test Page",
"group": "Group Record Filter",
"filter": "Detailed Search",
"title": "Test Page Module",
"8":"8",
"16": "16",
......@@ -435,13 +459,21 @@
"empty": "No test pages found",
"search": "(I don't work but I should...) Search Test Pages.",
"long_title": "Long Title",
"add": "Add a new test page"
"add": "Add Test Page"
},
"field_dict": {
"reference": {
"title": "Reference",
"description": "The reference for this test page."
},
"text_content": {
"title": "Test Instructions",
"description": "The test instructions for this test page."
},
"content_type": {
"title": "Content Type",
"description": "The content type the test instructions are written in."
},
"title": {
"title": "Title",
"description": "The title of this test page."
......
......@@ -16,11 +16,93 @@
<script type="text/javascript" src="setup/jquery.testHelper.js"></script>
<script type="text/javascript">
var contentLoaded;
var contentLoaded, tableToJSON;
// stay idle
QUnit.config.autostart = false;
/**
* tabletojson
* jQuery plugin that reads an HTML table and returns a javascript object representing the values and columns of the table
*
* @author Daniel White
* @copyright Daniel White 2013
* @license MIT <https://github.com/lightswitch05/table-to-json/blob/master/MIT-LICENSE>
* @link https://github.com/lightswitch05/table-to-json
* @module tabletojson
* @version 0.6.0
*/
tableToJSON = function(table, opts) {
// Set options
var defaults = {
ignoreColumns: [],
onlyColumns: null,
ignoreHiddenRows: true,
headings: null
};
opts = $.extend(defaults, opts);
var notNull = function(value) {
if(value !== undefined && value !== null) {
return true;
}
return false;
};
var ignoredColumn = function(index) {
if( notNull(opts.onlyColumns) ) {
return $.inArray(index, opts.onlyColumns) === -1;
}
return $.inArray(index, opts.ignoreColumns) !== -1;
};
var arraysToHash = function(keys, values) {
var result = {};
$.each(values, function(index, value) {
if( index < keys.length ) {
result[ keys[index] ] = value;
}
});
return result;
};
var rowValues = function(row) {
var result = [];
$(row).children("td,th").each(function(cellIndex, cell) {
if( !ignoredColumn(cellIndex) ) {
var override = $(cell).data("override");
var value = $.trim($(cell).text());
result[ result.length ] = notNull(override) ? override : value;
}
});
return result;
};
var getHeadings = function(table) {
var firstRow = table.find("tr:first").first();
return notNull(opts.headings) ? opts.headings : rowValues(firstRow);
};
var construct = function(table, headings) {
var result = [];
table.children("tbody,*").children("tr").each(function(rowIndex, row) {
if( rowIndex !== 0 || notNull(opts.headings) ) {
if( $(row).is(":visible") || !opts.ignoreHiddenRows ) {
result[result.length] = arraysToHash(headings, rowValues(row));
}
}
});
return result;
};
// Run
var headings = getHeadings(table);
return construct(table, headings);
};
// DOMContentLoaded
contentLoaded = function (win, fn) {
var done = false,
......@@ -79,22 +161,71 @@
j = el.contentWindow.$;
helper = $.testHelper;
// ======================= start here ===========================
trigger = function (window, document, $, testHelper) {
trigger = function (window, d, $, testHelper) {
var i, instruction, madeJS, add;
var menu_button;
var string = '<table cellspacing="1" cellpadding="1" border="1">' +
'<thead>' +
'<tr class="title">' +
'<td colspan="3">Basic UI Interaction Test</td>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<td>Module</td>' +
'<td>We also want to test something else</td>' +
'<td></td>' +
'</tr>' +
'<tr>' +
'<td>waitForElementPresent</td>' +
'<td>//div[@id="global-panel"]</td>' +
'<td></td>' +
'</tr>' +
'<tr>' +
'<td>verifyText</td>' +
'<td>//div[@id="global-panel"]</td>' +
'<td>Menu</td>' +
'</tr>' +
'</tbody>' +
'</table>';
var tableToParse = tableToJSON( $(string), {"ignoreHiddenRows": false});
console.log(tableToParse)
madeJS = '';
for (i = 0; i < tableToParse.length; i += 1) {
instruction = tableToParse[i];
switch (instruction[i]) {
case "Module":
madeJS += 'module("' + instruction.Selector + '");';
break;
}
}
madeJS += ' asyncTest( "Number 2", function() {expect( 0 ); start(); });';
// inject
add = d.createElement("script");
add.type = "text/javascript";
add.appendChild(d.createTextNode(madeJS));
document.body.appendChild(add);
console.log("so...")
QUnit.start();
$.testHelper = testHelper;
// just a dummy....
window.setTimeout(function () {
QUnit.start();
// ========================
module( "Network Section" );
asyncTest( "Navigate to network page", function() {
var network_page, menu_button;
expect( 8 );
expect( 1 );
$.testHelper.pageSequence([
function() {
......@@ -102,6 +233,7 @@
ok( menu_button.length === 1, "Menu button exists, application init rendered correctly");
menu_button.trigger( "click" );
},
/*
function() {
setTimeout(function() {
ok( $("#global-panel").hasClass("ui-panel-open"), "panel opens when clicking menu button" );
......@@ -149,7 +281,7 @@
}
ok(test_value, "network has been generated and the name is matching what was entered before");
}, 1000);
},
},*/
function() {
start();
}
......
This diff is collapsed.
This diff is collapsed.
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