casein 5.3.2.0 → 5.4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Casein
2
4
  module CaseinHelper
3
-
4
- def casein_get_footer_string include_version = false
5
+ def casein_get_footer_string(include_version = false)
5
6
  if include_version
6
7
  "Running on #{link_to 'Casein', 'http://www.caseincms.com'} #{casein_get_full_version_string}, an open-source project.".html_safe
7
8
  else
@@ -9,315 +10,305 @@ module Casein
9
10
  end
10
11
  end
11
12
 
12
- def casein_get_version_info
13
+ def casein_get_version_info
13
14
  Casein::VERSION_HASH
14
- end
15
+ end
15
16
 
16
- def casein_get_full_version_string
17
+ def casein_get_full_version_string
17
18
  "v#{Casein::VERSION}"
18
- end
19
+ end
19
20
 
20
- def casein_get_short_version_string
21
+ def casein_get_short_version_string
21
22
  version_info = casein_get_version_info
22
- "v#{version_info[:major]}"
23
- end
24
-
25
- def casein_generate_page_title
23
+ "v#{version_info[:major]}"
24
+ end
26
25
 
27
- if @casein_page_title.nil?
28
- return casein_config_website_name
29
- end
26
+ def casein_generate_page_title
27
+ return casein_config_website_name if @casein_page_title.nil?
30
28
 
31
- casein_config_website_name + " > " + @casein_page_title
32
- end
29
+ casein_config_website_name + ' > ' + @casein_page_title
30
+ end
33
31
 
34
- def casein_get_access_level_text level
35
- case level
32
+ def casein_get_access_level_text(level)
33
+ case level
36
34
  when $CASEIN_USER_ACCESS_LEVEL_ADMIN
37
- return "Administrator"
35
+ 'Administrator'
38
36
  when $CASEIN_USER_ACCESS_LEVEL_USER
39
- return "User"
40
- else
41
- return "Unknown"
42
- end
43
- end
37
+ 'User'
38
+ else
39
+ 'Unknown'
40
+ end
41
+ end
44
42
 
45
- def casein_get_access_level_array
46
- [["Administrator", $CASEIN_USER_ACCESS_LEVEL_ADMIN], ["User", $CASEIN_USER_ACCESS_LEVEL_USER]]
47
- end
43
+ def casein_get_access_level_array
44
+ [['Administrator', $CASEIN_USER_ACCESS_LEVEL_ADMIN], ['User', $CASEIN_USER_ACCESS_LEVEL_USER]]
45
+ end
48
46
 
49
- def casein_pagination_details objs
47
+ def casein_pagination_details(objs)
50
48
  " <small class='pagination-details'>/ page #{objs.current_page} of #{objs.total_pages}</small>".html_safe if objs.current_page && objs.total_pages > 1
51
49
  end
52
50
 
53
- def casein_table_cell_link contents, link, options = {}
54
-
55
- if options.key? :casein_truncate
56
- contents = truncate(contents, length: options[:casein_truncate], omission: "...")
57
- end
51
+ def casein_table_cell_link(contents, link, options = {})
52
+ if options.key? :casein_truncate
53
+ contents = truncate(contents, length: options[:casein_truncate], omission: '...')
54
+ end
58
55
 
59
- link_to "#{contents}".html_safe, link, options
56
+ link_to contents.to_s.html_safe, link, options
60
57
  end
61
58
 
62
- def casein_table_cell_no_link contents, options = {}
63
-
64
- if options.key? :casein_truncate
65
- contents = truncate(contents, length: options[:casein_truncate], omission: "...")
66
- end
59
+ def casein_table_cell_no_link(contents, options = {})
60
+ if options.key? :casein_truncate
61
+ contents = truncate(contents, length: options[:casein_truncate], omission: '...')
62
+ end
67
63
 
68
- "<div class='no-link'>#{contents}</div>".html_safe
64
+ "<div class='no-link'>#{contents}</div>".html_safe
69
65
  end
70
66
 
71
- def casein_span_icon icon_name
67
+ def casein_span_icon(icon_name)
72
68
  "<span class='glyphicon glyphicon-#{icon_name}' title='#{icon_name.titleize}'></span>"
73
69
  end
74
70
 
75
- def casein_show_icon icon_name
76
- "<div class='icon'>#{casein_span_icon icon_name}</div>".html_safe
77
- end
71
+ def casein_show_icon(icon_name)
72
+ "<div class='icon'>#{casein_span_icon icon_name}</div>".html_safe
73
+ end
78
74
 
