Skip to content

Commit

Permalink
Vitasteps haben nun einen Status
Browse files Browse the repository at this point in the history
  • Loading branch information
marcometz committed Apr 17, 2015
1 parent 101a286 commit 24b8750
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -40,6 +40,7 @@ gem 'cancan'
#gem 'linkchecker', :git => "http://github.com/seb/linkchecker.git"

gem 'rmagick'
gem 'simple_enum'


gem "paper_trail"
Expand Down
6 changes: 5 additions & 1 deletion Gemfile.lock
Expand Up @@ -38,7 +38,7 @@ GIT
PATH
remote: .
specs:
goldencobra (1.4.25)
goldencobra (1.4.26)
activeadmin
activeadmin-cancan
acts-as-taggable-on
Expand Down Expand Up @@ -81,6 +81,7 @@ PATH
sass
sass-rails
sidekiq (= 3.2.1)
simple_enum
sinatra
slim
sprockets
Expand Down Expand Up @@ -494,6 +495,8 @@ GEM
json
redis (>= 3.0.6)
redis-namespace (>= 1.3.1)
simple_enum (1.6.9)
activesupport (>= 3.0.0)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
Expand Down Expand Up @@ -604,6 +607,7 @@ DEPENDENCIES
selenium-webdriver
shoulda-matchers
sidekiq
simple_enum
sinatra
slim
sunspot_rails
Expand Down
19 changes: 19 additions & 0 deletions admin/dashboards.rb
Expand Up @@ -54,6 +54,25 @@
end
end

section I18n.t('active_admin.dashboards.vita_steps'), priority: 2, :if => proc{can?(:update, Goldencobra::Vita)} do
table do
tr do
["Source", I18n.t("activerecord.attributes.goldencobra/widget.title"), "Description", ""].each do |sa|
th sa
end
end

Goldencobra::Vita.where(status_cd: 2).last(5).each do |vita|
tr do
td "#{vita.loggable_type} ID:#{vita.loggable_id}"
td vita.title
td vita.description
td l(vita.created_at, format: :short)
end
end
end
end

# == Render Partial Section
# The block is rendered within the context of the view, so you can
# easily render a partial rather than build content in ruby.
Expand Down
3 changes: 3 additions & 0 deletions app/models/goldencobra/vita.rb
Expand Up @@ -19,5 +19,8 @@ class Vita < ActiveRecord::Base
belongs_to :loggable, :polymorphic => true
attr_accessible :description, :title, :user_id
acts_as_taggable_on :tags

as_enum :status, success: 0, warning: 1, error: 2

end
end
1 change: 1 addition & 0 deletions config/locales/active_admin.de.yml
Expand Up @@ -318,6 +318,7 @@ de:
title2: "Artikel bearbeiten"
title3: "Neuen Unterartikel erstellen"
widget_section: "Neueste Schnipsel"
vita_steps: "Vita Step Errors"
title4: "Schnipsel bearbeiten"
new_link: "Neuen Artikel erstellen"
domains:
Expand Down
1 change: 1 addition & 0 deletions config/locales/active_admin.en.yml
Expand Up @@ -318,6 +318,7 @@ en:
title2: "Edit article"
title3: "Create new sub article"
widget_section: "Newest widget"
vita_steps: "Vita Step Errors"
title4: "Edit widget"
new_link: "Create new article"
domains:
Expand Down
@@ -0,0 +1,5 @@
class AddStatusToGoldencobraVitaSteps < ActiveRecord::Migration
def change
add_column :goldencobra_vita, :status_cd, :integer, :default => 0
end
end
1 change: 1 addition & 0 deletions goldencobra.gemspec
Expand Up @@ -75,6 +75,7 @@ Gem::Specification.new do |s|
s.add_dependency 'iconv'
s.add_dependency 'cocaine', '0.5.5'
s.add_dependency 'rack-utf8_sanitizer'
s.add_dependency 'simple_enum'
# s.add_dependency "wicked_pdf"
s.add_development_dependency "mysql2"
s.add_development_dependency 'annotate'
Expand Down

0 comments on commit 24b8750

Please sign in to comment.