sidekiq-tasks 0.1.1 → 0.1.3

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -1
  3. data/CHANGELOG.md +9 -0
  4. data/README.md +12 -1
  5. data/docs/task.png +0 -0
  6. data/lib/sidekiq/tasks/strategies/rules/disable_with_comment.rb +19 -0
  7. data/lib/sidekiq/tasks/strategies/rules/enable_with_comment.rb +16 -12
  8. data/lib/sidekiq/tasks/strategies/rules.rb +1 -0
  9. data/lib/sidekiq/tasks/version.rb +1 -1
  10. data/lib/sidekiq/tasks/web/extension.rb +13 -11
  11. data/lib/sidekiq/tasks/web/helpers/application_helper.rb +1 -3
  12. data/lib/sidekiq/tasks/web/helpers/pagination_helper.rb +40 -0
  13. data/lib/sidekiq/tasks/web/pagination.rb +86 -0
  14. data/lib/sidekiq/tasks/web/search.rb +2 -2
  15. data/lib/sidekiq/tasks/web.rb +22 -13
  16. data/web/assets/tasks/css/components/buttons.css +41 -0
  17. data/web/assets/tasks/css/components/forms.css +110 -0
  18. data/web/assets/tasks/css/components/pagination.css +52 -0
  19. data/web/assets/tasks/css/components/tables.css +48 -0
  20. data/web/assets/tasks/css/ext.css +7 -0
  21. data/web/assets/tasks/css/layouts/header.css +5 -0
  22. data/web/assets/tasks/css/utilities.css +8 -0
  23. data/{lib/sidekiq/tasks/web/assets/javascripts → web/assets/tasks/js}/env_confirmation.js +3 -3
  24. data/{lib/sidekiq/tasks/web → web}/locales/en.yml +1 -0
  25. data/{lib/sidekiq/tasks/web → web}/locales/fr.yml +1 -0
  26. data/web/views/_pagination.erb +15 -0
  27. data/{lib/sidekiq/tasks/web/views/task.html.erb → web/views/task.erb} +30 -36
  28. data/{lib/sidekiq/tasks/web/views/tasks.html.erb → web/views/tasks.erb} +14 -16
  29. metadata +87 -60
  30. data/lib/sidekiq/tasks/web/views/_pagination.html.erb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed1b4bb10d4cc9515458f41b69d8c0d347f7ed8e58e8043538465978666a4eb4
4
- data.tar.gz: ffe569c14fcef6e479e866666c5aaae303d69f145c657612334db9f03f7bfbf6
3
+ metadata.gz: b815ea42b8cc57ba73f3711e735fda709755b75c282e200dc18ab5287eadfdd6
4
+ data.tar.gz: 3e3e652e28ae9ee632452e89bab64bf34db9d4961a6b1eb7e5ff05914cfca3e3
5
5
  SHA512:
6
- metadata.gz: f3f94631245ff618c1a0449160aa105122bcbfe34ce3df10ab1ac161fe44328ca0c551af0a2a635fef7a783762c2710e91c11dcd2c0fb5d1450ea83bd79a460d
7
- data.tar.gz: 9de015b2eeacedc5104a033e07cf50dd47d760a09ef70389e32b9db36dfdc4594ceb971416f76a00f741accdb0fe6900730652cef9db1775e9ec760a0d21d496
6
+ metadata.gz: 53cb0abf54140641134acaf350bf51bf989f3b8d454359fe2b3f32a9ad1937d6257b06de3a000e602f3a63a217e475c4229c23712a88987731a27cab73485d29
7
+ data.tar.gz: 854ef40802df6e3d3cd6eda1eae39df3aff31efc8d1e82c69ae201b1ca3576060fcd9dd3bb71e7bfc6b1c8275f6db7169c61fcaabd84da18be121b3a9c0e55d6
data/.rubocop.yml CHANGED
@@ -1,11 +1,15 @@
1
1
  AllCops:
2
- TargetRubyVersion: 3.1
2
+ TargetRubyVersion: 3.0
3
3
  NewCops: disable
4
4
  SuggestExtensions: false
5
5
 
6
6
  Layout/SpaceInsideHashLiteralBraces:
7
7
  EnforcedStyle: no_space
8
8
 
9
+ Layout/LineLength:
10
+ Exclude:
11
+ - spec/**/*
12
+
9
13
  Metrics/AbcSize:
10
14
  Exclude:
11
15
  - lib/sidekiq/tasks/web/extension.rb
@@ -23,6 +27,10 @@ Metrics/ParameterLists:
23
27
  Exclude:
24
28
  - spec/**/*
25
29
 
30
+ Metrics/PerceivedComplexity:
31
+ Exclude:
32
+ - lib/sidekiq/tasks/web/extension.rb
33
+
26
34
  Naming/FileName:
27
35
  Exclude:
28
36
  - lib/sidekiq/sidekiq-tasks.rb
@@ -57,3 +65,6 @@ Style/TrailingCommaInArrayLiteral:
57
65
 
58
66
  Style/TrailingCommaInHashLiteral:
59
67
  EnforcedStyleForMultiline: consistent_comma
68
+
69
+ Style/WordArray:
70
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## Changelog
2
2
 
3
+ ### [0.1.3] - 2025-03-22
4
+
5
+ - Change required Ruby version to 3.0.0.
6
+ - Add `DisableWithComment` rule to disable a specific task with a magic comment.
7
+
8
+ ### [0.1.2] - 2025-03-22
9
+
10
+ - Update plugin registration for Sidekiq 7.3+ compatibility.
11
+
3
12
  ### [0.1.1] - 2025-02-25
4
13
 
5
14
  - Add an environment confirmation input to the task enqueuing form.
data/README.md CHANGED
@@ -56,10 +56,20 @@ task :my_task do
56
56
  end
57
57
  ```
58
58
 
59
+ You can also use `DisableWithComment` rule to selectively **exclude** tasks. (see [strategies configuration](#strategies-configuration))
60
+ It works similarly to `EnableWithComment`, but with inverted logic. Example of a disabled task:
61
+
62
+ ```ruby
63
+ # sidekiq-tasks:disable
64
+ task :my_task do
65
+ puts "my_task"
66
+ end
67
+ ```
68
+
59
69
  ## Strategies configuration
60
70
 
61
71
  Strategies can be configured through the `config.strategies` option.
62
- For example if you want to remove the `EnableWithComment` rule from the default strategy and enable all tasks from the `lib` folder:
72
+ For example if you want to enable all tasks in the lib folder and disable a few specific ones manually:
63
73
 
64
74
  ```ruby
