sunrise-scaffold 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Sunrise
3
3
  module Scaffold
4
- VERSION = "0.2.1".freeze
4
+ VERSION = "0.2.2".freeze
5
5
  end
6
6
  end
File without changes
metadata CHANGED
@@ -1,200 +1,152 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sunrise-scaffold
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Igor Galeta
14
9
  - Pavlo Galeta
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-04-09 00:00:00 Z
13
+ date: 2012-04-29 00:00:00.000000000 Z
20
14
  dependencies: []
21
-
22
15
  description: Sunrise is a Aimbulance CMS
23
16
  email: galeta.igor@gmail.com
24
17
  executables: []
25
-
26
18
  extensions: []
27
-
28
- extra_rdoc_files:
19
+ extra_rdoc_files:
29
20
  - README.rdoc
30
- files:
21
+ files:
31
22
  - lib/sunrise-scaffold.rb
32
- - lib/sunrise/scaffold/utils.rb
33
23
  - lib/sunrise/scaffold/version.rb
24
+ - lib/sunrise/scaffold/utils.rb
34
25
  - lib/sunrise/scaffold.rb
35
- - lib/generators/sunrise/scaffold/templates/multiplay/views/new.html.erb
36
- - lib/generators/sunrise/scaffold/templates/multiplay/views/model_filter.html.erb
37
- - lib/generators/sunrise/scaffold/templates/multiplay/views/edit.html.erb
38
- - lib/generators/sunrise/scaffold/templates/multiplay/views/show.html.erb
39
- - lib/generators/sunrise/scaffold/templates/multiplay/views/item.html.erb
40
- - lib/generators/sunrise/scaffold/templates/multiplay/views/form.html.erb
41
- - lib/generators/sunrise/scaffold/templates/multiplay/views/index.html.erb
42
- - lib/generators/sunrise/scaffold/templates/multiplay/helper.rb
43
- - lib/generators/sunrise/scaffold/templates/multiplay/controller.rb
44
- - lib/generators/sunrise/scaffold/templates/multiplay/spec/controller_spec.rb
45
- - lib/generators/sunrise/scaffold/templates/single/views/new.html.erb
26
+ - lib/generators/sunrise/scaffold/manage_generator.rb
27
+ - lib/generators/sunrise/scaffold/templates/single/controller.rb
28
+ - lib/generators/sunrise/scaffold/templates/single/spec/controller_spec.rb
46
29
  - lib/generators/sunrise/scaffold/templates/single/views/model_filter.html.erb
47
- - lib/generators/sunrise/scaffold/templates/single/views/edit.html.erb
48
- - lib/generators/sunrise/scaffold/templates/single/views/show.html.erb
49
- - lib/generators/sunrise/scaffold/templates/single/views/item.html.erb
50
30
  - lib/generators/sunrise/scaffold/templates/single/views/form.html.erb
51
31
  - lib/generators/sunrise/scaffold/templates/single/views/index.html.erb
32
+ - lib/generators/sunrise/scaffold/templates/single/views/item.html.erb
33
+ - lib/generators/sunrise/scaffold/templates/single/views/new.html.erb
34
+ - lib/generators/sunrise/scaffold/templates/single/views/edit.html.erb
35
+ - lib/generators/sunrise/scaffold/templates/single/views/show.html.erb
52
36
  - lib/generators/sunrise/scaffold/templates/single/helper.rb
53
- - lib/generators/sunrise/scaffold/templates/single/controller.rb
54
- - lib/generators/sunrise/scaffold/templates/single/spec/controller_spec.rb
37
+ - lib/generators/sunrise/scaffold/templates/multiplay/controller.rb
38
+ - lib/generators/sunrise/scaffold/templates/multiplay/spec/controller_spec.rb
39
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/model_filter.html.erb
40
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/form.html.erb
41
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/index.html.erb
42
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/item.html.erb
43
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/new.html.erb
44
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/edit.html.erb
45
+ - lib/generators/sunrise/scaffold/templates/multiplay/views/show.html.erb
46
+ - lib/generators/sunrise/scaffold/templates/multiplay/helper.rb
55
47
  - lib/generators/sunrise/scaffold/USAGE
