simplificator-activist 0.0.1

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.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Simplificator GmbH
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
File without changes
@@ -0,0 +1,25 @@
1
+ module Activist
2
+ module BlockHelpers
3
+
4
+ def notice_block(title, &block)
5
+ content = capture(&block)
6
+ content_for(:sidebar) do
7
+ content_tag(:div, :class => [:block, :notice]) do
8
+ content_tag(:h4, title) + content_tag(:p, content)
9
+ end
10
+ end
11
+ end
12
+
13
+ def section_block(title)
14
+ builder = Builder.new(self)
15
+ yield builder
16
+ content_tag(:div,
17
+ content_tag(:div,
18
+ content_tag(:div, builder.control, :class => :control) +
19
+ content_tag(:h2, title, :class => :title) +
20
+ content_tag(:div, builder.content, :class => :inner),
21
+ :class => :content),
22
+ :class => :block)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ module Activist
2
+ class Builder
3
+ def initialize(context)
4
+ @context = context
5
+ end
6
+
7
+ def content(&block)
8
+ if block_given?
9
+ @content = @context.capture(&block)
10
+ else
11
+ @content
12
+ end
13
+ end
14
+
15
+ def control(&block)
16
+ if block_given?
17
+ @control = @context.capture(&block)
18
+ else
19
+ @control
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ module Activist
2
+ module ButtonHelpers
3
+ def submit_buttons(cancel_path, save_text = 'Save', cancel_text = 'Cancel')
4
+ content_tag('div', content_tag(:button,
5
+ image_tag('icons/accept.png') + save_text, :class => :button, :type => :submit) + link_to(image_tag('icons/cancel.png') + cancel_text, cancel_path, :class => :button),
6
+ :class => [:group, :navform, 'wat-cf'])
7
+ end
8
+
9
+ def edit_button_link(path, text = 'Edit')
10
+ link_to((image_tag('icons/application_edit.png') + text).html_safe, path, :class => 'button')
11
+ end
12
+
13
+ def button_link(path, text, icon, link_to_options = {})
14
+ link_to((image_tag("icons/#{icon}.png") + text).html_safe, path, link_to_options.merge({:class => 'button'}))
15
+ end
16
+
17
+ def delete_button_link(path, text = 'Delete', confirmation = 'Are you sure')
18
+ link_to((image_tag('icons/application_delete.png', :class => :medium) + text).html_safe, path, :method => :delete, :class => 'button', :confirm => confirmation)
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ module Activist
2
+ module NavigationHelpers
3
+ def main_navigation_class(*controllers)
4
+ controllers.include?(controller_name) ? 'active' : 'passive'
5
+ end
6
+ end
7
+ end
data/lib/activist.rb ADDED
@@ -0,0 +1,7 @@
1
+ %w{builder block_helpers button_helpers navigation_helpers}.each do |file|
2
+ require File.join(File.dirname(__FILE__), 'activist', file)
3
+ end
4
+
5
+ ActionView::Base.send :include, Activist::BlockHelpers
6
+ ActionView::Base.send :include, Activist::ButtonHelpers
7
+ ActionView::Base.send :include, Activist::NavigationHelpers
@@ -0,0 +1,53 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{simplificator-activist}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["pascalbetz"]
9
+ s.date = %q{2011-07-23}
10
+ s.description = %q{Helpers for activo CSS template (release 2)}
11
+ s.email = %q{info@simplificator.com}
12
+ s.extra_rdoc_files = [
13
+ "LICENSE",
14
+ "README.rdoc"
15
+ ]
16
+ s.files = [
17
+ "LICENSE",
18
+ "README.rdoc",
19
+ "lib/activist.rb",
20
+ "lib/activist/block_helpers.rb",
21
+ "lib/activist/builder.rb",
22
+ "lib/activist/button_helpers.rb",
23
+ "lib/activist/navigation_helpers.rb",
24
+ "simplificator-activist.gemspec",
25
+ ]
26
+ s.homepage = %q{http://github.com/simplificator/activist}
27
+ s.rdoc_options = ["--charset=UTF-8"]
28
+ s.require_paths = ["lib"]
29
+ s.rubygems_version = %q{1.3.7}
30
+ s.summary = %q{Helpers for activo css template}
31
+ s.test_files = [
32
+ ]
33
+
34
+ if s.respond_to? :specification_version then
35
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
36
+ s.specification_version = 3
37
+
38
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
39
+ # s.add_development_dependency(%q<shoulda>, [">= 0"])
40
+ # s.add_development_dependency(%q<mocha>, [">= 0"])
41
+ # s.add_runtime_dependency(%q<httparty>, [">= 0"])
42
+ else
43
+ # s.add_dependency(%q<shoulda>, [">= 0"])
44
+ # s.add_dependency(%q<mocha>, [">= 0"])
45
+ # s.add_dependency(%q<httparty>, [">= 0"])
46
+ end
47
+ else
48
+ # s.add_dependency(%q<shoulda>, [">= 0"])
49
+ # s.add_dependency(%q<mocha>, [">= 0"])
50
+ # s.add_dependency(%q<httparty>, [">= 0"])
51
+ end
52
+ end
53
+
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simplificator-activist
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - pascalbetz
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-07-23 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Helpers for activo CSS template (release 2)
22
+ email: info@simplificator.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - LICENSE
29
+ - README.rdoc
30
+ files:
31
+ - LICENSE
32
+ - README.rdoc
33
+ - lib/activist.rb
34
+ - lib/activist/block_helpers.rb
35
+ - lib/activist/builder.rb
36
+ - lib/activist/button_helpers.rb
37
+ - lib/activist/navigation_helpers.rb
38
+ - simplificator-activist.gemspec
39
+ has_rdoc: true
40
+ homepage: http://github.com/simplificator/activist
41
+ licenses: []
42
+
43
+ post_install_message:
44
+ rdoc_options:
45
+ - --charset=UTF-8
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
54
+ version: "0"
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ requirements: []
63
+
64
+ rubyforge_project:
65
+ rubygems_version: 1.3.6
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Helpers for activo css template
69
+ test_files: []
70
+