Commit 27a7020c authored by Sven Franck's avatar Sven Franck

refactor "no records found/no auth" handler, set in property_dict

parent f61fd7f4
...@@ -20,28 +20,20 @@ ...@@ -20,28 +20,20 @@
"text_i18n":"validation_dict.requires_auth", "text_i18n":"validation_dict.requires_auth",
"children": [ "children": [
{ {
"generate": "widget", "href": "#global-popup",
"type": "controlgroup", "class_list": "translate action",
"property_dict": {"direction": "horizontal"}, "action": "login",
"children": [{ "rel": "popup",
"type": "a", "text": "Login",
"direct":{"className":"translate action", "href":"#global-popup"}, "text_i18n": "global_dict.common_dict.login",
"attributes":{ "icon": "lock"
"data-i18n":"global_dict.common_dict.login", },
"data-action":"login", {
"data-icon":"lock", "href":"#person::new",
"data-rel": "popup" "class_list": "translate ui-btn-slapos-black",
}, "text":"Register",
"logic": {"text":"Login"} "text_i18n": "global_dict.common_dict.register",
}, { "icon": "edit"
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "global_dict.common_dict.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}]
} }
] ]
} }
......
...@@ -152,6 +152,12 @@ html table.ui-table thead th, html table.ui-table thead td { ...@@ -152,6 +152,12 @@ html table.ui-table thead th, html table.ui-table thead td {
padding: 0; padding: 0;
} }
/* no items */
.ui-table tr td.ui-no-result {
text-align: center;
font-weight: bold;
}
/* table caption (will be inside a controlbar but belongs here) */ /* table caption (will be inside a controlbar but belongs here) */
html .ui-table-caption { html .ui-table-caption {
padding: 0.25em 0; padding: 0.25em 0;
...@@ -230,13 +236,18 @@ html table.ui-table tr td .ui-controlgroup { ...@@ -230,13 +236,18 @@ html table.ui-table tr td .ui-controlgroup {
margin: 0; margin: 0;
text-align: center; text-align: center;
} }
html table.ui-table tr td.ui-no-result .ui-controlgroup {
margin: 1em 0;
}
html table.ui-table tr td .ui-controlgroup .ui-controlgroup-controls { html table.ui-table tr td .ui-controlgroup .ui-controlgroup-controls {
width: auto; width: auto;
} }
/* why? a button should be a button
html table.ui-table tr td a.ui-btn { html table.ui-table tr td a.ui-btn {
border: 0 none; border: 0 none;
background: transparent; background: transparent;
} }
*/
html table.ui-table tr td a.ui-btn:after { html table.ui-table tr td a.ui-btn:after {
margin-top: -10px; margin-top: -10px;
} }
...@@ -276,8 +287,10 @@ html table tbody th .ui-checkbox .ui-btn, ...@@ -276,8 +287,10 @@ html table tbody th .ui-checkbox .ui-btn,
html table tbody th .ui-checkbox .ui-btn:hover, html table tbody th .ui-checkbox .ui-btn:hover,
html table tbody th .ui-radio .ui-btn, html table tbody th .ui-radio .ui-btn,
html table tbody th .ui-radio .ui-btn:hover, html table tbody th .ui-radio .ui-btn:hover,
/* why? white is white and black is black...
html table tbody td .ui-controlgroup-controls .ui-btn, html table tbody td .ui-controlgroup-controls .ui-btn,
html table tbody td .ui-controlgroup-controls .ui-btn:hover { html table tbody td .ui-controlgroup-controls .ui-btn:hover */
{
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
} }
......
...@@ -731,8 +731,8 @@ html body div.ui-slider-track.ui-body-slapos-black .ui-btn-active, ...@@ -731,8 +731,8 @@ html body div.ui-slider-track.ui-body-slapos-black .ui-btn-active,
html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn:active, html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn:active,
html .ui-page-theme-slapos-black .ui-table-wrapper .ui.btn.ui-btn-active, html .ui-page-theme-slapos-black .ui-table-wrapper .ui.btn.ui-btn-active,
/* Table rows on hover */ /* Table rows on hover */
html table.ui-table tbody tr:hover td, html table.ui-table tbody tr:hover td:not(.ui-no-result),
html table.ui-table tbody tr:hover th, html table.ui-table tbody tr:hover th:not(.ui-no-result),
/* Controlbar */ /* Controlbar */
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:active, html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:active,
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn.ui-btn-active, html .ui-page-theme-slapos-black .ui-controlbar .ui-btn.ui-btn-active,
......
...@@ -77,37 +77,5 @@ ...@@ -77,37 +77,5 @@
} }
] ]
} }
], ]
"placeholder_dict": {
"no_items": {
"text":"No items found.",
"text_i18n":"validation_dict.no_items_found",
"children": [{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [
{
"type": "a",
"direct": {
"href":"#",
"className": "translate "
},
"attributes": {
"data-icon":"chevron-sign-left",
"data-i18n":"global_dict.pagination_dict.back"
},
"logic": {"Text": "Back"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "page_dict.person.create",
"data-icon": "edit"
},
"logic": {"text":"Create person"}
}]
}]
}
}
} }
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
"form": true, "form": true,
"id": "invoice_overview", "id": "invoice_overview",
"property_dict": { "property_dict": {
"no_items": {
"message":"No invoices found",
"message_i18n":"page_dict.invoices.nodata"
},
"dynamic_children": [3], "dynamic_children": [3],
"requires_authentication": true, "requires_authentication": true,
"wrap_gadget": 2, "wrap_gadget": 2,
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
"form": true, "form": true,
"id": "computer_overview", "id": "computer_overview",
"property_dict": { "property_dict": {
"no_items": {
"message":"No servers associated with this network.",
"message_i18n":"page_dict.networks.nodata"
},
"initial_query_url_identifier": "group", "initial_query_url_identifier": "group",
"dynamic_children": [0], "dynamic_children": [0],
"requires_authentication": true, "requires_authentication": true,
...@@ -45,13 +49,6 @@ ...@@ -45,13 +49,6 @@
"bottom_grid": 1 "bottom_grid": 1
}, },
"children": [] "children": []
}], }]
"placeholder_dict": {
"no_items": {
"text":"No servers associated with this network.",
"text_i18n":"page_dict.networks.no_servers",
"children": []
}
}
} }
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
"form": true, "form": true,
"id": "network_overview", "id": "network_overview",
"property_dict": { "property_dict": {
"no_items": {
"message": "No networks found.",
"message_i18n": "page_dict.networks.nonet"
},
"dynamic_children": [4], "dynamic_children": [4],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state", "depends_on": "login_state",
...@@ -83,38 +87,6 @@ ...@@ -83,38 +87,6 @@
"bottom_grid": 1 "bottom_grid": 1
}, },
"children": [] "children": []
}], }]
"placeholder_dict": {
"no_items": {
"text":"No items found.",
"text_i18n":"validation_dict.no_items_found",
"children": [{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [
{
"type": "a",
"direct": {
"href":"#",
"className": "translate "
},
"attributes": {
"data-icon":"chevron-sign-left",
"data-i18n":"global_dict.pagination_dict.back"
},
"logic": {"Text": "Back"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#networks::new"},
"attributes": {
"data-i18n": "page_dict.network.add",
"data-icon": "edit"
},
"logic": {"text":"Add new network"}
}]
}]
}
}
} }
...@@ -6,6 +6,19 @@ ...@@ -6,6 +6,19 @@
"form": true, "form": true,
"id": "user_sample", "id": "user_sample",
"property_dict": { "property_dict": {
"no_items": {
"message": "No person found",
"message_i18n": "page_dict.person.nodata",
"children": [
{
"href": "#person::new",
"text": "Create person",
"text_i18n": "page_dict.person.create",
"class_list": "translate ui-btn-slapos-black",
"icon": "edit"
}
]
},
"dynamic_children": [0], "dynamic_children": [0],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state", "depends_on": "login_state",
...@@ -75,37 +88,5 @@ ...@@ -75,37 +88,5 @@
} }
] ]
} }
], ]
"placeholder_dict": {
"no_items": {
"text":"No items found.",
"text_i18n":"validation_dict.no_items_found",
"children": [{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [
{
"type": "a",
"direct": {
"href":"#",
"className": "translate "
},
"attributes": {
"data-icon":"chevron-sign-left",
"data-i18n":"global_dict.pagination_dict.back"
},
"logic": {"Text": "Back"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "page_dict.person.create",
"data-icon": "edit"
},
"logic": {"text":"Create person"}
}]
}]
}
}
} }
...@@ -6,6 +6,18 @@ ...@@ -6,6 +6,18 @@
"form": true, "form": true,
"id": "service_overview", "id": "service_overview",
"property_dict": { "property_dict": {
"no_items": {
"message":"No Software installed.",
"message_i18n":"page_dict.servers.no_software",
"children": [
{
"href": "#software::new",
"text": "Add Software",
"text_i18n": "page_dict.servers.add_software",
"class_list": "translate ui-btn-slapos-black"
}
]
},
"initial_query_url_identifier": "reference_computer", "initial_query_url_identifier": "reference_computer",
"dynamic_children": [0], "dynamic_children": [0],
"wrap_gadget": 2, "wrap_gadget": 2,
...@@ -53,27 +65,6 @@ ...@@ -53,27 +65,6 @@
{"type": "a", "direct": {"href": "#software::add", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.add_software"}, "logic": {"text":"Install Software"}} {"type": "a", "direct": {"href": "#software::add", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"page_dict.servers.add_software"}, "logic": {"text":"Install Software"}}
] ]
}] }]
}],
"placeholder_dict": {
"no_items": {
"text":"No Software installed.",
"text_i18n":"page_dict.servers.no_software",
"children": [
{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#software::new"},
"attributes": {
"data-i18n": "page_dict.servers.add_software"
},
"logic": {"text":"Add Software"}
}
]
}
]
} }
} ]
} }
This diff is collapsed.
...@@ -85,7 +85,8 @@ ...@@ -85,7 +85,8 @@
"title": "Account Info", "title": "Account Info",
"create": "Create Person", "create": "Create Person",
"register": "Register", "register": "Register",
"subtitle": "Registration/Invoicing Info" "subtitle": "Registration/Invoicing Info",
"nodata": "No Person found"
}, },
"invoices": { "invoices": {
"title": "Invoices", "title": "Invoices",
...@@ -93,7 +94,8 @@ ...@@ -93,7 +94,8 @@
"download": "Download", "download": "Download",
"add": "Create new invoice", "add": "Create new invoice",
"overview": "Invoice Overview", "overview": "Invoice Overview",
"search": "Search Invoices" "search": "Search Invoices",
"nodata": "No invoices found"
}, },
"servers": { "servers": {
"no_software": "No software installed.", "no_software": "No software installed.",
...@@ -132,7 +134,8 @@ ...@@ -132,7 +134,8 @@
"search": "Search available services" "search": "Search available services"
}, },
"networks": { "networks": {
"no_servers": "No servers associated with this network.", "nonet": "No networks found.",
"nodata": "No servers associated with this network.",
"title": "Networks", "title": "Networks",
"subtitle": "Network Administration", "subtitle": "Network Administration",
"networks": "Created Networks", "networks": "Created Networks",
......
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