diff --git a/app/assets/images/merged/card_preview/card_feature.png b/app/assets/images/merged/card_preview/card_feature_normal.png similarity index 100% rename from app/assets/images/merged/card_preview/card_feature.png rename to app/assets/images/merged/card_preview/card_feature_normal.png diff --git a/app/assets/images/merged/card_preview/card_feature_small.png b/app/assets/images/merged/card_preview/card_feature_small.png new file mode 100644 index 0000000..013df0e Binary files /dev/null and b/app/assets/images/merged/card_preview/card_feature_small.png differ diff --git a/app/views/merged/view/cards/_card_feature_normal.haml b/app/views/merged/view/cards/_card_feature_normal.haml new file mode 100644 index 0000000..bbba85f --- /dev/null +++ b/app/views/merged/view/cards/_card_feature_normal.haml @@ -0,0 +1,8 @@ +.max-w-md.sm:mx-auto.sm:text-center + .flex.items-center.justify-center.mb-4.rounded-full.mx-auto.w-40.h-40{options(card,:background )} + = image_for( card , "h-20 w-20") + %h6.mb-3.text-xl.font-bold.leading-5{options(card, :color)}= card.header + .mb-3.text-sm.text-gray-900{ prose_classes } + = markdown(card) + - if card.has_option?("button_link") + %a.inline-flex.items-center.font-semibold.transition-colors.duration-200.text-deep-purple-accent-400.hover:text-deep-purple-800{"aria-label" => "", :href => "/"} Learn more diff --git a/config/merged/card_styles.yml b/config/merged/card_styles.yml index 017013c..8cd4361 100644 --- a/config/merged/card_styles.yml +++ b/config/merged/card_styles.yml @@ -63,6 +63,20 @@ - text_align - button_link - button_text +- template: card_feature_small + header: Card looking feature, smaller version + text: For things where no image is available or apropriate. + Making lists a little more interesting to look at. + May use svg as image. + fields: + - header + - text + options: + - background + - color + - text_align + - button_link + - button_text - template: card_normal_round header: Standard card with rounded look text: Otherwise quite similar to standard. But there is gap under the image. diff --git a/config/merged/option_definitions.yml b/config/merged/option_definitions.yml index f3c6c69..565d3d5 100644 --- a/config/merged/option_definitions.yml +++ b/config/merged/option_definitions.yml @@ -6,7 +6,7 @@ :id: 1 - :name: columns :description: Number of columns in a layout that supports cards - :values: 2 3 4 + :values: 2 3 4 5 6 :default: 3 :id: 2 - :name: background diff --git a/test/integration/cards_test.rb b/test/integration/cards_test.rb index b775411..7c58d06 100644 --- a/test/integration/cards_test.rb +++ b/test/integration/cards_test.rb @@ -37,7 +37,8 @@ class CardsTest < ActionDispatch::IntegrationTest end def test_remove_image_force - visit "merged/cards/6/set_image?image=''" + first = Merged::Card.first.id + visit "merged/cards/#{first}/set_image?image=''" assert_text page , "No image" end end diff --git a/test/models/card_style_test.rb b/test/models/card_style_test.rb index 35dca9a..2db1de8 100644 --- a/test/models/card_style_test.rb +++ b/test/models/card_style_test.rb @@ -7,7 +7,7 @@ module Merged end def test_has_all - assert_equal CardStyle.all.length , 6 + assert CardStyle.all.length > 5 end def test_has_fields