diff --git a/vendor/built_in_modules/page_content/app/models/page_context.rb b/vendor/built_in_modules/page_content/app/models/page_context.rb index 7c9bde354..e854c09eb 100644 --- a/vendor/built_in_modules/page_content/app/models/page_context.rb +++ b/vendor/built_in_modules/page_content/app/models/page_context.rb @@ -32,5 +32,9 @@ class PageContext def is_top? self.is_top end + + def title + self.page.title + end end \ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb index caef96329..c2164c122 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb @@ -1,46 +1,54 @@ -<% # encoding: utf-8 %> +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> +<% end %> -<%= f.error_messages %> +
+
+ + + -
-
-
- <%= f.label :name, t(:name) %> - <%= @page_context.page.title %> -
- - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - -
- <%= f.label :context, t(:content) %> - <%= f.fields_for :context_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :style => "width:100%;", :class => 'tinymce_textarea', :value => (@page_context.context_translations[locale] rescue nil) %> - <% end %> -
- -
- <% end %> - +
"> + +
+ +
+
<%= @page_context.page.title %>
+
+
+ +
+ +
+
+ <%= f.fields_for :context_translations do |f| %> + <%= f.cktext_area locale, rows: 5, class: "input-block-level", id: "content_#{locale}", name: "content_#{locale}", :value => (@page_context.context_translations[locale] rescue nil) %> + <% end %> +
+
+
+
+ <% end %>
-
+ +
+ <%= f.submit t(:submit), class: 'btn btn-primary' %> + <%#= button_tag t("preview"), id: "button_for_preview", name: "commit", class: 'btn post_preview', type: :button, url: preview_panel_announcement_back_end_bulletins_path %> + <%= link_to t(:cancel), get_go_back, class: "btn" %> + <%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %> + <%= hidden_field_tag 'sort', params[:sort] if !params[:sort].blank? %> + <%= hidden_field_tag 'direction', params[:direction] if !params[:direction].blank? %> + <%= hidden_field_tag 'sort_options', params[:sort_options] if !params[:sort_options].blank? %> +
-
- <%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %> - <%= hidden_field_tag 'sort', params[:sort] if !params[:sort].blank? %> - <%= hidden_field_tag 'direction', params[:direction] if !params[:direction].blank? %> - <%= hidden_field_tag 'sort_options', params[:sort_options] if !params[:sort_options].blank? %> - <%= f.submit t('submit'), :class=>'btn btn-primary' %> - <%= link_to t('cancel'), get_go_back, :class=>"btn" %> -
+
\ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb index ee295706b..cae90ddb3 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb @@ -1,8 +1,3 @@ -
-

<%= t('page_content.editing_page_content') %>

- -<%= form_for @page_context, :url => panel_page_content_back_end_page_context_path(@page_context), :html => {:class => 'clear'} do |f| %> +<%= form_for @page_context, :url => panel_page_content_back_end_page_context_path(@page_context), :html => {:class => 'form-horizontal main-forms'} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> -
-<%#= link_back %> \ No newline at end of file +<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb index 163e97537..9cece863e 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb @@ -1,21 +1,41 @@ -<%= render 'filter' %> +<% set_default_index do + objects @page_contexts + quick_edit_link type: 'edit', + link: 'edit_panel_page_content_back_end_page_context_path' + quick_edit_link type: 'authorization', + link: "admin_authorizations_path(@module_app.key, 'page_context', object.id)" + field type: 'associated', + db_field: 'page', + model_field: 'path', + translation: 'path', + hide: 'phone', + sort: 'path' + field type: 'associated', + db_field: 'page', + model_field: 'title', + translation: 'name', + quick_edit: true, + header_class: 'span5', + hide: 'phone', + sort: 'name' + field db_field: 'version', + translation: 'version', + display_option: 'link_to value, panel_page_content_back_end_view_path(object.page_id)', + sort: 'version', + hide: 'phone' + field db_field: 'updated_at', + translation: 'update_at', + display_option: 'display_date_time(value)', + hide: 'phone', + sort: 'update_at' + field type: 'id', + db_field: 'update_user_id', + model: User, + model_field: 'name', + translation: 'last_modified', + hide: 'phone', + sort: 'last_modified' + footer +end %> - - - - - - - - - - - - <%= render :partial => 'page_context', :collection => @page_contexts %> - - -
- -
- <%= paginate @page_contexts, :params => {:direction => params[:direction], :sort => params[:sort]} %> -
+<%= render 'admin/default_index/index' %> diff --git a/vendor/built_in_modules/page_content/init.rb b/vendor/built_in_modules/page_content/init.rb index 5e04c1734..42f996e36 100644 --- a/vendor/built_in_modules/page_content/init.rb +++ b/vendor/built_in_modules/page_content/init.rb @@ -11,7 +11,9 @@ module PageContent intro "I am intro" update_info 'some update_info' - authorizable + authorizable do + authorizable_on('PageContext') + end front_end do app_page 'page_contexts' do @@ -27,11 +29,11 @@ module PageContent head_link_path "panel_page_content_back_end_page_contexts_path" - context_link 'module_authorization', - :link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'PageContent'}))", - :priority=>1, - :active_for_app_auth => 'PageContext', - :available_for => [:admin] + context_link 'all', + :link_path => "panel_page_content_back_end_page_contexts_path", + :priority => 1, + :active_for_action => {:page_contexts => :index}, + :available_for => [:all] end end end