56
- - lib/generators/sunrise/scaffold/manage_generator.rb
57
48
  - MIT-LICENSE
58
49
  - Rakefile
59
50
  - Gemfile
60
51
  - README.rdoc
61
- - test/integration/navigation_test.rb
62
- - test/generators/manage_generator_test.rb
52
+ - test/support/integration_case.rb
53
+ - test/test_helper.rb
54
+ - test/dummy/config.ru
55
+ - test/dummy/Rakefile
63
56
  - test/dummy/public/500.html
64
- - test/dummy/public/404.html
65
57
  - test/dummy/public/favicon.ico
58
+ - test/dummy/public/404.html
59
+ - test/dummy/public/422.html
60
+ - test/dummy/public/javascripts/prototype.js
66
61
  - test/dummy/public/javascripts/application.js
67
- - test/dummy/public/javascripts/dragdrop.js
68
62
  - test/dummy/public/javascripts/effects.js
69
- - test/dummy/public/javascripts/prototype.js
70
- - test/dummy/public/javascripts/controls.js
71
63
  - test/dummy/public/javascripts/rails.js
72
- - test/dummy/public/422.html
64
+ - test/dummy/public/javascripts/controls.js
65
+ - test/dummy/public/javascripts/dragdrop.js
73
66
  - test/dummy/app/views/layouts/application.html.erb
74
- - test/dummy/app/helpers/application_helper.rb
75
- - test/dummy/app/models/comment.rb
76
67
  - test/dummy/app/models/post.rb
68
+ - test/dummy/app/models/comment.rb
69
+ - test/dummy/app/helpers/application_helper.rb
77
70
  - test/dummy/app/controllers/application_controller.rb
78
- - test/dummy/log/production.log
79
- - test/dummy/log/server.log
80
- - test/dummy/log/test.log
81
- - test/dummy/log/development.log
82
- - test/dummy/Rakefile
83
- - test/dummy/script/rails
71
+ - test/dummy/config/database.yml
84
72
  - test/dummy/config/routes.rb
73
+ - test/dummy/config/application.rb
74
+ - test/dummy/config/locales/en.yml
75
+ - test/dummy/config/environment.rb
76
+ - test/dummy/config/boot.rb
85
77
  - test/dummy/config/environments/production.rb
86
78
  - test/dummy/config/environments/test.rb
87
79
  - test/dummy/config/environments/development.rb
88
- - test/dummy/config/boot.rb
89
- - test/dummy/config/application.rb
90
- - test/dummy/config/database.yml
91
- - test/dummy/config/initializers/session_store.rb
80
+ - test/dummy/config/initializers/secret_token.rb
92
81
  - test/dummy/config/initializers/inflections.rb
93
- - test/dummy/config/initializers/mime_types.rb
94
82
  - test/dummy/config/initializers/backtrace_silencers.rb
95
- - test/dummy/config/initializers/secret_token.rb
96
- - test/dummy/config/environment.rb
97
- - test/dummy/config/locales/en.yml
83
+ - test/dummy/config/initializers/session_store.rb
84
+ - test/dummy/config/initializers/mime_types.rb
98
85
  - test/dummy/db/migrate/20110722085934_create_comments.rb
99
86
  - test/dummy/db/migrate/20110722084440_create_posts.rb
100
- - test/dummy/db/test.sqlite3
101
- - test/dummy/config.ru
102
- - test/tmp/app/views/manage/posts/new.html.erb
103
- - test/tmp/app/views/manage/posts/_post.html.erb
104
- - test/tmp/app/views/manage/posts/edit.html.erb
105
- - test/tmp/app/views/manage/posts/_form.html.erb
106
- - test/tmp/app/views/manage/posts/_model_filter.html.erb
107
- - test/tmp/app/views/manage/posts/show.html.erb
108
- - test/tmp/app/views/manage/posts/index.html.erb
109
- - test/tmp/app/helpers/manage/posts_helper.rb
110
- - test/tmp/app/controllers/manage/posts_controller.rb
111
- - test/tmp/spec/controllers/manage/posts_controller_spec.rb
112
- - test/support/integration_case.rb
113
- - test/test_helper.rb
87
+ - test/dummy/script/rails
88
+ - test/generators/manage_generator_test.rb
89
+ - test/integration/navigation_test.rb
114
90
  homepage: https://github.com/galetahub/sunrise-scaffold