79
- def casein_show_row_icon icon_name
75
+ def casein_show_row_icon(icon_name)
80
76
  "<div class='iconRow'>#{casein_span_icon icon_name}</div>".html_safe
81
- end
77
+ end
82
78
 
83
- def casein_format_date date, format = "%b %d, %Y"
79
+ def casein_format_date(date, format = '%b %d, %Y')
84
80
  date.strftime(format)
85
81
  end
86
82
 
87
- def casein_format_time time, format = "%H:%M"
83
+ def casein_format_time(time, format = '%H:%M')
88
84
  time.strftime(format)
89
85
  end
90
86
 
91
- def casein_format_datetime datetime, format = "%b %d, %Y %H:%M"
87
+ def casein_format_datetime(datetime, format = '%b %d, %Y %H:%M')
92
88
  datetime.strftime(format)
93
89
  end
94
90
 
95
- def casein_sort_link title, column, options = {}
96
- condition = options[:unless] if options.has_key?(:unless)
91
+ def casein_sort_link(title, column, options = {})
92
+ condition = options[:unless] if options.key?(:unless)
97
93
  icon_to_show_html = "<div class='table-header-icon'>&nbsp;</div>".html_safe
98
94
  if params[:c].to_s == column.to_s
99
95
  icon_to_show = params[:d] == 'down' ? 'chevron-up' : 'chevron-down'
100
96
  icon_to_show_html = "<div class='table-header-icon glyphicon glyphicon-#{icon_to_show}'></div>".html_safe
101
97
  end
102
98
  sort_dir = params[:d] == 'down' ? 'up' : 'down'
103
- link_to_unless(condition, title, request.parameters.merge({ c: column, d: sort_dir })) + icon_to_show_html
99
+ link_to_unless(condition, title, request.parameters.merge(c: column, d: sort_dir)) + icon_to_show_html
104
100
  end
105
101
 
106
- def casein_yes_no_label value
102
+ def casein_yes_no_label(value)
107
103
  if value
108
- return "<span class='label label-success'>Yes</span>".html_safe
104
+ "<span class='label label-success'>Yes</span>".html_safe
109
105
  else
110
- return "<span class='label label-danger'>No</span>".html_safe
106
+ "<span class='label label-danger'>No</span>".html_safe
111
107
  end
112
108
  end
113
109
 
114
- def casein_no_yes_label value
110
+ def casein_no_yes_label(value)
115
111
  if value
116
- return "<span class='label label-danger'>Yes</span>".html_safe
112
+ "<span class='label label-danger'>Yes</span>".html_safe
117
113
  else
118
- return "<span class='label label-success'>No</span>".html_safe
114
+ "<span class='label label-success'>No</span>".html_safe
119
115
  end
120
116
  end
121
117
 
122
- # Styled form tag helpers
118
+ # Styled form tag helpers
123
119
 
