Sha256: 6d91b744bfd70108651aa15971903d5e1ac097d1b316a09e416d45c6814bbaa0

Contents?: true

Size: 1.62 KB

Versions: 1

Compression:

Stored size: 1.62 KB

Contents

<%= form_for(@report) do |f| %>
  <% if @report.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@report.errors.count, "error") %> prohibited this report from being saved:</h2>

      <ul>
      <% @report.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </div>
  <div class="field">
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :group %><br />
    <%= f.text_field :group %>
  </div>
  <div class="field">
    <%= f.label :direct %><br />
    <%= f.check_box :direct %>
  </div>
  <div class="field">
    <%= f.label :views %><br />
    <%= f.number_field :views, disabled: true %>
  </div>
  <div class="field">
    <%= f.label :target %><br />
    <%= f.text_field :target %>
  </div>
  <div class="field">
    <% formats = @report.formats %>
    <% if current_user.has_any_role?(:admin, :manager) %>
      <% for format in MetaReports::Base::FORMATS.sort %>
        <%= check_box_tag "report[formats][]", format, formats.include?(format) %>
        <span class='bold'><%= format.humanize %></span>
        <br />
      <% end %>
    <% else %>
      <% for format in formats %>
        * <span class='bold'><%= role.humanize %></span>
        <br />
      <% end %>
    <% end %>
    <%= hidden_field_tag "report[formats][]", "" %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meta_reports-0.0.5 spec/dummy/app/views/meta_reports/reports/_form.html.erb