115
91
  licenses: []
116
-
117
92
  post_install_message:
118
93
  rdoc_options: []
119
-
120
- require_paths:
94
+ require_paths:
121
95
  - lib
122
- required_ruby_version: !ruby/object:Gem::Requirement
96
+ required_ruby_version: !ruby/object:Gem::Requirement
123
97
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- hash: 3
128
- segments:
129
- - 0
130
- version: "0"
131
- required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
103
  none: false
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- hash: 3
137
- segments:
138
- - 0
139
- version: "0"
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
140
108
  requirements: []
141
-
142
109
  rubyforge_project: sunrise-core
143
- rubygems_version: 1.8.10
110
+ rubygems_version: 1.8.24
144
111
  signing_key:
145
112
  specification_version: 3
146
113
  summary: Rails CMS
147
- test_files:
148
- - test/integration/navigation_test.rb
149
- - test/generators/manage_generator_test.rb
114
+ test_files:
115
+ - test/support/integration_case.rb
116
+ - test/test_helper.rb
117
+ - test/dummy/config.ru
118
+ - test/dummy/Rakefile
150
119
  - test/dummy/public/500.html
151
- - test/dummy/public/404.html
152
120
  - test/dummy/public/favicon.ico
121
+ - test/dummy/public/404.html
122
+ - test/dummy/public/422.html
123
+ - test/dummy/public/javascripts/prototype.js
153
124
  - test/dummy/public/javascripts/application.js
154
- - test/dummy/public/javascripts/dragdrop.js
155
125
  - test/dummy/public/javascripts/effects.js
156
- - test/dummy/public/javascripts/prototype.js
157
- - test/dummy/public/javascripts/controls.js
158
126
  - test/dummy/public/javascripts/rails.js
159
- - test/dummy/public/422.html
127
+ - test/dummy/public/javascripts/controls.js
128
+ - test/dummy/public/javascripts/dragdrop.js
160
129
  - test/dummy/app/views/layouts/application.html.erb
161
- - test/dummy/app/helpers/application_helper.rb
162
- - test/dummy/app/models/comment.rb
163
130
  - test/dummy/app/models/post.rb
131
+ - test/dummy/app/models/comment.rb
132
+ - test/dummy/app/helpers/application_helper.rb
164
133
  - test/dummy/app/controllers/application_controller.rb
165
- - test/dummy/log/production.log
166
- - test/dummy/log/server.log
167
- - test/dummy/log/test.log
168
- - test/dummy/log/development.log
169
- - test/dummy/Rakefile
170
- - test/dummy/script/rails
134
+ - test/dummy/config/database.yml
171
135
  - test/dummy/config/routes.rb
136
+ - test/dummy/config/application.rb
137
+ - test/dummy/config/locales/en.yml
138
+ - test/dummy/config/environment.rb
139
+ - test/dummy/config/boot.rb
172
140
  - test/dummy/config/environments/production.rb
173
141
  - test/dummy/config/environments/test.rb
174
142
  - test/dummy/config/environments/development.rb
175
- - test/dummy/config/boot.rb
176
- - test/dummy/config/application.rb
177
- - test/dummy/config/database.yml
178
- - test/dummy/config/initializers/session_store.rb
143
+ - test/dummy/config/initializers/secret_token.rb
179
144
  - test/dummy/config/initializers/inflections.rb
180
- - test/dummy/config/initializers/mime_types.rb
181
145
  - test/dummy/config/initializers/backtrace_silencers.rb
