zencms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/zencms/application.js.coffee +19 -0
  6. data/app/assets/stylesheets/zencms/application.css.sass +6 -0
  7. data/app/controllers/zencms/application_controller.rb +4 -0
  8. data/app/controllers/zencms/backend/posts_controller.rb +37 -0
  9. data/app/controllers/zencms/posts_controller.rb +34 -0
  10. data/app/helpers/zencms/application_helper.rb +25 -0
  11. data/app/helpers/zencms/menu_items_helper.rb +15 -0
  12. data/app/helpers/zencms/posts_helper.rb +41 -0
  13. data/app/models/zencms/asset.rb +14 -0
  14. data/app/models/zencms/menu_item.rb +11 -0
  15. data/app/models/zencms/post.rb +48 -0
  16. data/app/models/zencms/post/audio.rb +8 -0
  17. data/app/models/zencms/post/image.rb +8 -0
  18. data/app/models/zencms/post_type.rb +5 -0
  19. data/app/views/layouts/zencms/application.html.haml +35 -0
  20. data/app/views/zencms/backend/posts/_audio_fields.html.haml +14 -0
  21. data/app/views/zencms/backend/posts/_form.html.haml +53 -0
  22. data/app/views/zencms/backend/posts/_image_fields.html.haml +14 -0
  23. data/app/views/zencms/backend/posts/edit.html.haml +1 -0
  24. data/app/views/zencms/backend/posts/index.html.haml +26 -0
  25. data/app/views/zencms/backend/posts/new.html.haml +1 -0
  26. data/app/views/zencms/posts/_post.html.haml +17 -0
  27. data/app/views/zencms/posts/_post_grid.html.haml +6 -0
  28. data/app/views/zencms/posts/_post_teaser.html.haml +6 -0
  29. data/app/views/zencms/posts/index.html.haml +6 -0
  30. data/app/views/zencms/posts/show.html.haml +1 -0
  31. data/app/views/zencms/shared/_block_archive.html.haml +6 -0
  32. data/app/views/zencms/shared/_block_categories.html.haml +6 -0
  33. data/app/views/zencms/shared/_block_tags.html.haml +7 -0
  34. data/app/views/zencms/shared/_images_carousel.html.haml +12 -0
  35. data/config/initializers/act_as_taggable_on.rb +10 -0
  36. data/config/initializers/friendly_id.rb +88 -0
  37. data/config/initializers/paperclip_defaults.rb +4 -0
  38. data/config/initializers/simple_form.rb +145 -0
  39. data/config/initializers/simple_form_bootstrap.rb +85 -0
  40. data/config/locales/simple_form.en.yml +26 -0
  41. data/config/routes.rb +17 -0
  42. data/db/migrate/20131222153742_create_zencms_posts.rb +15 -0
  43. data/db/migrate/20131222153810_create_zencms_assets.rb +13 -0
  44. data/db/migrate/20131222153844_acts_as_taggable_on_migration.rb +31 -0
  45. data/db/migrate/20131222154013_translate_posts.rb +14 -0
  46. data/db/migrate/20131222154211_create_friendly_id_slugs.rb +15 -0
  47. data/db/migrate/20131222161551_create_zencms_post_types.rb +11 -0
  48. data/db/migrate/20131223090443_create_zencms_menu_items.rb +13 -0
  49. data/lib/tasks/zencms_tasks.rake +4 -0
  50. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  51. data/lib/zencms.rb +4 -0
  52. data/lib/zencms/engine.rb +31 -0
  53. data/lib/zencms/version.rb +3 -0
  54. data/test/dummy/README.rdoc +28 -0
  55. data/test/dummy/Rakefile +6 -0
  56. data/test/dummy/app/assets/javascripts/application.js +13 -0
  57. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  58. data/test/dummy/app/controllers/application_controller.rb +5 -0
  59. data/test/dummy/app/helpers/application_helper.rb +2 -0
  60. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  61. data/test/dummy/bin/bundle +3 -0
  62. data/test/dummy/bin/rails +4 -0
  63. data/test/dummy/bin/rake +4 -0
  64. data/test/dummy/config.ru +4 -0
  65. data/test/dummy/config/application.rb +23 -0
  66. data/test/dummy/config/boot.rb +5 -0
  67. data/test/dummy/config/database.yml +25 -0
  68. data/test/dummy/config/environment.rb +5 -0
  69. data/test/dummy/config/environments/development.rb +29 -0
  70. data/test/dummy/config/environments/production.rb +80 -0
  71. data/test/dummy/config/environments/test.rb +36 -0
  72. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  73. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  74. data/test/dummy/config/initializers/inflections.rb +16 -0
  75. data/test/dummy/config/initializers/mime_types.rb +5 -0
  76. data/test/dummy/config/initializers/secret_token.rb +12 -0
  77. data/test/dummy/config/initializers/session_store.rb +3 -0
  78. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  79. data/test/dummy/config/locales/en.yml +23 -0
  80. data/test/dummy/config/routes.rb +4 -0
  81. data/test/dummy/db/development.sqlite3 +0 -0
  82. data/test/dummy/db/migrate/20131222160046_create_zencms_posts.zencms.rb +16 -0
  83. data/test/dummy/db/migrate/20131222160047_create_zencms_assets.zencms.rb +14 -0
  84. data/test/dummy/db/migrate/20131222160048_acts_as_taggable_on_migration.zencms.rb +31 -0
  85. data/test/dummy/db/migrate/20131222160049_translate_posts.zencms.rb +15 -0
  86. data/test/dummy/db/migrate/20131222160050_create_friendly_id_slugs.zencms.rb +16 -0
  87. data/test/dummy/db/schema.rb +88 -0
  88. data/test/dummy/db/test.sqlite3 +0 -0
  89. data/test/dummy/log/development.log +48 -0
  90. data/test/dummy/log/test.log +5 -0
  91. data/test/dummy/public/404.html +58 -0
  92. data/test/dummy/public/422.html +58 -0
  93. data/test/dummy/public/500.html +57 -0
  94. data/test/dummy/public/favicon.ico +0 -0
  95. data/test/fixtures/zencms/assets.yml +11 -0
  96. data/test/fixtures/zencms/menu_items.yml +11 -0
  97. data/test/fixtures/zencms/post_types.yml +11 -0
  98. data/test/fixtures/zencms/posts.yml +11 -0
  99. data/test/integration/navigation_test.rb +10 -0
  100. data/test/models/zencms/assets_test.rb +9 -0
  101. data/test/models/zencms/menu_item_test.rb +9 -0
  102. data/test/models/zencms/post_test.rb +9 -0
  103. data/test/models/zencms/post_type_test.rb +9 -0
  104. data/test/test_helper.rb +15 -0
  105. data/test/zencms_test.rb +7 -0
  106. metadata +478 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1887e2a32a471969c13c24bda9b4ec221d7b4f2e
