fullstack-admin 0.1.52 → 0.1.53
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/TODO.tasks +12 -0
- data/VERSION +1 -1
- data/app/controllers/admin/positionables_controller.rb +1 -1
- data/app/helpers/admin_form_helper.rb +15 -8
- data/app/views/admin/base/_associated_resources_table.html.erb +3 -1
- data/app/views/admin/base/_nested_form.html.erb +2 -1
- data/app/views/admin/base/_sort.html.erb +36 -0
- data/app/views/admin/positionables/_collection.html.erb +4 -1
- data/fullstack-admin.gemspec +6 -5
- metadata +8 -7
data/Gemfile
CHANGED
@@ -7,7 +7,7 @@ source "http://rubygems.org"
|
|
7
7
|
gem 'rails', "~> 3.2"
|
8
8
|
gem "fullstack", '~> 0.1.26'
|
9
9
|
gem "bootstrap-wysihtml5-rails"
|
10
|
-
gem "bootstrap-helpers"
|
10
|
+
gem "bootstrap-helpers", '~> 0.1.7'
|
11
11
|
gem "chosen-rails"
|
12
12
|
gem "ckeditor", :git => "git://github.com/paranoida/ckeditor.git"
|
13
13
|
gem "facebox-rails"
|
data/Gemfile.lock
CHANGED
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
bcrypt-ruby (3.0.1)
|
58
58
|
bootstrap-datepicker-rails (0.6.16)
|
59
59
|
railties (>= 3.0)
|
60
|
-
bootstrap-helpers (0.1.
|
60
|
+
bootstrap-helpers (0.1.8)
|
61
61
|
rails
|
62
62
|
bootstrap-wysihtml5-rails (0.3.0)
|
63
63
|
railties (>= 3.0)
|
@@ -245,7 +245,7 @@ PLATFORMS
|
|
245
245
|
|
246
246
|
DEPENDENCIES
|
247
247
|
bootstrap-datepicker-rails
|
248
|
-
bootstrap-helpers
|
248
|
+
bootstrap-helpers (~> 0.1.7)
|
249
249
|
bootstrap-wysihtml5-rails
|
250
250
|
chosen-rails
|
251
251
|
ckeditor!
|
data/TODO.tasks
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
= Fullstack Admin Roadmap =
|
3
3
|
===========================
|
4
4
|
|
5
|
+
- Fix positionable/_collection.html.erb not working
|
6
|
+
|
7
|
+
- Has many nested:
|
8
|
+
has_many_nested = has_many + accepts_nested_attributes_for + :allow_destroy => true [CORE]
|
9
|
+
|
10
|
+
- Fix problem that prevent link to be inserted in sequence [CMS]
|
11
|
+
- Remove Jquery datepiker and UI [ADMIN]
|
12
|
+
|
13
|
+
- Add shorthands scopes for ordering: desc, asc [CORE]
|
14
|
+
|
15
|
+
- Better navigation interface/ More similar to wordpress
|
16
|
+
|
5
17
|
✓ fix delete not removing rows/thumbnails on success
|
6
18
|
|
7
19
|
✓ Better rendering for boolean input
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.53
|
@@ -27,7 +27,7 @@ class Admin::PositionablesController < Admin::BaseController
|
|
27
27
|
|
28
28
|
raise "NotFound" unless @positionable_class && @positionable_class.columns_hash["position"]
|
29
29
|
|
30
|
-
@positionables = ::Admin::Positionable.new(@positionable_class.order("position"))
|
30
|
+
@positionables = ::Admin::Positionable.new(@positionable_class.unscoped.order("position"))
|
31
31
|
@skip_filter = true
|
32
32
|
@title = t('fullstack.admin.sort', :default => "Sort") + " - " + t("fullstack.admin.resources.#{@positionable_class.name.underscore.pluralize}", :default => @positionable_class.name.humanize)
|
33
33
|
end
|
@@ -179,33 +179,40 @@ module AdminFormHelper
|
|
179
179
|
yield(FormBuilderDecorator.new(f))
|
180
180
|
end
|
181
181
|
end
|
182
|
+
|
183
|
+
def sort_association(association, options = {})
|
184
|
+
assoc_str = association.to_s
|
185
|
+
@target.template.render :partial => "sort", :locals => {
|
186
|
+
:association => association, :f => self, :options => options }
|
187
|
+
|
188
|
+
end
|
182
189
|
|
183
|
-
def association_inputs(association)
|
190
|
+
def association_inputs(association, options = {})
|
191
|
+
|
184
192
|
assoc_str = association.to_s
|
185
193
|
is_singular = assoc_str.pluralize != assoc_str and assoc_str.singularize == assoc_str
|
186
194
|
|
187
195
|
if is_singular
|
188
196
|
if @target.template.partial?("nested_belongs_to_#{assoc_str}_fields")
|
189
197
|
@target.template.render :partial => "nested_belongs_to_#{assoc_str}_fields", :locals => {
|
190
|
-
:association => association, :f => self }
|
198
|
+
:association => association, :f => self, :options => options }
|
191
199
|
else
|
192
200
|
@target.template.render :partial => "nested_belongs_to_fields", :locals => {
|
193
|
-
:association => association, :f => self }
|
201
|
+
:association => association, :f => self, :options => options }
|
194
202
|
end
|
195
203
|
|
196
204
|
else
|
197
205
|
|
198
206
|
if @target.template.partial?("associated_#{assoc_str}_table")
|
199
207
|
@target.template.render :partial => "associated_#{assoc_str}_table", :locals => {
|
200
|
-
:association => association, :f => self }
|
208
|
+
:association => association, :f => self, :options => options }
|
201
209
|
else
|
202
210
|
@target.template.render :partial => "associated_resources_table", :locals => {
|
203
|
-
:association => association, :f => self }
|
211
|
+
:association => association, :f => self, :options => options }
|
204
212
|
end
|
205
|
-
|
206
|
-
|
207
|
-
end
|
208
213
|
|
214
|
+
end
|
215
|
+
|
209
216
|
end
|
210
217
|
|
211
218
|
end # ~
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<% association_class = f.object.class.reflect_on_association(association).klass %>
|
2
2
|
<% resource_name = f.object.class.name.demodulize.underscore %>
|
3
|
+
|
4
|
+
|
3
5
|
<%= f.inputs t(association, :scope => 'fullstack.admin.resources', :default => association.to_s.humanize), :class => "associated-resources" do %>
|
4
6
|
|
5
7
|
<table class="table table-bordered table-striped index-table <%= 'positionable' if positionable?(association_class) %>" >
|
@@ -14,7 +16,7 @@
|
|
14
16
|
|
15
17
|
<% i = 0 %>
|
16
18
|
<%= f.admin_fields_for association do |f| %>
|
17
|
-
<%= render :partial => "nested_form", :locals => {:index => i, :f => f, :resource_name => resource_name, :association => association} %>
|
19
|
+
<%= render :partial => "nested_form", :locals => { :index => i, :f => f, :resource_name => resource_name, :association => association } %>
|
18
20
|
<% i += 1 %>
|
19
21
|
<% end %>
|
20
22
|
|
@@ -40,7 +40,8 @@
|
|
40
40
|
<% begin %>
|
41
41
|
<%= render :partial => "admin/#{association}/associated_fields", :locals => {:f => f} %>
|
42
42
|
<% rescue ActionView::MissingTemplate %>
|
43
|
-
|
43
|
+
|
44
|
+
<%= f.resource_inputs :except => [ resource_name ] %>
|
44
45
|
<% end %>
|
45
46
|
|
46
47
|
<%= f.hidden_field(:_destroy, :class => "destroy-associated-resource") %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<% association_class = f.object.class.reflect_on_association(association).klass %>
|
2
|
+
<% resource_name = f.object.class.name.demodulize.underscore %>
|
3
|
+
|
4
|
+
|
5
|
+
<%= f.inputs t(association, :scope => 'fullstack.admin.resources', :default => association.to_s.humanize), :class => "associated-resources" do %>
|
6
|
+
|
7
|
+
<table class="table table-bordered table-striped index-table <%= 'positionable' if positionable?(association_class) %>" >
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th style="width:20px"><%= tag :i, :class => "icon icon-th-list", :"data-toggle" => "tooltip", :title => t('fullstack.admin.drag_to_sort_items', :default => "Drag to sort items") %></th>
|
11
|
+
<th><%= labelize_attribute_name(title_column(association_class)) %></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody class="associated-resources-index <%= 'sortable' if positionable?(association_class) %>">
|
15
|
+
<% f.object.send(association).each do |item| %>
|
16
|
+
<% title_column_or_id = title_column(item.class) || "id" %>
|
17
|
+
<% resource_title = item.send(title_column_or_id) %>
|
18
|
+
|
19
|
+
<tr class="associated-resource">
|
20
|
+
<td>
|
21
|
+
<%= image_tag "drag-handle.png", :class => "handle" %>
|
22
|
+
</td>
|
23
|
+
<td>
|
24
|
+
<span class='associated-resource-label'><%= resource_title %></span>
|
25
|
+
<%= f.admin_fields_for association, item do |f| %>
|
26
|
+
<%= f.hidden_field(:position, :class => "associated-resource-position") %>
|
27
|
+
<% end %>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
|
@@ -36,11 +36,14 @@
|
|
36
36
|
<% content_for :javascripts do -%>
|
37
37
|
<%= javascript_tag do %>
|
38
38
|
<%= coffee_script do %>
|
39
|
-
|
39
|
+
console.log("fasasf")
|
40
40
|
$(document).ready ->
|
41
41
|
$('.positionable .sortable').live 'sortupdate', ->
|
42
|
+
console.log('ok')
|
42
43
|
$(@).find('input.positionable-position-input').each (i, e) ->
|
44
|
+
console.log('pos' + i)
|
43
45
|
$(@).val(i)
|
46
|
+
|
44
47
|
|
45
48
|
<% end %>
|
46
49
|
<% end %>
|
data/fullstack-admin.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "fullstack-admin"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.53"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["mcasimir"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-10-03"
|
13
13
|
s.description = "Administration interface framework for fullstack"
|
14
14
|
s.email = "maurizio.cas@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -984,6 +984,7 @@ Gem::Specification.new do |s|
|
|
984
984
|
"app/views/admin/base/_index.html.erb",
|
985
985
|
"app/views/admin/base/_nested_belongs_to_fields.html.erb",
|
986
986
|
"app/views/admin/base/_nested_form.html.erb",
|
987
|
+
"app/views/admin/base/_sort.html.erb",
|
987
988
|
"app/views/admin/base/destroy.js.coffee",
|
988
989
|
"app/views/admin/base/edit.html.erb",
|
989
990
|
"app/views/admin/base/index.html.erb",
|
@@ -1077,7 +1078,7 @@ Gem::Specification.new do |s|
|
|
1077
1078
|
s.add_runtime_dependency(%q<rails>, ["~> 3.2"])
|
1078
1079
|
s.add_runtime_dependency(%q<fullstack>, ["~> 0.1.26"])
|
1079
1080
|
s.add_runtime_dependency(%q<bootstrap-wysihtml5-rails>, [">= 0"])
|
1080
|
-
s.add_runtime_dependency(%q<bootstrap-helpers>, ["
|
1081
|
+
s.add_runtime_dependency(%q<bootstrap-helpers>, ["~> 0.1.7"])
|
1081
1082
|
s.add_runtime_dependency(%q<chosen-rails>, [">= 0"])
|
1082
1083
|
s.add_runtime_dependency(%q<ckeditor>, [">= 0"])
|
1083
1084
|
s.add_runtime_dependency(%q<facebox-rails>, [">= 0"])
|
@@ -1091,7 +1092,7 @@ Gem::Specification.new do |s|
|
|
1091
1092
|
s.add_dependency(%q<rails>, ["~> 3.2"])
|
1092
1093
|
s.add_dependency(%q<fullstack>, ["~> 0.1.26"])
|
1093
1094
|
s.add_dependency(%q<bootstrap-wysihtml5-rails>, [">= 0"])
|
1094
|
-
s.add_dependency(%q<bootstrap-helpers>, ["
|
1095
|
+
s.add_dependency(%q<bootstrap-helpers>, ["~> 0.1.7"])
|
1095
1096
|
s.add_dependency(%q<chosen-rails>, [">= 0"])
|
1096
1097
|
s.add_dependency(%q<ckeditor>, [">= 0"])
|
1097
1098
|
s.add_dependency(%q<facebox-rails>, [">= 0"])
|
@@ -1106,7 +1107,7 @@ Gem::Specification.new do |s|
|
|
1106
1107
|
s.add_dependency(%q<rails>, ["~> 3.2"])
|
1107
1108
|
s.add_dependency(%q<fullstack>, ["~> 0.1.26"])
|
1108
1109
|
s.add_dependency(%q<bootstrap-wysihtml5-rails>, [">= 0"])
|
1109
|
-
s.add_dependency(%q<bootstrap-helpers>, ["
|
1110
|
+
s.add_dependency(%q<bootstrap-helpers>, ["~> 0.1.7"])
|
1110
1111
|
s.add_dependency(%q<chosen-rails>, [">= 0"])
|
1111
1112
|
s.add_dependency(%q<ckeditor>, [">= 0"])
|
1112
1113
|
s.add_dependency(%q<facebox-rails>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fullstack-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.53
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -64,17 +64,17 @@ dependencies:
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 0.1.7
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 0.1.7
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: chosen-rails
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1194,6 +1194,7 @@ files:
|
|
1194
1194
|
- app/views/admin/base/_index.html.erb
|
1195
1195
|
- app/views/admin/base/_nested_belongs_to_fields.html.erb
|
1196
1196
|
- app/views/admin/base/_nested_form.html.erb
|
1197
|
+
- app/views/admin/base/_sort.html.erb
|
1197
1198
|
- app/views/admin/base/destroy.js.coffee
|
1198
1199
|
- app/views/admin/base/edit.html.erb
|
1199
1200
|
- app/views/admin/base/index.html.erb
|
@@ -1288,7 +1289,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1288
1289
|
version: '0'
|
1289
1290
|
segments:
|
1290
1291
|
- 0
|
1291
|
-
hash:
|
1292
|
+
hash: -3238499166189108078
|
1292
1293
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1293
1294
|
none: false
|
1294
1295
|
requirements:
|