From c4abe3a2d9741be55ee37f2d8857c4110d32f113 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 5 Nov 2013 19:21:57 +0100 Subject: Replace icons with the ones from Font Awesome https://fedorahosted.org/freeipa/ticket/3904 --- install/ui/ipa.css | 8 +++++--- install/ui/src/freeipa/association.js | 16 ++++++++-------- install/ui/src/freeipa/details.js | 6 +++--- install/ui/src/freeipa/dns.js | 8 ++++---- install/ui/src/freeipa/hbac.js | 4 ++-- install/ui/src/freeipa/hbactest.js | 10 ++++++---- install/ui/src/freeipa/search.js | 8 ++++---- install/ui/src/freeipa/selinux.js | 4 ++-- install/ui/src/freeipa/sudo.js | 8 ++++---- install/ui/src/freeipa/user.js | 4 ++-- install/ui/src/freeipa/widget.js | 16 +++++++++------- ipatests/test_webui/ui_driver.py | 4 ++-- 12 files changed, 51 insertions(+), 45 deletions(-) diff --git a/install/ui/ipa.css b/install/ui/ipa.css index faebd2d1..7ceaf84e 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -1028,14 +1028,15 @@ table.scrollable tbody { width: 250px; } -.combobox-widget-input .combobox-icon { +.combobox-widget-input a i { display: inline-block; position: absolute; top: 0; bottom: 0; right: 0; margin-top: 4px; - margin-right: 4px; + margin-right: 8px; + font-size: 16px; } .combobox-widget-list { @@ -1057,13 +1058,14 @@ table.scrollable tbody { margin: 0; } -.combobox-widget-list .search-icon { +.combobox-widget-list a i { position: absolute; top: 0; bottom: 0; right: 0; margin-top: 6px; margin-right: 3px; + font-size: 16px; } .host-adder-dialog table.fqdn { diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index f976d58e..685821e0 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -484,7 +484,7 @@ IPA.association_table_widget = function (spec) { that.remove_button = IPA.action_button({ name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon', + icon: 'fa-trash-o', 'class': 'action-button-disabled', click: function() { if (!that.remove_button.hasClass('action-button-disabled')) { @@ -497,7 +497,7 @@ IPA.association_table_widget = function (spec) { that.add_button = IPA.action_button({ name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon', + icon: 'fa-plus', click: function() { if (!that.add_button.hasClass('action-button-disabled')) { that.add_handler(); @@ -887,17 +887,17 @@ exp.association_facet_pre_op = function(spec, context) { { name: 'refresh', label: '@i18n:buttons.refresh', - icon: 'reset-icon' + icon: 'fa-refresh' }, { name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon' + icon: 'fa-trash-o' }, { name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon' + icon: 'fa-plus' }); spec.state = spec.state || {}; @@ -1312,17 +1312,17 @@ exp.attribute_facet_pre_op = function(spec, context) { { name: 'refresh', label: '@i18n:buttons.refresh', - icon: 'reset-icon' + icon: 'fa-refresh' }, { name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon' + icon: 'fa-trash-o' }, { name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon' + icon: 'fa-plus' }); spec.state = spec.state || {}; diff --git a/install/ui/src/freeipa/details.js b/install/ui/src/freeipa/details.js index 596dc1ac..00134a23 100644 --- a/install/ui/src/freeipa/details.js +++ b/install/ui/src/freeipa/details.js @@ -466,19 +466,19 @@ exp.details_facet_pre_op = function(spec, context) { { name: 'reset', label: '@i18n:buttons.reset', - icon: 'reset-icon' + icon: 'fa-undo' }, { name: 'update', label: '@i18n:buttons.update', - icon: 'update-icon' + icon: 'fa-upload' }); } spec.control_buttons.unshift( { name: 'refresh', label: '@i18n:buttons.refresh', - icon: 'reset-icon' + icon: 'fa-refresh' }); spec.state = spec.state || {}; diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js index ab88cec4..3ef5620f 100644 --- a/install/ui/src/freeipa/dns.js +++ b/install/ui/src/freeipa/dns.js @@ -119,12 +119,12 @@ return { { name: 'disable', label: '@i18n:buttons.disable', - icon: 'disabled-icon' + icon: 'fa-minus' }, { name: 'enable', label: '@i18n:buttons.enable', - icon: 'enabled-icon' + icon: 'fa-check' } ] }, @@ -1674,7 +1674,7 @@ IPA.dns.record_type_table_widget = function(spec) { that.remove_button = IPA.action_button({ name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon', + icon: 'fa-trash-o', 'class': 'action-button-disabled', click: function() { if (!that.remove_button.hasClass('action-button-disabled')) { @@ -1687,7 +1687,7 @@ IPA.dns.record_type_table_widget = function(spec) { that.add_button = IPA.action_button({ name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon', + icon: 'fa-plus', click: function() { if (!that.add_button.hasClass('action-button-disabled')) { that.add_handler(); diff --git a/install/ui/src/freeipa/hbac.js b/install/ui/src/freeipa/hbac.js index ec214406..18024953 100644 --- a/install/ui/src/freeipa/hbac.js +++ b/install/ui/src/freeipa/hbac.js @@ -61,12 +61,12 @@ var spec = { { name: 'disable', label: '@i18n:buttons.disable', - icon: 'disabled-icon' + icon: 'fa-minus' }, { name: 'enable', label: '@i18n:buttons.enable', - icon: 'enabled-icon' + icon: 'fa-check' } ] }, diff --git a/install/ui/src/freeipa/hbactest.js b/install/ui/src/freeipa/hbactest.js index a127db9b..93155b5a 100644 --- a/install/ui/src/freeipa/hbactest.js +++ b/install/ui/src/freeipa/hbactest.js @@ -182,7 +182,7 @@ IPA.hbac.test_facet = function(spec) { that.prev_button = IPA.button({ name: 'prev', label: '@i18n:widget.prev', - icon: 'prev-icon', + icon: 'fa-chevron-left', click: function() { if (!that.prev_button.hasClass('action-button-disabled')) { that.prev(); @@ -197,7 +197,7 @@ IPA.hbac.test_facet = function(spec) { that.next_button = IPA.button({ name: 'next', label: '@i18n:widget.next', - icon: 'next-icon', + icon: 'fa-chevron-right', click: function() { if (!that.next_button.hasClass('action-button-disabled')) { that.next(); @@ -309,7 +309,7 @@ IPA.hbac.test_select_facet = function(spec) { that.find_button = IPA.action_button({ name: 'find', - icon: 'search-icon', + icon: 'fa-search', click: function() { that.find(); return false; @@ -533,6 +533,7 @@ IPA.hbac.test_run_facet = function(spec) { that.run_button = IPA.button({ name: 'run_test', label: '@i18n:objects.hbactest.run_test', + icon: 'fa-gear', click: function() { if (!that.run_button.hasClass('action-button-disabled')) { that.run(); @@ -605,7 +606,7 @@ IPA.hbac.test_run_facet = function(spec) { that.prev_button = IPA.button({ name: 'prev', label: '@i18n:widget.prev', - icon: 'prev-icon', + icon: 'fa-chevron-left', click: function() { if (!that.prev_button.hasClass('action-button-disabled')) { that.prev(); @@ -619,6 +620,7 @@ IPA.hbac.test_run_facet = function(spec) { that.new_test_button = IPA.button({ name: 'new_test', label: '@i18n:objects.hbactest.new_test', + icon: 'fa-repeat', click: function() { if (!that.new_test_button.hasClass('action-button-disabled')) { that.new_test(); diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js index 10ed0cb9..680f0268 100644 --- a/install/ui/src/freeipa/search.js +++ b/install/ui/src/freeipa/search.js @@ -48,19 +48,19 @@ exp.search_facet_control_buttons_pre_op = function(spec, context) { { name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon' + icon: 'fa-trash-o' }, { name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon' + icon: 'fa-plus' }); } spec.control_buttons.unshift( { name: 'refresh', label: '@i18n:buttons.refresh', - icon: 'reset-icon' + icon: 'fa-refresh' }); spec.state = spec.state || {}; @@ -128,7 +128,7 @@ IPA.search_facet = function(spec, no_init) { that.find_button = IPA.action_button({ name: 'find', - icon: 'search-icon', + icon: 'fa-search', click: function() { that.find(); return false; diff --git a/install/ui/src/freeipa/selinux.js b/install/ui/src/freeipa/selinux.js index ff0ad848..af21356f 100644 --- a/install/ui/src/freeipa/selinux.js +++ b/install/ui/src/freeipa/selinux.js @@ -60,12 +60,12 @@ var spec = { { name: 'disable', label: '@i18n:buttons.disable', - icon: 'disabled-icon' + icon: 'fa-minus' }, { name: 'enable', label: '@i18n:buttons.enable', - icon: 'enabled-icon' + icon: 'fa-check' } ] }, diff --git a/install/ui/src/freeipa/sudo.js b/install/ui/src/freeipa/sudo.js index e50615bd..17e55b08 100644 --- a/install/ui/src/freeipa/sudo.js +++ b/install/ui/src/freeipa/sudo.js @@ -61,12 +61,12 @@ var spec = { { name: 'disable', label: '@i18n:buttons.disable', - icon: 'disabled-icon' + icon: 'fa-minus' }, { name: 'enable', label: '@i18n:buttons.enable', - icon: 'enabled-icon' + icon: 'fa-check' } ] }, @@ -705,7 +705,7 @@ IPA.sudo.options_section = function(spec) { that.remove_button = IPA.action_button({ name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon', + icon: 'fa-trash-o', 'class': 'action-button-disabled', click: function() { if (!that.remove_button.hasClass('action-button-disabled')) { @@ -718,7 +718,7 @@ IPA.sudo.options_section = function(spec) { that.add_button = IPA.action_button({ name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon', + icon: 'fa-plus', click: function() { if (!that.add_button.hasClass('action-button-disabled')) { that.add_handler(); diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js index c141ea3f..ecd82296 100644 --- a/install/ui/src/freeipa/user.js +++ b/install/ui/src/freeipa/user.js @@ -87,12 +87,12 @@ return { { name: 'disable', label: '@i18n:buttons.disable', - icon: 'disabled-icon' + icon: 'fa-minus' }, { name: 'enable', label: '@i18n:buttons.enable', - icon: 'enabled-icon' + icon: 'fa-check' } ] }, diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 641b3486..c39f3326 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -1905,11 +1905,13 @@ IPA.boolean_status_formatter = function(spec) { that.show_false = true; that.type = 'html'; + that.enabled_icon = spec.disabled_icon || 'fa fa-check'; + that.disabled_icon = spec.disabled_icon || 'fa fa-minus'; that.format = function(value) { - var status = value ? 'enabled' : 'disabled'; + var icon_cls = value ? that.enabled_icon : that.disabled_icon; var formatted_value = that.boolean_formatter_format(value); - formatted_value = ' '+formatted_value; + formatted_value = ' '+formatted_value; return formatted_value; }; @@ -2717,7 +2719,7 @@ IPA.attribute_table_widget = function(spec) { that.remove_button = IPA.action_button({ name: 'remove', label: '@i18n:buttons.remove', - icon: 'remove-icon', + icon: 'fa-trash-o', 'class': 'action-button-disabled', click: function() { if (!that.remove_button.hasClass('action-button-disabled')) { @@ -2730,7 +2732,7 @@ IPA.attribute_table_widget = function(spec) { that.add_button = IPA.action_button({ name: 'add', label: '@i18n:buttons.add', - icon: 'add-icon', + icon: 'fa-plus', click: function() { if (!that.add_button.hasClass('action-button-disabled')) { that.add_handler(); @@ -3078,7 +3080,7 @@ IPA.combobox_widget = function(spec) { that.open_button = IPA.action_button({ name: 'open', - icon: 'combobox-icon', + icon: 'fa-angle-down', focusable: false, click: function() { that.no_close_flag = false; @@ -3116,7 +3118,7 @@ IPA.combobox_widget = function(spec) { that.search_button = IPA.action_button({ name: 'search', - icon: 'search-icon', + icon: 'fa-search', focusable: false, click: function() { that.no_close_flag = false; @@ -3680,7 +3682,7 @@ IPA.button = function(spec) { if (spec.type) button.addClass(spec.type); if (spec.icon) { - $('', { + $('', { 'class': 'fa '+spec.icon }).appendTo(button); } diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index 8ffb1e9b..d0a61050 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -742,12 +742,12 @@ class UI_driver(object): parent = self.get_form() s = "[name='%s'].combobox-widget" % name cb = self.find(s, By.CSS_SELECTOR, parent, strict=True) - open_btn = self.find('a[name=open] span', By.CSS_SELECTOR, cb, strict=True) + open_btn = self.find('a[name=open] i', By.CSS_SELECTOR, cb, strict=True) open_btn.click() self.wait() self.wait_for_request() - search_btn = self.find('a[name=search] span', By.CSS_SELECTOR, cb, strict=True) + search_btn = self.find('a[name=search] i', By.CSS_SELECTOR, cb, strict=True) opt_s = "select[name=list] option[value='%s']" % value option = self.find(opt_s, By.CSS_SELECTOR, cb) if not option: -- cgit