mokio 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/backend.css.scss +3 -1
- data/app/assets/stylesheets/backend/custom.css.scss +45 -30
- data/app/assets/stylesheets/backend/menu.css.scss +7 -0
- data/app/controllers/mokio/base_articles_controller.rb +3 -0
- data/app/controllers/mokio/base_contacts_controller.rb +5 -0
- data/app/controllers/mokio/base_contents_controller.rb +3 -0
- data/app/controllers/mokio/base_mov_galleries_controller.rb +3 -0
- data/app/controllers/mokio/base_pic_galleries_controller.rb +4 -0
- data/app/controllers/mokio/support_controller.rb +11 -0
- data/app/controllers/passwords_controller.rb +6 -0
- data/app/models/mokio/base_article.rb +29 -0
- data/app/models/mokio/base_contact.rb +30 -0
- data/app/models/mokio/base_content.rb +5 -0
- data/app/models/mokio/base_mov_gallery.rb +30 -0
- data/app/models/mokio/base_pic_gallery.rb +30 -0
- data/app/models/mokio/support.rb +29 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +1 -1
- data/app/views/devise/sessions/new.html.haml +0 -1
- data/app/views/mokio/articles/_form.html.slim +3 -2
- data/app/views/mokio/base_articles/_multi_lang_form.html.slim +18 -0
- data/app/views/mokio/base_contacts/_multi_lang_form.html.slim +48 -0
- data/app/views/mokio/base_contents/update_content_form.js.slim +1 -0
- data/app/views/mokio/base_pic_galleries/_multi_lang_form.html.slim +13 -0
- data/app/views/mokio/common/_main_pic.html.slim +3 -1
- data/app/views/mokio/common/_multi_lang_gmap.html.slim +41 -0
- data/app/views/mokio/common/_multi_lang_meta.html.slim +50 -0
- data/app/views/mokio/common/edit.html.slim +5 -1
- data/app/views/mokio/common/multi_lang_form_content.html.slim +56 -0
- data/app/views/mokio/common/new.html.slim +4 -1
- data/app/views/mokio/contacts/_form.html.slim +2 -1
- data/app/views/mokio/contents/_common.slim +2 -0
- data/app/views/mokio/contents/delete_main_pic.js.slim +1 -0
- data/app/views/mokio/contents/new.html.slim +50 -0
- data/app/views/mokio/data_files/_file_upload.html.erb +8 -1
- data/app/views/mokio/layout/_user_widget.html.slim +4 -0
- data/app/views/mokio/layout/sidebar.html.slim +19 -9
- data/app/views/mokio/layout/sidebar_support.html.slim +4 -0
- data/app/views/mokio/menus/_form.html.haml +13 -5
- data/app/views/mokio/menus/_menu.html.slim +1 -1
- data/app/views/mokio/mov_galleries/_form_inputs.html.slim +5 -4
- data/app/views/mokio/pic_galleries/_form.html.slim +1 -1
- data/app/views/mokio/pic_galleries/_form_inputs.html.slim +5 -5
- data/app/views/mokio/support/index.html.slim +23 -0
- data/app/views/mokio/users/_form.html.slim +2 -0
- data/app/views/mokio/youtubes/_gallery.html.slim +9 -10
- data/app/views/mokio/youtubes/_search_yt.html.slim +8 -9
- data/config/locales/en.yml +24 -0
- data/config/locales/pl.yml +48 -1
- data/config/routes.rb +63 -2
- data/config/views.yml +4 -0
- data/db/migrate/20150408074951_create_mokio_base_contents.rb +17 -0
- data/db/migrate/20150408075454_add_base_content_id_to_mokio_contents.mokio.rb +6 -0
- data/db/migrate/20150414054139_add_name_to_mokio_users.rb +6 -0
- data/db/migrate/20150414070406_add_author_and_editor_to_mokio_content.rb +6 -0
- data/db/migrate/20150528104851_add_base_content_id_to_mokio_data_files.rb +5 -0
- data/lib/generators/mokio/btr_generator.rb +11 -0
- data/lib/generators/mokio/contents_generator.rb +58 -0
- data/lib/generators/mokio/templates/contents/_form.html.slim +15 -0
- data/lib/generators/mokio/templates/contents/_sidebar_btn.html.slim +1 -0
- data/lib/generators/mokio/templates/contents/controller.rb +23 -0
- data/lib/generators/mokio/templates/contents/model.rb +24 -0
- data/lib/generators/mokio/templates/contents/views_template.yml +6 -0
- data/lib/generators/mokio/templates/mokio.rb +32 -0
- data/lib/generators/mokio/templates/translations/backend_example.yml +57 -0
- data/lib/mokio.rb +13 -2
- data/lib/mokio/concerns.rb +15 -1
- data/lib/mokio/concerns/common/controller_functions.rb +19 -1
- data/lib/mokio/concerns/common/controller_object.rb +2 -2
- data/lib/mokio/concerns/controllers/application.rb +32 -3
- data/lib/mokio/concerns/controllers/articles.rb +39 -3
- data/lib/mokio/concerns/controllers/base.rb +1 -0
- data/lib/mokio/concerns/controllers/base_articles.rb +31 -0
- data/lib/mokio/concerns/controllers/base_contacts.rb +32 -0
- data/lib/mokio/concerns/controllers/base_contents.rb +167 -0
- data/lib/mokio/concerns/controllers/base_mov_galleries.rb +48 -0
- data/lib/mokio/concerns/controllers/base_pic_galleries.rb +32 -0
- data/lib/mokio/concerns/controllers/common.rb +7 -8
- data/lib/mokio/concerns/controllers/contacts.rb +39 -1
- data/lib/mokio/concerns/controllers/contents.rb +1 -0
- data/lib/mokio/concerns/controllers/main_pics.rb +32 -0
- data/lib/mokio/concerns/controllers/menus.rb +3 -2
- data/lib/mokio/concerns/controllers/mov_galleries.rb +19 -3
- data/lib/mokio/concerns/controllers/photos.rb +1 -1
- data/lib/mokio/concerns/controllers/pic_galleries.rb +18 -3
- data/lib/mokio/concerns/models/article.rb +1 -0
- data/lib/mokio/concerns/models/base_article.rb +21 -0
- data/lib/mokio/concerns/models/base_contact.rb +36 -0
- data/lib/mokio/concerns/models/base_content.rb +51 -0
- data/lib/mokio/concerns/models/base_mov_gallery.rb +19 -0
- data/lib/mokio/concerns/models/base_pic_gallery.rb +22 -0
- data/lib/mokio/concerns/models/common.rb +1 -1
- data/lib/mokio/concerns/models/contact_template.rb +4 -0
- data/lib/mokio/concerns/models/content.rb +12 -0
- data/lib/mokio/concerns/models/data_file.rb +9 -3
- data/lib/mokio/concerns/models/lang.rb +1 -1
- data/lib/mokio/concerns/models/recipient.rb +2 -0
- data/lib/mokio/concerns/models/user.rb +5 -1
- data/lib/mokio/frontend_helpers/menu_helper.rb +17 -8
- data/lib/mokio/version.rb +1 -1
- data/spec/dummy/config/routes.rb +2 -0
- metadata +55 -11
- data/app/views/devise/passwords/edit.html.erb +0 -19
- data/app/views/devise/passwords/new.html.erb +0 -15
- data/app/views/mokio/menus/sort.html.slim +0 -1
- data/spec/dummy/config/views.yml +0 -11
@@ -0,0 +1,18 @@
|
|
1
|
+
/= render :partial => "mokio/common/gmap", locals: {obj: obj, f: f} if obj.class.has_gmap_enabled?
|
2
|
+
/= render :partial => "mokio/common/meta", locals: {obj: obj, f: f} if obj.class.has_meta_enabled?
|
3
|
+
/= render :partial => "mokio/common/main_pic", locals: {f:f}
|
4
|
+
|
5
|
+
|
6
|
+
= lf.input :lang_id , :as => :hidden, :input_html => { :value => obj.lang_id }
|
7
|
+
= lf.input :title, disabled: !obj.display_editable_field?('title')
|
8
|
+
= lf.input :subtitle, disabled: !obj.display_editable_field?('subtitle'), :as => :string
|
9
|
+
= lf.input :intro, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Mini', :height => 150} }, disabled: !obj.display_editable_field?('intro')
|
10
|
+
= lf.input :content, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Medium', :height => 400} }, disabled: !obj.display_editable_field?('content')
|
11
|
+
|
12
|
+
.row-fluid
|
13
|
+
label.form-label.span2
|
14
|
+
= t('menus.content_assoc')
|
15
|
+
.span10
|
16
|
+
=collection_select(:article, :menu_ids,menu_select_grouped(Mokio::Menu.all.includes(:content_links).arrange(:order => :seq)),:id,:name, {disabled: lambda{|s| s.fake.present? },selected:obj.menus.map {|j| j.id} },:multiple => true)
|
17
|
+
|
18
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
= lf.input :lang_id , :as => :hidden, :input_html => { :value => obj.lang_id }
|
2
|
+
= lf.input :title, disabled: !obj.display_editable_field?('title')
|
3
|
+
= lf.input :subtitle, disabled: !obj.display_editable_field?('subtitle'), :as => :string
|
4
|
+
= lf.input :content, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Medium', :height => 400} }, disabled: !obj.display_editable_field?('content')
|
5
|
+
|
6
|
+
= lf.input :recipient_emails, :as => :string, :input_html => { :class => "recipients span10" }, disabled: !obj.display_editable_field?('recipient_emails')
|
7
|
+
.row-fluid
|
8
|
+
label.lorm-label.span2
|
9
|
+
= t('menus.content_assoc')
|
10
|
+
.span10
|
11
|
+
=collection_select(:contact, :menu_ids,menu_select_grouped(Mokio::Menu.all.includes(:content_links).arrange(:order => :seq)),:id,:name, {disabled: lambda{|s| s.fake.present? },selected:obj.menus.map {|j| j.id} },:multiple => true)
|
12
|
+
|
13
|
+
|
14
|
+
.contaner
|
15
|
+
hr
|
16
|
+
.row-fluid
|
17
|
+
/ .span1
|
18
|
+
/ .span7
|
19
|
+
= f.fields_for :contact_template do |t|
|
20
|
+
.label-wrapper
|
21
|
+
= f.label btc("tpl", Mokio::Contact)
|
22
|
+
.well
|
23
|
+
= btc("form_data", Mokio::Contact)
|
24
|
+
hr
|
25
|
+
ul.unstyled
|
26
|
+
li
|
27
|
+
span.icon16.icomoon-icon-arrow-right-2
|
28
|
+
= "%name% - #{t('contacts.form_name')}"
|
29
|
+
li
|
30
|
+
span.icon16.icomoon-icon-arrow-right-2
|
31
|
+
= "%email% - #{t('contacts.form_email')}"
|
32
|
+
li
|
33
|
+
span.icon16.icomoon-icon-arrow-right-2
|
34
|
+
= "%title% - #{t('contacts.form_title')}"
|
35
|
+
li
|
36
|
+
span.icon16.icomoon-icon-arrow-right-2
|
37
|
+
= "%content% - #{t('contacts.form_content')}"
|
38
|
+
|
39
|
+
= t.input :tpl, :label => "", :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Medium', :height => 300} }
|
40
|
+
|
41
|
+
|
42
|
+
= f.hidden_field :contact, value: true
|
43
|
+
= f.hidden_field :intro, value: ""
|
44
|
+
|
45
|
+
- content_for :js do
|
46
|
+
= javascript_include_tag 'backend/plugins/forms/select/select2.min'
|
47
|
+
javascript:
|
48
|
+
$(".recipients").select2({tags: []});
|
@@ -0,0 +1 @@
|
|
1
|
+
| $('.content').replaceWith('#{@content}');
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= render :partial => "mokio/common/main_pic", locals: {f:lf}
|
2
|
+
= lf.input :lang_id , :as => :hidden, :input_html => { :value => obj.lang_id }
|
3
|
+
= lf.input :title, disabled: !obj.display_editable_field?('title')
|
4
|
+
= lf.input :subtitle, disabled: !obj.display_editable_field?('subtitle'), :as => :string
|
5
|
+
= lf.input :intro, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Mini', :height => 150} }, disabled: !obj.display_editable_field?('intro')
|
6
|
+
= lf.input :content, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Medium', :height => 300} }, disabled: !obj.display_editable_field?('content')
|
7
|
+
|
8
|
+
.row-fluid
|
9
|
+
label.form-label.span2
|
10
|
+
= t('menus.content_assoc')
|
11
|
+
.span10
|
12
|
+
=collection_select(:pic_gallery, :menu_ids,menu_select_grouped(Mokio::Menu.all.includes(:content_links).arrange(:order => :seq)),:id,:name, {disabled: lambda{|s| s.fake.present? },selected:obj.menus.map {|j| j.id} },:multiple => true)
|
13
|
+
|
@@ -1,4 +1,6 @@
|
|
1
1
|
= f.input :main_pic
|
2
2
|
#main_pic_view
|
3
3
|
a.fancybox href=f.object.main_pic.url
|
4
|
-
img.image.marginR10 alt="" src=f.object.main_pic.url(:main_pic) /
|
4
|
+
img.image.marginR10.article-mainpic alt="" src=f.object.main_pic.url(:main_pic) /
|
5
|
+
- unless f.object.main_pic.file.nil?
|
6
|
+
= link_to "", delete_main_pic_content_path, method: :delete, remote: true, class: "delete-mainpic-button icon16 icomoon-icon-remove white"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
- cache :gmap_button do
|
2
|
+
a data-toggle="modal" href=("#gmap_modal_#{obj.lang_id}" )
|
3
|
+
button.btn.btn-danger.btn-mini.box-form-gmap.right
|
4
|
+
span.icon16.iconic-icon-map-pin-fill.white
|
5
|
+
= bt("gmap", Mokio::Gmap)
|
6
|
+
|
7
|
+
- cache [:gmap_form, obj.gmap] do
|
8
|
+
.modal.fade id=("gmap_g_modal_#{obj.lang_id}") role="dialog" aria-hidden="true" style="display:none;" aria-labelledby="gmap_ModalLabel"
|
9
|
+
.modal-dialog
|
10
|
+
.modal-content
|
11
|
+
.modal-header
|
12
|
+
h3.modal-title.modal-photo id="gmap_ModalLabel_#{obj.lang_id}"
|
13
|
+
span.icon24.iconic-icon-map-pin-fill
|
14
|
+
= bt("gmap", Mokio::Gmap)
|
15
|
+
|
16
|
+
.modal-body
|
17
|
+
= f.fields_for :gmap do |g|
|
18
|
+
.span12
|
19
|
+
= g.input :full_address, :wrapper => :custom_without_label, :input_html => { :class => "gmap_full_address" }
|
20
|
+
.hidden_elements
|
21
|
+
= g.input :street_number, :input_html => { :class => "gmap_element gmap_street_number"}
|
22
|
+
= g.input :route, :input_html => { :class => "gmap_element gmap_route"}
|
23
|
+
= g.input :locality, :input_html => { :class => "gmap_element gmap_locality"}
|
24
|
+
= g.input :postal_code, :input_html => { :class => "gmap_element gmap_postal_code"}
|
25
|
+
= g.input :country, :as => :string, :input_html => { :class => "gmap_element gmap_country"}
|
26
|
+
= g.input :administrative_area_level_2, :input_html => { :class => "gmap_element gmap_administrative_area_level_2"}
|
27
|
+
= g.input :administrative_area_level_1, :input_html => { :class => "gmap_element gmap_administrative_area_level_1"}
|
28
|
+
= g.input :gtype, :input_html => { :class => "gmap_element gmap_type"}
|
29
|
+
= g.input :lat, :input_html => { :class => "gmap_element gmap_lat"}
|
30
|
+
= g.input :lng, :input_html => { :class => "gmap_element gmap_lng"}
|
31
|
+
= g.input :zoom, :input_html => { :class => "gmap_element gmap_zoom"}
|
32
|
+
|
33
|
+
#map
|
34
|
+
.modal-footer
|
35
|
+
button.btn.btn-primary type="button" data-dismiss="modal" = bt("close")
|
36
|
+
|
37
|
+
|
38
|
+
- content_for :js do
|
39
|
+
= javascript_include_tag "//maps.google.com/maps/api/js?sensor=false"
|
40
|
+
= javascript_include_tag "backend/jquery.ui.addresspicker"
|
41
|
+
= javascript_include_tag "backend/gmap"
|
@@ -0,0 +1,50 @@
|
|
1
|
+
a data-toggle="modal" href=("#meta_g_modal_#{obj.lang_id}" )
|
2
|
+
button.btn.btn-success.btn-mini.box-form3.right
|
3
|
+
span.icon16.icomoon-icon-google-plus.white
|
4
|
+
= bt("meta_google", Mokio::Meta)
|
5
|
+
|
6
|
+
a data-toggle="modal" href=("#meta_f_modal_#{obj.lang_id}" )
|
7
|
+
button.btn.btn-primary.btn-mini.box-form2.right
|
8
|
+
span.icon16.icomoon-icon-facebook-2.white
|
9
|
+
= bt("meta_facebook", Mokio::Meta)
|
10
|
+
|
11
|
+
.modal.fade id=("meta_g_modal_#{obj.lang_id}") role="dialog" aria-hidden="true" style="display:none;" aria-labelledby="meta_g_ModalLabel"
|
12
|
+
.modal-dialog
|
13
|
+
.modal-content
|
14
|
+
.modal-header
|
15
|
+
h3.modal-title.modal-photo id="meta_g_ModalLabel_#{obj.lang_id}"
|
16
|
+
span.icon24.icomoon-icon-google-plus
|
17
|
+
= bt("meta_google", Mokio::Meta)
|
18
|
+
small= bt("meta_google_desc", Mokio::Meta)
|
19
|
+
|
20
|
+
.modal-body
|
21
|
+
= f.fields_for :meta do |m|
|
22
|
+
= m.input :g_title
|
23
|
+
= m.input :g_desc
|
24
|
+
= m.input :g_keywords
|
25
|
+
= m.input :g_author
|
26
|
+
= m.input :g_copyright
|
27
|
+
= m.input :g_application_name
|
28
|
+
|
29
|
+
.modal-footer
|
30
|
+
button.btn.btn-primary type="button" data-dismiss="modal" = bt("close")
|
31
|
+
|
32
|
+
.modal.fade id =("meta_f_modal_#{obj.lang_id}") role="dialog" aria-hidden="true" style="display:none;" aria-labelledby="meta_f_ModalLabel_#{obj.lang_id}"
|
33
|
+
.modal-dialog
|
34
|
+
.modal-content
|
35
|
+
.modal-header
|
36
|
+
h3.modal-title.modal-photo id="meta_f_ModalLabel_#{obj.lang_id}"
|
37
|
+
span.icon24.icomoon-icon-facebook-2
|
38
|
+
= bt("meta_facebook", Mokio::Meta)
|
39
|
+
small= bt("meta_facebook_desc", Mokio::Meta)
|
40
|
+
|
41
|
+
.modal-body
|
42
|
+
= f.fields_for :meta do |m|
|
43
|
+
= m.input :f_title
|
44
|
+
= m.input :f_type
|
45
|
+
= m.input :f_image
|
46
|
+
= m.input :f_url
|
47
|
+
= m.input :f_desc
|
48
|
+
|
49
|
+
.modal-footer
|
50
|
+
button.btn.btn-primary type="button" data-dismiss="modal" = bt("close")
|
@@ -3,4 +3,8 @@
|
|
3
3
|
.box
|
4
4
|
= box_title do
|
5
5
|
= bt("edit_title", obj.respond_to?(:type) ? obj.type : @obj_class)
|
6
|
-
|
6
|
+
|
7
|
+
-if Mokio.multi_lang_contents == true && obj.kind_of?(Mokio::BaseContent)
|
8
|
+
= render :template => "mokio/common/multi_lang_form_content", locals: {obj: obj}
|
9
|
+
-else
|
10
|
+
= render :partial => "mokio/common/form_content", locals: {obj: obj}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
.content
|
2
|
+
= common_form do
|
3
|
+
.row-fluid
|
4
|
+
= simple_form_for obj, :html => { :class => 'form-horizontal' } do |g|
|
5
|
+
= g.input :main_pic
|
6
|
+
= g.input :title, disabled: !obj.display_editable_field?('title')
|
7
|
+
= g.input :display_from, :wrapper => :date, :as => :string, :input_html => { :class => "mask-date display_from", :value => (localize(g.object.display_from, :format => :datepicker) if g.object.display_from) }, disabled: !obj.display_editable_field?('display_from')
|
8
|
+
= g.input :display_to, :wrapper => :date, :as => :string, :input_html => { :class => "mask-date display_to", :value => (localize(g.object.display_to, :format => :datepicker) if g.object.display_to) }, disabled: !obj.display_editable_field?('display_to')
|
9
|
+
= g.input :active, :wrapper => :active_checkbox, disabled: !obj.display_editable_field?('active')
|
10
|
+
= g.input :home_page, :wrapper => :active_checkbox, disabled: !obj.display_editable_field?('home_page')
|
11
|
+
|
12
|
+
ul#langContentTab.nav.nav-tabs
|
13
|
+
-@contents.each_with_index do |content,i|
|
14
|
+
li class=(i == 0 ? "in active":" ") id="nav_lang_#{content.lang_id}"
|
15
|
+
a href="#lang_#{content.lang_id}"
|
16
|
+
=content.lang.name.html_safe
|
17
|
+
i.icon12
|
18
|
+
.tab-content
|
19
|
+
hr
|
20
|
+
-@contents.each_with_index do |content,i|
|
21
|
+
.tab-pane.fade id="lang_#{content.lang_id}" class=(i == 0 ? "in active":" ")
|
22
|
+
= g.simple_fields_for :contents,content do |lf|
|
23
|
+
= render :partial => "mokio/common/multi_lang_gmap", locals: {obj: content, f: lf} if obj.class.has_gmap_enabled?
|
24
|
+
= render :partial => "mokio/common/multi_lang_meta", locals: {obj: content, f: lf} if content.class.has_meta_enabled?
|
25
|
+
= lf.input :form_active, :label => I18n.t('backend.form_active'), :as => :boolean, :input_html => { :checked => (true if content.title.present? ) ,:contentForm => "content_form_#{content.lang_id}"}
|
26
|
+
/-if content.base_content_id.nil?
|
27
|
+
/ .row-fluid
|
28
|
+
/ label.form-label.span2
|
29
|
+
/ = t('menus.content_assoc')
|
30
|
+
/ .span10
|
31
|
+
/ = lf.collection_select(:base_content_id, @contents_select.where('lang_id = ? OR lang_id IS NULL',content.lang_id), :id, :title ,:include_blank => true)
|
32
|
+
|
33
|
+
.content_form id="content_form_#{content.lang_id}"
|
34
|
+
= render :partial => "#{ obj.class.to_s.tableize}/multi_lang_form", :locals => {f: g, obj: content,lf:lf}
|
35
|
+
|
36
|
+
- cache [:form_buttons, obj] do
|
37
|
+
.form-actions
|
38
|
+
= btn_submit bt("save")
|
39
|
+
= btn_submit bt("save_and_create_new"), true
|
40
|
+
= btn_cancel "#{engine_root}#{obj.class.to_s.tableize.gsub("mokio/", "")}"
|
41
|
+
- if has_data_files?(obj) && params[:action] == "edit" && obj.default_data_file != Mokio::Youtube
|
42
|
+
= render :template => "mokio/data_files/uploader" , locals: {obj: obj, f: g}
|
43
|
+
- if has_data_files?(obj) && obj.default_data_file == Mokio::Youtube && params[:action] == "edit"
|
44
|
+
= render :template => "mokio/youtubes/uploader" , locals: {obj: obj, f: g}
|
45
|
+
- if has_data_files?(obj) && params[:action] == "edit"
|
46
|
+
= render :partial => "#{obj.default_data_file.to_s.tableize}/gallery", :locals => {videos: @videos}
|
47
|
+
|
48
|
+
= render :partial => "mokio/common/datepicker_settings"
|
49
|
+
-content_for :js do
|
50
|
+
= javascript_include_tag 'backend/forms'
|
51
|
+
|
52
|
+
- if has_data_files?(obj) && params[:action] == "edit"
|
53
|
+
= javascript_include_tag "backend/galleries"
|
54
|
+
|
55
|
+
- if params[:action] == "new" && has_data_files?(obj)
|
56
|
+
= flash_message(bt("cannot_add_files_now", @obj_class))
|
@@ -3,4 +3,7 @@
|
|
3
3
|
.box
|
4
4
|
= box_title do
|
5
5
|
= bt("new_title", @obj_class)
|
6
|
-
|
6
|
+
-if Mokio.multi_lang_contents == true && obj.kind_of?(Mokio::BaseContent)
|
7
|
+
= render :template => "mokio/common/multi_lang_form_content", locals: {obj: obj}
|
8
|
+
-else
|
9
|
+
= render :partial => "mokio/common/form_content", locals: {obj: obj}
|
@@ -3,7 +3,8 @@
|
|
3
3
|
= f.input :home_page, :wrapper => :active_checkbox, disabled: !obj.display_editable_field?('home_page')
|
4
4
|
= f.input :title, disabled: !obj.display_editable_field?('title')
|
5
5
|
= f.input :subtitle, disabled: !obj.display_editable_field?('subtitle'), :as => :string
|
6
|
-
= f.input :
|
6
|
+
= f.input :intro, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Full', :height => 150, :language => I18n.locale} }, disabled: !obj.display_editable_field?('intro')
|
7
|
+
= f.input :content, :wrapper => :ckeditor, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'Full', :height => 400, :language => I18n.locale} }, disabled: !obj.display_editable_field?('content')
|
7
8
|
|
8
9
|
= f.input :recipient_emails, :as => :string, :input_html => { :class => "recipients span10" }, disabled: !obj.display_editable_field?('recipient_emails')
|
9
10
|
.row-fluid
|
@@ -0,0 +1 @@
|
|
1
|
+
| $(".article-mainpic, .delete-mainpic-button").css("display", "none");
|
@@ -0,0 +1,50 @@
|
|
1
|
+
.span12
|
2
|
+
= render :partial => "mokio/common/notice"
|
3
|
+
.box
|
4
|
+
= box_title do
|
5
|
+
= bt("new_title", @obj_class)
|
6
|
+
.content
|
7
|
+
= common_form do
|
8
|
+
.row-fluid
|
9
|
+
-langs.each.with_index(1) do |lang,index|
|
10
|
+
.bs-example
|
11
|
+
ul.nav.nav-tabs
|
12
|
+
-if index == 1
|
13
|
+
li.active
|
14
|
+
a data-toggle="tab" href="#sectionA" =lang.shortname.html_safe
|
15
|
+
-else
|
16
|
+
li
|
17
|
+
a data-toggle="tab" href="#sectionA" =lang.shortname.html_safe
|
18
|
+
|
19
|
+
= simple_form_for obj, :html => { :class => 'form-horizontal' } do |f|
|
20
|
+
= render :partial => "mokio/common/gmap", locals: {content: content, f: f} if content.class.has_gmap_enabled?
|
21
|
+
= render :partial => "mokio/common/meta", locals: {content: content, f: f} if content.class.has_meta_enabled?
|
22
|
+
|
23
|
+
= render :partial => "#{content.class.to_s.tableize}/form", :locals => {f: f, content: content}
|
24
|
+
|
25
|
+
- if params[:action] != "edit" || !has_data_files?(content)
|
26
|
+
- cache [:form_buttons, content] do
|
27
|
+
.form-actions
|
28
|
+
= btn_submit bt("save")
|
29
|
+
= btn_submit bt("save_and_create_new"), true
|
30
|
+
= btn_cancel "#{engine_root}#{content.class.to_s.tableize.gsub("mokio/", "")}"
|
31
|
+
|
32
|
+
- if has_data_files?(content) && params[:action] == "edit" && content.default_data_file != Mokio::Youtube
|
33
|
+
= render :template => "mokio/data_files/uploader"
|
34
|
+
- if has_data_files?(content) && content.default_data_file == Mokio::Youtube && params[:action] == "edit"
|
35
|
+
= render :template => "mokio/youtubes/uploader"
|
36
|
+
|
37
|
+
- if has_data_files?(content) && params[:action] == "edit"
|
38
|
+
= render :partial => "#{content.default_data_file.to_s.tableize}/gallery", :locals => {videos: @videos}
|
39
|
+
|
40
|
+
= render :partial => "mokio/common/datepicker_settings"
|
41
|
+
|
42
|
+
- content_for :js do
|
43
|
+
= javascript_include_tag 'backend/forms'
|
44
|
+
|
45
|
+
- if has_data_files?(content) && params[:action] == "edit"
|
46
|
+
= javascript_include_tag "backend/galleries"
|
47
|
+
|
48
|
+
- if params[:action] == "new" && has_data_files?(content)
|
49
|
+
= flash_message(bt("cannot_add_files_now", @content_class))
|
50
|
+
|
@@ -5,7 +5,14 @@
|
|
5
5
|
<!-- The fileinput-button span is used to style the file input field as button -->
|
6
6
|
<span class="btn btn-success fileinput-button">
|
7
7
|
<span><%= bt("add_files") %></span>
|
8
|
-
|
8
|
+
|
9
|
+
<% if obj.kind_of?(Mokio::BaseContent) %>
|
10
|
+
<%= f.hidden_field "base_content_id", :value => obj.id, name: "#{file_type.to_s.tableize.gsub('mokio/', '').singularize}[base_content_id]" %>
|
11
|
+
<% else %>
|
12
|
+
<%= f.hidden_field @obj_class.to_s.demodulize.downcase+"_id", :value => obj.id, name: "#{file_type.to_s.tableize.gsub('mokio/', '').singularize}[#{@obj_class.to_s.demodulize.downcase}_id]" %>
|
13
|
+
|
14
|
+
<% end %>
|
15
|
+
|
9
16
|
<%= f.file_field :data_file, multiple:true, name: "#{file_type.to_s.tableize.gsub('mokio/', '').singularize}[data_file]" %>
|
10
17
|
</span>
|
11
18
|
<button type="submit" class="btn btn-primary start">
|
@@ -3,6 +3,10 @@
|
|
3
3
|
li#username
|
4
4
|
span.icon16.icomoon-icon-user.white
|
5
5
|
= current_user.email
|
6
|
+
li#support
|
7
|
+
a href="#{support_path}"
|
8
|
+
span.icon16.entypo-icon-help
|
9
|
+
= bts("support")
|
6
10
|
li
|
7
11
|
= link_to bt('change_password'), edit_password_user_path(current_user), :method => :get
|
8
12
|
li
|
@@ -7,10 +7,11 @@
|
|
7
7
|
h5.title style="margin-bottom:0" = bt("sidebar_title", "backend.sidebar")
|
8
8
|
.mainnav
|
9
9
|
ul#sidebar-ul
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
- if (can? :manage, Mokio::Content) && (can? :manage, Mokio::Menu)
|
11
|
+
li.dashboard_nav
|
12
|
+
a href=root_path
|
13
|
+
span.icon16.icomoon-icon-screen-2
|
14
|
+
= bts("dashboard")
|
14
15
|
/ MENU
|
15
16
|
= sidebar_btn Mokio::Menu, "icomoon-icon-menu-2"
|
16
17
|
/ CONTENT MANAGEMENT
|
@@ -20,11 +21,19 @@
|
|
20
21
|
span.icon16.minia-icon-pencil-2
|
21
22
|
= bts("content_management")
|
22
23
|
ul.sub#add_content
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
-if Mokio.multi_lang_contents
|
25
|
+
= sidebar_btn Mokio::BaseContent, "icomoon-icon-list-view-2", bts("all"), false
|
26
|
+
= sidebar_btn Mokio::BaseArticle, "icomoon-icon-file"
|
27
|
+
= sidebar_btn Mokio::BasePicGallery, "icomoon-icon-picture"
|
28
|
+
= sidebar_btn Mokio::BaseMovGallery, "icomoon-icon-movie"
|
29
|
+
= sidebar_btn Mokio::BaseContact, "icomoon-icon-mail-3"
|
30
|
+
-else
|
31
|
+
= sidebar_btn Mokio::Content, "icomoon-icon-list-view-2", bts("all"), false
|
32
|
+
= sidebar_btn Mokio::Article, "icomoon-icon-file"
|
33
|
+
= sidebar_btn Mokio::PicGallery, "icomoon-icon-picture"
|
34
|
+
= sidebar_btn Mokio::MovGallery, "icomoon-icon-movie"
|
35
|
+
= sidebar_btn Mokio::Contact, "icomoon-icon-mail-3"
|
36
|
+
|
28
37
|
/ SITE ELEMENTS
|
29
38
|
- if can? :create, Mokio::Content
|
30
39
|
li.site_elements_nav
|
@@ -44,6 +53,7 @@
|
|
44
53
|
ul.sub#settings
|
45
54
|
= sidebar_btn Mokio::User, "entypo-icon-users"
|
46
55
|
= sidebar_btn Mokio::Lang, "brocco-icon-earth"
|
56
|
+
/= render :template => "mokio/layout/sidebar_support"
|
47
57
|
- if @obj_class == Mokio::Content && params[:action] == "index"
|
48
58
|
= render :partial => "mokio/contents/content_info_widget"
|
49
59
|
|
@@ -10,16 +10,17 @@
|
|
10
10
|
= text_field_tag '', (@menu.full_slug.nil?) ? bt('no_slug', Mokio::Menu) : "/" + @menu.full_slug.to_s, readonly: true
|
11
11
|
= f.input :name, disabled: !@menu.display_editable_field?('name')
|
12
12
|
= f.input :subtitle, disabled: !@menu.display_editable_field?('subtitle'), :as => :string
|
13
|
+
= f.input :css_class, disabled: !@menu.display_editable_field?('css_class')
|
14
|
+
= f.input :css_body_class, disabled: !@menu.display_editable_field?('css_body_class')
|
13
15
|
.row-fluid
|
14
16
|
%label.form-label.span2
|
15
17
|
= btc('type', Mokio::Menu)
|
16
18
|
.span10
|
17
|
-
= select_tag "menu_type", options_for_select([[btc("content",'Menu'), 'content'],[btc("external_link",'Menu'), 'external_link']],
|
18
|
-
|
19
|
-
|
20
|
-
.row-fluid#content_box{:style => "display: #{@menu.contents.empty? && !@menu.external_link.blank? ? 'none' : 'block'};"}
|
19
|
+
= select_tag "menu_type", options_for_select([[btc("content",'Menu'), 'content'],[btc("external_link",'Menu'), 'external_link']], !@menu.external_link.blank? ? "external_link" : "content")
|
20
|
+
|
21
|
+
.row-fluid#content_box{:style => "display: #{!@menu.external_link.blank? ? 'none' : 'block'};"}
|
21
22
|
= dual_select_box(@menu.available_contents, 'id', 'title', @menu.contents, 'id', 'title', btc('content', 'Menu'), '','menu[content_ids][]', true, false, false, @menu.display_editable_field?('contents'))
|
22
|
-
#url_box{:style => "display: #{
|
23
|
+
#url_box{:style => "display: #{!@menu.external_link.blank? ? 'block' : 'none'};"}
|
23
24
|
= f.input :external_link, label: btc("external_link",'Menu'), disabled: !@menu.display_editable_field?('external_link')
|
24
25
|
= f.input :follow, :as => :select, :collection => [[bt("follow",'Menu'), "true"], [bt("nofollow",'Menu'), "false"]], :include_blank => false
|
25
26
|
= f.input :parent_id, :collection => @menu.parent_tree.collect{|m| ["#{'-' * m.ancestry.count('/')}#{m.name}", m.id]}, include_blank: false, disabled: !@menu.display_editable_field?('parent_id')
|
@@ -75,9 +76,16 @@
|
|
75
76
|
//tabs
|
76
77
|
$('#tabs_modules li').first().addClass('active');
|
77
78
|
$('.tabs_wrap .tab-pane').first().addClass('in active');
|
79
|
+
|
78
80
|
$('#menu_type').change(function() {
|
79
81
|
$('#content_box').toggle();
|
80
82
|
$('#url_box').toggle();
|
83
|
+
if ($('#menu_type').val() == "content") {
|
84
|
+
$('#menu_external_link').val("");
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
$('#allTo1real').click();
|
88
|
+
}
|
81
89
|
});
|
82
90
|
});
|
83
91
|
|