diff --git a/app/assets/stylesheets/knobs.css b/app/assets/stylesheets/knobs.css index 573ef12a7..6014eb345 100644 --- a/app/assets/stylesheets/knobs.css +++ b/app/assets/stylesheets/knobs.css @@ -139,4 +139,4 @@ margin-block-start: 1ch; text-transform: uppercase; } -} \ No newline at end of file +} diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 8993fdb2c..d535f26d9 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -28,9 +28,7 @@ class CardsController < ApplicationController def update @card.update! card_params - if params[:card][:collection_id].present? - redirect_to collection_card_path(@card.collection, @card) - elsif @card.published? + if @card.published? render_card_replacement else redirect_to @card @@ -56,7 +54,7 @@ class CardsController < ApplicationController end def card_params - params.expect(card: [ :collection_id, :status, :title, :description, :image, tag_ids: [] ]) + params.expect(card: [ :status, :title, :description, :image, tag_ids: [] ]) end def render_card_replacement diff --git a/app/javascript/controllers/knob_controller.js b/app/javascript/controllers/knob_controller.js index 7603f5ed0..f8413cb76 100644 --- a/app/javascript/controllers/knob_controller.js +++ b/app/javascript/controllers/knob_controller.js @@ -25,4 +25,4 @@ export default class extends Controller { option.checked = true; } -} \ No newline at end of file +} diff --git a/app/javascript/controllers/navigable_list_controller.js b/app/javascript/controllers/navigable_list_controller.js index 49050e3ab..eb416c159 100644 --- a/app/javascript/controllers/navigable_list_controller.js +++ b/app/javascript/controllers/navigable_list_controller.js @@ -125,10 +125,11 @@ export default class extends Controller { this.#handleArrowKey(event, this.#selectPrevious.bind(this)) }, Enter(event) { - this.#clickCurrentItem(event) + if (event.shiftKey) { + this.#toggleCurrentItem(event) + } else { + this.#clickCurrentItem(event) + } }, - x(event) { - this.#toggleCurrentItem(event) - } } } diff --git a/app/views/cards/_messages.html.erb b/app/views/cards/_messages.html.erb index cbf7a40d0..042c25ed5 100644 --- a/app/views/cards/_messages.html.erb +++ b/app/views/cards/_messages.html.erb @@ -1,23 +1,25 @@ <%= messages_tag(card) do %> - <%= render partial: "cards/comments/comment", collection: card.comments.chronologically, cached: true %> - <%= render "cards/comments/new", card: card %> + <% if card.published? %> + <%= render partial: "cards/comments/comment", collection: card.comments.chronologically, cached: true %> + <%= render "cards/comments/new", card: card %> -
- Subscribers +
+ Subscribers -

- <%= pluralize(@card.watchers.without(User.system).count, "person") %> will be notified when someone comments on this. -

+

+ <%= pluralize(@card.watchers.without(User.system).count, "person") %> will be notified when someone comments on this. +

-
- <% prepend_current_user_to(@card.watchers.without(User.system).alphabetically).each do |watcher| %> - <%= avatar_tag watcher %> - <% end %> +
+ <% prepend_current_user_to(@card.watchers.without(User.system).alphabetically).each do |watcher| %> + <%= avatar_tag watcher %> + <% end %> +
+ <% end %> -
-
- <%= button_to_delete_card(@card) %> -
+
+
+ <%= button_to_delete_card(@card) %>
<% end %> diff --git a/app/views/cards/edit.html.erb b/app/views/cards/edit.html.erb index 6a8d37e13..d7cbe9e6c 100644 --- a/app/views/cards/edit.html.erb +++ b/app/views/cards/edit.html.erb @@ -12,7 +12,7 @@ placeholder: "Add some notes, context, pictures, or video about this…", data: { action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" } %>
- <%= form.button "Save changes", type: :submit, class: "btn" %> + <%= form.button "Save changes", type: :submit, class: "btn btn--reversed", style: "--btn-background: #{@card.color}" %> <%= link_to "Close editor and discard changes", collection_card_path(@card.collection, @card), data: { form_target: "cancel" }, hidden: true %> <% end %> <% end %> diff --git a/app/views/cards/index/_header.html.erb b/app/views/cards/index/_header.html.erb index 7498d9095..8120d3ea4 100644 --- a/app/views/cards/index/_header.html.erb +++ b/app/views/cards/index/_header.html.erb @@ -31,7 +31,7 @@ <%= render "cards/index/collections_filter", filter: filter %>

- Press <%= hotkey_label(["ctrl", "J"]) -%> anytime to open this, esc to close, to move, enter to navigate, x to select. + Press <%= hotkey_label(["ctrl", "J"]) -%> anytime to open this, esc to close, to move, enter to navigate, SHIFT+ENTER to select.

<% end %>
diff --git a/app/views/cards/show.html.erb b/app/views/cards/show.html.erb index 56ca920bb..ef0989929 100644 --- a/app/views/cards/show.html.erb +++ b/app/views/cards/show.html.erb @@ -32,7 +32,7 @@
<%= render "cards/container", card: @card %> - <% if @card.published? %> + <% if @card.published? || @card.drafted? %> <%= render "cards/messages", card: @card %> <% end %>
diff --git a/app/views/collections/edit/_knob.html.erb b/app/views/collections/edit/_knob.html.erb new file mode 100644 index 000000000..5dda6727e --- /dev/null +++ b/app/views/collections/edit/_knob.html.erb @@ -0,0 +1,35 @@ +<% name = label.parameterize %> + +
+ +
+ <% knob_options.each_with_index do |value, i| %> + + <% end %> + + +
+
+ +
Days
+
diff --git a/app/views/events/_filter.html.erb b/app/views/events/_filter.html.erb index 22add94b5..7486754a4 100644 --- a/app/views/events/_filter.html.erb +++ b/app/views/events/_filter.html.erb @@ -36,7 +36,7 @@ <% end %>

- Press <%= hotkey_label(["ctrl", "J"]) -%> anytime to open this, esc to close, to move, enter to navigate, x to select. + Press <%= hotkey_label(["ctrl", "J"]) -%> anytime to open this, esc to close, to move, enter to navigate, SHIFT+ENTER to select.

<% end %>