182
- - test/dummy/config/initializers/secret_token.rb
183
- - test/dummy/config/environment.rb
184
- - test/dummy/config/locales/en.yml
146
+ - test/dummy/config/initializers/session_store.rb
147
+ - test/dummy/config/initializers/mime_types.rb
185
148
  - test/dummy/db/migrate/20110722085934_create_comments.rb
186
149
  - test/dummy/db/migrate/20110722084440_create_posts.rb
187
- - test/dummy/db/test.sqlite3
188
- - test/dummy/config.ru
189
- - test/tmp/app/views/manage/posts/new.html.erb
190
- - test/tmp/app/views/manage/posts/_post.html.erb
191
- - test/tmp/app/views/manage/posts/edit.html.erb
192
- - test/tmp/app/views/manage/posts/_form.html.erb
193
- - test/tmp/app/views/manage/posts/_model_filter.html.erb
194
- - test/tmp/app/views/manage/posts/show.html.erb
195
- - test/tmp/app/views/manage/posts/index.html.erb
196
- - test/tmp/app/helpers/manage/posts_helper.rb
197
- - test/tmp/app/controllers/manage/posts_controller.rb
198
- - test/tmp/spec/controllers/manage/posts_controller_spec.rb
199
- - test/support/integration_case.rb
200
- - test/test_helper.rb
150
+ - test/dummy/script/rails
151
+ - test/generators/manage_generator_test.rb
152
+ - test/integration/navigation_test.rb
Binary file
File without changes
File without changes
File without changes
@@ -1,135 +0,0 @@
1
- SQL (0.3ms)  SELECT name
2
- FROM sqlite_master
3
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
4
- 
5
- SQL (0.1ms) select sqlite_version(*)
6
- SQL (812.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
7
- SQL (0.1ms) PRAGMA index_list("schema_migrations")
8
- SQL (84.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
- SQL (0.2ms) SELECT name
10
- FROM sqlite_master
11
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
12
- SQL (0.4ms)  SELECT name
13
- FROM sqlite_master
14
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
15
- 
16
- SQL (0.4ms)  SELECT name
17
- FROM sqlite_master
18
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
19
- 
20
- SQL (0.1ms) SELECT name
21
- FROM sqlite_master
22
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
23
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
24
- Migrating to CreatePosts (20110722084440)
25
- SQL (0.1ms) select sqlite_version(*)
26
- SQL (0.3ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime) 
27
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20110722084440')
28
- SQL (0.4ms)  SELECT name
29
- FROM sqlite_master
30
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
31
- 
32
- SQL (0.1ms) SELECT name
33
- FROM sqlite_master
34
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
35
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
36
- Migrating to CreatePosts (20110722084440)
37
- SQL (0.4ms)  SELECT name
38
- FROM sqlite_master
39
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
40
- 
41
- SQL (0.1ms) SELECT name
42
- FROM sqlite_master
43
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
44
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
45
- Migrating to CreatePosts (20110722084440)
46
- SQL (0.4ms)  SELECT name
47
- FROM sqlite_master
48
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
49
- 
50
- SQL (0.1ms) SELECT name
51
- FROM sqlite_master
52
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
53
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
54
- Migrating to CreatePosts (20110722084440)
55
- SQL (0.4ms)  SELECT name
56
- FROM sqlite_master
57
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
58
- 
59
- SQL (0.1ms) SELECT name
60
- FROM sqlite_master
61
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
62
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
63
- Migrating to CreatePosts (20110722084440)
64
- SQL (0.4ms)  SELECT name
65
- FROM sqlite_master
66
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
67
- 
68
- SQL (0.1ms) SELECT name
69
- FROM sqlite_master
70
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
71
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
72
- Migrating to CreatePosts (20110722084440)
73
- SQL (0.4ms)  SELECT name
74
- FROM sqlite_master
75
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
76
- 
77
- SQL (0.1ms) SELECT name
78
- FROM sqlite_master
79
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
80
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
81
- Migrating to CreatePosts (20110722084440)
82
- Migrating to CreateComments (20110722085934)
83
- SQL (0.0ms) select sqlite_version(*)
84
- SQL (0.3ms) CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "post_id" integer, "content" text, "user_name" varchar(255), "created_at" datetime, "updated_at" datetime) 
85
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20110722085934')
86
- SQL (0.4ms)  SELECT name
87
- FROM sqlite_master
88
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
89
- 
90
- SQL (0.1ms) SELECT name
91
- FROM sqlite_master
92
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
93
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
94
- Migrating to CreatePosts (20110722084440)
95
- Migrating to CreateComments (20110722085934)
96
- SQL (0.4ms)  SELECT name
97
- FROM sqlite_master
98
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
99
- 
100
- SQL (0.1ms) SELECT name
101
- FROM sqlite_master
102
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
103
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
104
- Migrating to CreatePosts (20110722084440)
105
- Migrating to CreateComments (20110722085934)
106
- SQL (0.4ms)  SELECT name
107
- FROM sqlite_master
108
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
109
- 
110
- SQL (0.1ms) SELECT name
111
- FROM sqlite_master
112
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
113
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
114
- Migrating to CreatePosts (20110722084440)
115
- Migrating to CreateComments (20110722085934)
116
- SQL (0.8ms)  SELECT name
117
- FROM sqlite_master
118
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
119
- 
120
- SQL (0.2ms) SELECT name
121
- FROM sqlite_master
122
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
123
- SQL (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
124
- Migrating to CreatePosts (20110722084440)
125
- Migrating to CreateComments (20110722085934)
126
- SQL (0.4ms)  SELECT name
127
- FROM sqlite_master
128
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
129
- 
130
- SQL (0.1ms) SELECT name
131
- FROM sqlite_master
132
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
133
- SQL (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
134
- Migrating to CreatePosts (20110722084440)
135
- Migrating to CreateComments (20110722085934)
@@ -1,26 +0,0 @@
1
- class Manage::PostsController < Manage::BaseController
2
- inherit_resources
3
-
4
- load_and_authorize_resource :class => Post
5
-
6
- has_scope :with_title, :as => :title, :only => :index
7
- order_by :created_at, :updated_at
8
-
9
- def create
10
- create!{ manage_posts_path }
11
- end
12
-
13
- def update
14
- update!{ manage_posts_path }
15
- end
16
-
17
- def destroy
18
- destroy!{ manage_posts_path }
19
- end
20
-
21
- protected
22
-
23
- def collection
24
- @posts = (@posts || end_of_association_chain).order(search_filter.order).page(params[:page])
25
- end
26
- end
@@ -1,2 +0,0 @@
1
- module Manage::PostsHelper
2
- end
@@ -1,18 +0,0 @@
1
- <%= manage_form_for @post do |f| %>
2
-
3
-
4
- <div class="edit-cont">
5
- <div class="inputs-bl">
6
-
7
- <%= f.input :created_at %>
8
-
9
- <%= f.input :title %>
10
-
11
- <%= f.input :updated_at %>
12
-
13
- <%= f.input :content %>
14
- </div>
15
- </div>
16
-
17
- <%= f.button :submit %>
18
- <% end %>
@@ -1,34 +0,0 @@
1
- <div class="bot-bg">
2
- <div class="filt-bl">
3
- <%= link_to_function t('manage.model_filter.title'), "Manage.toggle_element('block_filter')", :class=>"dark-arr" %>
4
-
5
- <%= t('manage.model_filter.total_count') %>: <%= @posts.total_count %>
6
-
7
- <%= cookie_content_tag(:div, :id=>"block_filter", :class=>"filt") do %>
8
- <%= form_for search_filter, :url => manage_posts_path, :html => { :method => :get } do |f| %>
9
- <% controller.scopes_configuration.each do |key, value| %>
10
- <%= f.label value[:as], t(value[:as], :scope => "activerecord.attributes.post") %>
11
- <%= f.text_field value[:as], :class => "text", :name => value[:as] %>
12
- <% end %>
13
-
14
- <div class="buts">
15
- <%= content_tag(:button, :value=>"search", :type=>"submit", :name=>"commit", :class=>"gr cupid-green") do %>
16
- <%= t('manage.model_filter.search') %>
17
- <% end %>
18
-
19
- <%= link_to t('manage.model_filter.clear'), manage_posts_path, :class=>"erase" %>
20
- </div>
21
- <% end %>
22
- <% end %>
23
- </div>
24
- <div class="sort">
25
- <label><%= t('manage.sort') %></label>
26
- <div class="select-input"><%= link_to_function t(search_filter.current_order, :scope => "manage.posts.sort"), "SelectList.toggle(event)", :class=>"corn", :id=>'sort_select' %></div>
27
- <div id='sort_select_list' class="select-list" style='display:none;'>
28
- <% controller.orders_configuration.each do |key, value| %>
29
- <%= link_to_sort(t("#{key}_desc", :scope => "manage.posts.sort"), :name => key, :order_type=>'desc') %>
30
- <%= link_to_sort(t("#{key}_asc", :scope => "manage.posts.sort"), :name => key, :order_type=>'asc') %>
31
- <% end %>
32
- </div>
33
- </div>
34
- </div>
@@ -1,32 +0,0 @@
1
- <%= content_tag(:div, :id=>dom_id(post), :class=>"dinamic-bl") do %>
2
- <div class="act-bl" style="display:none;">
3
- <% if can? :update, post, :context => :manage %>
4
- <%= link_to manage_icon("edit"), edit_manage_post_path(:id=>post.id), :class=>"icons" %>
5
- <% end -%>
6
-
7
- <% if can? :delete, post, :context => :manage %>
8
- <%= link_to manage_icon("delete"), manage_post_path(:id=>post.id),
9
- :method=>:delete, :confirm=>t("manage.confirm_delete"), :class=>"icons" %>
10
- <% end -%>
11
- </div>
12
-
13
- <div class="bot-bg">
14
- <div class="dinamic-container">
15
- <div class="right-data">
16
- <div class="right-data-cont">
17
- <div class="dinamic-inner">
18
- <div class="r-block">
19
- <div class="r-block-cont">
20
- <%= link_to post.title, edit_manage_post_path(:id=>post.id), :class=>"title" %>
21
- </div>
22
- </div>
23
- <!--<div class="l-block"> ava img </div>-->
24
- </div>
25
- </div>
26
- </div>
27
- <div class="left-data">
28
- <span class="data"><%= raw I18n.l(post.created_at, :format=>"<span>%d/%m</span>%Y") %></span>
29
- </div>
30
- </div>
31
- </div>
32
- <% end %>
@@ -1,6 +0,0 @@
1
- <div class="edit-bl">
2
- <div class="bot-bg">
3
- <div class="block-title"><%= t('manage.edit') %>:</div>
4
- <%= render :partial => 'manage/posts/form' %>
5
- </div>
6
- </div>
@@ -1,36 +0,0 @@
1
- <div class="duo-bl">
2
- <div class="left-part">
3
- <div class="content">
4
- <div class="row-container">
5
- <div class="white-row">
6
- <div class="r-corn">
7
- <%= link_to t('manage.menu.posts'), manage_posts_path, :class=>"dark-text" %>
8
- <div class="act-bl">
9
- <% if can? :create, Post, :context => :manage %>
10
- <%= link_to t('manage.add'), new_manage_post_path, :class=>"create" %>
11
- <% end -%>
12
- </div>
13
- </div>
14
- </div>
15
- </div>
16
-
17
- <div id="posts" class="stage">
18
- <%= render :partial=>"manage/posts/post", :collection=>@posts %>
19
- <%= paginate @posts, :theme => 'manage' %>
20
- </div>
21
-
22
- <script type='text/javascript'>
23
- $(document).ready(function(){
24
- Manage.init_collection('posts', 'dinamic-bl');
25
- });
26
- </script>
27
-
28
- </div>
29
- </div>
30
-
31
- <div class="right-part">
32
- <div class="filter-right">
33
- <%= render :partial=>"manage/posts/model_filter" %>
34
- </div>
35
- </div>
36
- </div>
@@ -1,6 +0,0 @@
1
- <div class="edit-bl">
2
- <div class="bot-bg">
3
- <div class="block-title"><%= t('manage.add') %>:</div>
4
- <%= render :partial => 'manage/posts/form' %>
5
- </div>
6
- </div>
@@ -1,29 +0,0 @@
1
- <div class="buttons">
2
- <div class="back-but-bl">
3
- <%= link_to content_tag(:span, t('manage.menu.posts')), manage_posts_path, :class=>"back" %>
4
- </div>
5
-
6
- <div class="act-bl">
7
- <%= link_to image_tag("manage/ico_edit.gif", :title=>t('manage.edit')), edit_manage_post_path(:id=>@post.id), :class=>"icons" %>
8
-
9
- <%= link_to image_tag("manage/ico_del.gif", :title=>t('manage.delete')), manage_post_path(:id=>@post.id), :method=>:delete, :confirm=>t("manage.confirm_delete"), :class=>"icons" %>
10
- </div>
11
- </div>
12
-
13
- <div class="edit-bl">
14
- <div class="bot-bg">
15
- <div class="block-title"><%= @post.title %>:</div>
16
- <div class="edit-cont">
17
- <table border="0" cellspacing="0" cellpadding="0" class="page-info">
18
- <tbody>
19
- <% @post.attributes.each do |attribute, value| %>
20
- <tr>
21
- <td><strong><%= attribute %></strong></td>
22
- <td><%= value %></td>
23
- </tr>
24
- <% end %>
25
- </tbody>
26
- </table>
27
- </div>
28
- </div>
29
- </div>
@@ -1,94 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Manage::PostsController do
4
- render_views
5
-
6
- context "administrator" do
7
- login_admin
8
-
9
- before(:each) do
10
- @attrs = FactoryGirl.attributes_for(:post)
11
- end
12
-
13
- it "should render new action" do
14
- get :new
15
- response.should be_success
16
- response.should render_template("new")
17
- end
18
-
19
- it "should create new post" do
20
- lambda {
21
- post :create, :post => @attrs
22
- }.should change { Post.count }.by(1)
23
- end
24
-
25
- context "exists default post" do
26
- before(:each) do
27
- @post = FactoryGirl.create(:post)
28
- end
29
-
30
- it "should render index action" do
31
- get :index
32
- assigns(:posts).should include(@post)
33
- response.should render_template('index')
34
- end
35
-
36
- it "should render edit action" do
37
- controller.should_receive :edit
38
- get :edit, :id => @post.id
39
- end
40
-
41
- it "should update post" do
42
- put :update, :id => @post.id, :post => @attrs
43
- assigns(:post).should be_valid
44
- response.should redirect_to(manage_posts_path)
45
- end
46
-
47
- it "should destroy post" do
48
- lambda {
49
- delete :destroy, :id => @post.id
50
- }.should change { Post.count }.by(-1)
51
- end
52
- end
53
- end
54
-
55
- context "anonymous user" do
56
- user_logout
57
-
58
- it "should not render index action" do
59
- controller.should_not_receive :index
60
- get :index
61
- end
62
-
63
- it "should not render new action" do
64
- controller.should_not_receive :new
65
- get :new
66
- end
67
-
68
- it "should not render create action" do
69
- controller.should_not_receive :create
70
- post :create
71
- end
72
-
73
- context "with exists post" do
74
- before(:each) do
75
- @post = FactoryGirl.create(:post)
76
- end
77
-
78
- it "should not render edit action" do
79
- controller.should_not_receive :edit
80
- get :edit, :id => @post.id
81
- end
82
-
83
- it "should not render update action" do
84
- controller.should_not_receive :update
85
- put :update, :id => @post.id
86
- end
87
-
88
- it "should not render destroy action" do
89
- controller.should_not_receive :destroy
90
- delete :destroy, :id => @post.id
91
- end
92
- end
93
- end
94
- end