active_scaffold_kanban 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e25b955b58cdedd3c53158c2c0750756e9939033ca0622e14b5e5a74f065ade3
4
- data.tar.gz: 6e2809f0242b81621ced3742b04c16d0a288568f6dca7c3f5df88f2448983519
3
+ metadata.gz: d75bed289605098b25dc9b8d70ff38988681a70b8b61e00c3ef504993f322053
4
+ data.tar.gz: 2a9b39b0463fef41905e8f737befbe6dbde0fe1d8cd3840bb732a1137b1bf1f9
5
5
  SHA512:
6
- metadata.gz: 61313ca7f2eeaf6317b87f22cb9a526caa48a9406a7c9789503742f7c059a9813d05ffe9ee88496c26cbdb07ad830fef423e177dfc3898a82a3d4937e12337d9
7
- data.tar.gz: ed1fde6d9d9f84c8a5473fb122067a568a6b1e8831f846c939c15b41e132d5f30694f14c4c14461ce52bd5f5fe4a8741502a97db42f9e06b51b32da222746357
6
+ metadata.gz: 4c3fdcf46fffadab3cb74764ce0e0c04bbb7ba7cde02b21adaab802bc21337eb563e55af7c7fabe380e097d6dad823897d9407290635c3c912c2e4e503842976
7
+ data.tar.gz: 38000a05e2567eb216763d02d6937d97f09a4090cfd322426800485d6f88f66864200bc80fd162668bf4a4c00af1f4a7ca57df3574b5bf20c3626d639ac02b93
@@ -3,6 +3,7 @@
3
3
  <div class="card-title">
4
4
  <%= record.send(active_scaffold_config.kanban.title_method) %>
5
5
  <div class="actions">
6
+ <%= loading_indicator_tag(action: :record, id: record.id) %>
6
7
  <%= display_action_links(active_scaffold_config.action_links.member, record, for: record) %>
7
8
  </div>
8
9
  </div>
@@ -1,4 +1,18 @@
1
1
  <% if @kanban_view %>
2
+ <% if active_scaffold_config.list.messages_above_header %>
3
+ <table>
4
+ <tbody>
5
+ <tr>
6
+ <td class="messages-container">
7
+ <%= render 'list_messages_content' %>
8
+ </td>
9
+ </tr>
10
+ </tbody>
11
+ </table>
12
+ <% end %>
13
+ <table>
14
+ <%= render 'list_messages', column_count: 1 %>
15
+ </table>
2
16
  <%= render 'kanban' %>
3
17
  <% else %>
4
18
  <%= render :super %>
@@ -1,8 +1,7 @@
1
1
  <% if @kanban_view %>
2
- <%= selector = ".kanban-column[data-value=\"#{@record.send(@kanban_column.name)}\"] .cards" %>
3
- // ActiveScaffold.create_record_row('<%= active_scaffold_id %>', html, <%= {insert_at: insert_at, body_selector: selector}.to_json.html_safe %>);
4
- jQuery('<%= selector %>').prepend('<%= escape_javascript render('kanban_card', record: @record) %>');
5
- jQuery('<%= selector %>').sortable('refresh');
2
+ <% selector = ".kanban-column[data-value=\"#{@record.send(@kanban_column.name)}\"] .cards" %>
3
+ ActiveScaffold.create_record_row('<%= active_scaffold_id %>', '<%= escape_javascript render('kanban_card', record: @record) %>', <%= {insert_at: insert_at, body_selector: selector}.to_json.html_safe %>);
4
+ jQuery(<%=raw selector.to_json %>).sortable('refresh');
6
5
  <% else %>
7
6
  <%= render :super %>
8
7
  <% end %>
@@ -4,7 +4,7 @@ module ActiveScaffold
4
4
  module Actions
5
5
  module Kanban
6
6
  def self.included(base)
7
- base.before_action :setup_kanban, only: [:index, :update_column, :reorder, :create]
7
+ base.before_action :setup_kanban
8
8
  base.after_action :reorder_cards, only: :update_column
9
9
  base.after_action :set_error_status_code, only: [:update_column, :reorder]
10
10
  end
@@ -10,6 +10,7 @@ module ActiveScaffold
10
10
  @title_method = self.class.title_method
11
11
  @description_method = self.class.description_method
12
12
  @replace_list_view = self.class.replace_list_view
13
+ @links_position = self.class.links_position
13
14
  end
14
15
 
15
16
  # global level configuration
@@ -24,6 +25,10 @@ module ActiveScaffold
24
25
  # enable it to replace list view with kanban, instead of being optional with view=kanban param
25
26
  cattr_accessor :replace_list_view, instance_accessor: false
26
27
 
28
+ # the position to set on actions used in kanban cards
29
+ cattr_accessor :links_position, instance_accessor: false
30
+ @@links_position = :table
31
+
27
32
  # the model's method used for card's title
28
33
  attr_accessor :title_method
29
34
 
@@ -36,8 +41,10 @@ module ActiveScaffold
36
41
  # the model's column used for kanban columns
37
42
  attr_accessor :group_by_column
38
43
 
44
+ attr_accessor :links_position
45
+
39
46
  UserSettings.class_eval do
40
- user_attr :title_method, :description_method, :group_by_column, :replace_list_view
47
+ user_attr :title_method, :description_method, :group_by_column, :replace_list_view, :links_position
41
48
  end
42
49
  end
43
50
  end
@@ -1,6 +1,10 @@
1
1
  module ActiveScaffold
2
2
  module Helpers
3
3
  module KanbanHelpers
4
+ def list_record_view
5
+ @kanban_view ? 'kanban_card' : 'list_record'
6
+ end
7
+
4
8
  def kanban_columns
5
9
  record = active_scaffold_config.model.new
6
10
  if @kanban_column.association
@@ -39,8 +43,8 @@ module ActiveScaffold
39
43
 
40
44
  def action_link_html_options(link, record, options)
41
45
  options = super
42
- if @kanban_view && link.position == :after
43
- options[:data][:position] = :replace
46
+ if @kanban_view && link.type == :member && link.position.in?(%i[after replace before])
47
+ options[:data][:position] = active_scaffold_config.kanban.links_position
44
48
  end
45
49
  options
46
50
  end
@@ -2,7 +2,7 @@ module ActiveScaffoldKanban
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_kanban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.7.10
19
+ version: 3.7.11
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.7.10
26
+ version: 3.7.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_scaffold_sortable
29
29
  requirement: !ruby/object:Gem::Requirement