AgileVentures/LocalSupport

View on GitHub
app/views/organisations/_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for org do |f| %>
  <table>
    <thead>
    </thead>
    <tbody>
    <tr>
      <td data-toggle="tooltip" title="Enter a unique name">
        <% if org.errors[:name].any?%>
          <p class="error-name"><%= org.errors[:name].first %></p>
        <% end %>
        <%= f.text_area :name, :size => "50x4", :class => "wide_form org_h3", :placeholder => "Enter organisation name" %>
      </td>
      <td class="borderless">
        <input type="checkbox" class="publish" disabled checked = "checked" value="">
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Enter a full description here. When an individual searches this database all words in this description will be searched.">
        <% if org.errors[:description].any?%>
          <p class="error"><%= org.errors[:description].first %></p>
        <% end %>
        <%= f.text_area :description, :class => "wide_form", :cols => "10", :rows => "10", :placeholder => "Enter organisation description" %>
      </td>
      <td class="borderless">
        <input type="checkbox" class="publish" disabled checked = "checked" value="">
      </td>
    </tr>
    <tr><td><h3>
      Contact information
    </h3></td></tr>
    <tr>
      <td data-toggle="tooltip" title="Enter a complete address">
        <%= f.text_field :address, :class => "wide_form", :placeholder => "Enter organisation address"%>
      </td>
      <td class="borderless" data-toggle="tooltip" title="Toggle to change the visibility of your address">
        <%= f.check_box :publish_address, :class => 'publish' %>
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Make sure post code is accurate">
        <%= f.text_field :postcode, :class => "wide_form", :placeholder => "Enter organisation post code" %>
      </td>
      <td class="borderless">
        <input type="checkbox" class="publish" disabled checked = "checked" value="">
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Make sure email is correct">
        <%= f.text_field :email, :class => "wide_form", :placeholder => "Enter organisation email address" %>
      </td>
      <td class="borderless" data-toggle="tooltip" title="Toggle to change the visibility of your email address">
        <%= f.check_box :publish_email, :class => 'publish' %>
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Make sure url is correct">
        <% if org.errors[:website].any?%>
          <p class="error"><%= org.errors[:website].first %></p>
        <% end %>
        <%= f.text_field :website, :class => "wide_form", :placeholder => "Enter organisation website url" %>
      </td>
      <td class="borderless">
        <input type="checkbox" class="publish" disabled checked = "checked" value="">
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Make sure phone number is correct">
        <%= f.text_field :telephone, :class => "wide_form", :placeholder => "Enter organisation phone number" %>
      </td>
      <td class="borderless" data-toggle="tooltip" title="Toggle to change the visibility of your telephone number">
        <%= f.check_box :publish_phone, :class => "publish"%>
      </td>
    </tr>
    <tr>
      <td class="borderless" data-toggle="tooltip" title="Please enter a website here either to the fundraising page on your website or to an online donation site.">
        <% if org.errors[:donation_info].any?%>
          <p class="error"><%= org.errors[:donation_info].first %></p>
        <% end %>
        <%= f.text_field :donation_info, :class => "wide_form", :placeholder => "Enter organisation donation url" %>
      </td>
      <td class="borderless">
        <input type="checkbox" disabled checked = "checked" value="" class="publish">
      </td>
    </tr>
    <tr>
      <td class="borderless" >
        <div>
          <%= render partial: 'organisations/organisation_admin_display', locals: {org: org} %>
       </div>
      </td>
      <td class="borderless">
        <input type="checkbox" class="publish" disabled>
      </td>
    </tr>
  <tr>
    <td class="borderless" data-toggle="tooltip" title="Please enter the details of individuals from your organisation you would like to give permission to update your entry. E-mail addresses entered here will not be made public.">
      <%= text_field_tag 'organisation_superadmin_email_to_add', value = nil, {:size => 100, class: 'wide_form', :cols => "10", :rows => "3", :placeholder => 'You may add an organisation administrator email here'} %>
    </td>
    <td class="borderless"></td>
  </tr>
    </tbody>
  </table>
  <div class="org-categories">
    <h4>Edit categories</h4>
    <%= render partial: 'organisations/category_type', locals: {f: f} %>
  </div>
    <br>
    <% if org.class == ProposedOrganisation %>
        <h5>Please Confirm you are a not for profit organisation and are registered or working in Harrow</h5>
        <%= f.check_box :non_profit %>
        <%= f.label :non_profit ,"We are a not for profit organisation registered or working in Harrow", class: "checkbox inline", style: "padding-left: 5px; padding-top: 1px;" %>
    <% end %>

    <% if @user_id %>
      <%= f.hidden_field :user_id, value: @user_id %> 
    <%end %>

    <div id="org-cat-buttons" class="row">
      <div class="position-bottom col-md-6">
        <div class="actions">
          <%= f.submit :class => 'btn btn-primary' %>
        </div>
      </div>
    </div>

<% end %>

<% render partial: 'shared/map_scripts', locals: {markers: @markers} %>