124
- def casein_text_field form, obj, attribute, options = {}
125
- casein_form_tag_wrapper(form.text_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
126
- end
120
+ def casein_text_field(form, obj, attribute, options = {})
121
+ casein_form_tag_wrapper(form.text_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
122
+ end
127
123
 
128
- def casein_password_field form, obj, attribute, options = {}
129
- casein_form_tag_wrapper(form.password_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
130
- end
124
+ def casein_password_field(form, obj, attribute, options = {})
125
+ casein_form_tag_wrapper(form.password_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
126
+ end
131
127
 
132
- def casein_text_area form, obj, attribute, options = {}
133
- casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
134
- end
128
+ def casein_text_area(form, obj, attribute, options = {})
129
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
130
+ end
135
131
 
136
- def casein_text_area_big form, obj, attribute, options = {}
137
- casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
138
- end
132
+ def casein_text_area_big(form, obj, attribute, options = {})
133
+ casein_form_tag_wrapper(form.text_area(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
134
+ end
139
135
 
140
- def casein_check_box form, obj, attribute, options = {}
141
- form_tag = "<div class='check-box'>#{form.check_box(attribute, strip_casein_options(options))}</div>".html_safe
136
+ def casein_check_box(form, obj, attribute, options = {})
137
+ form_tag = "<div class='check-box'>#{form.check_box(attribute, strip_casein_options(options))}</div>".html_safe
142
138
  casein_form_tag_wrapper(form_tag, form, obj, attribute, options).html_safe
143
- end
139
+ end
144
140
 
145
- def casein_check_box_group form, obj, check_boxes = {}
146
- form_tags = ""
141
+ def casein_check_box_group(form, obj, check_boxes = {})
142
+ form_tags = ''
147
143
 
148
- for check_box in check_boxes
144
+ check_boxes.each do |check_box|
149
145
  form_tags += casein_check_box form, obj, check_box[0], check_box[1]
150
146
  end
151
147
 
152
148
  casein_form_tag_wrapper(form_tag, form, obj, attribute, options)
153
149
  end
154
150
 
155
- def casein_radio_button form, obj, attribute, tag_value, options = {}
156
- form_tag = form.radio_button(obj, attribute, tag_value, strip_casein_options(options))
151
+ def casein_radio_button(form, obj, attribute, tag_value, options = {})
152
+ form_tag = form.radio_button(obj, attribute, tag_value, strip_casein_options(options))
157
153
 
158
- if options.key? :casein_button_label
159
- form_tag = "<div>" + form_tag + "<span class=\"rcText\">#{options[:casein_button_label]}</span></div>".html_safe
160
- end
154
+ if options.key? :casein_button_label
155
+ form_tag = '<div>' + form_tag + "<span class=\"rcText\">#{options[:casein_button_label]}</span></div>".html_safe
156
+ end
161
157
 
162
- casein_form_tag_wrapper(form_tag, form, obj, attribute, options).html_safe
163
- end
158
+ casein_form_tag_wrapper(form_tag, form, obj, attribute, options).html_safe
159
+ end
164
160
 
165
- def casein_radio_button_group form, obj, radio_buttons = {}
166
- form_tags = ""
161
+ def casein_radio_button_group(form, obj, radio_buttons = {})
162
+ form_tags = ''
167
163
 
168
- for radio_button in radio_buttons
164
+ radio_buttons.each do |_radio_button|
169
165
  form_tags += casein_radio_button form, obj, check_box[0], check_box[1], check_box[2]
170
166
  end
171
167
 
172
168
  casein_form_tag_wrapper(form_tag, form, obj, attribute, options).html_safe
173
169
  end
174
170
 
175
- def casein_select form, obj, attribute, option_tags, options = {}, html_options = {}
176
-
177
- html_options_to_use = merged_class_hash(options, 'form-control') #legacy support
171
+ def casein_select(form, obj, attribute, option_tags, options = {}, html_options = {})
172
+ html_options_to_use = merged_class_hash(options, 'form-control') # legacy support
178
173
  html_options_to_use = options_hash_with_merged_classes(html_options, html_options_to_use[:class])
179
-
180
- casein_form_tag_wrapper(form.select(attribute, option_tags, strip_casein_options(options), html_options_to_use), form, obj, attribute, options).html_safe
181
- end
182
174
 
183
- def casein_time_zone_select form, obj, attribute, option_tags, options = {}
184
- casein_form_tag_wrapper(form.time_zone_select(attribute, option_tags, strip_casein_options(options), merged_class_hash(options, 'form-control')), form, obj, attribute, options).html_safe
185
- end
175
+ casein_form_tag_wrapper(form.select(attribute, option_tags, strip_casein_options(options), html_options_to_use), form, obj, attribute, options).html_safe
176
+ end
186
177
 
187
- #e.g. casein_collection_select f, f.object, :article, :author_id, Author.all, :id, :name, { prompt: 'Select author' }
188
- def casein_collection_select form, obj, object_name, attribute, collection, value_method, text_method, options = {}
189
- casein_form_tag_wrapper(collection_select(object_name, attribute, collection, value_method, text_method, strip_casein_options(options), merged_class_hash(options, 'form-control')), form, obj, attribute, options).html_safe
190
- end
178
+ def casein_time_zone_select(form, obj, attribute, option_tags, options = {})
179
+ casein_form_tag_wrapper(form.time_zone_select(attribute, option_tags, strip_casein_options(options), merged_class_hash(options, 'form-control')), form, obj, attribute, options).html_safe
180
+ end
191
181
 
192
- def casein_date_select form, obj, attribute, options = {}
193
- casein_form_tag_wrapper("<div class='casein-date-select'>".html_safe + form.date_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + "</div>".html_safe, form, obj, attribute, options).html_safe
194
- end
182
+ # e.g. casein_collection_select f, f.object, :article, :author_id, Author.all, :id, :name, { prompt: 'Select author' }
183
+ def casein_collection_select(form, obj, object_name, attribute, collection, value_method, text_method, options = {})
184
+ casein_form_tag_wrapper(collection_select(object_name, attribute, collection, value_method, text_method, strip_casein_options(options), merged_class_hash(options, 'form-control')), form, obj, attribute, options).html_safe
185
+ end
186
+
187
+ def casein_date_select(form, obj, attribute, options = {})
188
+ casein_form_tag_wrapper("<div class='casein-date-select'>".html_safe + form.date_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + '</div>'.html_safe, form, obj, attribute, options).html_safe
189
+ end
195
190
 
196
- def casein_time_select form, obj, attribute, options = {}
197
- casein_form_tag_wrapper("<div class='casein-time-select'>".html_safe + form.time_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + "</div>".html_safe, form, obj, attribute, options).html_safe
198
- end
191
+ def casein_time_select(form, obj, attribute, options = {})
192
+ casein_form_tag_wrapper("<div class='casein-time-select'>".html_safe + form.time_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + '</div>'.html_safe, form, obj, attribute, options).html_safe
193
+ end
199
194
 
200
- def casein_datetime_select form, obj, attribute, options = {}
201
- casein_form_tag_wrapper("<div class='casein-datetime-select'>".html_safe + form.datetime_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + "</div>".html_safe, form, obj, attribute, options).html_safe
202
- end
195
+ def casein_datetime_select(form, obj, attribute, options = {})
196
+ casein_form_tag_wrapper("<div class='casein-datetime-select'>".html_safe + form.datetime_select(attribute, strip_casein_options(options), merged_class_hash(options, 'form-control')) + '</div>'.html_safe, form, obj, attribute, options).html_safe
197
+ end
203
198
 
204
- def casein_file_field form, obj, object_name, attribute, options = {}
205
- class_hash = merged_class_hash(options, 'form-control')
206
- contents = "<div class='#{class_hash[:class]}'>" + form.file_field(attribute, strip_casein_options(options)) + '</div>'
199
+ def casein_file_field(form, obj, _object_name, attribute, options = {})
200
+ class_hash = merged_class_hash(options, 'form-control')
201
+ contents = "<div class='#{class_hash[:class]}'>" + form.file_field(attribute, strip_casein_options(options)) + '</div>'
207
202
 
208
203
  if options.key? :casein_contents_preview
209
204
  contents = options[:casein_contents_preview].html_safe + contents.html_safe
210
205
  end
211
206
 
212
- casein_form_tag_wrapper(contents, form, obj, attribute, options).html_safe
213
- end
207
+ casein_form_tag_wrapper(contents, form, obj, attribute, options).html_safe
208
+ end
214
209
 
215
- def casein_hidden_field form, obj, attribute, options = {}
216
- form.hidden_field(attribute, strip_casein_options(options)).html_safe
217
- end
210
+ def casein_hidden_field(form, _obj, attribute, options = {})
211
+ form.hidden_field(attribute, strip_casein_options(options)).html_safe
212
+ end
218
213
 
219
- def casein_color_field form, obj, attribute, options = {}
220
- casein_form_tag_wrapper(form.color_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
214
+ def casein_color_field(form, obj, attribute, options = {})
215
+ casein_form_tag_wrapper(form.color_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
221
216
  end
222
217
 
223
- def casein_search_field form, obj, attribute, options = {}
218
+ def casein_search_field(form, obj, attribute, options = {})
224
219
  casein_form_tag_wrapper(form.search_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
225
220
  end
226
221
 
227
- def casein_telephone_field form, obj, attribute, options = {}
222
+ def casein_telephone_field(form, obj, attribute, options = {})
228
223
  casein_form_tag_wrapper(form.telephone_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
229
224
  end
230
225
 
231
- def casein_url_field form, obj, attribute, options = {}
226
+ def casein_url_field(form, obj, attribute, options = {})
232
227
  casein_form_tag_wrapper(form.url_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
233
228
  end
234
229
 
235
- def casein_email_field form, obj, attribute, options = {}
230
+ def casein_email_field(form, obj, attribute, options = {})
236
231
  casein_form_tag_wrapper(form.email_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
237
232
  end
238
233
 
239
- def casein_date_field form, obj, attribute, options = {}
234
+ def casein_date_field(form, obj, attribute, options = {})
240
235
  casein_form_tag_wrapper(form.date_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
241
236
  end
242
237
 
243
- def casein_datetime_field form, obj, attribute, options = {}
238
+ def casein_datetime_field(form, obj, attribute, options = {})
244
239
  casein_form_tag_wrapper(form.datetime_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
245
240
  end
246
241
 
247
- def casein_datetime_local_field form, obj, attribute, options = {}
242
+ def casein_datetime_local_field(form, obj, attribute, options = {})
248
243
  casein_form_tag_wrapper(form.datetime_local_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
249
244
  end
250
245
 
251
- def casein_month_field form, obj, attribute, options = {}
246
+ def casein_month_field(form, obj, attribute, options = {})
252
247
  casein_form_tag_wrapper(form.month_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
253
248
  end
254
249
 
255
- def casein_week_field form, obj, attribute, options = {}
250
+ def casein_week_field(form, obj, attribute, options = {})
256
251
  casein_form_tag_wrapper(form.week_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
257
252
  end
258
253
 
259
- def casein_time_field form, obj, attribute, options = {}
254
+ def casein_time_field(form, obj, attribute, options = {})
260
255
  casein_form_tag_wrapper(form.time_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
261
256
  end
262
257
 
263
- def casein_number_field form, obj, attribute, options = {}
258
+ def casein_number_field(form, obj, attribute, options = {})
264
259
  casein_form_tag_wrapper(form.number_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
265
260
  end
266
261
 
267
- def casein_range_field form, obj, attribute, options = {}
262
+ def casein_range_field(form, obj, attribute, options = {})
268
263
  casein_form_tag_wrapper(form.range_field(attribute, strip_casein_options(options_hash_with_merged_classes(options, 'form-control'))), form, obj, attribute, options).html_safe
269
264
  end
270
265
 
271
- def casein_custom_field form, obj, attribute, custom_contents, options = {}
266
+ def casein_custom_field(form, obj, attribute, custom_contents, options = {})
272
267
  casein_form_tag_wrapper(custom_contents, form, obj, attribute, options).html_safe
273
268
  end
274
269
 
275
270
  protected
276
271
 
277
- def strip_casein_options options
278
- options.reject { |key, value| key.to_s.include? "casein_" }
272
+ def strip_casein_options(options)
273
+ options.reject { |key, _value| key.to_s.include? 'casein_' }
279
274
  end
280
275
 
281
- def merged_class_hash options, new_class
282
- if options.key? :class
283
- new_class += " #{options[:class]}"
284
- end
276
+ def merged_class_hash(options, new_class)
277
+ new_class += " #{options[:class]}" if options.key? :class
285
278
 
286
279
  { class: new_class }
287
280
  end
288
281
 
289
- def options_hash_with_merged_classes options, new_class
290
- if options.key? :class
291
- new_class += " #{options[:class]}"
292
- end
282
+ def options_hash_with_merged_classes(options, new_class)
283
+ new_class += " #{options[:class]}" if options.key? :class
293
284
  options[:class] = new_class
294
285
  options
295
286
  end
296
287
 
297
- def casein_form_tag_wrapper form_tag, form, obj, attribute, options = {}
298
- unless options.key? :casein_label
299
- human_attribute_name = attribute.to_s.humanize.titleize
300
- else
301
- human_attribute_name = options[:casein_label]
302
- end
288
+ def casein_form_tag_wrapper(form_tag, form, obj, attribute, options = {})
289
+ human_attribute_name = if options.key? :casein_label
290
+ options[:casein_label]
291
+ else
292
+ attribute.to_s.humanize.titleize
293
+ end
303
294
 
304
- sublabel = ""
295
+ sublabel = ''
305
296
 
306
297
  if options.key? :casein_sublabel
307
298
  sublabel = " <small>#{options[:casein_sublabel]}</small>".html_safe
308
299
  end
309
300
 
310
- html = ""
301
+ html = ''
311
302
 
312
303
  if obj && obj.errors[attribute].any?
313
304
  html += "<div class='form-group has-error'>"
314
- html += form.label(attribute, "#{human_attribute_name} #{obj.errors[attribute].first}".html_safe, class: "control-label")
315
- else
305
+ html += form.label(attribute, "#{human_attribute_name} #{obj.errors[attribute].first}".html_safe, class: 'control-label')
306
+ else
316
307
  html += "<div class='form-group'>"
317
- html += form.label(attribute, "#{human_attribute_name}#{sublabel}".html_safe, class: "control-label")
318
- end
308
+ html += form.label(attribute, "#{human_attribute_name}#{sublabel}".html_safe, class: 'control-label')
309
+ end
319
310
 
320
- html += "<div class='well'>#{form_tag}</div></div>"
311
+ html += "<div class='well'>#{form_tag}</div></div>"
321
312
  end
322
313
  end
323
314
  end