4
+ data.tar.gz: 361b6bf13bc76ba77f6aea8510641b6a0bb3448f
5
+ SHA512:
6
+ metadata.gz: 8ba50212fbd29537760df447555fd32d500d98dafc9a906fc07e67ee2a61bdd20b1d7ca95db515abd35216c14578206f09d27d183e5370da31199d7ef1bb00a1
7
+ data.tar.gz: 6f1aee3518b50987571d52778b7cf4e4885fd3fe09b7874c8a62795e500fa6281c536db6d3b68181d2453a1f09adc55ed727072ee3c790194a319a5b924cac7f
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Zencms
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Zencms'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,19 @@
1
+ # = require jquery
2
+ # = require jquery_ujs
3
+ # = require bootstrap
4
+ # = require soundmanager2/script/soundmanager2-nodebug-jsmin
5
+ # = require soundmanager2/demo/play-mp3-links/script/inlineplayer
6
+ # = require ckeditor/ckeditor
7
+ # = require_tree .
8
+
9
+ $('form').on 'click', '.add_fields', (event) ->
10
+ console.log 'd'
11
+ event.preventDefault()
12
+ time = new Date().getTime()
13
+ regexp = new RegExp($(this).data('id'), 'g')
14
+ $(this).closest('table').find('tbody').append($(this).data('fields').replace(regexp, time))
15
+
16
+ $('form').on 'click', '.remove_fields', (event) ->
17
+ event.preventDefault()
18
+ $(this).prev('input[type=hidden]').val('1')
19
+ $(this).closest('tr').hide()
@@ -0,0 +1,6 @@
1
+ //= require font-awesome
2
+ //= require soundmanager2/demo/play-mp3-links/css/inlineplayer
3
+ //= require_self
4
+ //= require_tree .
5
+
6
+ @import "bootstrap"
@@ -0,0 +1,4 @@
1
+ module Zencms
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,37 @@
1
+ require_dependency "zencms/application_controller"
2
+
3
+ module Zencms
4
+ module Backend
5
+ class PostsController < ApplicationController
6
+ inherit_resources
7
+ respond_to :html
8
+ # belongs_to :post_type, :optional => true, :parent_class => PostType
9
+ has_scope :sticky, :type => :boolean, :default => true
10
+ has_scope :page, :default => 1
11
+ # before_filter :authenticate_user!
12
+ # load_and_authorize_resource
13
+
14
+ def update
15
+ update! do |success, failure|
16
+ success.html{ redirect_to post_path(resource) }
17
+ failure.html{ render action: "edit" }
18
+ end
19
+ end
20
+
21
+ def create
22
+ @post = build_resource
23
+ @post.user = current_user
24
+ create! do |success, failure|
25
+ success.html{ redirect_to post_path(@post) }
26
+ failure.html{ render action: "new" }
27
+ end
28
+ end
29
+
30
+ protected
31
+ def permitted_params
32
+ params.permit!
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,34 @@
1
+ require_dependency "zencms/application_controller"
2
+
3
+ module Zencms
4
+ class PostsController < ApplicationController
5
+ inherit_resources
6
+ before_action :set_posts_by_month, only: [:index, :show, :archive, :tag, :category]
7
+ has_scope :published, :type => :boolean, :default => true
8
+ respond_to :html
9
+
10
+
11
+ def category
12
+ @category = ActsAsTaggableOn::Tag.friendly.find(params[:category])
13
+ @posts ||= end_of_association_chain.tagged_with(@category, on: :categories)
14
+ render :action => 'index'
15
+ end
16
+
17
+ def tag
18
+ @tag = ActsAsTaggableOn::Tag.friendly.find(params[:tag])
19
+ @posts ||= end_of_association_chain.tagged_with(@tag, on: :tags)
20
+ render :action => 'index'
21
+ end
22
+
23
+ def archive
24
+ @posts ||= end_of_association_chain.from_month(Time.parse "#{params[:month]}/#{params[:year]}").published
25
+ render :action => 'index'
26
+ end
27
+
28
+ private
29
+ def set_posts_by_month
30
+ @posts_by_month = Post.published.group_by { |t| t.created_at.beginning_of_month}
31
+ end
32
+
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ module Zencms
2
+ module ApplicationHelper
3
+
4
+ def link_to_add_fields(name, f, association)
5
+ new_object = f.object.send(association).klass.new
6
+ id = new_object.object_id
7
+ fields = f.fields_for(association, new_object, child_index: id) do |builder|
8
+ render(association.to_s.singularize + "_fields", f: builder)
9
+ end
10
+ link_to(name, '#', class: "add_fields btn btn-default", data: {id: id, fields: fields.gsub("\n", "")})
11
+ end
12
+
13
+ def main_column_class
14
+ if content_for? :sidebar_first
15
+ 'col-md-9'
16
+ else
17
+ 'col-md-12'
18
+ end
19
+ end
20
+
21
+ def active_class(path)
22
+ "active" if current_page?(path)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ module Zencms
2
+ module MenuItemsHelper
3
+
4
+ def menu_link(menu_item)
5
+ if menu_item.menuable.present?
6
+ link_to menu_item.name, menu_item.menuable, title: "Link to #{menu_item.name}"
7
+ elsif menu_item.url?
8
+ link_to menu_item.name, menu_item.url, title: "Link to #{menu_item.name}"
9
+ else
10
+ link_to menu_item.name, '#', title: "Link to #{menu_item.name}"
11
+ end
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,41 @@
1
+ module Zencms
2
+ module PostsHelper
3
+
4
+ def post_teaser(post, length)
5
+ truncate_html(post.body, :length => length, :omission => link_to(' [...]', post, :title => "read more"))
6
+ end
7
+
8
+ def post_grid_images(post)
9
+ content_tag :div, class: 'row', :'data-clearing' => true do
10
+ content_tag_for :div, post.images, class: 'col-md-3' do |image|
11
+ concat link_to(image_tag(image.url(:small), :'data-caption' => image.title), image.url(:original), class: 'thumbnail')
12
+ end
13
+ end
14
+ end
15
+
16
+ def post_audios(post)
17
+ content_tag :ul, class: 'flat' do
18
+ content_tag_for :li, post.audios do |audio|
19
+ concat link_to audio.title, audio.url, class: 'sm2_link'
20
+ end
21
+ end
22
+ end
23
+
24
+ def post_categories(post)
25
+ content_tag :ul, class: 'list-inline' do
26
+ content_tag_for :li, post.categories do |category|
27
+ concat link_to category, category_posts_path(category), class: 'label label-info'
28
+ end
29
+ end
30
+ end
31
+
32
+ def post_tags(post)
33
+ content_tag :ul, class: 'list-inline' do
34
+ content_tag_for :li, post.tags do |tag|
35
+ concat link_to tag, tag_posts_path(tag), class: 'label label-default'
36
+ end
37
+ end
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,14 @@
1
+ module Zencms
2
+ class Asset < ActiveRecord::Base
3
+ # Associations
4
+ belongs_to :assetable, :polymorphic => true
5
+ delegate :url, :to => :attachment
6
+ # Callbacks
7
+ before_create :default_title
8
+
9
+ def default_title
10
+ self.title ||= File.basename(attachment_file_name, '.*').titleize if attachment
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Zencms
2
+ class MenuItem < ActiveRecord::Base
3
+ default_scope { order('position') }
4
+ belongs_to :menuable, :polymorphic => true
5
+ has_ancestry
6
+ acts_as_list scope: [:ancestry]
7
+
8
+ MENUS = ['Primary','Secondary']
9
+
10
+ end
11
+ end
@@ -0,0 +1,48 @@
1
+ module Zencms
2
+ class Post < ActiveRecord::Base
3
+ # Scopes
4
+ default_scope { order('created_at DESC') }
5
+ scope :sticky, -> { order('sticky DESC') }
6
+ scope :published, -> { where(:published => true) }
7
+ scope :frontpage, -> { where(frontpage: true) }
8
+ scope :from_month, lambda { |month| where(:created_at => month..(month + 1.month)) }
9
+ scope :next, lambda {|id| where("id > ?",id).order("id ASC") }
10
+ scope :previous, lambda {|id| where("id < ?",id).order("id DESC") }
11
+
12
+ # Associations
13
+ belongs_to :post_type
14
+ belongs_to :user
15
+ has_one :menu_item, as: :menuable, dependent: :destroy
16
+ has_many :images, as: :assetable, class_name: "Post::Image", dependent: :destroy
17
+ has_many :audios, as: :assetable, class_name: "Post::Audio", dependent: :destroy
18
+
19
+ accepts_nested_attributes_for :images, allow_destroy: true, :reject_if => proc { |attributes| attributes['attachment'].blank? }
20
+ accepts_nested_attributes_for :audios, allow_destroy: true, :reject_if => proc { |attributes| attributes['attachment'].blank? }
21
+ accepts_nested_attributes_for :menu_item, allow_destroy: true, :reject_if => proc { |attributes| attributes['name'].blank? }
22
+
23
+ # Delegation
24
+ delegate :username, :to => :user
25
+
26
+ # Validations
27
+ validates :title, presence: true
28
+
29
+ # Gem
30
+ paginates_per 12
31
+ acts_as_taggable_on :tags, :categories
32
+ translates :title, :body
33
+
34
+ def to_param
35
+ "#{id}-#{title}".parameterize
36
+ end
37
+
38
+ def next
39
+ Post.next(self.id).first
40
+ end
41
+
42
+ def previous
43
+ Post.previous(self.id).first
44
+ end
45
+
46
+
47
+ end
48
+ end
@@ -0,0 +1,8 @@
1
+ module Zencms
2
+ class Post::Audio < Asset
3
+ has_attached_file :attachment
4
+
5
+ validates_attachment_size :attachment, :less_than => 20.megabytes
6
+ validates_attachment_content_type :attachment, :content_type => [ 'application/mp3', 'application/x-mp3', 'audio/mpeg', 'audio/mp3', 'audio/aiff', 'audio/wav', 'audio/x-wav' ]
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Zencms
2
+ class Post::Image < Asset
3
+ has_attached_file :attachment,
4
+ :styles => { :large => "1024x1024>", :medium => "480x320>", :small => "320x240#", :thumb => "48x48#"}
5
+ validates_attachment_size :attachment, :less_than => 2.megabytes
6
+ validates_attachment_content_type :attachment, :content_type => ['image/jpeg', 'image/png', 'image/gif']
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Zencms
2
+ class PostType < ActiveRecord::Base
3
+ has_many :posts
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{:charset => "utf-8"}
5
+ %meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}
6
+ %title
7
+ %meta{:content => "", :name => "description"}
8
+ %meta{:content => "width=device-width, initial-scale=1", :name => "viewport"}
9
+ = csrf_meta_tags
10
+ = stylesheet_link_tag "zencms/application", media: "all", "data-turbolinks-track" => true
11
+ %body
12
+ #page
13
+ %header#header{:role => 'banner'}
14
+ %nav.navbar.navbar-inverse.navbar-static-top{role: 'navigation'}
15
+ .navbar-header
16
+ =link_to 'Rails4 Blog engine', zencms.root_path, class: 'navbar-brand'
17
+ .collapse.navbar-collapse
18
+ %ul.nav.navbar-nav
19
+ - Zencms::MenuItem.all.where(menu: 'Primary').includes(:menuable).each do |menu_item|
20
+ %li= menu_link(menu_item)
21
+
22
+ #main
23
+ #main-inner.container
24
+ = content_tag(:div, flash.notice, :class => "alert alert-info") if flash.notice
25
+ = content_tag(:div, flash.alert, :class => "alert alert-danger") if flash.alert
26
+ = content_tag(:h1, yield(:page_title), id: 'page-title', class: 'page-header') if content_for? :page_title
27
+ .row
28
+ = content_tag(:section, yield, :role => 'main', id: 'main-content', class: main_column_class)
29
+ = content_tag(:section, yield(:sidebar_first), id: 'sidebar-second', class: 'col-md-3') if content_for? :sidebar_first
30
+
31
+ %footer#footer{:role => 'contentinfo'}
32
+ #footer-inner.container
33
+ %p © 2014 Exakat
34
+
35
+ = javascript_include_tag "zencms/application", "data-turbolinks-track" => true
@@ -0,0 +1,14 @@
1
+ %tr
2
+ - unless f.object.new_record?
3
+ %td
4
+ = link_to f.object.attachment_file_name, f.object.url
5
+ %td
6
+ = f.hidden_field :id
7
+ = f.input :title, label_html: {class: 'hidden'}
8
+ %td
9
+ = f.hidden_field :_destroy
10
+ = link_to raw("<i class='fa fa-trash-o'></i> Remove"), '#', class: "remove_fields btn btn-danger"
11
+ - else
12
+ %td{colspan: 3}
13
+ = f.hidden_field :id
14
+ = f.input :attachment
@@ -0,0 +1,53 @@
1
+ = simple_form_for [:backend, resource] do |f|
2
+ = f.error_notification
3
+ .row
4
+ .col-md-9
5
+ = f.input :title
6
+ = f.input :body, input_html: {class: 'ckeditor'}
7
+
8
+ %table.table.table-bordered.table-condensed
9
+ %thead
10
+ %tr
11
+ %th Thumbnail
12
+ %th Image caption
13
+ %th Operation
14
+ %tbody
15
+ = f.simple_fields_for :images do |builder|
16
+ = render 'image_fields', f: builder
17
+ %tfoot
18
+ %tr
19
+ %th.align-left{colspan: 3}= link_to_add_fields "Add Image", f, :images
20
+
21
+ %table.table.table-bordered.table-condensed
22
+ %thead
23
+ %tr
24
+ %th Audio
25
+ %th Audio title
26
+ %th Operation
27
+ %tbody
28
+ = f.simple_fields_for :audios do |builder|
29
+ = render 'audio_fields', f: builder
30
+ %tfoot
31
+ %tr
32
+ %th.align-left{colspan: 3}= link_to_add_fields "Add Audio", f, :audios
33
+
34
+ .col-md-3
35
+ %fieldset
36
+ %legend Vocabularies
37
+ = f.input :category_list, label: 'Categories'
38
+ = f.input :tag_list, label: 'Tags'
39
+
40
+ %fieldset
41
+ %legend Promotion options
42
+ = f.input :published
43
+ = f.input :frontpage
44
+ = f.input :sticky
45
+
46
+ %fieldset
47
+ %legend Menu option
48
+ -resource.build_menu_item if resource.menu_item.blank?
49
+ = f.simple_fields_for :menu_item do |menu_item|
50
+ = menu_item.input :menu, collection: Zencms::MenuItem::MENUS, include_blank: false
51
+ = menu_item.input :name
52
+
53
+ = f.button :submit