65
75
  Sidekiq::Tasks.configure do |config|
@@ -67,6 +77,7 @@ Sidekiq::Tasks.configure do |config|
67
77
  Sidekiq::Tasks::Strategies::RakeTask.new(
68
78
  rules: [
69
79
  Sidekiq::Tasks::Strategies::Rules::TaskFromLib.new,
80
+ Sidekiq::Tasks::Strategies::Rules::DisableWithComment.new,
70
81
  ]
71
82
  )
72
83
  ]
data/docs/task.png CHANGED
Binary file
@@ -0,0 +1,19 @@
1
+ module Sidekiq
2
+ module Tasks
3
+ module Strategies
4
+ module Rules
5
+ class DisableWithComment < EnableWithComment
6
+ def respected?(task)
7
+ !super
8
+ end
9
+
10
+ protected
11
+
12
+ def magic_comment_regex
13
+ /sidekiq-tasks:disable/
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -3,24 +3,28 @@ module Sidekiq
3
3
  module Strategies
4
4
  module Rules
5
5
  class EnableWithComment < Base
6
- MAGIC_COMMENT_REGEX = /sidekiq-tasks:enable/
7
-
8
6
  def respected?(task)
9
- file, start_line = task.locations.first.split(":")
10
- start_line_counting_desc = start_line.to_i > 2 ? start_line.to_i - 3 : 0
11
- lines = File.read(file).split("\n")[start_line_counting_desc..start_line_counting_desc + 1].reverse
7
+ lines = relevant_lines(task)
12
8
 
13
- valid_magic_comment_line?(lines)
14
- rescue Errno::ENOENT
15
- raise ArgumentError, "File '#{file}' not found"
9
+ return false if lines.first.match?(/namespace/)
10
+
11
+ lines.any? { |line| line.strip.match?(magic_comment_regex) }
16
12
  end
17
13
 
18
- private
14
+ protected
19
15
 
20
- def valid_magic_comment_line?(lines)
21
- return false if lines.first.match?(/namespace/)
16
+ def magic_comment_regex
17
+ /sidekiq-tasks:enable/
18
+ end
19
+
20
+ private
22
21
 
23
- lines.any? { |line| line.strip.match?(MAGIC_COMMENT_REGEX) }
22
+ def relevant_lines(task)
23
+ file, start_line = task.locations.first.split(":")
24
+ start_line_counting_desc = start_line.to_i > 2 ? start_line.to_i - 3 : 0
25
+ File.read(file).split("\n")[start_line_counting_desc..start_line_counting_desc + 1].reverse
26
+ rescue Errno::ENOENT
27
+ raise ArgumentError, "File '#{file}' not found"
24
28
  end
25
29
  end
26
30
  end
@@ -5,6 +5,7 @@ module Sidekiq
5
5
  autoload :Base, "sidekiq/tasks/strategies/rules/base"
6
6
  autoload :TaskFromLib, "sidekiq/tasks/strategies/rules/task_from_lib"
7
7
  autoload :EnableWithComment, "sidekiq/tasks/strategies/rules/enable_with_comment"
8
+ autoload :DisableWithComment, "sidekiq/tasks/strategies/rules/disable_with_comment"
8
9
  end
9
10
  end
10
11
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Tasks
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
@@ -1,25 +1,27 @@
1
+ require "sidekiq/tasks/web/helpers/application_helper"
2
+ require "sidekiq/tasks/web/helpers/task_helper"
3
+ require "sidekiq/tasks/web/helpers/pagination_helper"
4
+ require "sidekiq/tasks/web/search"
5
+ require "sidekiq/tasks/web/pagination"
6
+ require "sidekiq/tasks/web/params"
7
+
1
8
  module Sidekiq
2
9
  module Tasks
3
10
  module Web
4
11
  class Extension
5
- LOCALES_PATH = File.expand_path("../web/locales", __dir__).freeze
6
-
7
12
  def self.registered(app)
8
- app.settings.locales << File.join(LOCALES_PATH)
9
-
10
- app.helpers do
11
- include Sidekiq::Tasks::Web::Helpers::ApplicationHelper
12
- include Sidekiq::Tasks::Web::Helpers::TaskHelper
13
- end
13
+ app.helpers(Sidekiq::Tasks::Web::Helpers::ApplicationHelper)
14
+ app.helpers(Sidekiq::Tasks::Web::Helpers::TaskHelper)
15
+ app.helpers(Sidekiq::Tasks::Web::Helpers::PaginationHelper)
14
16
 
15
17
  app.get "/tasks" do
16
- @search = Sidekiq::Tasks::Web::Search.new(params)
18
+ @search = Sidekiq::Tasks::Web::Search.new(params.transform_keys(&:to_sym))
17
19
 
18
20
  erb(read_view(:tasks), locals: {search: @search})
19
21
  end
20
22
 
21
23
  app.get "/tasks/:name" do
22
- @task = find_task!(params["name"])
24
+ @task = find_task!(env["rack.route_params"][:name])
23
25
 
24
26
  erb(read_view(:task), locals: {task: @task})
25
27
  rescue Sidekiq::Tasks::NotFoundError
@@ -31,7 +33,7 @@ module Sidekiq
31
33
  throw :halt, [400, {Rack::CONTENT_TYPE => "text/plain"}, ["Invalid confirm"]]
32
34
  end
33
35
 
34
- task = find_task!(params["name"])
36
+ task = find_task!(env["rack.route_params"][:name])
35
37
  args = Sidekiq::Tasks::Web::Params.new(task, params["args"]).permit!
36
38
 
37
39
  task.enqueue(args)
@@ -5,10 +5,8 @@ module Sidekiq
5
5
  module ApplicationHelper
6
6
  extend self
7
7
 
8
- VIEW_PATH = File.expand_path("../../web/views", __dir__).freeze
9
-
10
8
  def read_view(name)
