Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1724 from AparnaKarve/generic_object_ui
Generic Objects UI
- Loading branch information
Showing
14 changed files
with
163 additions
and
770 deletions.
There are no files selected for viewing
103 changes: 0 additions & 103 deletions
103
app/assets/javascripts/controllers/generic_object/generic_object_definition_controller.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
class GenericObjectDefinitionController < ApplicationController | ||
before_action :check_privileges | ||
before_action :get_session_data | ||
|
||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
include Mixins::GenericListMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::GenericShowMixin | ||
|
||
menu_section :automate | ||
|
||
def self.display_methods | ||
%w(generic_objects) | ||
end | ||
|
||
def self.model | ||
GenericObjectDefinition | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i(relationships)] | ||
end | ||
|
||
helper_method :textual_group_list | ||
end |
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,3 @@ | ||
module GenericObjectDefinitionHelper | ||
include_concern 'TextualSummary' | ||
end |
17 changes: 17 additions & 0 deletions
17
app/helpers/generic_object_definition_helper/textual_summary.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,17 @@ | ||
module GenericObjectDefinitionHelper::TextualSummary | ||
include TextualMixins::TextualName | ||
|
||
def textual_group_relationships | ||
TextualGroup.new(_("Relationships"), %i(generic_objects)) | ||
end | ||
|
||
def textual_generic_objects | ||
num = @record.number_of(:generic_objects) | ||
h = {:label => _("Instances"), :value => num} | ||
if role_allows?(:feature => "generic_object_view") && num > 0 | ||
h.update(:link => url_for_only_path(:action => 'show', :id => @record, :display => 'generic_objects'), | ||
:title => _('Show all Instances')) | ||
end | ||
h | ||
end | ||
end |
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
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
#main_div | ||
- if %w(generic_objects).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- else | ||
= render :partial => 'layouts/textual_groups_generic' |
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,2 @@ | ||
#main_div | ||
= render :partial => 'layouts/gtl' |
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
Oops, something went wrong.