camaleon_cms 2.3.3 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +7 -12
- data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +1 -2
- data/app/assets/javascripts/camaleon_cms/admin/_data.js +1 -0
- data/app/assets/javascripts/camaleon_cms/admin/_post.js +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/_posttype.js.coffee +21 -0
- data/app/assets/javascripts/camaleon_cms/admin/admin-manifest.js +2 -0
- data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/fr.js +49 -0
- data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +11 -6
- data/app/controllers/camaleon_cms/admin/appearances/themes_controller.rb +6 -0
- data/app/controllers/camaleon_cms/admin/media_controller.rb +3 -0
- data/app/controllers/camaleon_cms/admin/users_controller.rb +3 -0
- data/app/controllers/camaleon_cms/camaleon_controller.rb +5 -0
- data/app/controllers/camaleon_cms/frontend_controller.rb +1 -1
- data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +1 -1
- data/app/decorators/camaleon_cms/site_decorator.rb +1 -1
- data/app/decorators/camaleon_cms/user_decorator.rb +4 -0
- data/app/helpers/camaleon_cms/admin/custom_fields_helper.rb +4 -4
- data/app/helpers/camaleon_cms/camaleon_helper.rb +5 -0
- data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +16 -16
- data/app/helpers/camaleon_cms/hooks_helper.rb +10 -4
- data/app/helpers/camaleon_cms/plugins_helper.rb +1 -1
- data/app/helpers/camaleon_cms/session_helper.rb +9 -4
- data/app/helpers/camaleon_cms/short_code_helper.rb +1 -1
- data/app/helpers/camaleon_cms/theme_helper.rb +1 -1
- data/app/helpers/camaleon_cms/uploader_helper.rb +10 -7
- data/app/mailers/camaleon_cms/html_mailer.rb +33 -17
- data/app/models/camaleon_cms/ability.rb +2 -2
- data/app/models/camaleon_cms/nav_menu.rb +2 -2
- data/app/models/camaleon_cms/nav_menu_item.rb +5 -3
- data/app/models/camaleon_cms/site.rb +5 -101
- data/app/models/camaleon_cms/user.rb +8 -144
- data/app/models/camaleon_cms/user_relationship.rb +1 -1
- data/app/models/camaleon_cms/user_role.rb +0 -2
- data/app/models/concerns/camaleon_cms/custom_fields_read.rb +14 -7
- data/app/models/concerns/camaleon_cms/metas.rb +5 -4
- data/app/models/concerns/camaleon_cms/site_default_settings.rb +87 -0
- data/app/models/concerns/camaleon_cms/user_methods.rb +142 -0
- data/app/uploaders/camaleon_cms_aws_uploader.rb +13 -4
- data/app/uploaders/camaleon_cms_uploader.rb +3 -1
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_menus.html.erb +11 -5
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_external_menu.html.erb +8 -0
- data/app/views/camaleon_cms/admin/settings/_media_settings.html.erb +4 -0
- data/app/views/camaleon_cms/admin/settings/custom_fields/_get_items.html.erb +155 -154
- data/app/views/camaleon_cms/admin/settings/custom_fields/_render.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkbox.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkboxes.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb +2 -5
- data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/post_types/_form.html.erb +24 -16
- data/app/views/camaleon_cms/admin/users/form.html.erb +2 -2
- data/app/views/camaleon_cms/default_theme/single.html.erb +1 -1
- data/app/views/layouts/camaleon_cms/admin.html.erb +2 -2
- data/config/initializers/model_alias.rb +10 -3
- data/config/locales/camaleon_cms/admin/en.yml +10 -0
- data/config/locales/camaleon_cms/admin/fr.yml +663 -0
- data/config/locales/camaleon_cms/common.yml +66 -0
- data/config/routes/frontend.rb +1 -1
- data/config/system.json +2 -2
- data/db/migrate/20150611161134_post_table_into_utf8.rb +6 -5
- data/lib/camaleon_cms/engine.rb +3 -0
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/ext/string.rb +1 -54
- data/lib/plugin_routes.rb +5 -0
- data/spec/decorators/post_type_spec.rb +13 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +186 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/features/categories_spec.rb +25 -0
- data/spec/features/comments_spec.rb +45 -0
- data/spec/features/contact_form_spec.rb +53 -0
- data/spec/features/content_groups_spec.rb +45 -0
- data/spec/features/custom_fields_spec.rb +47 -0
- data/spec/features/frontend/pages_spec.rb +5 -0
- data/spec/features/languages_spec.rb +27 -0
- data/spec/features/media_spec.rb +50 -0
- data/spec/features/menus_spec.rb +46 -0
- data/spec/features/pages_spec.rb +30 -0
- data/spec/features/plugins_spec.rb +29 -0
- data/spec/features/posts_spec.rb +36 -0
- data/spec/features/session_spec.rb +52 -0
- data/spec/features/settings_spec.rb +17 -0
- data/spec/features/shortcodes_spec.rb +11 -0
- data/spec/features/sites_spec.rb +45 -0
- data/spec/features/tags_spec.rb +25 -0
- data/spec/features/themes_spec.rb +18 -0
- data/spec/features/user_roles_spec.rb +60 -0
- data/spec/features/users_spec.rb +79 -0
- data/spec/features/widgets_spec.rb +50 -0
- data/spec/helpers/email_helper_spec.rb +16 -0
- data/spec/mailers/send_mail_spec.rb +37 -0
- data/spec/rails_helper.rb +1 -0
- data/spec/routing/post_type_routes_spec.rb +12 -0
- data/spec/spec_helper.rb +191 -0
- data/spec/support/common.rb +113 -0
- data/spec/support/wait_for_ajax.rb +36 -0
- metadata +326 -3
@@ -5,174 +5,175 @@
|
|
5
5
|
@index = "#{@item_id}_#{Time.now.to_i}_#{rand(999...99999)}"
|
6
6
|
@field_config = cama_custom_field_elements[@key.to_sym]
|
7
7
|
colors = ['primary','success','warning','colorful','info','danger']
|
8
|
+
unless @field_config.nil?
|
8
9
|
%>
|
9
|
-
|
10
|
-
<div
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
10
|
+
<div id="panel-field<%= @index %>" class="panel panel-default panel-<%= colors.sample %> panel-item <%= 'panel-toggled' if @item_options_value[:panel_hidden].to_s.to_bool %>">
|
11
|
+
<div class="panel-heading">
|
12
|
+
<h3 class="panel-title"><span class="span-title"><%= @item_value[:name]? @item_value[:name] : "#{t('camaleon_cms.admin.settings.untitled')}
|
13
|
+
#{@field_config[:label]}" %>
|
14
|
+
</span> - <%= @field_config[:label] %>
|
15
|
+
<%= t('camaleon_cms.admin.settings.field') %></h3>
|
16
|
+
<ul class="panel-controls">
|
17
|
+
<li><a class="panel-sortable" href="#" title="<%= t('camaleon_cms.admin.button.sortable')%>" data-toggle="tooltip" data-placement="left"><span class="fa fa-arrows"></span></a></li>
|
18
|
+
<li><a class="panel-delete" href="#" title="<%= t('camaleon_cms.admin.button.delete')%>" data-toggle="tooltip" data-placement="left"><span class="fa fa-times text-danger"></span></a></li>
|
19
|
+
<li><a class="panel-collapse" href="#"><span class="fa fa-angle-down"></span></a></li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
<div class="panel-body">
|
23
|
+
<%= hidden_field(:fields, :id, index: @index, value: @item_id) %>
|
24
|
+
<%= hidden_field(:field_options, :field_key, index: @index, value: @key) %>
|
25
|
+
<%= hidden_field(:field_options, :label_eval, index: @index, value: @item_options_value[:label_eval].to_s.cama_true? ? 'true' : '') %>
|
26
|
+
<%= hidden_field(:field_options, :panel_hidden, index: @index, value: @item_options_value[:panel_hidden], class: 'input-panel-hidden') %>
|
27
|
+
<div class="form-group input-group-sm">
|
28
|
+
<label for=""><%= t('camaleon_cms.admin.table.name') %></label><br>
|
29
|
+
<%= text_field(:fields, :name, class: "form-control text-title", index: @index, value: @item_value[:name]? @item_value[:name] : "#{t('camaleon_cms.admin.settings.untitled')} #{@field_config[:label]}") %>
|
30
|
+
</div>
|
31
|
+
<div class="form-group input-group-sm">
|
32
|
+
<label for=""><%= t('camaleon_cms.admin.table.slug') %></label><br>
|
33
|
+
<%= text_field(:fields, :slug, class: "form-control text-slug", index: @index, value: @item_value[:slug]) %>
|
34
|
+
</div>
|
35
|
+
<div class="form-group">
|
36
|
+
<label for=""><%= t('camaleon_cms.admin.table.description') %></label><br>
|
37
|
+
<%= text_area(:fields, :description, class: "form-control", index: @index, value: @item_value[:description]) %>
|
38
|
+
</div>
|
39
|
+
<%
|
40
|
+
html = ''
|
41
|
+
if @field_config[:extra_fields].present?
|
42
|
+
@field_config[:extra_fields].each do |input|
|
43
|
+
type = input[:type]
|
44
|
+
html += '<div class="form-group">'
|
45
|
+
html += "<label>#{input[:label]}</label>" if input[:label].present?
|
46
|
+
case type
|
47
|
+
when 'select'
|
48
|
+
html += "<div class='form-group'> <select id=\"field_options_#{@index}_#{input[:key]}\" name=\"field_options[#{@index}][#{input[:key]}]\" class='form-control'>"
|
49
|
+
input[:values].each do |val|
|
50
|
+
html += "<option value='#{val[:value]}' #{"selected" if @item_options_value.present? ? (val[:value] == @item_options_value[input[:key].to_sym]) : false}>#{val[:label]}</option>"
|
51
|
+
end
|
52
|
+
html += "</select> </div>"
|
53
|
+
when 'radio'
|
54
|
+
input[:values].each do |val|
|
55
|
+
html += "<div class='radio'><label>#{radio_button(:field_options, input[:key],val[:value], index: @index, checked: @item_options_value.present? ? (val[:value] == @item_options_value[input[:key].to_sym]) : (val[:value] == '0')) } #{val[:label]}</label></div>"
|
56
|
+
end
|
57
|
+
when 'checkbox'
|
58
|
+
input[:values].each do |val|
|
59
|
+
html += "<div class='checkbox'><label><input type=\"checkbox\" id=\"field_options_#{@index}_#{input[:key]}\" name=\"field_options[#{@index}][#{input[:key]}][]\" #{"checked" if @item_options_value[input[:key].to_sym].to_s.include?(val[:value].to_s) rescue false} value=\"#{val[:value]}\"> #{val[:label]} </label></div>"
|
60
|
+
end
|
61
|
+
when 'text_area'
|
62
|
+
html += "#{text_area(:field_options, input[:key], index: @index , value: @item_options_value[input[:key].to_sym] || '', class: 'form-control') }"
|
63
|
+
else
|
64
|
+
html += "#{text_field(:field_options, input[:key], index: @index , value: @item_options_value[input[:key].to_sym] || '', class: 'form-control') }"
|
60
65
|
end
|
61
|
-
|
62
|
-
html +=
|
63
|
-
else
|
64
|
-
html += "#{text_field(:field_options, input[:key], index: @index , value: @item_options_value[input[:key].to_sym] || '', class: 'form-control') }"
|
66
|
+
html += "<small>#{input[:description]}</small>" if input[:description].present?
|
67
|
+
html += '</div>'
|
65
68
|
end
|
66
|
-
html += "<small>#{input[:description]}</small>" if input[:description].present?
|
67
|
-
html += '</div>'
|
68
69
|
end
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
70
|
+
%>
|
71
|
+
<div>
|
72
|
+
<%= raw html %>
|
73
|
+
</div>
|
74
|
+
<% if @field_config[:options][:multiple_options].present? %>
|
75
|
+
<div class="form-group">
|
76
|
+
<strong><%= @field_config[:options][:multiple_options][:label] %></strong>
|
77
|
+
<div class="sortable-fields-options">
|
78
|
+
<div id="clone<%= @index %>" class="hidden">
|
79
|
+
<div class="actions">
|
80
|
+
<i class="fa fa-arrows"></i> <i class="fa fa-times text-danger"></i>
|
81
|
+
</div>
|
82
|
+
<div class="inputs input-group input-group-sm">
|
83
|
+
<input type="text" name="field_options[<%= @index %>][multiple_options][][title]" placeholder="Option title" class="form-control option-name" style="width: 160px;">
|
84
|
+
<input type="text" name="field_options[<%= @index %>][multiple_options][][value]" placeholder="Value" class="form-control option-value" style="width: 120px;">
|
85
|
+
<% if @field_config[:options][:multiple_options][:default].present? %>
|
86
|
+
<div class="<%= @field_config[:options][:multiple_options][:default] %>" style="float: right; width: auto;">
|
87
|
+
<label><input type="<%= @field_config[:options][:multiple_options][:default] %>" class="option-default" value="1" name="field_options[<%= @index %>][multiple_options][][default]"> <%= t('camaleon_cms.admin.table.default') %> </label>
|
88
|
+
</div>
|
89
|
+
<% end %>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
92
93
|
|
94
|
+
<ul id="sortable<%= @index %>" >
|
93
95
|
|
94
|
-
|
96
|
+
</ul>
|
97
|
+
<% if @field_config[:options][:multiple_options][:use_not_default].present? %>
|
98
|
+
<div class="radio_none_option">
|
99
|
+
<label><input type="radio" class="option-default" value="none" name="field_options[<%= @index %>][multiple_options][][default]"> <%= t('camaleon_cms.admin.table.no_default') %> </label>
|
100
|
+
</div>
|
101
|
+
<% end %>
|
95
102
|
|
96
|
-
|
97
|
-
|
98
|
-
<div class="radio_none_option">
|
99
|
-
<label><input type="radio" class="option-default" value="none" name="field_options[<%= @index %>][multiple_options][][default]"> <%= t('camaleon_cms.admin.table.no_default') %> </label>
|
103
|
+
<div style="margin-top: 4px">
|
104
|
+
<a id="add_btn<%= @index %>" href="#" class="btn btn-default btn-sm"> <i class="fa fa-plus"></i> <%= t('camaleon_cms.admin.button.add_option')%></a>
|
100
105
|
</div>
|
101
|
-
|
106
|
+
<script>
|
102
107
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
108
|
+
var function_init_options<%= @index %> = function(){
|
109
|
+
var that = this;
|
110
|
+
var $panel = $( "#panel-field<%= @index %>" );
|
111
|
+
var $sortable = $( "#sortable<%= @index %>" );
|
112
|
+
var option_default_html = $('#clone<%= @index %>').html();
|
113
|
+
var option_default_values = <%= raw(@item_options_value[:multiple_options].present? ? @item_options_value[:multiple_options].to_json : '[]') %>
|
114
|
+
function add_option_default(values){
|
115
|
+
if(!values) values = {}
|
116
|
+
values = $.extend({title: I18n("msg.option_title"), value: '1',default: false},values)
|
117
|
+
var $option = $('<li>'+option_default_html+'</li>');
|
118
|
+
$option.find('.option-name').val(values.title);
|
119
|
+
$option.find('.option-value').val(values.value);
|
120
|
+
if(values.default && values.default != 'none') $option.find('.option-default').attr('checked','checked').prop('checked',true)
|
121
|
+
if(values.default && values.default == 'none') $panel.find('.radio_none_option input').attr('checked','checked').prop('checked',true)
|
107
122
|
|
108
|
-
|
109
|
-
|
110
|
-
var $panel = $( "#panel-field<%= @index %>" );
|
111
|
-
var $sortable = $( "#sortable<%= @index %>" );
|
112
|
-
var option_default_html = $('#clone<%= @index %>').html();
|
113
|
-
var option_default_values = <%= raw(@item_options_value[:multiple_options].present? ? @item_options_value[:multiple_options].to_json : '[]') %>
|
114
|
-
function add_option_default(values){
|
115
|
-
if(!values) values = {}
|
116
|
-
values = $.extend({title: I18n("msg.option_title"), value: '1',default: false},values)
|
117
|
-
var $option = $('<li>'+option_default_html+'</li>');
|
118
|
-
$option.find('.option-name').val(values.title);
|
119
|
-
$option.find('.option-value').val(values.value);
|
120
|
-
if(values.default && values.default != 'none') $option.find('.option-default').attr('checked','checked').prop('checked',true)
|
121
|
-
if(values.default && values.default == 'none') $panel.find('.radio_none_option input').attr('checked','checked').prop('checked',true)
|
123
|
+
$sortable.append($option)
|
124
|
+
};
|
122
125
|
|
123
|
-
|
124
|
-
|
126
|
+
if(option_default_values.length > 0){
|
127
|
+
$.each(option_default_values, function(i, value){
|
128
|
+
add_option_default(value);
|
129
|
+
})
|
130
|
+
}else{
|
131
|
+
add_option_default({default: true});
|
132
|
+
}
|
125
133
|
|
126
|
-
|
127
|
-
|
128
|
-
|
134
|
+
$('#add_btn<%= @index %>').click(function(){
|
135
|
+
add_option_default({
|
136
|
+
value: $sortable.children('li').size() + 1
|
137
|
+
});
|
138
|
+
return false;
|
139
|
+
});
|
140
|
+
$sortable.sortable({
|
141
|
+
handle: ".fa-arrows"
|
142
|
+
});
|
143
|
+
$sortable.on('click','.fa-times', function(){
|
144
|
+
$(this).closest('li').remove()
|
145
|
+
return false;
|
129
146
|
})
|
130
|
-
|
131
|
-
add_option_default({default: true});
|
147
|
+
$('#clone<%= @index %>').remove();
|
132
148
|
}
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
value: $sortable.children('li').size() + 1
|
137
|
-
});
|
138
|
-
return false;
|
139
|
-
});
|
140
|
-
$sortable.sortable({
|
141
|
-
handle: ".fa-arrows"
|
142
|
-
});
|
143
|
-
$sortable.on('click','.fa-times', function(){
|
144
|
-
$(this).closest('li').remove()
|
145
|
-
return false;
|
146
|
-
})
|
147
|
-
$('#clone<%= @index %>').remove();
|
148
|
-
}
|
149
|
-
jQuery(function_init_options<%= @index %>);
|
150
|
-
</script>
|
149
|
+
jQuery(function_init_options<%= @index %>);
|
150
|
+
</script>
|
151
|
+
</div>
|
151
152
|
</div>
|
152
|
-
|
153
|
-
<% end %>
|
153
|
+
<% end %>
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
155
|
+
<% if @field_config[:options].key?(:default_value) %>
|
156
|
+
<div class="form-group input-group-sm">
|
157
|
+
<label><%= t('camaleon_cms.admin.table.default_value')%></label>
|
158
|
+
<%= text_field(:field_options, 'default_value', index: @index, value: @item_options_value[:default_value] || @field_config[:options][:default_value], class: 'form-control') %>
|
159
|
+
</div>
|
160
|
+
<% end %>
|
161
161
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
</div>
|
162
|
+
<% if @field_config[:options][:multiple] || @field_config[:options][:required] || @field_config[:options][:translate] %>
|
163
|
+
<strong><%= t('camaleon_cms.admin.table.options_field')%></strong>
|
164
|
+
<% end %>
|
165
|
+
<% if @field_config[:options][:multiple] %>
|
166
|
+
<div class="checkbox"><label><%= check_box(:field_options, 'multiple', index: @index, checked: @item_options_value[:multiple].to_s.to_bool) %> <%= t('camaleon_cms.admin.table.multiple_field_int') %> </label> <%= raw cama_html_tooltip(t('camaleon_cms.admin.table.multiple_field_int'),'right')%></div>
|
167
|
+
<% end %>
|
168
|
+
<% if @field_config[:options][:required] %>
|
169
|
+
<div class="checkbox"><label><%= check_box(:field_options, 'required', index: @index, checked: @item_options_value[:required].to_s.to_bool) %> <%= t('camaleon_cms.admin.table.required_field_int') %> </label> <%= raw cama_html_tooltip(t('camaleon_cms.admin.table.required_field_int'),'right')%></div>
|
170
|
+
<% end %>
|
171
|
+
<% if @field_config[:options][:translate] %>
|
172
|
+
<div class="checkbox"><label><%= check_box(:field_options, 'translate', index: @index, checked: @item_options_value[:translate].to_s.to_bool) %> <%= t('camaleon_cms.admin.table.translate_field_int') %> </label> <%= raw cama_html_tooltip(t('camaleon_cms.admin.table.translate_field_int'),'right')%></div>
|
173
|
+
<% end %>
|
174
|
+
<% if false && @field_config[:options][:show_frontend] %>
|
175
|
+
<div class="checkbox"><label><%= check_box(:field_options, 'show_frontend', index: @index, checked: @item_options_value[:show_frontend].to_s.to_bool) %> <%= t('camaleon_cms.admin.table.show_in_frontend') %> </label> <%= raw cama_html_tooltip( t('camaleon_cms.admin.table.show_in_frontend'),'right')%></div>
|
176
|
+
<% end %>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
<% end %>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<p><small><%= field.options[:label_eval].present? ? eval(field.description) : field.description %></small></p>
|
31
31
|
<% end %>
|
32
32
|
<div class="editor-custom-fields content-field-<%= field.id %>" data-add_field_title="<%= t('camaleon_cms.admin.button.add_new_field', default: 'Add new field')%>">
|
33
|
-
<%= render(field.get_option('render') || cama_custom_field_elements[field.get_option('field_key').to_sym][:render] || "camaleon_cms/admin/settings/custom_fields/fields/#{field.options[:field_key]}", field: field, values: nil, is_disabled: is_disabled, default_use: default_use, field_name: field_name) %>
|
33
|
+
<%= render(field.get_option('render') || (cama_custom_field_elements[field.get_option('field_key').to_sym][:render] rescue nil) || "camaleon_cms/admin/settings/custom_fields/fields/#{field.options[:field_key]}", field: field, values: nil, is_disabled: is_disabled, default_use: default_use, field_name: field_name) %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
<% end %>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<div class="group-input-fields-content" data-callback-render="custom_field_checkbox_val">
|
2
|
-
<div class="checkbox"><label><input type="checkbox" value="
|
2
|
+
<div class="checkbox"><label><input type="checkbox" value="1" name="<%= field_name %>[<%= field.slug %>][values][]"> <%= field.the_name %> </label></div>
|
3
3
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="group-input-fields-content" data-callback-render="custom_field_checkboxs_val">
|
1
|
+
<div class="group-input-fields-content cama_skip_cf_rename_multiple" data-callback-render="custom_field_checkboxs_val">
|
2
2
|
<% field.options[:multiple_options].each do |option| %>
|
3
3
|
<div class="checkbox"><label><input type="checkbox" value="<%= option[:value] %>" name="<%= field_name %>[<%= field.slug %>][values][]" <%= 'checked' if default_use && option[:default].present? %> > <%= option[:title] %></label></div>
|
4
4
|
<% end %>
|
@@ -4,12 +4,9 @@
|
|
4
4
|
<% if field.options[:post_types].present? %>
|
5
5
|
<% (field.options[:post_types].include?("all") ? current_site.post_types : current_site.post_types.where(id: field.options[:post_types])).each do |pt| %>
|
6
6
|
<optgroup label="<%= pt.name %>">
|
7
|
-
<%
|
8
|
-
pt.posts.public_posts.each do |post|
|
9
|
-
post = post.decorate
|
10
|
-
%>
|
7
|
+
<% pt.posts.public_posts.each do |post| post = post.decorate %>
|
11
8
|
<option value="<%= post.id %>"><%= post.the_title %></option>
|
12
|
-
<%
|
9
|
+
<% end %>
|
13
10
|
</optgroup>
|
14
11
|
<% end %>
|
15
12
|
<% end %>
|
@@ -61,7 +61,7 @@
|
|
61
61
|
<option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_users') %>"><%= t('camaleon_cms.admin.sidebar.users') %></option>
|
62
62
|
<% value = "Site,#{current_site.id}" %>
|
63
63
|
<option value="<%= value %>" data-help="<%= t('camaleon_cms.admin.settings.tooltip.add_custom_field_sites') %>"><%= t('camaleon_cms.admin.sidebar.site_settings') %></option>
|
64
|
-
<% @_extra_models_for_fields.each do |model| %>
|
64
|
+
<% f_args={models: @_extra_models_for_fields || []}; hooks_run('custom_field_custom_models', f_args); f_args[:models].each do |model| %>
|
65
65
|
<% value = "#{model.name},#{current_site.id}" %>
|
66
66
|
<option value="<%= value %>" data-help=""><%= model.name %></option><%= model.name %>
|
67
67
|
<% end %>
|
@@ -95,12 +95,6 @@
|
|
95
95
|
<input name="meta[has_featured]" type="hidden" value="false"/>
|
96
96
|
<label class="check0"><input name="meta[has_featured]" type="checkbox" class="icheckbox0" value="true" <%= 'checked' if @post_type.get_option('has_featured', false) %>/> <%= t('camaleon_cms.admin.table.permit_is_featured', default: 'Permit Featured Articles') %></label>
|
97
97
|
</div>
|
98
|
-
<div class="form-group">
|
99
|
-
<input name="meta[has_picture]" type="hidden" value="false"/>
|
100
|
-
<label class="check0"><input name="meta[has_picture]" type="checkbox" class="icheckbox0" value="true" <%= 'checked' if @post_type.get_option('has_picture', true) %>/> <%= t('camaleon_cms.admin.table.manage_picture') %>
|
101
|
-
</label>
|
102
|
-
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_image_presentation')}", 'right') %>
|
103
|
-
</div>
|
104
98
|
<div class="form-group">
|
105
99
|
<input name="meta[has_keywords]" type="hidden" value="false"/>
|
106
100
|
<label class="check0"><input name="meta[has_keywords]" type="checkbox" class="icheckbox0" value="true" <%= 'checked' if @post_type.get_option('has_keywords', true) %>/> <%= t('camaleon_cms.admin.table.manage_keywords') %></label>
|
@@ -111,6 +105,29 @@
|
|
111
105
|
<label class="check0"><input name="meta[has_parent_structure]" type="checkbox" class="icheckbox0" value="true" <%= 'checked' if @post_type.manage_hierarchy? %>/> <%= t('camaleon_cms.admin.table.manage_parent_structure', default: 'Manage page hierarchy') %></label>
|
112
106
|
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_to_support_parent_structure', default: "Permit to posts indicate the parent page")}", 'right') %>
|
113
107
|
</div>
|
108
|
+
<div class="form-group">
|
109
|
+
<input name="meta[has_picture]" type="hidden" value="false"/>
|
110
|
+
<label class="check0"><input name="meta[has_picture]" type="checkbox" class="icheckbox0" value="true" <%= 'checked' if @post_type.get_option('has_picture', true) %>/> <%= t('camaleon_cms.admin.table.manage_picture') %>
|
111
|
+
</label>
|
112
|
+
<%= raw cama_html_tooltip("#{t('camaleon_cms.admin.post_type.tooltip.permission_add_image_presentation')}", 'right') %>
|
113
|
+
</div>
|
114
|
+
<div class="picture_settings" style="margin-left: 30px">
|
115
|
+
<div class="form-group">
|
116
|
+
<label><%= cama_t('camaleon_cms.admin.custom_field.fields.image_dimension') %></label>
|
117
|
+
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_dimension_descr')}", 'right') %>
|
118
|
+
<%= text_field_tag 'meta[posts_image_dimension]', @post_type.get_option('posts_image_dimension'), class: 'form-control' %>
|
119
|
+
</div>
|
120
|
+
<div class="form-group">
|
121
|
+
<label><%= cama_t('camaleon_cms.admin.custom_field.fields.image_versions') %></label>
|
122
|
+
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_versions_descr')}", 'right') %>
|
123
|
+
<%= text_field_tag 'meta[posts_thumb_versions]', @post_type.get_option('posts_thumb_versions'), class: 'form-control' %>
|
124
|
+
</div>
|
125
|
+
<div class="form-group">
|
126
|
+
<label><%= cama_t('camaleon_cms.admin.custom_field.fields.image_thumb') %></label>
|
127
|
+
<%= raw cama_html_tooltip("#{cama_t('camaleon_cms.admin.custom_field.fields.image_thumb_descr', d: current_site.get_option('filesystem_thumb_size', '100x100'))}", 'right') %>
|
128
|
+
<%= text_field_tag 'meta[posts_thumb_size]', @post_type.get_option('posts_thumb_size'), class: 'form-control' %>
|
129
|
+
</div>
|
130
|
+
</div>
|
114
131
|
</div>
|
115
132
|
<div role="tabpanel" class="tab-pane" id="post_type_setting_front">
|
116
133
|
<div class="form-group">
|
@@ -141,15 +158,6 @@
|
|
141
158
|
</div>
|
142
159
|
<% end %>
|
143
160
|
<script>
|
144
|
-
jQuery(function($){
|
145
|
-
var form = $("#post_type_form");
|
146
|
-
form.find('.unput_upload').input_upload();
|
147
|
-
form.find("[name='meta[has_parent_structure]']").change(function(){ // permit hierarchy route only for post types enabled "Manage page hierarchy"
|
148
|
-
var item = form.find("#meta_contents_route_format_hierarchy_post");
|
149
|
-
item.parent().siblings().find("input").prop("disabled", $(this).is(":checked"));
|
150
|
-
if($(this).is(":checked")) item.prop("checked", true).prop("disabled", false);
|
151
|
-
else item.prop("disabled", true)
|
152
|
-
}).trigger("change");
|
153
|
-
});
|
161
|
+
jQuery(function($){ cama_init_posttype_form(); });
|
154
162
|
</script>
|
155
163
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
<div class="row">
|
15
15
|
<%= form_for @user, as: "user", url:{action: @user.new_record? ? :create : :update, id: @user.id}, html:{class: 'validate-user form-horizontal cama_ajax_request', id: "user_form"} do |f| %>
|
16
|
-
<div class="col-md-3
|
16
|
+
<div class="col-md-3">
|
17
17
|
<div class="panel panel-default">
|
18
18
|
<div class="panel-body">
|
19
19
|
<%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @user} %>
|
@@ -69,7 +69,7 @@
|
|
69
69
|
</div>
|
70
70
|
</div>
|
71
71
|
|
72
|
-
<div class="col-md-6
|
72
|
+
<div class="col-md-6">
|
73
73
|
<div class="panel panel-default">
|
74
74
|
<div class="panel-body form-group-separated">
|
75
75
|
<div class="form-group">
|