cloudstrg 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/cloudstrg/configs.js +2 -0
- data/app/assets/javascripts/cloudstrg/remoteobjects.js +2 -0
- data/app/assets/stylesheets/cloudstrg/configs.css +4 -0
- data/app/assets/stylesheets/cloudstrg/remoteobjects.css +4 -0
- data/app/controllers/cloudstrg/configs_controller.rb +103 -0
- data/app/controllers/cloudstrg/configs_controller.rb~ +103 -0
- data/app/controllers/cloudstrg/remoteobjects_controller.rb +91 -0
- data/app/controllers/cloudstrg/remoteobjects_controller.rb~ +90 -0
- data/app/helpers/cloudstrg/configs_helper.rb +4 -0
- data/app/helpers/cloudstrg/remoteobjects_helper.rb +4 -0
- data/app/models/cloudstrg/cloudstrgplugin.rb +3 -0
- data/app/models/cloudstrg/cloudstrgplugin.rb~ +8 -0
- data/app/models/cloudstrg/config.rb +9 -0
- data/app/models/cloudstrg/config.rb~ +30 -0
- data/app/models/cloudstrg/remoteobject.rb +11 -0
- data/app/models/cloudstrg/remoteobject.rb~ +9 -0
- data/app/views/cloudstrg/configs/_form.html.erb +26 -0
- data/app/views/cloudstrg/configs/_form.html.erb~ +26 -0
- data/app/views/cloudstrg/configs/edit.html.erb +6 -0
- data/app/views/cloudstrg/configs/index.html.erb +29 -0
- data/app/views/cloudstrg/configs/index.html.erb~ +29 -0
- data/app/views/cloudstrg/configs/new.html.erb +5 -0
- data/app/views/cloudstrg/configs/show.html.erb +15 -0
- data/app/views/cloudstrg/configs/show.html.erb~ +15 -0
- data/app/views/cloudstrg/remoteobjects/_form.html.erb +33 -0
- data/app/views/cloudstrg/remoteobjects/edit.html.erb +6 -0
- data/app/views/cloudstrg/remoteobjects/index.html.erb +29 -0
- data/app/views/cloudstrg/remoteobjects/new.html.erb +5 -0
- data/app/views/cloudstrg/remoteobjects/show.html.erb +25 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +8 -0
- data/db/migrate/20121109112536_create_cloudstrg_remoteobjects.rb~ +12 -0
- data/db/migrate/20121109175154_create_cloudstrg_remoteobjects.rb +12 -0
- data/db/migrate/20121109175154_create_cloudstrg_remoteobjects.rb~ +12 -0
- data/db/migrate/20121113105908_create_cloudstrg_configs.rb +10 -0
- data/db/migrate/20121113105908_create_cloudstrg_configs.rb~ +10 -0
- data/db/migrate/20121116111055_rename_cloudstrg_config_plugin_id_to_cloudstrg_config_cloudstrgplugin_id.rb +5 -0
- data/db/migrate/20121119105425_rename_remoteobject_plugin_id_to_remoteobject_cloudstrgplugin_id.rb +5 -0
- data/db/migrate/20121119184135_add_file_remote_id_to_cloudstrg_remoteobjects.rb +5 -0
- data/db/migrate/20121119184135_add_file_remote_id_to_cloudstrg_remoteobjects.rb~ +5 -0
- data/db/migrate/20121120022309_change_file_remote_id_type_to_string.rb +6 -0
- data/lib/cloudstrg/cloudstrg.rb +44 -23
- data/lib/cloudstrg/cloudstrg.rb~ +164 -0
- data/lib/cloudstrg/version.rb +1 -1
- data/lib/cloudstrg.rb +1 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20121107132518_create_cloudstrg_cloudstrgplugins.cloudstrg.rb +11 -0
- data/test/dummy/db/schema.rb +23 -0
- data/test/dummy/log/development.log +16 -0
- data/test/fixtures/cloudstrg/configs.yml +9 -0
- data/test/fixtures/cloudstrg/remoteobjects.yml +13 -0
- data/test/functional/cloudstrg/configs_controller_test.rb +51 -0
- data/test/functional/cloudstrg/remoteobjects_controller_test.rb +51 -0
- data/test/unit/cloudstrg/config_test.rb +9 -0
- data/test/unit/cloudstrg/remoteobject_test.rb +9 -0
- data/test/unit/helpers/cloudstrg/configs_helper_test.rb +6 -0
- data/test/unit/helpers/cloudstrg/remoteobjects_helper_test.rb +6 -0
- metadata +64 -3
- data/lib/cloudstrg/version.rb~ +0 -3
@@ -0,0 +1,103 @@
|
|
1
|
+
require_dependency "cloudstrg/application_controller"
|
2
|
+
require 'cloudstrg/cloudstrg'
|
3
|
+
|
4
|
+
module Cloudstrg
|
5
|
+
class ConfigsController < ApplicationController
|
6
|
+
before_filter :get_main_params
|
7
|
+
|
8
|
+
# GET /configs
|
9
|
+
# GET /configs.json
|
10
|
+
def index
|
11
|
+
@config = @user.cloudstrgconfig
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.html # index.html.erb
|
15
|
+
format.json { render json: @config }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# GET /configs/1
|
20
|
+
# GET /configs/1.json
|
21
|
+
def show
|
22
|
+
@config = Config.find(params[:id])
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
format.html # show.html.erb
|
26
|
+
format.json { render json: @config }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# GET /configs/new
|
31
|
+
# GET /configs/new.json
|
32
|
+
def new
|
33
|
+
@config = @user.cloudstrgconfig
|
34
|
+
if not @config
|
35
|
+
@config = @user.build_cloudstrgconfig
|
36
|
+
end
|
37
|
+
@driver_list = CloudStrg.driver_list
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
format.html # new.html.erb
|
41
|
+
format.json { render json: @config }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# GET /configs/1/edit
|
46
|
+
def edit
|
47
|
+
@config = Config.find(params[:id])
|
48
|
+
@driver_list = CloudStrg.driver_list
|
49
|
+
end
|
50
|
+
|
51
|
+
# POST /configs
|
52
|
+
# POST /configs.json
|
53
|
+
def create
|
54
|
+
@config = @user.build_cloudstrgconfig(params[:config])
|
55
|
+
@driver_list = CloudStrg.driver_list
|
56
|
+
|
57
|
+
respond_to do |format|
|
58
|
+
if @config.save
|
59
|
+
format.html { redirect_to @config, notice: 'Config was successfully created.' }
|
60
|
+
format.json { render json: @config, status: :created, location: @config }
|
61
|
+
else
|
62
|
+
format.html { render action: "new" }
|
63
|
+
format.json { render json: @config.errors, status: :unprocessable_entity }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# PUT /configs/1
|
69
|
+
# PUT /configs/1.json
|
70
|
+
def update
|
71
|
+
@config = Config.find(params[:id])
|
72
|
+
@driver_list = CloudStrg.driver_list
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
if @config.update_attributes(params[:config])
|
76
|
+
format.html { redirect_to @config, notice: 'Config was successfully updated.' }
|
77
|
+
format.json { head :no_content }
|
78
|
+
else
|
79
|
+
format.html { render action: "edit" }
|
80
|
+
format.json { render json: @config.errors, status: :unprocessable_entity }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# DELETE /configs/1
|
86
|
+
# DELETE /configs/1.json
|
87
|
+
def destroy
|
88
|
+
@config = Config.find(params[:id])
|
89
|
+
@config.destroy
|
90
|
+
|
91
|
+
respond_to do |format|
|
92
|
+
format.html { redirect_to configs_url }
|
93
|
+
format.json { head :no_content }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
def get_main_params
|
99
|
+
@user = current_user
|
100
|
+
puts @user.email
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require_dependency "cloudstrg/application_controller"
|
2
|
+
require 'cloudstrg/cloudstrg'
|
3
|
+
|
4
|
+
module Cloudstrg
|
5
|
+
class ConfigsController < ApplicationController
|
6
|
+
before_filter :get_main_params
|
7
|
+
|
8
|
+
# GET /configs
|
9
|
+
# GET /configs.json
|
10
|
+
def index
|
11
|
+
@config = @user.cloudstrgconfig
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.html # index.html.erb
|
15
|
+
format.json { render json: @config }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# GET /configs/1
|
20
|
+
# GET /configs/1.json
|
21
|
+
def show
|
22
|
+
@config = Config.find(params[:id])
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
format.html # show.html.erb
|
26
|
+
format.json { render json: @config }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# GET /configs/new
|
31
|
+
# GET /configs/new.json
|
32
|
+
def new
|
33
|
+
@config = @user.cloudstrgconfig
|
34
|
+
if not @config
|
35
|
+
@config = @user.cloudstrgconfig.build_cloudstrgconfig
|
36
|
+
end
|
37
|
+
@driver_list = CloudStrg.driver_list
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
format.html # new.html.erb
|
41
|
+
format.json { render json: @config }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# GET /configs/1/edit
|
46
|
+
def edit
|
47
|
+
@config = Config.find(params[:id])
|
48
|
+
@driver_list = CloudStrg.driver_list
|
49
|
+
end
|
50
|
+
|
51
|
+
# POST /configs
|
52
|
+
# POST /configs.json
|
53
|
+
def create
|
54
|
+
@config = @user.cloudstrgconfig.build_cloudstrgconfig(params[:config])
|
55
|
+
@driver_list = CloudStrg.driver_list
|
56
|
+
|
57
|
+
respond_to do |format|
|
58
|
+
if @config.save
|
59
|
+
format.html { redirect_to @config, notice: 'Config was successfully created.' }
|
60
|
+
format.json { render json: @config, status: :created, location: @config }
|
61
|
+
else
|
62
|
+
format.html { render action: "new" }
|
63
|
+
format.json { render json: @config.errors, status: :unprocessable_entity }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# PUT /configs/1
|
69
|
+
# PUT /configs/1.json
|
70
|
+
def update
|
71
|
+
@config = Config.find(params[:id])
|
72
|
+
@driver_list = CloudStrg.driver_list
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
if @config.update_attributes(params[:config])
|
76
|
+
format.html { redirect_to @config, notice: 'Config was successfully updated.' }
|
77
|
+
format.json { head :no_content }
|
78
|
+
else
|
79
|
+
format.html { render action: "edit" }
|
80
|
+
format.json { render json: @config.errors, status: :unprocessable_entity }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# DELETE /configs/1
|
86
|
+
# DELETE /configs/1.json
|
87
|
+
def destroy
|
88
|
+
@config = Config.find(params[:id])
|
89
|
+
@config.destroy
|
90
|
+
|
91
|
+
respond_to do |format|
|
92
|
+
format.html { redirect_to configs_url }
|
93
|
+
format.json { head :no_content }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
def get_main_params
|
99
|
+
@user = current_user
|
100
|
+
puts @user.email
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require_dependency "cloudstrg/application_controller"
|
2
|
+
|
3
|
+
module Cloudstrg
|
4
|
+
class RemoteobjectsController < ApplicationController
|
5
|
+
# GET /remoteobjects
|
6
|
+
# GET /remoteobjects.json
|
7
|
+
def index
|
8
|
+
if params.has_key? :plugin_id
|
9
|
+
@remoteobjects = Remoteobject.where :plugin_id => params[:plugin_id]
|
10
|
+
else
|
11
|
+
@remoteobjects = Remoteobject.all
|
12
|
+
end
|
13
|
+
|
14
|
+
respond_to do |format|
|
15
|
+
format.html # index.html.erb
|
16
|
+
format.json { render json: @remoteobjects }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /remoteobjects/1
|
21
|
+
# GET /remoteobjects/1.json
|
22
|
+
def show
|
23
|
+
@remoteobject = Remoteobject.find(params[:id])
|
24
|
+
|
25
|
+
respond_to do |format|
|
26
|
+
format.html # show.html.erb
|
27
|
+
format.json { render json: @remoteobject }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# GET /remoteobjects/new
|
32
|
+
# GET /remoteobjects/new.json
|
33
|
+
def new
|
34
|
+
@remoteobject = Remoteobject.new
|
35
|
+
|
36
|
+
respond_to do |format|
|
37
|
+
format.html # new.html.erb
|
38
|
+
format.json { render json: @remoteobject }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# GET /remoteobjects/1/edit
|
43
|
+
def edit
|
44
|
+
@remoteobject = Remoteobject.find(params[:id])
|
45
|
+
end
|
46
|
+
|
47
|
+
# POST /remoteobjects
|
48
|
+
# POST /remoteobjects.json
|
49
|
+
def create
|
50
|
+
@remoteobject = Remoteobject.new(params[:remoteobject])
|
51
|
+
|
52
|
+
respond_to do |format|
|
53
|
+
if @remoteobject.save
|
54
|
+
format.html { redirect_to @remoteobject, notice: 'Remoteobject was successfully created.' }
|
55
|
+
format.json { render json: @remoteobject, status: :created, location: @remoteobject }
|
56
|
+
else
|
57
|
+
format.html { render action: "new" }
|
58
|
+
format.json { render json: @remoteobject.errors, status: :unprocessable_entity }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# PUT /remoteobjects/1
|
64
|
+
# PUT /remoteobjects/1.json
|
65
|
+
def update
|
66
|
+
@remoteobject = Remoteobject.find(params[:id])
|
67
|
+
|
68
|
+
respond_to do |format|
|
69
|
+
if @remoteobject.update_attributes(params[:remoteobject])
|
70
|
+
format.html { redirect_to @remoteobject, notice: 'Remoteobject was successfully updated.' }
|
71
|
+
format.json { head :no_content }
|
72
|
+
else
|
73
|
+
format.html { render action: "edit" }
|
74
|
+
format.json { render json: @remoteobject.errors, status: :unprocessable_entity }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# DELETE /remoteobjects/1
|
80
|
+
# DELETE /remoteobjects/1.json
|
81
|
+
def destroy
|
82
|
+
@remoteobject = Remoteobject.find(params[:id])
|
83
|
+
@remoteobject.destroy
|
84
|
+
|
85
|
+
respond_to do |format|
|
86
|
+
format.html { redirect_to remoteobjects_url }
|
87
|
+
format.json { head :no_content }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require_dependency "cloudstrg/application_controller"
|
2
|
+
|
3
|
+
module Cloudstrg
|
4
|
+
class RemoteobjectsController < ApplicationController
|
5
|
+
# GET /remoteobjects
|
6
|
+
# GET /remoteobjects.json
|
7
|
+
def index
|
8
|
+
if params.has_key? :plugin_id
|
9
|
+
@remoteobjects = Remoteobject.where :plugin_id => params[:plugin_id]
|
10
|
+
else
|
11
|
+
@remoteobjects = Remoteobject.all
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.html # index.html.erb
|
15
|
+
format.json { render json: @remoteobjects }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# GET /remoteobjects/1
|
20
|
+
# GET /remoteobjects/1.json
|
21
|
+
def show
|
22
|
+
@remoteobject = Remoteobject.find(params[:id])
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
format.html # show.html.erb
|
26
|
+
format.json { render json: @remoteobject }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# GET /remoteobjects/new
|
31
|
+
# GET /remoteobjects/new.json
|
32
|
+
def new
|
33
|
+
@remoteobject = Remoteobject.new
|
34
|
+
|
35
|
+
respond_to do |format|
|
36
|
+
format.html # new.html.erb
|
37
|
+
format.json { render json: @remoteobject }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# GET /remoteobjects/1/edit
|
42
|
+
def edit
|
43
|
+
@remoteobject = Remoteobject.find(params[:id])
|
44
|
+
end
|
45
|
+
|
46
|
+
# POST /remoteobjects
|
47
|
+
# POST /remoteobjects.json
|
48
|
+
def create
|
49
|
+
@remoteobject = Remoteobject.new(params[:remoteobject])
|
50
|
+
|
51
|
+
respond_to do |format|
|
52
|
+
if @remoteobject.save
|
53
|
+
format.html { redirect_to @remoteobject, notice: 'Remoteobject was successfully created.' }
|
54
|
+
format.json { render json: @remoteobject, status: :created, location: @remoteobject }
|
55
|
+
else
|
56
|
+
format.html { render action: "new" }
|
57
|
+
format.json { render json: @remoteobject.errors, status: :unprocessable_entity }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# PUT /remoteobjects/1
|
63
|
+
# PUT /remoteobjects/1.json
|
64
|
+
def update
|
65
|
+
@remoteobject = Remoteobject.find(params[:id])
|
66
|
+
|
67
|
+
respond_to do |format|
|
68
|
+
if @remoteobject.update_attributes(params[:remoteobject])
|
69
|
+
format.html { redirect_to @remoteobject, notice: 'Remoteobject was successfully updated.' }
|
70
|
+
format.json { head :no_content }
|
71
|
+
else
|
72
|
+
format.html { render action: "edit" }
|
73
|
+
format.json { render json: @remoteobject.errors, status: :unprocessable_entity }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# DELETE /remoteobjects/1
|
79
|
+
# DELETE /remoteobjects/1.json
|
80
|
+
def destroy
|
81
|
+
@remoteobject = Remoteobject.find(params[:id])
|
82
|
+
@remoteobject.destroy
|
83
|
+
|
84
|
+
respond_to do |format|
|
85
|
+
format.html { redirect_to remoteobjects_url }
|
86
|
+
format.json { head :no_content }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module Cloudstrg
|
2
2
|
class Cloudstrgplugin < ActiveRecord::Base
|
3
3
|
attr_accessible :plugin_name, :version
|
4
|
+
|
5
|
+
has_one :cloudstrgconfig, :class_name => Cloudstrg::Config, :dependent => :destroy
|
6
|
+
has_many :remotes, :class_name => Cloudstrg::Remoteobject, :dependent => :destroy
|
4
7
|
end
|
5
8
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Cloudstrg
|
2
|
+
class Cloudstrgplugin < ActiveRecord::Base
|
3
|
+
attr_accessible :plugin_name, :version
|
4
|
+
|
5
|
+
has_one :cloudstrgconfig, :class_name => Cloudstrg::Config, :dependent => :destroy
|
6
|
+
has_many :remoteobjects, :class_name => Cloudstrg::Remoteobject, :dependent => :destroy
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Cloudstrg
|
2
|
+
class Config < ActiveRecord::Base
|
3
|
+
attr_accessible :cloudstrgplugin_id, :user_id
|
4
|
+
|
5
|
+
attr_accessor :cloudstrgplugin_name
|
6
|
+
belongs_to :cloudstrgplugin, :class_name => Cloudstrg::Cloudstrgplugin
|
7
|
+
|
8
|
+
attr_accessor :user_email
|
9
|
+
belongs_to :user, :class_name => Cloudstrg.user_class
|
10
|
+
|
11
|
+
before_save :set_hooks
|
12
|
+
|
13
|
+
private
|
14
|
+
def set_hooks
|
15
|
+
if cloudstrgplugin_name
|
16
|
+
self.cloudstrgplugin = Cloudstrg::Cloudstrgplugin.find_by_plugin_name(cloudstrgplugin_name)
|
17
|
+
else
|
18
|
+
self.cloudstrgplugin = Cloudstrg::Cloudstrgplugin.find(self.cloudstrgplugin_id)
|
19
|
+
end
|
20
|
+
|
21
|
+
if not self.cloudstrgplugin
|
22
|
+
return false
|
23
|
+
end
|
24
|
+
self.user = Cloudstrg.user_class.constantize.find_by_email(user_email)
|
25
|
+
if not self.user
|
26
|
+
return false
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Cloudstrg
|
2
|
+
class Remoteobject < ActiveRecord::Base
|
3
|
+
attr_accessible :filehash, :filename, :cloudstrgplugin_id, :user_id, :file_remote_id
|
4
|
+
|
5
|
+
belongs_to :cloudstrgplugin, :class_name => Cloudstrg::Cloudstrgplugin
|
6
|
+
|
7
|
+
has_many :remoteobjects, :class_name => Cloudstrg::Remoteobject, :dependent => :destroy
|
8
|
+
|
9
|
+
belongs_to :user, :class_name => Cloudstrg.user_class
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Cloudstrg
|
2
|
+
class Remoteobject < ActiveRecord::Base
|
3
|
+
attr_accessible :filehash, :filename, :cloudstrgplugin_id, :user_id, :file_remote_id
|
4
|
+
|
5
|
+
belongs_to :cloudstrgplugin, :class_name => Cloudstrg::Cloudstrgplugin
|
6
|
+
|
7
|
+
belongs_to :user, :class_name => Cloudstrg.user_class
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= form_for(@config) do |f| %>
|
2
|
+
<% if @config.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@config.errors.count, "error") %> prohibited this config from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @config.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<!--
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :user_id %><br />
|
16
|
+
<%= f.number_field :user_id %>
|
17
|
+
</div>
|
18
|
+
-->
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :cloudstrgplugin_id, "Choose what driver would you like to use:" %><br />
|
21
|
+
<%= f.select :cloudstrgplugin_id, @driver_list %>
|
22
|
+
</div>
|
23
|
+
<div class="actions">
|
24
|
+
<%= f.submit %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= form_for(@config) do |f| %>
|
2
|
+
<% if @config.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@config.errors.count, "error") %> prohibited this config from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @config.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<!--
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :user_id %><br />
|
16
|
+
<%= f.number_field :user_id %>
|
17
|
+
</div>
|
18
|
+
-->
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :plugin_id, "Choose what driver would you like to use:" %><br />
|
21
|
+
<%= f.select :plugin_id, @driver_list %>
|
22
|
+
</div>
|
23
|
+
<div class="actions">
|
24
|
+
<%= f.submit %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1>Listing configs</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>User</th>
|
6
|
+
<th>Plugin</th>
|
7
|
+
<th></th>
|
8
|
+
<th></th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<% if @config %>
|
13
|
+
<tr>
|
14
|
+
<td><%= @config.user.email %></td>
|
15
|
+
<td><%= @config.cloudstrgplugin.plugin_name %></td>
|
16
|
+
<td><%= link_to 'Show', @config %></td>
|
17
|
+
<td><%= link_to 'Edit', edit_config_path(@config) %></td>
|
18
|
+
<td><%= link_to 'Destroy', @config, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<br />
|
24
|
+
|
25
|
+
<% if not @config %>
|
26
|
+
<%= link_to 'New Config', new_config_path %>
|
27
|
+
|
|
28
|
+
<% end %>
|
29
|
+
<%= link_to 'Back', main_app.scenes_path %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1>Listing configs</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>User</th>
|
6
|
+
<th>Plugin</th>
|
7
|
+
<th></th>
|
8
|
+
<th></th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<% if @config %>
|
13
|
+
<tr>
|
14
|
+
<td><%= @config.user.email %></td>
|
15
|
+
<td><%= @config.cloudstrgplugin.plugin_name %></td>
|
16
|
+
<td><%= link_to 'Show', @config %></td>
|
17
|
+
<td><%= link_to 'Edit', edit_config_path(@config) %></td>
|
18
|
+
<td><%= link_to 'Destroy', @config, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<br />
|
24
|
+
|
25
|
+
<% if not @config %>
|
26
|
+
<%= link_to 'New Config', new_config_path %>
|
27
|
+
|
|
28
|
+
<% end %>
|
29
|
+
<%= link_to 'Index', main_app.scenes_path %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>User:</b>
|
5
|
+
<%= @config.user.email %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Plugin:</b>
|
10
|
+
<%= @config.cloudstrgplugin.plugin_name %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
|
14
|
+
<%= link_to 'Edit', edit_config_path(@config) %> |
|
15
|
+
<%= link_to 'Back', configs_path %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>User:</b>
|
5
|
+
<%= @config.user.email %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Plugin:</b>
|
10
|
+
<%= @config.plugin.plugin_name %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
|
14
|
+
<%= link_to 'Edit', edit_config_path(@config) %> |
|
15
|
+
<%= link_to 'Back', configs_path %>
|