-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade to use latest wallaby-* gems and remove Cell (#162)
* chore: upgrade the gemspec to use latest wallaby-* gems * chore: use partial instead of cell for index folder * chore: use partial for resources folder * chore: remove renderers specs * chore: remove active_record adaptor specs * chore: add specs for index partials * chore: a bit of spec cleanup and remove deprecated methods * chore: update docs to take out everything about Cell * chore: update specs * chore: fix rubocop issue * chore: update specs for rails 4.2 * chore: update docs again * chore: update travis
- Loading branch information
Showing
235 changed files
with
1,066 additions
and
4,528 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
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value.try(:attachment) ? link_to(value.attachment.blob.filename, rails_blob_path(value)) : null %> |
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 @@ | ||
<%= show_link(local_assigns[:decorated]) {} %> | ||
<%= edit_link(local_assigns[:decorated]) {} %> | ||
<%= delete_link(local_assigns[:decorated]) {} %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value.present? ? show_link(value, options: { readonly: true }) : null %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value || null %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value || null %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value ? muted('binary') : null %> |
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,9 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
content_tag :code, value | ||
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,9 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
content_tag :code, value | ||
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,5 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value ? muted('blob') : null %> |
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,9 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
value ? fa_icon('check-square') : fa_icon('square') | ||
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,16 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
max = metadata[:max] || default_metadata.max | ||
value = value.to_s | ||
if value.length > max | ||
concat content_tag(:code, value.truncate(max)) | ||
itooltip value | ||
else | ||
content_tag :code, value | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
concat content_tag(:code, value) | ||
link_to( | ||
fa_icon('link'), "http://ip-api.com/##{value}", | ||
target: :_blank, class: 'text-info' | ||
) | ||
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,16 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
max = metadata[:max] || default_metadata.max | ||
value = value.to_s | ||
if value.length > max | ||
concat content_tag(:code, value.truncate(max)) | ||
itooltip value | ||
else | ||
content_tag :code, value | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
max = metadata[:max] || default_metadata.max | ||
value = value.to_s | ||
if value.length > max | ||
concat content_tag(:span, value.truncate(max)) | ||
imodal metadata[:label], value | ||
else | ||
value | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
concat content_tag(:span, nil, style: "background-color: #{value};", class: 'color-square') | ||
content_tag(:span, value, class: 'text-uppercase') | ||
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,11 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
value = Time.zone.parse value if value.is_a? String | ||
value = value.to_date if value.is_a? Time | ||
I18n.l value | ||
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,12 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
concat content_tag(:span, I18n.l(value.first, format: :short), class: 'from') | ||
concat '...' | ||
concat content_tag(:span, I18n.l(value.last, format: :short), class: 'to') | ||
itooltip "#{I18n.l value.first} ... #{I18n.l value.last}", 'time' | ||
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,11 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
value = Time.zone.parse value if value.is_a? String | ||
concat content_tag(:span, I18n.l(value, format: :short)) | ||
itooltip I18n.l(value), 'time' | ||
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,5 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value || null %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value.nil? ? null : mail_to(value) %> |
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 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value.try(:to_f) || null %> |
15 changes: 15 additions & 0 deletions
15
app/views/wallaby/resources/index/_has_and_belongs_to_many.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,15 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<% unique_collection = value.uniq %> | ||
<%= raw unique_collection.first(2).map { |item| show_link item, options: { readonly: true } }.join(', ') %> | ||
<%= if unique_collection.length > 2 | ||
title = metadata[:label] | ||
body = unique_collection.map { |item| show_link item, options: { readonly: true } }.to_sentence.html_safe | ||
label = "#{unique_collection.length - 2} more" | ||
concat ' and ' | ||
imodal title, body, label: label | ||
elsif unique_collection.blank? | ||
null | ||
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,15 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<% unique_collection = value.uniq %> | ||
<%= raw unique_collection.first(2).map { |item| show_link item, options: { readonly: true } }.join(', ') %> | ||
<%= if unique_collection.length > 2 | ||
title = metadata[:label] | ||
body = unique_collection.map { |item| show_link item, options: { readonly: true } }.to_sentence.html_safe | ||
label = "#{unique_collection.length - 2} more" | ||
concat ' and ' | ||
imodal title, body, label: label | ||
elsif unique_collection.blank? | ||
null | ||
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,5 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= value.present? ? show_link(value, options: { readonly: true }) : null %> |
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,16 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
max = metadata[:max] || default_metadata.max | ||
value = value.to_s | ||
if value.length > max | ||
concat content_tag(:code, value.truncate(max)) | ||
imodal metadata[:label], "<pre>#{h value}</pre>".html_safe | ||
else | ||
content_tag :code, value | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
concat content_tag(:code, value) | ||
link_to( | ||
fa_icon('link'), "http://ip-api.com/##{value}", | ||
target: :_blank, class: 'text-info' | ||
) | ||
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,11 @@ | ||
<%# @param object [model] model instance %> | ||
<%# @param field_name [String] name of the field %> | ||
<%# @param value [Object] value of the field %> | ||
<%# @param metadata [Hash] metadata of the field %> | ||
<%= if value.nil? | ||
null | ||
else | ||
concat content_tag(:span, value.first, class: 'from') | ||
concat '...' | ||
content_tag(:span, value.last, class: 'to') | ||
end %> |
Oops, something went wrong.