spree_testimonials 3.0.2

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/README.md ADDED
@@ -0,0 +1,13 @@
1
+ Testimonials
2
+ ============
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+
13
+ Copyright (c) 2010 [name of extension creator], released under the New BSD License
@@ -0,0 +1,11 @@
1
+ class Admin::TestimonialsController < Admin::BaseController
2
+ resource_controller
3
+
4
+ create.wants.html { redirect_to collection_path }
5
+ update.wants.html { redirect_to collection_path }
6
+
7
+ new_action.response do |wants|
8
+ wants.html {render :action => :new, :layout => !request.xhr?}
9
+ end
10
+
11
+ end
@@ -0,0 +1,5 @@
1
+ class Testimonial < ActiveRecord::Base
2
+ validates_presence_of :name, :location, :description
3
+
4
+ scope :featured, where(:featured => true)
5
+ end
@@ -0,0 +1,30 @@
1
+ <%- locals = {:f => f} %>
2
+
3
+ <%= render "shared/error_messages", :target => f.object %>
4
+
5
+ <%= hook :admin_testimonial_form, locals do %>
6
+
7
+ <%= f.field_container :name do %>
8
+ <%= f.label :name, t("name") %> <span class="required">*</span><br />
9
+ <%= f.text_field :name, :class => 'fullwidth title' %>
10
+ <%= f.error_message_on :name %>
11
+ <% end %>
12
+
13
+ <%= f.field_container :location do %>
14
+ <%= f.label :location, t("location") %> <span class="required">*</span><br />
15
+ <%= f.text_field :location, :class => 'fullwidth title' %>
16
+ <%= f.error_message_on :location %>
17
+ <% end %>
18
+
19
+ <%= f.field_container :description do %>
20
+ <%= f.label :description, t("description") %> <span class="required">*</span><br />
21
+ <%= f.text_area :description, :class => 'fullwidth title' %>
22
+ <%= f.error_message_on :description %>
23
+ <% end %>
24
+
25
+ <%= f.field_container :featured do %>
26
+ <%= f.check_box :featured %>
27
+ <%= f.label :featured, t("featured") %>
28
+ <%= f.error_message_on :featured %>
29
+ <% end %>
30
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= form_for(@testimonial, :url => object_url, :html => { :method => :put }) do |f| %>
2
+ <%= render :partial => 'form', :locals => {:f => f} %>
3
+ <%= render :partial => 'admin/shared/edit_resource_links' %>
4
+ <% end %>
@@ -0,0 +1,45 @@
1
+ <div class='toolbar'>
2
+ <ul class='actions'>
3
+ <li id="new_testimonial_link">
4
+ <%= button_link_to t("new_testimonial"),
5
+ new_object_url,
6
+ {:remote => :true, :icon => 'add' } %>
7
+ </li>
8
+ </ul>
9
+ <br class='clear' />
10
+ </div>
11
+ <div id="new_testimonial"></div>
12
+
13
+ <h1><%= t("testimonials") %></h1>
14
+ <table class="index">
15
+ <thead>
16
+ <%= hook :admin_testimonials_index_headers do %>
17
+ <th><%= t("name") %></td>
18
+ <th><%= t("description") %></td>
19
+ <th><%= t("location") %></td>
20
+ <th><%= t("featured") %></td>
21
+ <% end %>
22
+ <th>
23
+ <%= hook :admin_testimonials_header_actions %>
24
+ </th>
25
+ </tr>
26
+ <thead>
27
+ <% @testimonials.each do |testimonial| %>
28
+ <tr id="<%= dom_id testimonial %>">
29
+ <%- locals = {:testimonial => testimonial} %>
30
+ <%= hook :admin_testimonials_index_rows, locals do %>
31
+ <td><%= testimonial.name %></td>
32
+ <td><%= simple_format testimonial.description %></td>
33
+ <td><%= testimonial.location %></td>
34
+ <td><%= "featured" if testimonial.featured %></td>
35
+ <% end %>
36
+ <td class="actions">
37
+ <%= hook :admin_testimonials_index_row_actions, locals do %>
38
+ <%= link_to_edit testimonial %>&nbsp;
39
+ <%= link_to_delete testimonial %>
40
+ <% end %>
41
+ </td>
42
+ </tr>
43
+ <% end %>
44
+ </tbody>
45
+ </table>
@@ -0,0 +1,4 @@
1
+ <%= form_for(@testimonial, :url => collection_url) do |f| %>
2
+ <%= render :partial => 'form', :locals => {:f => f} %>
3
+ <%= render :partial => 'admin/shared/new_resource_links' %>
4
+ <% end %>
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ namespace :admin do
3
+ resources :testimonials
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ module SpreeTestimonials
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+
6
+ desc "Configures your Rails application for use with spree_testimonials"
7
+ def copy_migrations
8
+ directory "db"
9
+ end
10
+
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ class CreateTestimonials < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :testimonials do |t|
4
+ t.string :name
5
+ t.string :location
6
+ t.text :description
7
+ t.boolean :featured
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :testimonials
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ require "spree_testimonials"
2
+
3
+ module SpreeTestimonials
4
+
5
+ class Engine < Rails::Engine
6
+
7
+ def self.activate
8
+ end
9
+
10
+ end
11
+
12
+ end
@@ -0,0 +1,3 @@
1
+ require 'spree_core'
2
+ require 'spree_testimonials_hooks'
3
+ require 'spree_testimonials/engine'
@@ -0,0 +1,6 @@
1
+ class SpreeTestimonialsHooks < Spree::ThemeSupport::HookListener
2
+ insert_after :admin_tabs do
3
+ %(<%= tab(:testimonials) %>)
4
+ end
5
+ end
6
+
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_testimonials
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
+ prerelease: false
6
+ segments:
7
+ - 3
8
+ - 0
9
+ - 2
10
+ version: 3.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Josh Nussbaum
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-06 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: spree_core
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 101
30
+ segments:
31
+ - 0
32
+ - 30
33
+ - 1
34
+ version: 0.30.1
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: With this gem you get management tools to make it very easy to update your testimonials thru the admin section
38
+ email: joshnuss@gmail.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - README.md
47
+ - lib/spree_testimonials_hooks.rb
48
+ - lib/spree_testimonials.rb
49
+ - lib/spree_testimonials/engine.rb
50
+ - lib/generators/spree_testimonials/install_generator.rb
51
+ - lib/generators/templates/db/migrate/20101122222055_create_testimonials.rb
52
+ - app/views/admin/testimonials/edit.html.erb
53
+ - app/views/admin/testimonials/new.html.erb
54
+ - app/views/admin/testimonials/_form.html.erb
55
+ - app/views/admin/testimonials/index.html.erb
56
+ - app/controllers/admin/testimonials_controller.rb
57
+ - app/models/testimonial.rb
58
+ - config/routes.rb
59
+ has_rdoc: true
60
+ homepage: http://spreecommerce.com
61
+ licenses: []
62
+
63
+ post_install_message:
64
+ rdoc_options: []
65
+
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 57
74
+ segments:
75
+ - 1
76
+ - 8
77
+ - 7
78
+ version: 1.8.7
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ requirements:
89
+ - none
90
+ rubyforge_project: spree_testimonials
91
+ rubygems_version: 1.3.7
92
+ signing_key:
93
+ specification_version: 3
94
+ summary: Adds the ability to manage testimonials to a spree site
95
+ test_files: []
96
+