11
- File.read(File.join(VIEW_PATH, "#{name}.html.erb"))
9
+ File.read(File.join(Sidekiq::Tasks::Web::ROOT, "views", "#{name}.erb"))
12
10
  end
13
11
 
14
12
  def current_env
@@ -0,0 +1,40 @@
1
+ module Sidekiq
2
+ module Tasks
3
+ module Web
4
+ module Helpers
5
+ module PaginationHelper
6
+ extend self
7
+
8
+ def pagination_link(root_path, link, search)
9
+ build_tag(:li, class: "st-page-item") do
10
+ build_tag(
11
+ :a,
12
+ link[:text],
13
+ class: build_classes("st-page-link", disabled: link[:disabled], active: link[:active]),
14
+ href: pagination_url(root_path, search, link[:page])
15
+ )
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def build_tag(tag, content = nil, **attributes, &block)
22
+ attr_string = attributes.map { |key, value| "#{key}=\"#{value}\"" }.join(" ")
23
+
24
+ "<#{tag} #{attr_string}>#{block&.call || content}</#{tag}>"
25
+ end
26
+
27
+ def build_classes(*classes, **conditions)
28
+ condition_classes = conditions.select { |_, value| value }.keys
29
+
30
+ (classes + condition_classes).join(" ")
31
+ end
32
+
33
+ def pagination_url(root_path, search, page)
34
+ "#{root_path}tasks?filter=#{ERB::Util.url_encode(search.filter)}&count=#{search.count}&page=#{page}"
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,86 @@
1
+ module Sidekiq
2
+ module Tasks
3
+ module Web
4
+ class Pagination
5
+ PREV_LABEL = "«".freeze
6
+ NEXT_LABEL = "»".freeze
7
+ ELLIPSIS_LABEL = "...".freeze
8
+ MIN_PAGE_DISPLAY = 7
9
+ PAGE_OFFSET = 2
10
+
11
+ attr_reader :current_page, :total_pages
12
+
13
+ def initialize(current_page, total_pages)
14
+ @current_page = current_page
15
+ @total_pages = total_pages
16
+ end
17
+
18
+ def links
19
+ return [] if total_pages <= 1
20
+
21
+ build_links.flatten.compact
22
+ end
23
+
24
+ private
25
+
26
+ def build_links
27
+ [
28
+ navigation_link(PREV_LABEL, current_page - 1, current_page > 1),
29
+ first_page_link,
30
+ leading_ellipsis,
31
+ middle_page_links,
32
+ trailing_ellipsis,
33
+ last_page_link,
34
+ navigation_link(NEXT_LABEL, current_page + 1, current_page < total_pages),
35
+ ]
36
+ end
37
+
38
+ def navigation_link(text, page, enabled)
39
+ enabled ? {page: page, text: text} : {page: nil, text: text, disabled: true}
40
+ end
41
+
42
+ def page_link(page)
43
+ {page: page, text: page.to_s, active: page == current_page}
44
+ end
45
+
46
+ def ellipsis
47
+ {page: 1, text: ELLIPSIS_LABEL, disabled: true}
48
+ end
49
+
50
+ def first_page_link
51
+ return nil if total_pages <= MIN_PAGE_DISPLAY
52
+
53
+ page_link(1)
54
+ end
55
+
56
+ def last_page_link
57
+ return nil if total_pages <= MIN_PAGE_DISPLAY
58
+
59
+ page_link(total_pages)
60
+ end
61
+
62
+ def leading_ellipsis
63
+ return nil if total_pages <= MIN_PAGE_DISPLAY || current_page <= PAGE_OFFSET + 2
64
+
65
+ ellipsis
66
+ end
67
+
68
+ def trailing_ellipsis
69
+ return nil if total_pages <= MIN_PAGE_DISPLAY || current_page >= total_pages - (PAGE_OFFSET + 1)
70
+
71
+ ellipsis
72
+ end
73
+
74
+ def middle_page_links
75
+ if total_pages <= MIN_PAGE_DISPLAY
76
+ (1..total_pages).map { |page| page_link(page) }
77
+ else
78
+ start_page = [current_page - PAGE_OFFSET, 2].max
79
+ end_page = [current_page + PAGE_OFFSET, total_pages - 1].min
80
+ (start_page..end_page).map { |page| page_link(page) }
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -2,10 +2,10 @@ module Sidekiq
2
2
  module Tasks
3
3
  module Web
4
4
  class Search
5
- DEFAULT_COUNT = 25
5
+ DEFAULT_COUNT = 15
6
6
 
7
7
  def self.count_options
8
- (1..4).map { |index| index * DEFAULT_COUNT }
8
+ (0..3).map { |index| DEFAULT_COUNT * (2**index) }
9
9
  end
10
10
 
11
11
  attr_reader :params
@@ -1,28 +1,37 @@
1
- require "sidekiq/tasks/web/helpers/application_helper"
2
- require "sidekiq/tasks/web/helpers/task_helper"
3
- require "sidekiq/tasks/web/search"
4
- require "sidekiq/tasks/task"
1
+ require "sidekiq/tasks"
5
2
 
6
3
  module Sidekiq
7
4
  module Tasks
8
5
  module Web
9
- ASSET_PATH = File.expand_path("web/assets", __dir__).freeze
10
-
11
6
  autoload :Extension, "sidekiq/tasks/web/extension"
12
- autoload :Params, "sidekiq/tasks/web/params"
7
+
8
+ ROOT = File.expand_path("../../../web", File.dirname(__FILE__))
9
+ SIDEKIQ_GTE_7_3_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new("7.3.0")
13
10
  end
14
11
  end
15
12
  end
16
13
 
