holderdeord/hdo-site

View on GitHub
app/views/admin/representatives/edit.html.erb

Summary

Maintainability
Test Coverage
<% page_title "Rediger #{@representative.name} - Admin - #{t('app.title')}" %>

<h1><%= "#{@representative.first_name} #{@representative.last_name}" %></h1>
<div class="row-fluid">
  <div class="span4">
    <%= image_tag @representative.image, class: 'representative-image', alt: @representative.full_name, width: '240', height: '320' %>
  </div>

  <div class="span6">
    <%= form_for [:admin, @representative] do |form| %>
      <fieldset>
        <legend><%= t('app.edit') %></legend>

        <div class="input-prepend">
          <span class="add-on">@</span>
          <%= text_field :representative, :twitter_id %>
        </div>

        <div class="input-prepend">
          <span class="add-on"><%= Representative.human_attribute_name :email %></span>
          <%= text_field :representative, :email %>
        </div>

        <div>
          <div class="row-fluid"><div class="span1"><%= check_box :representative, :opted_out, class: "pull-right" %></div><div class="span5"><%= form.label :opted_out %></div></div>
        </div>
      </fieldset>

      <div class="actions"></div>
        <%= form.submit t('app.save'), class: 'btn btn-primary' %>
        <%= link_to t('app.cancel'), admin_representatives_path, class: 'btn' %>
      </div>
    <% end %>
  </div>
</div>