- <%= form.label :actions %>
+
+ <%= form.label :url do %>
+
Payload URL
+
This is the URL for the app that will receive payloads from Fizzy.
+ <% end %>
+ <%= form.url_field :url,
+ required: true,
+ pattern: "https?://.*",
+ title: "Must be an http:// or https:// URL",
+ class: "input",
+ placeholder: "https://example.com",
+ data: { action: "keydown.esc@document->form#cancel" } %>
+
+
+
+ <%= form.label :actions do %>
+
Events
+
Trigger a call to the Payload URL when these things occur:
+ <% end %>
<%= render "webhooks/form/actions", form: form %>
- <%= form.button type: :submit, class: "btn btn--reversed center margin-block-start txt-medium" do %>
-
Update Webhook
+ <%= form.button type: :submit, class: "btn btn--link center txt-medium" do %>
+
Save Changes
<% end %>
<%= link_to "Go back", collection_webhooks_path, data: { form_target: "cancel" }, hidden: true %>
diff --git a/app/views/webhooks/form/_actions.html.erb b/app/views/webhooks/form/_actions.html.erb
index bd592ca20..cd75e2dd6 100644
--- a/app/views/webhooks/form/_actions.html.erb
+++ b/app/views/webhooks/form/_actions.html.erb
@@ -1,16 +1,16 @@
-
+
<%= form.collection_check_boxes \
:subscribed_actions,
Webhook::PERMITTED_ACTIONS,
:itself,
:humanize do |item| %>
-
-
-
- <%= item.check_box %>
-
- <%= item.text %>
+
+
+ <%= item.check_box(class: "switch__input") %>
+
+ <%= item.text %>
+ <%= item.text %>
<% end %>
diff --git a/app/views/webhooks/index.html.erb b/app/views/webhooks/index.html.erb
index 3f2c47e19..43d1f696b 100644
--- a/app/views/webhooks/index.html.erb
+++ b/app/views/webhooks/index.html.erb
@@ -2,12 +2,16 @@
<% content_for :header do %>
<%= render "filters/menu", user_filtering: @user_filtering %>
- <%= link_to cards_path(collection_ids: [ @collection ]), class: "header__title btn borderless txt-large", style: "--btn-padding: 0.25ch 1ch 0.25ch 0.75ch; view-transistion-name: webhooks-title;", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %>
-
- ←
- <%= @collection.name %>
-
- <% end %>
+
+
+
<% end %>
-
- <%= tag.div class: "panel shadow center", data: {
- controller: "navigable-list",
- action: "keydown->navigable-list#navigate",
- navigable_list_focus_on_selection_value: true,
- navigable_list_actionable_items_value: true
- } do %>
-
-
-
-
- <%= render partial: "webhooks/webhook", collection: @page.records %>
-
-
-
- Press ↑ ↓ to move, enter to visit webhook, SHIFT+ENTER to toggle.
-
-
+<%= tag.section class: "panel shadow center webhooks", data: {
+ controller: "navigable-list",
+ action: "keydown->navigable-list#navigate",
+ navigable_list_focus_on_selection_value: true,
+ navigable_list_actionable_items_value: true
+} do %>
+ <% if @page.records.any? %>
+
+ <%= render partial: "webhooks/webhook", collection: @page.records %>
+
+ <% else %>
+ Webhooks can notify another application when something happens in this Fizzy collection. You'll choose which events to subscribe to and provide a URL to receive the data.
+ For example, you could create a webhook that posts to a Campfire chat in Basecamp when new cards are added to Fizzy.
+ <%= link_to new_collection_webhook_path, class: "btn btn--link" do %>
+ <%= icon_tag "add" %>
+ Set up a webhook
+ <% end %>
<% end %>
-
+
+ <% if @page.records.many? %>
+
+ <% end %>
+<% end %>
diff --git a/app/views/webhooks/new.html.erb b/app/views/webhooks/new.html.erb
index 780088117..27d741fd2 100644
--- a/app/views/webhooks/new.html.erb
+++ b/app/views/webhooks/new.html.erb
@@ -1,30 +1,48 @@
-<% @page_title = "Webhooks" %>
+<% @page_title = "Set up a Webhook" %>
<% content_for :header do %>
<%= render "filters/menu", user_filtering: @user_filtering %>
-
+
+
+
<% end %>
-
- <%= form_with model: @webhook, url: collection_webhooks_path, data: { controller: "form" }, html: { class: "flex flex-column gap align-center justify-starts" } do |form| %>
+
+ <%= form_with model: @webhook, url: collection_webhooks_path, data: { controller: "form" }, html: { class: "flex flex-column gap" } do |form| %>
- <%= form.text_field :name, required: true, autofocus: true, class: "input", placeholder: "Name your Webhook…", data: { action: "keydown.esc@document->form#cancel" } %>
+ <%= form.text_field :name, required: true, autofocus: true, class: "input", placeholder: "Name this Webhook…", data: { action: "keydown.esc@document->form#cancel" } %>
- <%= form.url_field :url,
- required: true,
- pattern: "https?://.*",
- title: "Must be an http:// or https:// URL",
- class: "input",
- placeholder: "https://example.com",
- data: { action: "keydown.esc@document->form#cancel" } %>
+
+ <%= form.label :url do %>
+
Payload URL
+
This is the URL for the app that will receive payloads from Fizzy.
+ <% end %>
+ <%= form.url_field :url,
+ required: true,
+ pattern: "https?://.*",
+ title: "Must be an http:// or https:// URL",
+ class: "input",
+ placeholder: "https://example.com",
+ data: { action: "keydown.esc@document->form#cancel" } %>
+
-
- <%= form.label :actions %>
+
+ <%= form.label :actions do %>
+
Events
+
Trigger a call to the Payload URL when these things occur:
+ <% end %>
<%= render "webhooks/form/actions", form: form %>
- <%= form.button type: :submit, class: "btn btn--reversed center margin-block-start txt-medium" do %>
+ <%= form.button type: :submit, class: "btn btn--link center txt-medium" do %>
Create Webhook
<% end %>