2012-10-01 12:29:36 +00:00
|
|
|
require "sisyphus-rails/version"
|
2012-10-01 17:08:48 +00:00
|
|
|
require "sisyphus-rails/engine"
|
2012-10-02 14:13:22 +00:00
|
|
|
require "sisyphus-rails/form_helper"
|
2012-10-01 18:59:59 +00:00
|
|
|
require "sisyphus-rails/form_tag_helper"
|
2012-10-01 12:29:36 +00:00
|
|
|
|
|
|
|
module Sisyphus
|
2012-10-02 14:13:22 +00:00
|
|
|
mattr_accessor :process
|
2012-10-03 05:40:31 +00:00
|
|
|
mattr_accessor :app_root
|
|
|
|
mattr_accessor :config
|
2012-11-07 23:46:54 +00:00
|
|
|
mattr_accessor :form_builder
|
2012-10-02 14:13:22 +00:00
|
|
|
|
2012-10-03 05:40:31 +00:00
|
|
|
def self.setup
|
|
|
|
yield self
|
|
|
|
end
|
2012-11-07 23:46:54 +00:00
|
|
|
|
|
|
|
class FormBuilder
|
|
|
|
def initialize(template)
|
|
|
|
@template = template
|
|
|
|
end
|
|
|
|
|
|
|
|
def status
|
|
|
|
@template.content_tag(:div, message.html_safe, :class => 'sisyphus_status', :style => 'display: none')
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
@template.t('sisyphus.autosaved_content') << @template.content_tag(:button, @template.t('sisyphus.revert'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Sisyphus.form_builder = Sisyphus::FormBuilder
|
|
|
|
end
|