ecm_courses2_backend 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5846bca115b6dd2c8612fed7ac4e6b2c788c1964
4
- data.tar.gz: 5b6faf51855d69fa3634738ccb87567d92a03223
3
+ metadata.gz: 36921f73ecd62f971de9e02f06a4f7da6b46828b
4
+ data.tar.gz: ee4cf11d86791e6bdaa538047338e51afb34344d
5
5
  SHA512:
6
- metadata.gz: b9d1fd1bd5e94ff829b33831b5229e278ddb08ecf01b282e16b210389b1e2d21ff22623291f4de2f722a3824aa92d12c8b4c9a2a93f30d05979e9297f2633468
7
- data.tar.gz: 1e2a8d0f45d7bc3efc576e22dc359ae407e25b2b5f220aa69fa0f086551383f2853786568ed300b8f3733beead1b9e112606f5f14679044bc366716adda0dad3
6
+ metadata.gz: f3a87a4db4fd9f16e28b45c86eb8b2a4ba75d846d9679bc73dcfd789a6587ab82b5d9ef7cd3e598ad33c02555701bc328a19826d3aeb6f7f7c6fce2c073e936b
7
+ data.tar.gz: 93cd0c24b31802b421e6dfecb4f3c1937b8fd45501c4bdc81d03fe0addefc027df9937d688a88b1e6a2b4352b3335acd0352e25c2452cf8357ec5142819dfb76
@@ -11,6 +11,10 @@ module Ecm
11
11
  def load_resource
12
12
  load_scope.friendly.find(params[:id])
13
13
  end
14
+
15
+ def permitted_params
16
+ params.require(:course_category).permit(:parent_id, :locale, :name, :description)
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -5,6 +5,12 @@ module Ecm
5
5
  def self.resource_class
6
6
  Ecm::Courses::CourseDate
7
7
  end
8
+
9
+ private
10
+
11
+ def permitted_params
12
+ params.require(:course_date).permit(:course_id, :description, :start_at, :end_at)
13
+ end
8
14
  end
9
15
  end
10
16
  end
@@ -2,14 +2,24 @@ module Ecm
2
2
  module Courses
3
3
  module Backend
4
4
  class CoursesController < Itsf::Backend::Resource::BaseController
5
+ include Controller::ActsAsListConcern
6
+
5
7
  def self.resource_class
6
8
  Ecm::Courses::Course
7
9
  end
8
10
 
9
11
  private
10
12
 
11
- def load_resource
12
- load_scope.friendly.find(params[:id])
13
+ def load_scope
14
+ resource_class.friendly
15
+ end
16
+
17
+ # def load_resource
18
+ # load_scope.friendly.find(params[:id])
19
+ # end
20
+
21
+ def permitted_params
22
+ params.require(:course).permit(:course_category_id, :locale, :name, :description)
13
23
  end
14
24
  end
15
25
  end
@@ -0,0 +1,4 @@
1
+ = form.association :parent
2
+ = form.input :locale, collection: I18n.available_locales
3
+ = form.input :name
4
+ = form.input :description
@@ -0,0 +1,5 @@
1
+ = table.column :parent, as: :association
2
+ = table.column :locale
3
+ = table.column :name
4
+ = table.column :description, class: 'truncate-chars truncate-chars-30'
5
+ = table.timestamps
@@ -0,0 +1,4 @@
1
+ = form.association :course
2
+ = form.input :description
3
+ = form.input :start_at
4
+ = form.input :end_at
@@ -0,0 +1,5 @@
1
+ = table.column :course, as: :association
2
+ = table.column :description, class: 'truncate-chars truncate-chars-30'
3
+ = table.column :start_at
4
+ = table.column :end_at
5
+ = table.timestamps
@@ -0,0 +1,4 @@
1
+ = form.association :course_category
2
+ = form.input :locale, collection: I18n.available_locales
3
+ = form.input :name
4
+ = form.input :description
@@ -0,0 +1,6 @@
1
+ = table.column :course_category, as: :association
2
+ = table.column :locale
3
+ = table.column :name
4
+ = table.column :description, class: 'truncate-chars truncate-chars-30'
5
+ = table.acts_as_list_actions scope: 'course_category_id'
6
+ = table.timestamps
data/config/routes.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  Ecm::Courses::Backend::Engine.routes.draw do
2
2
  backend_resources :course_categories
3
- backend_resources :courses
3
+ backend_resources :courses do
4
+ post :reposition, on: :member
5
+ end
4
6
  backend_resources :course_dates
5
7
 
6
8
  root to: 'home#index'
@@ -1,7 +1,7 @@
1
1
  module Ecm
2
2
  module Courses
3
3
  module Backend
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_courses2_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-21 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,6 +60,12 @@ files:
60
60
  - app/controllers/ecm/courses/backend/home_controller.rb
61
61
  - app/helpers/ecm/courses/backend/application_helper.rb
62
62
  - app/policies/ecm/courses/backend/engine_policy.rb
63
+ - app/views/ecm/courses/backend/course_categories/_form.haml
64
+ - app/views/ecm/courses/backend/course_categories/_table.haml
65
+ - app/views/ecm/courses/backend/course_dates/_form.haml
66
+ - app/views/ecm/courses/backend/course_dates/_table.haml
67
+ - app/views/ecm/courses/backend/courses/_form.haml
68
+ - app/views/ecm/courses/backend/courses/_table.haml
63
69
  - app/views/layouts/ecm/courses/backend/application.html.erb
64
70
  - config/initializers/assets.rb
65
71
  - config/locales/de.yml
@@ -94,9 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
100
  version: '0'
95
101
  requirements: []
96
102
  rubyforge_project:
97
- rubygems_version: 2.4.8
103
+ rubygems_version: 2.5.1
98
104
  signing_key:
99
105
  specification_version: 4
100
106
  summary: Ecm::Courses::Backend.
101
107
  test_files: []
102
- has_rdoc: