one-for-all-framework 1.0.0 → 3.0.0
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.
- checksums.yaml +4 -4
- data/README.md +77 -19
- data/app/controllers/api_controller.rb +1 -1
- data/app/controllers/application_controller.rb +2 -2
- data/app/controllers/cart_controller.rb +52 -0
- data/app/controllers/dashboard_controller.rb +4 -3
- data/app/controllers/products_controller.rb +58 -0
- data/app/models/product.rb +8 -0
- data/app/views/cart_index.erb +112 -0
- data/app/views/cms/pages_form.erb +1 -1
- data/app/views/cms/pages_index.erb +61 -45
- data/app/views/cms/posts_form.erb +1 -1
- data/app/views/cms/posts_index.erb +54 -41
- data/app/views/cms/products_form.erb +89 -0
- data/app/views/cms/products_index.erb +129 -0
- data/app/views/cms/projects_form.erb +8 -8
- data/app/views/cms/projects_index.erb +47 -37
- data/app/views/dashboard.erb +18 -0
- data/app/views/docs.erb +180 -28
- data/app/views/index.erb +1 -1
- data/app/views/layout.erb +299 -20
- data/app/views/login.erb +1 -1
- data/app/views/product_show.erb +42 -0
- data/app/views/products_index.erb +40 -0
- data/bin/ofa +38 -9
- data/config/boot.rb +1 -0
- data/config/features.json +1 -1
- data/config/routes.rb +32 -0
- data/db/development.sqlite3 +0 -0
- data/db/migrations/20260502000000_create_products.rb +17 -0
- metadata +10 -1
data/config/routes.rb
CHANGED
|
@@ -11,11 +11,42 @@ ROUTES = EksCent::Router.new do
|
|
|
11
11
|
when 'blog'
|
|
12
12
|
posts = Post.where(is_active: true).order(Sequel.desc(:created_at)).all
|
|
13
13
|
res.render 'blog_home', title: "Blog - One-For-All", posts: posts
|
|
14
|
+
when 'e_commerce'
|
|
15
|
+
ProductsController.new(req, res).index
|
|
14
16
|
else
|
|
15
17
|
res.render 'index', title: "One-For-All Framework"
|
|
16
18
|
end
|
|
17
19
|
end
|
|
18
20
|
|
|
21
|
+
# --- E-Commerce Routes ---
|
|
22
|
+
get '/products' do |req, res|
|
|
23
|
+
ProductsController.new(req, res).index
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
get '/products/:slug' do |req, res|
|
|
27
|
+
ProductsController.new(req, res).show
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
get '/cart' do |req, res|
|
|
31
|
+
CartController.new(req, res).index
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
post '/cart/add' do |req, res|
|
|
35
|
+
CartController.new(req, res).add
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
post '/cart/update' do |req, res|
|
|
39
|
+
CartController.new(req, res).update
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
post '/cart/remove' do |req, res|
|
|
43
|
+
CartController.new(req, res).remove
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
post '/cart/clear' do |req, res|
|
|
47
|
+
CartController.new(req, res).clear
|
|
48
|
+
end
|
|
49
|
+
|
|
19
50
|
get '/docs' do |req, res|
|
|
20
51
|
res.render 'docs', title: "Documentation - One-For-All"
|
|
21
52
|
end
|
|
@@ -33,6 +64,7 @@ ROUTES = EksCent::Router.new do
|
|
|
33
64
|
resources :pages, prefix: '/dashboard'
|
|
34
65
|
resources :posts, prefix: '/dashboard'
|
|
35
66
|
resources :projects, prefix: '/dashboard'
|
|
67
|
+
resources :products, prefix: '/dashboard'
|
|
36
68
|
|
|
37
69
|
# Auth Routes
|
|
38
70
|
get '/login' do |req, res|
|
data/db/development.sqlite3
CHANGED
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Sequel.migration do
|
|
2
|
+
change do
|
|
3
|
+
create_table(:products) do
|
|
4
|
+
primary_key :id
|
|
5
|
+
String :name, null: false
|
|
6
|
+
String :slug, null: false, unique: true
|
|
7
|
+
String :description, text: true
|
|
8
|
+
Float :price, default: 0.0
|
|
9
|
+
Integer :stock, default: 0
|
|
10
|
+
String :image_url
|
|
11
|
+
String :category
|
|
12
|
+
TrueClass :is_active, default: true
|
|
13
|
+
DateTime :created_at
|
|
14
|
+
DateTime :updated_at
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: one-for-all-framework
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ishikawa Uta
|
|
@@ -188,22 +188,28 @@ files:
|
|
|
188
188
|
- app/controllers/api_controller.rb
|
|
189
189
|
- app/controllers/application_controller.rb
|
|
190
190
|
- app/controllers/auth_controller.rb
|
|
191
|
+
- app/controllers/cart_controller.rb
|
|
191
192
|
- app/controllers/dashboard_controller.rb
|
|
192
193
|
- app/controllers/pages_controller.rb
|
|
193
194
|
- app/controllers/posts_controller.rb
|
|
195
|
+
- app/controllers/products_controller.rb
|
|
194
196
|
- app/controllers/projects_controller.rb
|
|
195
197
|
- app/helpers/cloudinary_helper.rb
|
|
196
198
|
- app/middleware/auth_middleware.rb
|
|
197
199
|
- app/middleware/csrf_middleware.rb
|
|
198
200
|
- app/models/page.rb
|
|
199
201
|
- app/models/post.rb
|
|
202
|
+
- app/models/product.rb
|
|
200
203
|
- app/models/project.rb
|
|
201
204
|
- app/models/user.rb
|
|
202
205
|
- app/views/blog_home.erb
|
|
206
|
+
- app/views/cart_index.erb
|
|
203
207
|
- app/views/cms/pages_form.erb
|
|
204
208
|
- app/views/cms/pages_index.erb
|
|
205
209
|
- app/views/cms/posts_form.erb
|
|
206
210
|
- app/views/cms/posts_index.erb
|
|
211
|
+
- app/views/cms/products_form.erb
|
|
212
|
+
- app/views/cms/products_index.erb
|
|
207
213
|
- app/views/cms/projects_form.erb
|
|
208
214
|
- app/views/cms/projects_index.erb
|
|
209
215
|
- app/views/dashboard.erb
|
|
@@ -216,6 +222,8 @@ files:
|
|
|
216
222
|
- app/views/portfolio.erb
|
|
217
223
|
- app/views/post.erb
|
|
218
224
|
- app/views/posts/hello_world.erb
|
|
225
|
+
- app/views/product_show.erb
|
|
226
|
+
- app/views/products_index.erb
|
|
219
227
|
- app/views/project.erb
|
|
220
228
|
- bin/ofa
|
|
221
229
|
- config.eks
|
|
@@ -229,6 +237,7 @@ files:
|
|
|
229
237
|
- config/routes.rb
|
|
230
238
|
- db/data.sqlite3
|
|
231
239
|
- db/development.sqlite3
|
|
240
|
+
- db/migrations/20260502000000_create_products.rb
|
|
232
241
|
- ofa
|
|
233
242
|
- public/css/cms.css
|
|
234
243
|
- public/images/logo.jpg
|