-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 5 distinct toolbars for 4 kinds of nodes - root, god, actions, buttongroup, button - Other unrequired toolbars have been deleted - Only the required button toolbar classes have been kept - Removed `kindof?` usage from those classes - Fixed toolbar spec
- Loading branch information
1 parent
1f419b0
commit b41a559
Showing
15 changed files
with
171 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
app/helpers/application_helper/button/generic_object_definition_button_button_delete.rb
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
app/helpers/application_helper/button/generic_object_definition_button_button_edit.rb
This file was deleted.
Oops, something went wrong.
6 changes: 1 addition & 5 deletions
6
...helpers/application_helper/button/generic_object_definition_button_button_group_delete.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
class ApplicationHelper::Button::GenericObjectDefinitionButtonButtonGroupDelete < ApplicationHelper::Button::Basic | ||
def visible? | ||
@record.kind_of?(CustomButtonSet) | ||
end | ||
|
||
def disabled? | ||
!@record.kind_of?(CustomButtonSet) || (@record.kind_of?(CustomButtonSet) && !@record.custom_buttons.count.zero?) | ||
!@record.custom_buttons.count.zero? | ||
end | ||
end |
5 changes: 0 additions & 5 deletions
5
app/helpers/application_helper/button/generic_object_definition_button_button_group_edit.rb
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
app/helpers/application_helper/button/generic_object_definition_button_button_group_new.rb
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
app/helpers/application_helper/button/generic_object_definition_button_button_new.rb
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
app/helpers/application_helper/button/generic_object_definition_button_delete.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
class ApplicationHelper::Button::GenericObjectDefinitionButtonDelete < ApplicationHelper::Button::Basic | ||
def visible? | ||
@record.kind_of?(GenericObjectDefinition) && @display != 'generic_objects' | ||
@display != 'generic_objects' | ||
end | ||
|
||
def disabled? | ||
@record.kind_of?(GenericObjectDefinition) && !@record.generic_objects.count.zero? | ||
!@record.generic_objects.count.zero? | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
app/helpers/application_helper/toolbar/generic_object_definition_actions_node_center.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class ApplicationHelper::Toolbar::GenericObjectDefinitionActionsNodeCenter < ApplicationHelper::Toolbar::Basic | ||
button_group('generic_object_definition', [ | ||
select( | ||
:generic_object_definition_configuration, | ||
'fa fa-cog fa-lg', | ||
title = N_('Configuration'), | ||
title, | ||
:items => [ | ||
button( | ||
:ab_group_new, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Add a new Button Group'), | ||
t, | ||
:url => 'custom_button_group_new', | ||
), | ||
button( | ||
:ab_button_new, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Add a new Button'), | ||
t, | ||
:url => 'custom_button_new', | ||
), | ||
] | ||
) | ||
]) | ||
end |
28 changes: 28 additions & 0 deletions
28
app/helpers/application_helper/toolbar/generic_object_definition_button_center.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class ApplicationHelper::Toolbar::GenericObjectDefinitionButtonCenter < ApplicationHelper::Toolbar::Basic | ||
button_group('generic_object_definition', [ | ||
select( | ||
:generic_object_definition_configuration, | ||
'fa fa-cog fa-lg', | ||
title = N_('Configuration'), | ||
title, | ||
:items => [ | ||
button( | ||
:ab_group_edit, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Edit this Button'), | ||
t, | ||
:url => 'custom_button_edit', | ||
), | ||
button( | ||
:ab_button_delete, | ||
'pficon pficon-delete fa-lg', | ||
t = N_('Remove this Button from Inventory'), | ||
t, | ||
:data => {'function' => 'sendDataWithRx', | ||
'function-data' => '{"type": "delete_custom_button", "controller": "genericObjectDefinitionToolbarController", "entity": "Button"}'}, | ||
:confirm => N_("Warning: This Button will be permanently removed!"), | ||
) | ||
] | ||
) | ||
]) | ||
end |
36 changes: 36 additions & 0 deletions
36
app/helpers/application_helper/toolbar/generic_object_definition_button_group_center.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class ApplicationHelper::Toolbar::GenericObjectDefinitionButtonGroupCenter < ApplicationHelper::Toolbar::Basic | ||
button_group('generic_object_definition', [ | ||
select( | ||
:generic_object_definition_configuration, | ||
'fa fa-cog fa-lg', | ||
title = N_('Configuration'), | ||
title, | ||
:items => [ | ||
button( | ||
:ab_group_edit, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Edit this Button Group'), | ||
t, | ||
:url => 'custom_button_group_edit', | ||
), | ||
button( | ||
:ab_button_new, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Add a new Button'), | ||
t, | ||
:url => 'custom_button_new', | ||
), | ||
button( | ||
:ab_button_delete, | ||
'pficon pficon-delete fa-lg', | ||
t = N_('Remove this Button Group from Inventory'), | ||
t, | ||
:data => {'function' => 'sendDataWithRx', | ||
'function-data' => '{"type": "delete_custom_button_set", "controller": "genericObjectDefinitionToolbarController", "entity": "Button Group"}'}, | ||
:klass => ApplicationHelper::Button::GenericObjectDefinitionButtonButtonGroupDelete, | ||
:confirm => N_("Warning: This Button Group will be permanently removed!"), | ||
), | ||
] | ||
) | ||
]) | ||
end |
79 changes: 0 additions & 79 deletions
79
app/helpers/application_helper/toolbar/generic_object_definition_center.rb
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
app/helpers/application_helper/toolbar/generic_object_definition_node_center.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class ApplicationHelper::Toolbar::GenericObjectDefinitionNodeCenter < ApplicationHelper::Toolbar::Basic | ||
button_group('generic_object_definition', [ | ||
select( | ||
:generic_object_definition_configuration, | ||
'fa fa-cog fa-lg', | ||
title = N_('Configuration'), | ||
title, | ||
:items => [ | ||
button( | ||
:generic_object_definition_edit, | ||
'pficon pficon-edit fa-lg', | ||
t = N_('Edit this Generic Object Class'), | ||
t, | ||
), | ||
button( | ||
:ab_group_new, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Add a new Button Group'), | ||
t, | ||
:url => 'custom_button_group_new', | ||
), | ||
button( | ||
:ab_button_new, | ||
'pficon pficon-add-circle-o fa-lg', | ||
t = N_('Add a new Button'), | ||
t, | ||
:url => 'custom_button_new', | ||
), | ||
button( | ||
:generic_object_definition_delete, | ||
'pficon pficon-delete fa-lg', | ||
t = N_('Remove this Generic Object Classes from Inventory'), | ||
t, | ||
:data => {'function' => 'sendDataWithRx', | ||
'function-data' => '{"type": "delete", "controller": "genericObjectDefinitionToolbarController"}'}, | ||
:klass => ApplicationHelper::Button::GenericObjectDefinitionButtonDelete, | ||
:confirm => N_("Warning: This Generic Object Class will be permanently removed!"), | ||
), | ||
] | ||
) | ||
]) | ||
end |
Oops, something went wrong.