spree_snippets 0.5.0 → 0.5.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.
@@ -0,0 +1,41 @@
1
+ Snippets - Compatible with Spree 0.30+
2
+ ======================================
3
+
4
+ Admin configurable chunks of content that can be rendered in any view via the SnippetsHelper#render_snippet method.
5
+
6
+ note: the 0.11 compatible version is on the 0.11-stable branch.
7
+
8
+ Synopsis
9
+ --------
10
+
11
+ <%# in a view %>
12
+ ...
13
+ <%= render_snippet('slug-name') %>
14
+ ...
15
+ <%= render_snippet(@snippet_object) %>
16
+ ...
17
+ <% snippet_id = 26 %>
18
+ <%= render_snippet(snippet_id) %>
19
+
20
+ Installation
21
+ ------------
22
+
23
+ Add to Gemfile:
24
+ gem 'spree_snippets', :git => 'git://github.com/divineforest/spree-snippets.git'
25
+
26
+ Run:
27
+ bundle install
28
+ rake spree_snippets:install
29
+ rake db:migrate
30
+
31
+ Snippet CRUD
32
+ ------------
33
+
34
+ 1. Login to the Administration Console
35
+ 2. Click on the Configuration Tab
36
+ 3. Click on the Snippets link
37
+
38
+ Snippet Settings
39
+ ----------------
40
+
41
+ To enable exceptions on missing snippets, set Spree::Config.set(:spree_snippets_raise_on_missing => true)
@@ -0,0 +1,8 @@
1
+ ---
2
+ en-GB:
3
+ snippets: "Snippets"
4
+ snippets_desc: "Manage snippets with WYM editor."
5
+ snippets_slug: "Slug"
6
+ snippets_content: "Content"
7
+ new_snippet: "New snippet"
8
+ editing_snippet: "Editing snippet"
@@ -0,0 +1,8 @@
1
+ ---
2
+ en:
3
+ snippets: "Snippets"
4
+ snippets_desc: "Manage snippets with WYM editor."
5
+ snippets_slug: "Slug"
6
+ snippets_content: "Content"
7
+ new_snippet: "New snippet"
8
+ editing_snippet: "Editing snippet"
@@ -0,0 +1,7 @@
1
+ ru:
2
+ snippets: "Тексты"
3
+ snippets_desc: "Управление текстами из админки через WYM editor"
4
+ snippets_slug: "Код"
5
+ snippets_content: "Содержимое"
6
+ new_snippet: "Новый текст"
7
+ editing_snippet: "Редактирование текста"
@@ -0,0 +1,9 @@
1
+ Rails.application.routes.draw do
2
+ namespace :admin do
3
+ resources :snippets do
4
+ collection do
5
+ get :create_draft
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ class CreateSnippets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :snippets do |t|
4
+ t.string :name
5
+ t.string :content
6
+ t.integer :created_by
7
+ t.integer :modified_by
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :snippets
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ class ChangeSnippetsNameToSlug < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :snippets, :name, :slug
4
+ end
5
+
6
+ def self.down
7
+ rename_column :snippets, :slug, :name
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class ChangeSnippetsContent < ActiveRecord::Migration
2
+ def self.up
3
+ change_column :snippets, :content, :text
4
+ end
5
+
6
+ def self.down
7
+ change_column :snippets, :content, :string
8
+ end
9
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: spree_snippets
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.0
5
+ version: 0.5.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christopher Maujean
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.30.0
23
+ version: 0.50.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: *id001
@@ -44,6 +44,7 @@ extensions: []
44
44
  extra_rdoc_files: []
45
45
 
46
46
  files:
47
+ - README.markdown
47
48
  - LICENSE
48
49
  - lib/spree_snippets.rb
49
50
  - lib/spree_snippets_hooks.rb
@@ -59,6 +60,13 @@ files:
59
60
  - app/views/admin/snippets/index.html.erb
60
61
  - app/views/admin/snippets/new.html.erb
61
62
  - app/views/snippets/_snippet.html.erb
63
+ - config/locales/en-GB.yml
64
+ - config/locales/en.yml
65
+ - config/locales/ru.yml
66
+ - config/routes.rb
67
+ - db/migrate/20090610074613_create_snippets.rb
68
+ - db/migrate/20090615031927_change_snippets_name_to_slug.rb
69
+ - db/migrate/20091020191630_change_snippets_content.rb
62
70
  has_rdoc: true
63
71
  homepage: http://github.com/cmaujean/spree-snippets
64
72
  licenses: []
@@ -79,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
87
  requirements:
80
88
  - - ">="
81
89
  - !ruby/object:Gem::Version
82
- hash: -51902383
90
+ hash: 442702733
83
91
  segments:
84
92
  - 0
85
93
  version: "0"