spree_snippets 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -1,25 +1,13 @@
|
|
1
|
-
class Admin::SnippetsController < Admin::
|
2
|
-
|
1
|
+
class Admin::SnippetsController < Admin::ResourceController
|
2
|
+
update.after :expire_cache
|
3
|
+
create.after :expire_cache
|
3
4
|
|
4
5
|
def create_draft
|
5
6
|
@snippet = Snippet.create!
|
6
7
|
redirect_to edit_admin_snippet_url(@snippet.id)
|
7
8
|
end
|
8
9
|
|
9
|
-
|
10
|
-
wants.html { redirect_to collection_url }
|
11
|
-
end
|
12
|
-
|
13
|
-
update.after do
|
14
|
-
Rails.cache.delete('snippets')
|
15
|
-
end
|
16
|
-
|
17
|
-
create.response do |wants|
|
18
|
-
wants.html { redirect_to collection_url }
|
19
|
-
end
|
20
|
-
|
21
|
-
create.after do
|
10
|
+
def expire_cache
|
22
11
|
Rails.cache.delete('snippets')
|
23
12
|
end
|
24
|
-
|
25
13
|
end
|
@@ -1,28 +1,6 @@
|
|
1
|
-
|
2
|
-
.snippet-form-bottom-buttons {
|
3
|
-
margin-left: 5px;
|
4
|
-
margin-bottom: 20px;
|
5
|
-
}
|
6
|
-
</style>
|
7
|
-
|
8
|
-
<table class="admin-report" width="545">
|
9
|
-
<tr>
|
10
|
-
<td valign="top"><%=t("snippets_slug")%>:</td>
|
11
|
-
<td><%= f.text_field :slug, {"style" => "width: 745px"} %></td>
|
12
|
-
</tr>
|
13
|
-
<tr>
|
14
|
-
<td colspan="2">
|
15
|
-
<%= f.text_area :content, {"style" => "width:100%", "id" => "snippet_content"} %>
|
16
|
-
</td>
|
17
|
-
</tr>
|
18
|
-
</table>
|
19
|
-
|
20
|
-
<div class="snippet-form snippet-form-bottom-buttons">
|
21
|
-
<div class="button" id="snippet_content_switch_simple">
|
22
|
-
<a href="#"><%= t("editor.switch_simple") %></a>
|
23
|
-
</div>
|
24
|
-
<div class="button" id="snippet_content_switch_rich" style="display: none;">
|
25
|
-
<a href="#"><%= t("editor.switch_rich") %></a>
|
26
|
-
</div>
|
27
|
-
</div>
|
1
|
+
<%= stylesheet_link_tag 'formtastic', 'formtastic_changes' %>
|
28
2
|
|
3
|
+
<%= f.inputs do %>
|
4
|
+
<%= f.input :slug %>
|
5
|
+
<%= f.input :content, :as => :text %>
|
6
|
+
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<%= render "shared/error_messages", :target => @snippet %>
|
6
6
|
|
7
|
-
<%
|
7
|
+
<% semantic_form_for(:snippet, :url => object_url, :html => { :method => :put }) do |f| %>
|
8
8
|
<%= render :partial => "form", :locals => { :f => f } %>
|
9
9
|
<p class="form-buttons">
|
10
10
|
<%= button t("actions.update"), nil, 'submit' %>
|
data/lib/spree_snippets.rb
CHANGED
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
|
+
version: 0.6.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Christopher Maujean
|
@@ -10,31 +10,42 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-07-08 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: spree_core
|
18
|
+
prerelease: false
|
18
19
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
20
|
none: false
|
20
21
|
requirements:
|
21
22
|
- - ">="
|
22
23
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
24
|
+
version: 0.60.1
|
24
25
|
type: :runtime
|
25
|
-
prerelease: false
|
26
26
|
version_requirements: *id001
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_editor
|
29
|
+
prerelease: false
|
29
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
30
31
|
none: false
|
31
32
|
requirements:
|
32
33
|
- - ">="
|
33
34
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
35
|
+
version: 0.50.0
|
35
36
|
type: :runtime
|
36
|
-
prerelease: false
|
37
37
|
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: formtastic
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.2.3
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
38
49
|
description:
|
39
50
|
email: cmaujean@gmail.com
|
40
51
|
executables: []
|
@@ -87,9 +98,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
98
|
requirements:
|
88
99
|
- - ">="
|
89
100
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 442702733
|
91
|
-
segments:
|
92
|
-
- 0
|
93
101
|
version: "0"
|
94
102
|
requirements:
|
95
103
|
- none
|