#wid-id-8.jarviswidget{"data-widget-custombutton" => "false", "data-widget-editbutton" => "false", :id => "wid-id-0", 'data-widget-colorbutton' => true} %header %span.widget-icon %i.fa.fa-edit %h2 Сериалы / widget div %div / widget edit box .jarviswidget-editbox / This area used as dropdown edit box / end widget edit box / widget content = nested_form_for(category, :html => {:class => 'smart-form', :multipart => true}) do |f| - if category.errors.any? - category.errors.full_messages.each do |msg| = render 'layouts/fly_admin/error_flash_message', msg: msg %section .row - if category.poster .col-xs-3 = link_to category.poster_url do = image_tag category.poster_url, size: '245x305', class: 'margin-left-10' .col-xs-8 %label.textarea = f.text_area :description, placeholder: 'Описание сериала', class: 'form-control ckeditor' .row %section.col.col-8 %label.input = f.text_field :remote_poster_url, placeholder: 'Ссылка на постер', class: 'form-control input-sm margin-10' %header Дополнителная инфа .row %section.col.col-4 %label.input = f.text_field :main_roles, placeholder: 'В главных ролях', class: 'margin-10 form-control input-sm' %section.col.col-4 %label.input = f.text_field :country, placeholder: 'Страна', class: 'margin-10 form-control input-sm' %section.col.col-4 %label.input = f.text_field :year, placeholder: 'Год', class: 'margin-10 form-control input-sm' .row %section.col.col-3 %lable.input = f.text_field :scenario, placeholder: 'Сценарий', class: 'margin-10 form-control input-sm' %section.col.col-3 %label.input = f.text_field :director, placeholder: 'Режиссер', class: 'margin-10 form-control input-sm' %section.col.col-3 %label.input = f.text_field :time, placeholder: 'Время', class: 'margin-10 form-control input-sm' %section.col.col-3 %label.input = f.text_field :genre, placeholder: 'Жанр', class: 'margin-10 form-control input-sm' %br .widget-body.no-padding %header Общая информация %table.table.table-bordered.margin-10.table-serials{style: 'width: 500px;'} %thead %tr %th Название сериала %th на языке %tbody - categories_with_locales.each_with_index do |arr, index| - locale = arr[0] - title = arr[1] - if index >= 2 - hide_class = "hidden-categories-inputs" %tr{class: hide_class} %td - if f.object.persisted? = text_field_tag "name[#{locale}]", f.object.name_with_locale(locale), class: 'input-xs', style: 'width: 90%;' - else = text_field_tag "name[#{locale}]", nil, class: 'input-xs', style: 'width: 90%;' %td = locale = link_to "Остальные языки для сериалов", "#", id: 'show-categories-inputs', class: 'margin-10 btn btn-for-link btn-link' = f.link_to_add 'Добавить сезон', :seasons, class: 'margin-10 btn btn-for-link btn-primary' = f.fields_for :seasons do |season_form| = season_form.hidden_field :id .row .col-xs-6 %table.table.table-bordered.margin-10{style: 'width: 500px;'} %thead %tr %th Название сезона %th на языке %tbody - categories_with_locales.each_with_index do |arr, index| - locale = arr[0] - title = arr[1] - if index >= 2 - hide_class = "hidden-seasons-inputs" %tr{class: hide_class} %td - if season_form.object.persisted? = text_field_tag "#{season_form.object_name}[title][#{locale}]]", season_form.object.name_with_locale(locale), class: 'input-xs', style: 'width: 90%;' - else = text_field_tag "#{season_form.object_name}[title][#{locale}]]", nil, class: 'input-xs', style: 'width: 90%;' %td = locale = link_to "Остальные языки для сезонов", "#", class: 'show-seasons-inputs margin-10 btn btn-for-link btn-link' = season_form.link_to_remove 'Удалить сезон', class: 'margin-10 btn btn-for-link btn-danger' .col-xs-4 %label.textarea = season_form.text_field :remote_poster_url, placeholder: 'Ссылка на постер', class: 'form-control input-sm margin-10' - if season_form.object.persisted? = link_to season_form.object.poster_url do = image_tag season_form.object.poster_url, size: '100x100', class: 'margin-left-10' %footer = f.submit 'Сохранить', class: 'btn btn-primary'