queue_classic_admin 0.0.6 → 0.0.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
  SHA1:
3
- metadata.gz: f79c0e07c15e15f5d70c2e19da6e410b8fdc982a
4
- data.tar.gz: 300b1e8754de1ea758d978996a5bf423210d4fb3
3
+ metadata.gz: 0f2bc64b2b0da2c2d3fbc15ef88e8d1e08f3b79e
4
+ data.tar.gz: a2cc513e4469662f894e1a43fe384016bfc87c9d
5
5
  SHA512:
6
- metadata.gz: 0c066445ad7933e4b63babdf96552e6272de0e74066d8ead6727d5340ae1c962ae684bf40f6036d7f45ab74863d9cabfad990088ca3987d0205f72d384a8c3c9
7
- data.tar.gz: b7d269012dd5c2ba24780df6e104948c0eafa44fa1abd51e19a31a998b2326b5a211b6b74bbcfcdfdcad180bcaca8877250935eaa83a3366af1ef268b7182c3e
6
+ metadata.gz: fc008359b02f77c92dad78e6ed9f94d466bda64e3ffed695b747413b8a0df3b87e87e0f35c16cd8d5676a4dd7438e7dfbe71de6ee80014b8fbcfca32a5dd3a30
7
+ data.tar.gz: 07c66f91aa78094203cd9a154ffa5e5bcf80f86dd010947a7c876ce8734af6d6c0fd5fe52a0d60e0a807cc65e0322add8d429943456bf6112211997d4a3ffc9c
data/README.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  An admin interface for the [queue_classic](https://github.com/ryandotsmith/queue_classic) and [queue_classic-later](https://github.com/dpiddy/queue_classic-later) gems.
4
4
 
5
+ ![qc admin](https://f.cloud.github.com/assets/148622/865030/9b1b2610-f62e-11e2-8908-8c271bfe0f6c.png)
6
+
7
+
8
+ # Features
9
+
10
+ * Support for [queue_classic-later](https://github.com/dpiddy/queue_classic-later)
11
+ * Support for custom columns
12
+ * Delete entire queues
13
+ * Delete jobs
14
+
5
15
  # Install
6
16
 
7
17
  Copy and run the migrations
@@ -2,13 +2,13 @@ require_dependency "queue_classic_admin/application_controller"
2
2
 
3
3
  module QueueClassicAdmin
4
4
  class QueueClassicJobsController < ApplicationController
5
+ before_filter :get_job, only: [:destroy, :unlock]
5
6
  def index
6
7
  filter_jobs(QueueClassicJob)
7
8
  @queue_classic_jobs = @queue_classic_jobs.paginate(page: params[:page])
8
9
  end
9
10
 
10
11
  def destroy
11
- @queue_classic_job = QueueClassicJob.find(params[:id])
12
12
  @queue_classic_job.destroy
13
13
  redirect_to queue_classic_jobs_url
14
14
  end
@@ -18,11 +18,21 @@ module QueueClassicAdmin
18
18
  redirect_to queue_classic_jobs_url
19
19
  end
20
20
 
21
+ def unlock
22
+ @queue_classic_job.locked_at = nil
23
+ @queue_classic_job.save
24
+ redirect_to queue_classic_jobs_url
25
+ end
26
+
21
27
  private
22
28
  def index_path(*params)
23
29
  queue_classic_jobs_path(*params)
24
30
  end
25
31
 
32
+ def get_job
33
+ @queue_classic_job = QueueClassicJob.find(params[:id])
34
+ end
35
+
26
36
  helper_method :index_path
27
37
  end
28
38
  end
@@ -65,7 +65,12 @@
65
65
  <td><%= queue_classic_job[column] %></th>
66
66
  <% end %>
67
67
 
68
- <td><%= link_to 'Destroy', queue_classic_job, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %></td>
68
+ <td>
69
+ <%= link_to 'Destroy', queue_classic_job, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %>
70
+ <% if queue_classic_job[:locked_at] %>
71
+ <%= link_to 'Unlock', unlock_queue_classic_job_path(queue_classic_job), method: :post, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %>
72
+ <% end %>
73
+ </td>
69
74
  </tr>
70
75
  <% end %>
71
76
  </tbody>
data/config/routes.rb CHANGED
@@ -9,6 +9,10 @@ QueueClassicAdmin::Engine.routes.draw do
9
9
  collection do
10
10
  delete :purge
11
11
  end
12
+
13
+ member do
14
+ post :unlock
15
+ end
12
16
  end
13
17
 
14
18
  root to: "queue_classic_jobs#index"
@@ -1,3 +1,3 @@
1
1
  module QueueClassicAdmin
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_classic_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-02 00:00:00.000000000 Z
11
+ date: 2013-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.0.3
167
+ rubygems_version: 2.0.4
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: An admin interface for QueueClassic