dianhua1560/bhgh

View on GitHub
app/views/events/_add_event_modal.html.erb

Summary

Maintainability
Test Coverage
<div class="modal fade" tabindex="-1" role="dialog" id = 'add-event-modal'>
  <div class="modal-dialog">
    <div class="modal-content">

      <div class="modal-body">

        <div ng-show = 'has_errors && error_type == "event"'>
          <h1>Errors</h1>
          <div ng-repeat = 'error in errors'>
            <div>{{error}}</div>
          </div>
        </div>

        <%= form_for Event.new, url: '/events/create_form', html: { multipart: true } do |form| %>
        <h1>Add an event</h1>
        Title: <%= form.text_field :title, :placeholder => 'title', :class => 'form-control', :id => "add-event-title" %>
        Description: <%= form.text_field :description, :placeholder => 'description', :class => 'form-control', :id =>  'add-event-description' %>
        Time: <%= form.text_field :time, :placeholder => 'time', :class => 'form-control', :id => 'add-event-time'  %>
        Organizer: <%= form.text_field :organizer, :placeholder => 'organizer', :class => 'form-control', :id=> 'add-event-organizer' %>
        Location: <%= form.text_field :location, :placeholder => 'location', :class => 'form-control', :id=> 'add-event-location' %>
        Photo: 
        <div>
            <input type="file" name="event[avatar]" id="add-event-avatar" onchange = "readURL(this, '#event-add-img-preview')">
            <img src = '' id = 'event-add-img-preview' class = 'img-preview'>
          </div>

        <%= form.submit "Create", :class => 'btn btn-default' %>

        <% end %>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->