-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
13 changed files
with
155 additions
and
203 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
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 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 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 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 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 +1 @@ | ||
<%= render partial: '/shared/data/index' -%> | ||
<%= render partial: '/shared/data/simple_index' -%> |
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 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 +1 @@ | ||
<%= render(partial: 'shared/data/show', locals: {object: @geographic_area}) -%> | ||
<%= render(partial: 'shared/shared_data/application_defined/show', locals: {object: @geographic_area}) -%> |
53 changes: 53 additions & 0 deletions
53
app/views/shared/shared_data/application_defined/_show.html.erb
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,53 @@ | ||
<div class="flexbox"> | ||
<div class="item item1"> | ||
<h2> <%= model_name_title -%></h2> | ||
|
||
<div>id: <%= object.id -%></div> | ||
<%= forward_back_links(object) -%> <br> | ||
<%= pin_item_to_pinboard_link(object, sessions_current_user) -%> | ||
<br> | ||
<%= add_alternate_value_link(object: object, user: sessions_current_user) -%> | ||
<br> | ||
<%= papertrail_link(object) -%> | ||
</div> | ||
|
||
<div class="item item2"> | ||
<h2> <%= object_tag(object) -%> </h2> | ||
<%= render object_attributes_partial_path(object.becomes(object.class.base_class)) %> | ||
<%= render partial: '/shared/data/show/housekeeping', locals: {object: object} -%> | ||
<%= render(partial: '/shared/data/show/soft_validation', locals: {object: object}) if object.class.respond_to?(:soft_validates?) -%> | ||
</div> | ||
|
||
<div class="item item3"> | ||
<h2> Related data </h2> | ||
|
||
<h3> Has many </h3> | ||
<% object.class.reflect_on_all_associations(:has_many).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<% if object.respond_to?(r.name) -%> | ||
<%= object.send(r.name.to_s).count -%> | ||
<% else %> | ||
<mark> requires method rename!</mark> | ||
<% end %> | ||
<br> | ||
<% end %> | ||
<h3> Has one </h3> | ||
<% object.class.reflect_on_all_associations(:has_one).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<%= content_tag(:strong, object_tag(object.send(r.name.to_s))) -%> | ||
<br> | ||
<% end %> | ||
<h3> Belongs to </h3> | ||
<% object.class.reflect_on_all_associations(:belongs_to).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<%= content_tag(:strong, object_tag(object.send(r.name.to_s))) -%> | ||
<br> | ||
<% end %> | ||
|
||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
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,53 @@ | ||
<div class="flexbox"> | ||
<div class="item item1"> | ||
<h2> <%= model_name_title -%></h2> | ||
|
||
<div>id: <%= object.id -%></div> | ||
<%= forward_back_links(object) -%> <br> | ||
<%= pin_item_to_pinboard_link(object, sessions_current_user) -%> | ||
<br> | ||
<%= add_alternate_value_link(object: object, user: sessions_current_user) -%> | ||
<br> | ||
<%= papertrail_link(object) -%> | ||
</div> | ||
|
||
<div class="item item2"> | ||
<h2> <%= object_tag(object) -%> </h2> | ||
<%= render object_attributes_partial_path(object.becomes(object.class.base_class)) %> | ||
<%= render partial: '/shared/data/show/housekeeping', locals: {object: object} -%> | ||
<%= render(partial: '/shared/data/show/soft_validation', locals: {object: object}) if object.class.respond_to?(:soft_validates?) -%> | ||
</div> | ||
|
||
<div class="item item3"> | ||
<h2> Related data </h2> | ||
|
||
<h3> Has many </h3> | ||
<% object.class.reflect_on_all_associations(:has_many).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<% if object.respond_to?(r.name) -%> | ||
<%= object.send(r.name.to_s).count -%> | ||
<% else %> | ||
<mark> requires method rename!</mark> | ||
<% end %> | ||
<br> | ||
<% end %> | ||
<h3> Has one </h3> | ||
<% object.class.reflect_on_all_associations(:has_one).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<%= content_tag(:strong, object_tag(object.send(r.name.to_s))) -%> | ||
<br> | ||
<% end %> | ||
<h3> Belongs to </h3> | ||
<% object.class.reflect_on_all_associations(:belongs_to).sort { |a, b| a.name <=> b.name }.each do |r| -%> | ||
<%= r.name.to_s.humanize -%> | ||
<%= content_tag(:strong, object_tag(object.send(r.name.to_s))) -%> | ||
<br> | ||
<% end %> | ||
|
||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
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.