six-updater-web 0.18.0 → 0.18.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.
- data/Rakefile +1 -1
- data/lib/six-updater-web/app/controllers/actions_controller.rb +0 -5
- data/lib/six-updater-web/app/controllers/appsettings_controller.rb +0 -5
- data/lib/six-updater-web/app/controllers/queryservers_controller.rb +1 -1
- data/lib/six-updater-web/app/controllers/sixconfigs_controller.rb +6 -0
- data/lib/six-updater-web/app/models/queryserver.rb +4 -0
- data/lib/six-updater-web/config/six-updater-web.rb +1 -1
- data/lib/six-updater-web/vendor/plugins/six-import/lib/six/import.rb +14 -6
- metadata +2 -2
data/Rakefile
CHANGED
@@ -15,9 +15,4 @@ class ActionsController < ApplicationController
|
|
15
15
|
config.action_links.add 'copy', :label => 'Clone', :type => :record, :position => false, :confirm => "Do you really want to *clone* this item?"
|
16
16
|
end
|
17
17
|
|
18
|
-
def copy
|
19
|
-
t = copy_ll(Action)
|
20
|
-
@original_record = t[0]
|
21
|
-
@record = t[1]
|
22
|
-
end
|
23
18
|
end
|
@@ -8,7 +8,7 @@ class QueryserversController < ApplicationController
|
|
8
8
|
config.columns = [:name, :ip, :port, :numplayers, :ping, :country, :gametype, :mission, :mapname, :mods, :saved_password, :updated_at,
|
9
9
|
:password, :sv_battleye, :verifysignatures, :dedicated, :favorite, :difficulty, :gamestate, :gamemode,
|
10
10
|
:language, :gamever, :platform, :exec2, :mod, :signatures, :players]
|
11
|
-
config.list.columns.exclude :saved_password, :ip, :port, :gamestate, :language, :difficulty, :
|
11
|
+
config.list.columns.exclude :saved_password, :ip, :port, :gamestate, :language, :difficulty, :gamemode, :mapname, :platform,
|
12
12
|
:sv_battleye, :players, :signatures, :mod
|
13
13
|
config.show.columns.exclude :mission # :players # Encoding problem when both are displayed, with russian text?
|
14
14
|
config.update.columns.exclude :exec2
|
@@ -30,4 +30,10 @@ class SixconfigsController < ApplicationController
|
|
30
30
|
config.columns[column].inplace_edit = true
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
def copy
|
35
|
+
t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize), [:mods])
|
36
|
+
@original_record = t[0]
|
37
|
+
@record = t[1]
|
38
|
+
end
|
33
39
|
end
|
@@ -9,12 +9,6 @@ module Six
|
|
9
9
|
|
10
10
|
module ClassMethods
|
11
11
|
public
|
12
|
-
def copy
|
13
|
-
t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize))
|
14
|
-
@original_record = t[0]
|
15
|
-
@record = t[1]
|
16
|
-
end
|
17
|
-
|
18
12
|
def six_local_auto_login
|
19
13
|
if request.remote_ip == "127.0.0.1" && defined?(SixUpdaterWeb::SIX_ADMIN)
|
20
14
|
if SixUpdaterWeb::SIX_ADMIN
|
@@ -25,6 +19,12 @@ module Six
|
|
25
19
|
end
|
26
20
|
end
|
27
21
|
|
22
|
+
def copy
|
23
|
+
t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize))
|
24
|
+
@original_record = t[0]
|
25
|
+
@record = t[1]
|
26
|
+
end
|
27
|
+
|
28
28
|
private
|
29
29
|
def copy_ll(cl, include = [])
|
30
30
|
record = cl.find(params[:id])
|
@@ -35,6 +35,14 @@ module Six
|
|
35
35
|
end
|
36
36
|
#new_record.id = nil
|
37
37
|
new_record.updated_at = nil
|
38
|
+
# TODO: only each if plural... or class == AR Association
|
39
|
+
include.each do |i|
|
40
|
+
n = new_record.send i
|
41
|
+
o = record.send i
|
42
|
+
o.each do |m|
|
43
|
+
n << m
|
44
|
+
end
|
45
|
+
end
|
38
46
|
new_record.save
|
39
47
|
[record, new_record]
|
40
48
|
end
|