@@ -2,17 +2,17 @@ class LabelsController < ApplicationController
2
2
before_action proc { |ctrl | ( ctrl . action_has_layout = false ) if ctrl . request . xhr? }
3
3
4
4
def index
5
- authorize! :read , Iqvoc ::XLLabel . base_class
5
+ authorize! :read , Iqvoc ::Xllabel . base_class
6
6
7
7
search_string = search_string ( params [ :query ] , params [ :mode ] )
8
- scope = Iqvoc ::XLLabel . base_class
8
+ scope = Iqvoc ::Xllabel . base_class
9
9
. editor_selectable
10
10
. by_query_value ( search_string )
11
11
12
12
if params [ :language ] # NB: this is not the same as :lang, which is supplied via route
13
13
scope = scope . by_language ( params [ :language ] )
14
14
end
15
- @labels = scope . order ( Arel . sql ( "LENGTH(#{ Iqvoc ::XLLabel . base_class . table_name } .value)" ) ) . all
15
+ @labels = scope . order ( Arel . sql ( "LENGTH(#{ Iqvoc ::Xllabel . base_class . table_name } .value)" ) ) . all
16
16
17
17
respond_to do |format |
18
18
format . html do
@@ -36,12 +36,12 @@ def index
36
36
end
37
37
38
38
def show
39
- scope = Iqvoc ::XLLabel . base_class . by_origin ( params [ :id ] ) . with_associations
39
+ scope = Iqvoc ::Xllabel . base_class . by_origin ( params [ :id ] ) . with_associations
40
40
41
41
@published = params [ :published ] == '1' || !params [ :published ]
42
42
if @published
43
43
scope = scope . published
44
- @new_label_version = Iqvoc ::XLLabel . base_class . by_origin ( params [ :id ] ) . unpublished . last
44
+ @new_label_version = Iqvoc ::Xllabel . base_class . by_origin ( params [ :id ] ) . unpublished . last
45
45
else
46
46
scope = scope . unpublished
47
47
end
@@ -59,16 +59,16 @@ def show
59
59
end
60
60
61
61
def new
62
- authorize! :create , Iqvoc ::XLLabel . base_class
63
- @label = Iqvoc ::XLLabel . base_class . new
62
+ authorize! :create , Iqvoc ::Xllabel . base_class
63
+ @label = Iqvoc ::Xllabel . base_class . new
64
64
@label . build_initial_change_note ( current_user )
65
65
@label . build_notes
66
66
end
67
67
68
68
def create
69
- authorize! :create , Iqvoc ::XLLabel . base_class
69
+ authorize! :create , Iqvoc ::Xllabel . base_class
70
70
71
- @label = Iqvoc ::XLLabel . base_class . new ( label_params )
71
+ @label = Iqvoc ::Xllabel . base_class . new ( label_params )
72
72
73
73
if @label . valid?
74
74
if @label . save
@@ -85,7 +85,7 @@ def create
85
85
end
86
86
87
87
def edit
88
- @label = Iqvoc ::XLLabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
88
+ @label = Iqvoc ::Xllabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
89
89
authorize! :update , @label
90
90
91
91
if params [ :check_associations_in_editing_mode ]
@@ -103,7 +103,7 @@ def edit
103
103
end
104
104
105
105
def update
106
- @label = Iqvoc ::XLLabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
106
+ @label = Iqvoc ::Xllabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
107
107
authorize! :update , @label
108
108
109
109
# set to_review to false if someone edits a label
@@ -123,11 +123,11 @@ def update
123
123
end
124
124
125
125
def destroy
126
- @new_label = Iqvoc ::XLLabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
126
+ @new_label = Iqvoc ::Xllabel . base_class . by_origin ( params [ :id ] ) . unpublished . last!
127
127
authorize! :destroy , @new_label
128
128
129
129
if @new_label . destroy
130
- published_label = Iqvoc ::XLLabel . base_class . published . by_origin ( @new_label . origin ) . first
130
+ published_label = Iqvoc ::Xllabel . base_class . published . by_origin ( @new_label . origin ) . first
131
131
flash [ :success ] = I18n . t ( 'txt.controllers.label_versions.delete' )
132
132
redirect_to published_label . present? ? label_path ( id : published_label . origin ) : dashboard_path
133
133
else
@@ -137,9 +137,9 @@ def destroy
137
137
end
138
138
139
139
def duplicate
140
- authorize! :create , Iqvoc ::XLLabel . base_class
141
- label = Iqvoc ::XLLabel . base_class . by_origin ( params [ :origin ] ) . published . first
142
- if Iqvoc ::XLLabel . base_class . by_origin ( params [ :origin ] ) . unpublished . last
140
+ authorize! :create , Iqvoc ::Xllabel . base_class
141
+ label = Iqvoc ::Xllabel . base_class . by_origin ( params [ :origin ] ) . published . first
142
+ if Iqvoc ::Xllabel . base_class . by_origin ( params [ :origin ] ) . unpublished . last
143
143
flash [ :error ] = t ( 'txt.controllers.label.duplicate_error' )
144
144
redirect_to label_path ( published : 1 , id : label )
145
145
end
@@ -149,8 +149,8 @@ def duplicate
149
149
end
150
150
151
151
def new_from_concept
152
- authorize! :create , Iqvoc ::XLLabel . base_class
153
- @label = Iqvoc ::XLLabel . base_class . new
152
+ authorize! :create , Iqvoc ::Xllabel . base_class
153
+ @label = Iqvoc ::Xllabel . base_class . new
154
154
155
155
respond_to do |format |
156
156
format . html do
@@ -160,9 +160,9 @@ def new_from_concept
160
160
end
161
161
162
162
def create_from_concept
163
- authorize! :create , Iqvoc ::XLLabel . base_class
163
+ authorize! :create , Iqvoc ::Xllabel . base_class
164
164
165
- @label = Iqvoc ::XLLabel . base_class . new ( label_params )
165
+ @label = Iqvoc ::Xllabel . base_class . new ( label_params )
166
166
@label . build_initial_change_note ( current_user )
167
167
168
168
if @label . save
0 commit comments