aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/refinery/banners/admin/banners/_form.html.erb
blob: 356719ed1c2d344a4952069b603b39da7dbfe17e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<%= form_for [refinery, :banners_admin, @banner] do |f| -%>
    <%= render '/refinery/admin/error_messages',
               :object => @banner,
               :include_object_name => true %>

    <%= hidden_field_tag 'banner[page_ids][]' %>

    <div class='field'>
      <%= f.label :name -%>
      <%= f.text_field :name, :class => 'larger widest'  -%>

    </div>

    <div class='field'>
      <%= f.label :title -%>
      <%= f.text_field :title  -%>

    </div>

    <div class='field'>
      <%= f.label :description -%>
      <%= f.text_area :description, :rows => 20, :class => 'wymeditor widest'  -%>

    </div>

    <div class='field'>
      <%= f.label :image -%>
      <%= render '/refinery/admin/image_picker',
                 :f => f,
                 :field => :image_id,
                 :image => @banner.image,
                 :toggle_image_display => false,
                 :description => t('refinery.banners.admin.banner')
      %>

    </div>

    <div class='field'>
      <%= f.label :url -%>
      <%= f.text_field :url  -%>

    </div>

    <% if Refinery::I18n.frontend_locales %>
      <div class='field'>
        <%= f.label :locale -%>
        <%= f.select :locale, Refinery::I18n.frontend_locales, include_blank: true  -%>
      </div>
    <% end %>

    <div class='field'>
      <%= f.label :is_active -%>
      <%= f.check_box :is_active, :checked => @banner[:is_active]  -%>

    </div>

    <div class='field'>
      <%= f.label :start_date -%>
      <%= f.date_select :start_date  -%>

    </div>

    <div class='field'>
      <%= f.label :expiry_date -%>
      <%= f.date_select :expiry_date  -%>

    </div>

    <section id="records" class="tree">
      <%= f.label :pages %>
      <ul class="tristate">
        <%= render :partial => 'refinery/banners/admin/banners/page', :collection => Refinery::Page.order("lft ASC").select{|p| p.parent_id.nil?}  %>
      </ul>
    </section>


    <div style="clear: both;"></div>
    <%= render '/refinery/admin/form_actions', :f => f,
               :continue_editing => false,
               :delete_title => t('delete', :scope => 'refinery.banners.admin.banners.banner'),
               :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @banner.name) %>
<% end -%>