action_link 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6ca963716e05cd48088b03967fa4a540c4da07a969f5c02b0c5f74737f0b068
4
- data.tar.gz: cd298d71d690639047a1e5f3a2729eb8b2c8525ca255d0ff74f3498d3918140e
3
+ metadata.gz: 8751045faed03a5802b305dbcc9d8b06ac5924809ff427486e7ebb1cfde422ba
4
+ data.tar.gz: 39c04503d2b3097fe50c7f0ec42838c28cb360db9d88e5be78d1baf379896fab
5
5
  SHA512:
6
- metadata.gz: 8e7bcab9f6b35c35656933abfcef6e1ef1264a68b2de40fc5f3d215cfbb7b14616f5531693ab53b1f0db1ee17e5b4b645168a333b0464f96e90ef65e65893700
7
- data.tar.gz: fb2a36f1df8d60d66c77c439d9b00f2ead2009c2c94bfa650aafba6a723104208348a4fbcb0895964685a9ff50a806660567bebb06ea7edeeb68b940fe3c3156
6
+ metadata.gz: 9ed13bfdd53de6a18257fc22b7fbaa268bb0a665071a1030abaee6237a0ab79caa4629d07a018796a40d04aeee203cc5bbae9f03884a88d196b791790616611e
7
+ data.tar.gz: 7fb5dab692d5659d316f8967bd88a562af98d216fb2fe5409d5b5273b573bf8f84845244f7a4e7bc4f9b5cd77ad98e8e715b2beea82f2494db32b881709f80b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.1.7] - 2026-11-06
2
+
3
+ - Add `multiple` option to `ActionLink::New` with plus-plus icon
4
+
5
+ ## [1.1.6] - 2026-09-25
6
+
7
+ - Add a Create link type for links that create a record right away
8
+
1
9
  ## [1.1.5] - 2026-08-04
2
10
 
3
11
  - Make VS Code snippet symlinking atomic so concurrent app boots no longer race into `Errno::EEXIST`
@@ -2,6 +2,11 @@
2
2
 
3
3
  @use "variables";
4
4
 
5
+ .o-acticon--plus-plus-circle {
6
+ &:before {
7
+ content: variables.$plus-plus-circle;
8
+ }
9
+ }
5
10
  .o-acticon--info-circle {
6
11
  &:before {
7
12
  content: variables.$info-circle;
@@ -1,5 +1,6 @@
1
1
  // This file is autogenerated by `rake acticons:update`
2
2
 
3
+ $plus-plus-circle: "\e900";
3
4
  $info-circle: "\e907";
4
5
  $questionmark: "\2753";
5
6
  $arrow-down-circle: "\e9af";
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionLink
4
+ # An action link that creates a record right away.
5
+ class Create < Base
6
+ ICON = 'plus-circle'
7
+
8
+ erb_template <<~ERB.gsub("\n", '')
9
+ <% if permission? %>
10
+ <%= link_to(url, **options) do %>
11
+ <%= content %>
12
+ <% if icon? %><%= ' ' %><%= icon_tag ::ActionLink::Create::ICON %><% end %>
13
+ <% end %>
14
+ <% else %>
15
+ <%= content %>
16
+ <% end %>
17
+ ERB
18
+
19
+ option :url
20
+
21
+ def http_method
22
+ :post
23
+ end
24
+ end
25
+ end
@@ -4,12 +4,13 @@ module ActionLink
4
4
  # An action link that indicates adding a new record.
5
5
  class New < Base
6
6
  ICON = 'plus-circle'.freeze
7
+ ICON_MULTIPLE = 'plus-plus-circle'.freeze
7
8
 
8
9
  erb_template <<~ERB.gsub("\n", '')
9
10
  <% if permission? %>
10
11
  <%= link_to(url, **options) do %>
11
12
  <%= content %>
12
- <% if icon? %><%= ' ' %><%= icon_tag ::ActionLink::New::ICON %><% end %>
13
+ <% if icon? %><%= ' ' %><%= icon_tag icon_name %><% end %>
13
14
  <% end %>
14
15
  <% else %>
15
16
  <%= content %>
@@ -21,11 +22,20 @@ module ActionLink
21
22
  option :model, as: :manual_model
22
23
  option :url
23
24
  option :associative, default: -> { false }
25
+ option :multiple, default: -> { false }
24
26
 
25
27
  def i18n_title_key
26
28
  return 'action_link.titles.assign' if associative
29
+ return 'action_link.titles.new_multiple' if multiple
27
30
 
28
31
  super
29
32
  end
33
+
34
+ def icon_name
35
+ return ::ActionLink::New::ICON if associative
36
+ return ::ActionLink::New::ICON_MULTIPLE if multiple
37
+
38
+ ::ActionLink::New::ICON
39
+ end
30
40
  end
31
41
  end
@@ -5,9 +5,11 @@ de:
5
5
  unassign: "Möchtest du %{subject} entkoppeln? Bei dieser Aktion wird nichts gelöscht."
6
6
  titles:
7
7
  assign: "%{subject} zuweisen"
8
+ create: "%{subject} anlegen"
8
9
  destroy: "%{subject} löschen"
9
10
  edit: "%{subject} bearbeiten"
10
11
  new: "%{subject} anlegen"
12
+ new_multiple: "%{subject} und weitere anlegen"
11
13
  show: "%{subject} anzeigen"
12
14
  unassign: "%{subject} entkoppeln"
13
15
  download: "%{subject} downloaden"
@@ -5,9 +5,11 @@ en:
5
5
  unassign: "Would you like to unassign %{subject}? This action does not delete."
6
6
  titles:
7
7
  assign: "Assign %{subject}"
8
+ create: "Create %{subject}"
8
9
  destroy: "Delete %{subject}"
9
10
  edit: "Edit %{subject}"
10
11
  new: Add %{subject}
12
+ new_multiple: Add %{subject} and more
11
13
  show: "Show %{subject}"
12
14
  unassign: "Unassign %{subject}"
13
15
  download: "Download %{subject}"
@@ -39,6 +39,7 @@ module ActionLink
39
39
  require_relative '../../app/components/action_link/application_component'
40
40
  require_relative '../../app/components/action_link/base'
41
41
  require_relative '../../app/components/action_link/custom'
42
+ require_relative '../../app/components/action_link/create'
42
43
  require_relative '../../app/components/action_link/destroy'
43
44
  require_relative '../../app/components/action_link/edit'
44
45
  require_relative '../../app/components/action_link/new'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionLink
4
- VERSION = '1.1.5'
4
+ VERSION = '1.1.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo
@@ -91,6 +91,7 @@ files:
91
91
  - app/assets/stylesheets/action_link/variables.scss
92
92
  - app/components/action_link/application_component.rb
93
93
  - app/components/action_link/base.rb
94
+ - app/components/action_link/create.rb
94
95
  - app/components/action_link/custom.rb
95
96
  - app/components/action_link/destroy.rb
96
97
  - app/components/action_link/download.rb
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  - !ruby/object:Gem::Version
129
130
  version: '0'
130
131
  requirements: []
131
- rubygems_version: 4.0.6
132
+ rubygems_version: 4.0.23
132
133
  specification_version: 4
133
134
  summary: A set of ViewComponents for common links (show, edit, delete, etc.)
134
135
  test_files: []