% layout 'mainlayout';

<div class="section container">

  <h1 class=title>Write Message</h1>

  % if (my $msg = stash('warning')) {
    <p class=message> <%= $msg %> </p>
  % }

  %= form_for '' => (method => 'post') => (enctype => 'multipart/form-data') => (class => '') => begin

    <div class=field>
    %= label_for mail => ucfirst l('send_to') => (class => 'label')
      <div class=control>
      %= email_field 'to' => (id => 'mail') => (multiple => '') => (required => '') => (class => 'input')
      </div>
    </div>

    <div class=field>
    %= label_for subject => ucfirst l('subject') => (class => 'label')
      <div class=control>
      %= text_field 'subject' => (required => '') => (class => 'input')
      </div>
    </div>

    <div class=field>
    %= label_for cc => 'CC' => (class => 'label')
      <div class=control>
      %= email_field 'cc' => (multiple => '') => (class => 'input')
      </div>
    </div>

    <div class=field>
    %= label_for bcc => 'BCC' => (class => 'label')
      <div class=control>
      %= email_field 'bcc' => (multiple => '') => (class => 'input')
      </div>
    </div>

    <div class=field>
    %= label_for back_to => ucfirst l('answer_to') => (class => 'label')
      <div class=control>
      %= email_field 'back_to' => (class => 'input')
      </div>
    </div>

    <div class=field>
    %= label_for txt => ucfirst l('content') => (class => 'label')
    %= text_area body => (rows => 24) => (name => 'txt') => (class => 'textarea')
    </div>

    <div class=field>
      <div class=file>
        <label class=file-label>
          %= file_field 'attach' => (class => 'file-input')
          <div class="file-cta">
            %= tag span => (class => 'file-label') => begin
            %= ucfirst l('attach file')
            % end
          </div>
        </label>
      </div>
    </div>

    <div class=field>
      <div class=control>
      %= submit_button l('send') => (class => 'button')
      </div>
    </div>

    %= csrf_field

  % end

  <nav>
    <a href="javascript:history.back()" class="button"> <%= ucfirst l 'back' %> </a>
  </nav>

</div>