Fix parser_back_end & side_bar & meta
This commit is contained in:
parent
fd26b7cd90
commit
32b7d95669
|
@ -25,7 +25,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= t('admin.module_app') %>
|
<%= t('admin.module_app') %>
|
||||||
<%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %>
|
<%= render :partial => "app_selector", :locals => { :f => f } %>
|
||||||
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span>
|
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span>
|
||||||
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> </span>
|
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> </span>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
|
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
|
||||||
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
|
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
|
||||||
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
|
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
|
||||||
<%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('tags', 'index') if is_manager? %>
|
<%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('tags', 'index') if (is_manager? rescue nil) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -31,6 +31,7 @@ module Orbit
|
||||||
config.autoload_paths += %W(#{config.root}/lib)
|
config.autoload_paths += %W(#{config.root}/lib)
|
||||||
config.autoload_paths += %W(#{config.root}/lib/parsers)
|
config.autoload_paths += %W(#{config.root}/lib/parsers)
|
||||||
config.autoload_paths += %W(#{config.root}/app/models/design)
|
config.autoload_paths += %W(#{config.root}/app/models/design)
|
||||||
|
config.autoload_paths += %W(#{config.root}/app/models/meta)
|
||||||
config.autoload_paths += %W(#{config.root}/app/models/purchase)
|
config.autoload_paths += %W(#{config.root}/app/models/purchase)
|
||||||
config.autoload_paths += %W(#{config.root}/app/models/user)
|
config.autoload_paths += %W(#{config.root}/app/models/user)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ module ParserBackEnd
|
||||||
def parse_page_edit_noko(page, id = nil)
|
def parse_page_edit_noko(page, id = nil)
|
||||||
body = Nokogiri::HTML(page.design.layout.body)
|
body = Nokogiri::HTML(page.design.layout.body)
|
||||||
parse_menu(body, page, true)
|
parse_menu(body, page, true)
|
||||||
public_r_tags = parse_contents(body, page, id)
|
public_r_tags = parse_content_edits(body, page, id)
|
||||||
parse_images(body, page)
|
parse_images(body, page)
|
||||||
|
|
||||||
public_r_tags.each do |tag|
|
public_r_tags.each do |tag|
|
||||||
|
@ -37,7 +37,7 @@ module ParserBackEnd
|
||||||
end
|
end
|
||||||
|
|
||||||
# page_contents
|
# page_contents
|
||||||
def parse_contents(body, page, id)
|
def parse_content_edits(body, page, id)
|
||||||
public_r_tags = []
|
public_r_tags = []
|
||||||
body.css('.page_content').each do |content|
|
body.css('.page_content').each do |content|
|
||||||
ret = ''
|
ret = ''
|
||||||
|
@ -47,7 +47,7 @@ module ParserBackEnd
|
||||||
ret << "'></div>"
|
ret << "'></div>"
|
||||||
else
|
else
|
||||||
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
|
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
|
||||||
ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>"
|
ret << "<div id='#{content['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>"
|
||||||
ret << "<div class='edit_link' style='display:none'>"
|
ret << "<div class='edit_link' style='display:none'>"
|
||||||
ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>"
|
ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>"
|
||||||
ret << '</div>'
|
ret << '</div>'
|
||||||
|
|
Reference in New Issue