17
- if defined?(Sidekiq::Web)
14
+ if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0
15
+ Sidekiq::Web.configure do |config|
16
+ config.register(
17
+ Sidekiq::Tasks::Web::Extension,
18
+ name: "tasks",
19
+ tab: ["Tasks"],
20
+ index: ["tasks"],
21
+ root_dir: Sidekiq::Tasks::Web::ROOT,
22
+ asset_paths: ["js", "css"]
23
+ )
24
+ end
25
+ else
26
+ Sidekiq::Web.tabs["Tasks"] = "tasks"
27
+ Sidekiq::Web.register(Sidekiq::Tasks::Web::Extension)
28
+ Sidekiq::Web.locales << "#{Sidekiq::Tasks::Web::ROOT}/locales"
29
+
18
30
  Sidekiq::Web.use(
19
31
  Rack::Static,
20
- urls: ["/javascripts"],
21
- root: File.expand_path("web/assets", __dir__),
32
+ urls: ["/tasks/css", "/tasks/js"],
33
+ root: "#{Sidekiq::Tasks::Web::ROOT}/assets",
22
34
  cascade: true,
23
35
  header_rules: [[:all, {"cache-control" => "private, max-age=86400"}]]
24
36
  )
25
-
26
- Sidekiq::Web.register(Sidekiq::Tasks::Web::Extension)
27
- Sidekiq::Web.tabs["Tasks"] = "tasks"
28
37
  end
