diff --git a/app/assets/stylesheets/card-perma.css b/app/assets/stylesheets/card-perma.css
index 47f4c4c8c..f61b22806 100644
--- a/app/assets/stylesheets/card-perma.css
+++ b/app/assets/stylesheets/card-perma.css
@@ -175,6 +175,7 @@
.btn--reversed {
--btn-background: var(--color-canvas);
--btn-color: var(--card-color);
+ --btn-border-color: var(--color-container);
}
}
diff --git a/app/controllers/cards/publishes_controller.rb b/app/controllers/cards/publishes_controller.rb
index f7ac6590c..cd24ffdeb 100644
--- a/app/controllers/cards/publishes_controller.rb
+++ b/app/controllers/cards/publishes_controller.rb
@@ -3,6 +3,12 @@ class Cards::PublishesController < ApplicationController
def create
@card.publish
- redirect_to @card
+
+ redirect_to add_another_param? ? @collection.cards.create! : @card
end
+
+ private
+ def add_another_param?
+ params[:creation_type] == "add_another"
+ end
end
diff --git a/app/views/cards/container/footer/_draft.html.erb b/app/views/cards/container/footer/_draft.html.erb
index f46e08b41..7b3dff00a 100644
--- a/app/views/cards/container/footer/_draft.html.erb
+++ b/app/views/cards/container/footer/_draft.html.erb
@@ -1,4 +1,5 @@
- <%= button_to "Create card", card_publish_path(card), class: "btn" %>
- <%= button_to "Save as draft", collection_card_path(card.collection, card), name: "card[status]", value: "drafted", method: :put, class: "btn btn--reversed" %>
+ <%= button_to "Create card", card_publish_path(card), name: "creation_type", value: "add", class: "btn" %>
+ <%= button_to "Create and add another", card_publish_path(card), method: :post, class: "btn btn--reversed", name: "creation_type", value: "add_another", form: { data: { turbo: false } } %>
+ <%= button_to "Save as a draft", collection_card_path(card.collection, card), name: "card[status]", value: "drafted", method: :put, class: "btn btn--reversed" %>
diff --git a/test/controllers/cards/publishes_controller_test.rb b/test/controllers/cards/publishes_controller_test.rb
index c9df4d0aa..e5a99c51c 100644
--- a/test/controllers/cards/publishes_controller_test.rb
+++ b/test/controllers/cards/publishes_controller_test.rb
@@ -15,4 +15,17 @@ class Cards::PublishesControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to card
end
+
+ test "create and add another" do
+ card = cards(:logo)
+ card.drafted!
+
+ assert_changes -> { card.reload.published? }, from: false, to: true do
+ assert_difference -> { Card.creating.count }, +1 do
+ post card_publish_path(card, creation_type: "add_another")
+ end
+ end
+
+ assert_redirected_to Card.creating.last
+ end
end