Showing
9 changed files
with
27 additions
and
7 deletions
| ... | ... | @@ -302,7 +302,7 @@ module Kanjai |
| 302 | 302 | private |
| 303 | 303 | |
| 304 | 304 | def permitted_params |
| 305 | - params.permit(:page => [:parent_id, :domain_id, :page_template_id, :title, :private_flag, :default_private_page, :root_page, :show_public_only, | |
| 305 | + params.permit(:page => [:parent_id, :domain_id, :page_template_id, :title, :private_flag, :default_private_page, :root_page, :show_public_only, :exclude_sitemap, | |
| 306 | 306 | :page_data_attributes => [:id, :title, :url, :meta_title, :meta_description, :meta_keywords]], |
| 307 | 307 | :page_content => [:type_content, :text_html, :controller_name, :action_name, |
| 308 | 308 | page_content_markers_attributes: [:id, :page_content_id, :marker, :text_value, :attachment_file_name, :form_subject, :form_body, :from_mail, :to_mail, :form_answer_text, :_destroy], | ... | ... |
| ... | ... | @@ -93,6 +93,15 @@ module Kanjai |
| 93 | 93 | layer.gsub!('<meta name="csrf-token" content="###CSRF_TOKEN###"/>', '') |
| 94 | 94 | end |
| 95 | 95 | |
| 96 | + domain.page_langs.each do |item| | |
| 97 | + if item.code.to_s != I18n.locale.to_s | |
| 98 | + layer.gsub!(/<language code=\"#{item.code}\">(.*?)<\/language>/m, '') | |
| 99 | + end | |
| 100 | + end | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 96 | 105 | layer.scan(/(<element name="([\w\W]*?)" type="([\w\W]+?)"><\/element>)/).each do |item| |
| 97 | 106 | content = item[0] |
| 98 | 107 | name = item[1].to_s | ... | ... |
| ... | ... | @@ -134,7 +134,7 @@ module Kanjai |
| 134 | 134 | url = self.lang_attributes(lang, :url) |
| 135 | 135 | count_contents = page_data.joins(:page_contents).where(lang: lang) |
| 136 | 136 | |
| 137 | - url != ":param" && count_contents.any? | |
| 137 | + url != ":param" && count_contents.any? && !exclude_sitemap | |
| 138 | 138 | end |
| 139 | 139 | |
| 140 | 140 | def plugin_sitemap_pages | ... | ... |
| ... | ... | @@ -58,6 +58,14 @@ |
| 58 | 58 | <label class="switch switch-lg"><%= form.check_box :show_public_only %><span></span></label> |
| 59 | 59 | </div> |
| 60 | 60 | </div> |
| 61 | + | |
| 62 | + <div class="form-group row mt-2"> | |
| 63 | + <%= form.label :exclude_sitemap, Kanjai::Page.human_attribute_name(:exclude_sitemap), class: 'col-md-2 col-form-label' %> | |
| 64 | + <div class="col-md-10"> | |
| 65 | + <label class="switch switch-lg"><%= form.check_box :exclude_sitemap %><span></span></label> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + | |
| 61 | 69 | </fieldset> |
| 62 | 70 | <% unless @page.new_record? %> |
| 63 | 71 | <fieldset> | ... | ... |
| ... | ... | @@ -279,9 +279,6 @@ module Kanjai |
| 279 | 279 | value['###REPEAT_CYCLE_COUNT###'] = @repeat_type_index[repeat_id].to_s |
| 280 | 280 | value['PARENT_ITEM_ID'] = scope.where(row_item: row_index).first.uuid.to_s |
| 281 | 281 | |
| 282 | - p '!!!!!!!!!!!!!!!!!!!' | |
| 283 | - p item[:children] | |
| 284 | - p value | |
| 285 | 282 | value.each do |key, value| |
| 286 | 283 | element = item[:children].find{|element| element[:name] == key} |
| 287 | 284 | if element && element[:attributes] && element[:attributes]['type'] == 'page' | ... | ... |