@@ -0,0 +1,41 @@
1
+ :root {
2
+ --st-button-bg: #b1003e;
3
+ --st-button-text: white;
4
+ --st-button-border: none;
5
+ --st-button-hover-bg: #900030;
6
+ --st-button-disabled-bg: #ccc;
7
+ --st-button-disabled-text: #666;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ :root {
12
+ --st-button-bg: #900030;
13
+ --st-button-text: white;
14
+ --st-button-border: none;
15
+ --st-button-hover-bg: #700024;
16
+ --st-button-disabled-bg: #555;
17
+ --st-button-disabled-text: #aaa;
18
+ }
19
+ }
20
+
21
+ .st-button {
22
+ background-color: var(--st-button-bg);
23
+ color: var(--st-button-text);
24
+ border: var(--st-button-border);
25
+ padding: 8px 16px;
26
+ border-radius: 6px;
27
+ font-size: 16px;
28
+ cursor: pointer;
29
+ transition: background 0.3s ease-in-out;
30
+ }
31
+
32
+ .st-button:hover {
33
+ background-color: var(--st-button-hover-bg);
34
+ }
35
+
36
+ .st-button:disabled {
37
+ background-color: var(--st-button-disabled-bg);
38
+ color: var(--st-button-disabled-text);
39
+ cursor: not-allowed;
40
+ }
41
+
@@ -0,0 +1,110 @@
1
+ :root {
2
+ --st-border-color: #ccc;
3
+ --st-focus-border-color: #b1003e;
4
+ --st-input-bg: white;
5
+ --st-input-text: #000;
6
+ --st-select-bg: #ddd;
7
+ --st-label-color: #000;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ :root {
12
+ --st-border-color: #555;
13
+ --st-focus-border-color: #900030;
14
+ --st-input-bg: #222;
15
+ --st-input-text: #ddd;
16
+ --st-select-bg: #333;
17
+ --st-label-color: #ddd;
18
+ }
19
+ }
20
+
21
+ .st-search-form {
22
+ display: flex;
23
+ align-items: center;
24
+ gap: 8px;
25
+ max-width: 350px;
26
+ }
27
+
28
+ .st-form-container {
29
+ max-width: 600px;
30
+ }
31
+
32
+ .st-form-row {
33
+ display: flex;
34
+ flex-wrap: wrap;
35
+ gap: 15px;
36
+ }
37
+
38
+ .st-form-group {
39
+ flex: 1 1 calc(50% - 15px);
40
+ display: flex;
41
+ flex-direction: column;
42
+ margin-bottom: 15px;
43
+ }
44
+
45
+ .st-form-group-full {
46
+ flex: 1 1 100%;
47
+ display: flex;
48
+ flex-direction: column;
49
+ margin-bottom: 15px;
50
+ }
51
+
52
+ .st-label {
53
+ font-weight: bold;
54
+ margin-bottom: 5px;
55
+ font-size: 14px;
56
+ color: var(--st-label-color);
57
+ }
58
+
59
+ .st-input {
60
+ width: 100%;
61
+ height: auto;
62
+ border: 1px solid var(--st-border-color);
63
+ padding: 8px 12px;
64
+ border-radius: 6px;
65
+ font-size: 16px;
66
+ background-color: var(--st-input-bg);
67
+ color: var(--st-input-text);
68
+ transition: border 0.3s ease-in-out, background 0.3s ease-in-out;
69
+ }
70
+
71
+ .st-input:focus,
72
+ .st-select:focus {
73
+ outline: none;
74
+ border: 1px solid var(--st-focus-border-color);
75
+ }
76
+
77
+ .st-select {
78
+ height: auto;
79
+ border: 1px solid var(--st-border-color);
80
+ padding: 8px;
81
+ border-radius: 6px;
82
+ font-size: 16px;
83
+ background-color: var(--st-select-bg);
84
+ color: var(--st-input-text);
85
+ transition: border 0.3s ease-in-out, background 0.3s ease-in-out;
86
+ }
87
+
88
+ .st-input,
89
+ .st-select,
90
+ .st-button {
91
+ height: 40px;
92
+ box-sizing: border-box;
93
+ }
94
+
95
+ @media (max-width: 600px) {
96
+ .st-form-row {
97
+ flex-direction: column;
98
+ gap: 0;
99
+ }
100
+
101
+ .st-form-group,
102
+ .st-form-group-full {
103
+ flex: 1 1 100%;
104
+ }
105
+
106
+ .st-form-container {
107
+ max-width: 100%;
108
+ padding: 10px 0;
109
+ }
110
+ }
@@ -0,0 +1,52 @@
1
+ :root {
2
+ --st-pagination-text: #b1003e;
3
+ --st-pagination-active-opacity: 0.5;
4
+ --st-pagination-disabled-text: #ccc;
5
+ }
6
+
7
+ @media (prefers-color-scheme: dark) {
8
+ :root {
9
+ --st-pagination-text: #ff4d79;
10
+ --st-pagination-active-opacity: 0.7;
11
+ --st-pagination-disabled-text: #555;
12
+ }
13
+ }
14
+
15
+ .st-pagination-wrapper {
16
+ overflow-x: auto;
17
+ padding-bottom: 10px;
18
+ display: flex;
19
+ width: 100%;
20
+ justify-content: space-between;
21
+ }
22
+
23
+ .st-pagination {
24
+ display: flex;
25
+ gap: 5px;
26
+ list-style: none;
27
+ padding: 0;
28
+ margin: 0;
29
+ white-space: nowrap;
30
+ }
31
+
32
+ .st-page-item {
33
+ display: flex;
34
+ }
35
+
36
+ a.st-page-link {
37
+ text-decoration: none;
38
+ display: block;
39
+ color: var(--st-pagination-text);
40
+ font-size: 14px;
41
+ transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
42
+ }
43
+
44
+ a.st-page-link.active {
45
+ opacity: var(--st-pagination-active-opacity);
46
+ }
47
+
48
+ a.st-page-link.disabled {
49
+ pointer-events: none;
50
+ color: var(--st-pagination-disabled-text);
51
+ }
52
+
@@ -0,0 +1,48 @@
1
+ :root {
2
+ --st-table-bg: transparent;
3
+ --st-table-text: #333;
4
+ --st-table-border: #ddd;
5
+ --st-table-odd-bg: #fcfcfc;
6
+ --st-table-even-bg: transparent;
7
+ --st-table-header-bg: transparent;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ :root {
12
+ --st-table-bg: transparent;
13
+ --st-table-text: #ddd;
14
+ --st-table-border: #555;
15
+ --st-table-odd-bg: #222;
16
+ --st-table-even-bg: #333;
17
+ --st-table-header-bg: #111;
18
+ }
19
+ }
20
+
21
+ .st-table {
22
+ background-color: var(--st-table-bg);
23
+ color: var(--st-table-text);
24
+ width: 100%;
25
+ max-width: 100%;
26
+ margin-bottom: 20px;
27
+ }
28
+
29
+ .st-table thead > tr > th,
30
+ .st-table tbody > tr > th,
31
+ .st-table tbody > tr > td {
32
+ border: 1px solid var(--st-table-border);
33
+ padding: 7px 10px;
34
+ }
35
+
36
+ .st-table tbody tr:nth-child(odd) {
37
+ background-color: var(--st-table-odd-bg);
38
+ }
39
+
40
+ .st-table tbody tr:nth-child(even) th,
41
+ .st-table tbody tr:nth-child(even) td {
42
+ background-color: var(--st-table-even-bg);
43
+ }
44
+
45
+ .st-table thead > tr > th {
46
+ background-color: var(--st-table-header-bg);
47
+ }
48
+
@@ -0,0 +1,7 @@
1
+ @import url("utilities.css");
2
+ @import url("layouts/header.css");
3
+ @import url("components/forms.css");
4
+ @import url("components/tables.css");
5
+ @import url("components/buttons.css");
6
+ @import url("components/pagination.css");
7
+
@@ -0,0 +1,5 @@
1
+ .st-header {
2
+ padding-top: 15px;
3
+ padding-bottom: 15px;
4
+ }
5
+
@@ -0,0 +1,8 @@
1
+ .st-text-primary {
2
+ color: #b1003e;
3
+ }
4
+
5
+ .st-ms-1 {
6
+ margin-left: 0.25rem;
7
+ }
8
+
@@ -1,10 +1,10 @@
1
- class EnvConfirmationController {
1
+ class EnvConfirmation {
2
2
  constructor(envConfirmationInputSelector, submitBtnSelector) {
3
3
  this.envConfirmationInput = document.querySelector(envConfirmationInputSelector);
4
4
  this.submitBtn = document.querySelector(submitBtnSelector);
5
5
  }
6
6
 
7
- connect() {
7
+ init() {
8
8
  this.submitBtn.disabled = true;
9
9
  this.currentEnv = this.envConfirmationInput.dataset.currentEnv;
10
10
  this.envConfirmationInput.addEventListener("input", this.#handleInputChange.bind(this));
@@ -16,5 +16,5 @@ class EnvConfirmationController {
16
16
  }
17
17
 
18
18
  document.addEventListener("DOMContentLoaded", function() {
19
- new EnvConfirmationController("#envConfirmationInput", "#submitBtn").connect();
19
+ new EnvConfirmation("#envConfirmationInput", "#submitBtn").init();
20
20
  });
@@ -1,4 +1,5 @@
1
1
  en:
2
+ search: "Search"
2
3
  prev: "Prev"
3
4
  next: "Next"
4
5
  tasks: "Tasks"
@@ -1,4 +1,5 @@
1
1
  fr:
2
+ search: "Rechercher"
2
3
  prev: "Précédent"
3
4
  next: "Suivant"
4
5
  tasks: "Tâches"
@@ -0,0 +1,15 @@
1
+ <% if search.total_pages > 1 %>
2
+ <div class="st-pagination-wrapper">
3
+ <div>
4
+ <small class="st-text-primary">
5
+ <%= search.tasks.size %> / <%= Sidekiq::Tasks.tasks.size %>
6
+ </small>
7
+ </div>
8
+
9
+ <ul class="st-pagination">
10
+ <% Sidekiq::Tasks::Web::Pagination.new(search.page, search.total_pages).links.each do |link| %>
11
+ <%= pagination_link(root_path, link, search) %>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
@@ -1,10 +1,14 @@
1
- <header class="row">
2
- <div class="col-sm-5 pull-left">
3
- <h1><%= t("task") %></h1>
4
- </div>
1
+ <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
2
+ <% style_tag "tasks/css/ext.css" %>
3
+ <% else %>
4
+ <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
5
+ <% end %>
6
+
7
+ <header class="st-header">
8
+ <h1><%= t("task") %></h1>
5
9
  </header>
6
10
 
7
- <table class="table table-bordered table-striped">
11
+ <table class="st-table">
8
12
  <tbody>
9
13
  <tr>
10
14
  <th><%= t("name") %></th>
@@ -25,8 +29,8 @@
25
29
  </tbody>
26
30
  </table>
27
31
 
28
- <header class="row">
29
- <div class="col-sm-12">
32
+ <header class="">
33
+ <div class="">
30
34
  <h2><%= t("history") %></h2>
31
35
  </div>
32
36
  </header>
@@ -34,7 +38,7 @@
34
38
  <% if task.history.empty? %>
35
39
  <p><%= t("no_history") %></p>
36
40
  <% else %>
37
- <table class="table table-hover table-bordered table-striped">
41
+ <table class="st-table">
38
42
  <thead>
39
43
  <tr>
40
44
  <th><%= t("jid") %></th>
@@ -56,48 +60,38 @@
56
60
  </table>
57
61
  <% end %>
58
62
 
59
- <header class="row">
60
- <div class="col-sm-12">
63
+ <header class="">
64
+ <div class="">
61
65
  <h2><%= t("run_task") %></h2>
62
66
  </div>
63
67
  </header>
64
68
 
65
- <form action="<%= task_url(root_path, task) %>/enqueue" method="post">
69
+ <form action="<%= task_url(root_path, task) %>/enqueue" method="post" class="st-form-container">
66
70
  <%= csrf_tag %>
67
71
 
68
- <div class="row">
72
+ <div class="st-form-row">
69
73
  <% task.args.each do |arg| %>
70
- <div class="col-sm-6">
71
- <div class="form-group">
72
- <label for="<%= arg %>"><%= arg %></label>
73
- <input type="text" id="<%= arg %>" class="form-control" name="args[<%= arg %>]"/>
74
- </div>
74
+ <div class="st-form-group">
75
+ <label for="<%= arg %>" class="st-label"><%= arg %></label>
76
+ <input type="text" id="<%= arg %>" class="st-input" name="args[<%= arg %>]"/>
75
77
  </div>
76
78
  <% end %>
77
79
  </div>
78
80
 
79
- <div class="row">
80
- <div class="col-sm-6">
81
- <div class="form-group">
82
- <label for="confirmInput">
83
- <%= t("env_confirmation", current_env: current_env) %>
84
- </label>
85
-
86
- <input
87
- type="text"
88
- id="envConfirmationInput"
89
- class="form-control"
90
- name="env_confirmation"
91
- data-current-env="<%= current_env %>"
92
- required
93
- />
94
- </div>
95
- </div>
81
+ <div class="st-form-group-full">
82
+ <label for="envConfirmationInput" class="st-label">
83
+ <%= t("env_confirmation", current_env: current_env) %>
84
+ </label>
85
+ <input type="text" id="envConfirmationInput" class="st-input" name="env_confirmation" data-current-env="<%= current_env %>" required/>
96
86
  </div>
97
87
 
98
- <button type="submit" class="btn btn-primary" id="submitBtn" disabled>
88
+ <button type="submit" class="st-button" id="submitBtn" disabled>
99
89
  <%= t("enqueue") %>
100
90
  </button>
101
91
  </form>
102
92
 
103
- <script type="text/javascript" src="<%= root_path %>javascripts/env_confirmation.js"></script>
93
+ <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
94
+ <%= script_tag "tasks/js/env_confirmation.js" %>
95
+ <% else %>
96
+ <script type="text/javascript" src="<%= root_path %>tasks/js/env_confirmation.js"></script>
97
+ <% end %>
@@ -1,10 +1,14 @@
1
- <div class="header-container">
2
- <h1><%= t("tasks") %></h1>
1
+ <% if Sidekiq::Tasks::Web::SIDEKIQ_GTE_7_3_0 %>
2
+ <% style_tag "tasks/css/ext.css" %>
3
+ <% else %>
4
+ <link href="<%= root_path %>tasks/css/ext.css" media="screen" rel="stylesheet" type="text/css"/>
5
+ <% end %>
3
6
 
4
- <form action="<%= root_path %>tasks" class="form-inline" method="get">
5
- <input name="filter" class="form-control" type="text" value="<%= @search.filter %>" />
7
+ <header class="st-header">
8
+ <form action="<%= root_path %>tasks" method="get" class="st-search-form">
9
+ <input name="filter" class="st-input" type="text" value="<%= @search.filter %>" placeholder="<%= t("search") %>">
6
10
 
7
- <select name="count" class="form-control">
11
+ <select name="count" class="st-select">
8
12
  <% Sidekiq::Tasks::Web::Search.count_options.each do |count| %>
9
13
  <option value="<%= count %>" <%= "selected" if @search.count == count %>>
10
14
  <%= count %>
@@ -12,18 +16,16 @@
12
16
  <% end %>
13
17
  </select>
14
18
 
15
- <input name="page" type="hidden" value="<%= @search.page %>" />
16
-
17
- <button class="btn btn-default" type="submit">
19
+ <button type="submit" class="st-button st-button-primary">
18
20
  <%= t("filter") %>
19
21
  </button>
20
22
  </form>
21
- </div>
23
+ </header>
22
24
 
23
25
  <% if @search.tasks.empty? %>
24
26
  <%= t("no_tasks") %>
25
27
  <% else %>
26
- <table class="table table-hover table-bordered table-striped table-white">
28
+ <table class="st-table">
27
29
  <thead>
28
30
  <tr>
29
31
  <th><%= t("name") %></th>
@@ -34,7 +36,7 @@
34
36
  <% @search.tasks.each do |task| %>
35
37
  <tr>
36
38
  <td>
37
- <a href="<%= task_url(root_path, task) %>">
39
+ <a href="<%= task_url(root_path, task) %>" class="st-text-primary">
38
40
  <b><%= task.name %></b>
39
41
  </a>
40
42
  </td>
@@ -45,9 +47,5 @@
45
47
  </tbody>
46
48
  </table>
47
49
 
48
- <div class="pull-left">
49
- <%= @search.tasks.size %> / <%= Sidekiq::Tasks.tasks.size %>
50
- </div>
51
-
52
- <%= render(:erb, read_view(:_pagination), locals: {search: @search}) %>
50
+ <%= erb(read_view(:_pagination), locals: {search: @search}) %>
53
51
  <% end %>
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-02-25 00:00:00.000000000 Z
11
+ date: 2025-03-22 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: rake
@@ -29,182 +30,196 @@ dependencies:
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
- version: '6'
33
+ version: '6.5'
33
34
  type: :runtime
34
35
  prerelease: false
35
36
  version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - ">="
38
39
  - !ruby/object:Gem::Version
39
- version: '6'
40
+ version: '6.5'
40
41
  - !ruby/object:Gem::Dependency
41
42
  name: base64
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
- - - "~>"
45
+ - - ">="
45
46
  - !ruby/object:Gem::Version
46
- version: 0.1.0
47
+ version: '0'
47
48
  type: :development
48
49
  prerelease: false
49
50
  version_requirements: !ruby/object:Gem::Requirement
50
51
  requirements:
51
- - - "~>"
52
+ - - ">="
52
53
  - !ruby/object:Gem::Version
53
- version: 0.1.0
54
+ version: '0'
54
55
  - !ruby/object:Gem::Dependency
55
56
  name: capybara
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
- - - "~>"
59
+ - - ">="
59
60
  - !ruby/object:Gem::Version
60
- version: '3.40'
61
+ version: '0'
61
62
  type: :development
62
63
  prerelease: false
63
64
  version_requirements: !ruby/object:Gem::Requirement
64
65
  requirements:
65
- - - "~>"
66
+ - - ">="
66
67
  - !ruby/object:Gem::Version
67
- version: '3.40'
68
+ version: '0'
68
69
  - !ruby/object:Gem::Dependency
69
70
  name: rack-session
70
71
  requirement: !ruby/object:Gem::Requirement
71
72
  requirements:
72
- - - "~>"
73
+ - - ">="
73
74
  - !ruby/object:Gem::Version
74
- version: '1.0'
75
+ version: '0'
75
76
  type: :development
76
77
  prerelease: false
77
78
  version_requirements: !ruby/object:Gem::Requirement
78
79
  requirements:
79
- - - "~>"
80
+ - - ">="
80
81
  - !ruby/object:Gem::Version
81
- version: '1.0'
82
+ version: '0'
82
83
  - !ruby/object:Gem::Dependency
83
84
  name: rack-test
84
85
  requirement: !ruby/object:Gem::Requirement
85
86
  requirements:
86
- - - "~>"
87
+ - - ">="
87
88
  - !ruby/object:Gem::Version
88
- version: '1.1'
89
+ version: '0'
89
90
  type: :development
90
91
  prerelease: false
91
92
  version_requirements: !ruby/object:Gem::Requirement
92
93
  requirements:
93
- - - "~>"
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rackup
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
94
109
  - !ruby/object:Gem::Version
95
- version: '1.1'
110
+ version: '0'
96
111
  - !ruby/object:Gem::Dependency
97
112
  name: rake
98
113
  requirement: !ruby/object:Gem::Requirement
99
114
  requirements:
100
- - - "~>"
115
+ - - ">="
101
116
  - !ruby/object:Gem::Version
102
- version: '13.0'
117
+ version: '0'
103
118
  type: :development
104
119
  prerelease: false
105
120
  version_requirements: !ruby/object:Gem::Requirement
106
121
  requirements:
107
- - - "~>"
122
+ - - ">="
108
123
  - !ruby/object:Gem::Version
109
- version: '13.0'
124
+ version: '0'
110
125
  - !ruby/object:Gem::Dependency
111
126
  name: rspec
112
127
  requirement: !ruby/object:Gem::Requirement
113
128
  requirements:
114
- - - "~>"
129
+ - - ">="
115
130
  - !ruby/object:Gem::Version
116
- version: '3.0'
131
+ version: '0'
117
132
  type: :development
118
133
  prerelease: false
119
134
  version_requirements: !ruby/object:Gem::Requirement
120
135
  requirements:
121
- - - "~>"
136
+ - - ">="
122
137
  - !ruby/object:Gem::Version
123
- version: '3.0'
138
+ version: '0'
124
139
  - !ruby/object:Gem::Dependency
125
140
  name: rubocop
126
141
  requirement: !ruby/object:Gem::Requirement
127
142
  requirements:
128
- - - "~>"
143
+ - - ">="
129
144
  - !ruby/object:Gem::Version
130
- version: '1.21'
145
+ version: '0'
131
146
  type: :development
132
147
  prerelease: false
133
148
  version_requirements: !ruby/object:Gem::Requirement
134
149
  requirements:
135
- - - "~>"
150
+ - - ">="
136
151
  - !ruby/object:Gem::Version
137
- version: '1.21'
152
+ version: '0'
138
153
  - !ruby/object:Gem::Dependency
139
154
  name: sidekiq
140
155
  requirement: !ruby/object:Gem::Requirement
141
156
  requirements:
142
- - - "~>"
157
+ - - ">="
143
158
  - !ruby/object:Gem::Version
144
- version: '6.5'
159
+ version: '0'
145
160
  type: :development
146
161
  prerelease: false
147
162
  version_requirements: !ruby/object:Gem::Requirement
148
163
  requirements:
149
- - - "~>"
164
+ - - ">="
150
165
  - !ruby/object:Gem::Version
151
- version: '6.5'
166
+ version: '0'
152
167
  - !ruby/object:Gem::Dependency
153
168
  name: simplecov
154
169
  requirement: !ruby/object:Gem::Requirement
155
170
  requirements:
156
- - - "~>"
171
+ - - ">="
157
172
  - !ruby/object:Gem::Version
158
- version: '0.21'
173
+ version: '0'
159
174
  type: :development
160
175
  prerelease: false
161
176
  version_requirements: !ruby/object:Gem::Requirement
162
177
  requirements:
163
- - - "~>"
178
+ - - ">="
164
179
  - !ruby/object:Gem::Version
165
- version: '0.21'
180
+ version: '0'
166
181
  - !ruby/object:Gem::Dependency
167
182
  name: simplecov-json
168
183
  requirement: !ruby/object:Gem::Requirement
169
184
  requirements:
170
- - - "~>"
185
+ - - ">="
171
186
  - !ruby/object:Gem::Version
172
- version: '0.2'
187
+ version: '0'
173
188
  type: :development
174
189
  prerelease: false
175
190
  version_requirements: !ruby/object:Gem::Requirement
176
191
  requirements:
177
- - - "~>"
192
+ - - ">="
178
193
  - !ruby/object:Gem::Version
179
- version: '0.2'
194
+ version: '0'
180
195
  - !ruby/object:Gem::Dependency
181
196
  name: webdrivers
182
197
  requirement: !ruby/object:Gem::Requirement
183
198
  requirements:
184
- - - "~>"
199
+ - - ">="
185
200
  - !ruby/object:Gem::Version
186
- version: 5.3.1
201
+ version: '0'
187
202
  type: :development
188
203
  prerelease: false
189
204
  version_requirements: !ruby/object:Gem::Requirement
190
205
  requirements:
191
- - - "~>"
206
+ - - ">="
192
207
  - !ruby/object:Gem::Version
193
- version: 5.3.1
208
+ version: '0'
194
209
  - !ruby/object:Gem::Dependency
195
210
  name: webrick
196
211
  requirement: !ruby/object:Gem::Requirement
197
212
  requirements:
198
- - - "~>"
213
+ - - ">="
199
214
  - !ruby/object:Gem::Version
200
- version: 1.9.1
215
+ version: '0'
201
216
  type: :development
202
217
  prerelease: false
203
218
  version_requirements: !ruby/object:Gem::Requirement
204
219
  requirements:
205
- - - "~>"
220
+ - - ">="
206
221
  - !ruby/object:Gem::Version
207
- version: 1.9.1
222
+ version: '0'
208
223
  description: |
209
224
  Sidekiq Tasks is an extension for Sidekiq that provides an interface for launching tasks.
210
225
  Natively supports rake tasks and can be easily extended to support other task execution systems.
@@ -235,6 +250,7 @@ files:
235
250
  - lib/sidekiq/tasks/strategies/rake_task.rb
236
251
  - lib/sidekiq/tasks/strategies/rules.rb
237
252
  - lib/sidekiq/tasks/strategies/rules/base.rb
253
+ - lib/sidekiq/tasks/strategies/rules/disable_with_comment.rb
238
254
  - lib/sidekiq/tasks/strategies/rules/enable_with_comment.rb
239
255
  - lib/sidekiq/tasks/strategies/rules/task_from_lib.rb
240
256
  - lib/sidekiq/tasks/task.rb
@@ -242,18 +258,27 @@ files:
242
258
  - lib/sidekiq/tasks/validations.rb
243
259
  - lib/sidekiq/tasks/version.rb
244
260
  - lib/sidekiq/tasks/web.rb
245
- - lib/sidekiq/tasks/web/assets/javascripts/env_confirmation.js
246
261
  - lib/sidekiq/tasks/web/extension.rb
247
262
  - lib/sidekiq/tasks/web/helpers/application_helper.rb
263
+ - lib/sidekiq/tasks/web/helpers/pagination_helper.rb
248
264
  - lib/sidekiq/tasks/web/helpers/task_helper.rb
249
- - lib/sidekiq/tasks/web/locales/en.yml
250
- - lib/sidekiq/tasks/web/locales/fr.yml
265
+ - lib/sidekiq/tasks/web/pagination.rb
251
266
  - lib/sidekiq/tasks/web/params.rb
252
267
  - lib/sidekiq/tasks/web/search.rb
253
- - lib/sidekiq/tasks/web/views/_pagination.html.erb
254
- - lib/sidekiq/tasks/web/views/task.html.erb
255
- - lib/sidekiq/tasks/web/views/tasks.html.erb
256
268
  - sig/sidekiq/tasks.rbs
269
+ - web/assets/tasks/css/components/buttons.css
270
+ - web/assets/tasks/css/components/forms.css
271
+ - web/assets/tasks/css/components/pagination.css
272
+ - web/assets/tasks/css/components/tables.css
273
+ - web/assets/tasks/css/ext.css
274
+ - web/assets/tasks/css/layouts/header.css
275
+ - web/assets/tasks/css/utilities.css
276
+ - web/assets/tasks/js/env_confirmation.js
277
+ - web/locales/en.yml
278
+ - web/locales/fr.yml
279
+ - web/views/_pagination.erb
280
+ - web/views/task.erb
281
+ - web/views/tasks.erb
257
282
  homepage: https://github.com/victorauthiat/sidekiq-tasks
258
283
  licenses:
259
284
  - MIT
@@ -261,6 +286,7 @@ metadata:
261
286
  homepage_uri: https://github.com/victorauthiat/sidekiq-tasks
262
287
  source_code_uri: https://github.com/victorauthiat/sidekiq-tasks/blob/master
263
288
  changelog_uri: https://github.com/victorauthiat/sidekiq-tasks/blob/master/CHANGELOG.md
289
+ post_install_message:
264
290
  rdoc_options: []
265
291
  require_paths:
266
292
  - lib
@@ -268,14 +294,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
294
  requirements:
269
295
  - - ">="
270
296
  - !ruby/object:Gem::Version
271
- version: 3.1.0
297
+ version: '3.0'
272
298
  required_rubygems_version: !ruby/object:Gem::Requirement
273
299
  requirements:
274
300
  - - ">="
275
301
  - !ruby/object:Gem::Version
276
302
  version: '0'
277
303
  requirements: []
278
- rubygems_version: 3.6.5
304
+ rubygems_version: 3.5.22
305
+ signing_key:
279
306
  specification_version: 4
280
307
  summary: Sidekiq extension for launching tasks.
281
308
  test_files: []
@@ -1,25 +0,0 @@
1
- <% if search.total_pages > 1 %>
2
- <ul class="pagination pull-right">
3
- <% if search.page > 1 %>
4
- <li>
5
- <a href="<%= "#{root_path}tasks?filter=#{ERB::Util.url_encode(search.filter)}&count=#{search.count}&page=#{search.page - 1}" %>">
6
- <%= t("prev") %>
7
- </a>
8
- </li>
9
- <% end %>
10
-
11
- <% (0..(search.total_pages - 1)).each.with_index(1) do |_page, index| %>
12
- <li class="<%= 'active' if index == search.page %>">
13
- <a href="<%= "#{root_path}tasks?filter=#{ERB::Util.url_encode(search.filter)}&count=#{search.count}&page=#{index}" %>"><%= index %></a>
14
- </li>
15
- <% end %>
16
-
17
- <% if search.tasks.any? && search.tasks.size == search.count %>
18
- <li>
19
- <a href="<%= "#{root_path}tasks?filter=#{ERB::Util.url_encode(search.filter)}&count=#{search.count}&page=#{search.page + 1}" %>">
20
- <%= t("next") %>
21
- </a>
22
- </li>
23
- <% end %>
24
- </ul>
25
- <% end %>