linguisticexplorer/Linguistic-Explorer

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

Summary

Maintainability
Test Coverage
<%= render :partial => 'layouts/forum_header_bar' %>
<%= form_for [@forum, @topic] do |f| %>
<% if @topic.errors.any? %>
  <% flash.now[:error] = @topic.errors.full_messages.join(', and ') %>
<% end %>
<div class="module">
  <div class="module_header"><%= action_name.humanize %> Topic</div>
    <div class="module_subheader smaller"></div>
    <div class="module_body">
      <div class="fieldset">
        <span class="label indent smaller">
          <%= f.label :title %><br />
          <small>(Required)</small>
        </span>
        <span class="input indent smaller"><%= f.text_field :title, :size => 75 %></span>
        <div class="clear"></div>
      </div>
      <% unless @topic.id %>
      <div class="fieldset">
        <span class="label indent smaller">
          <%= f.label :body %><br />
          <small>(Required)</small>
        </span>
        <span class="input indent smaller"><%= f.text_area :body, :cols => 60, :rows => 15 %></span>
        <div class="clear"></div>
      </div>
    </div>
    <% end %>
    <div class="module_footer">
      <div class="fieldset">
        <span class="input"><%= f.submit "submit" %> or <%= link_to "cancel", @topic.nil? ?  @topic : @forum %></span>
        <div class="clear"></div>
      </div>
    </div>
  </div>
</div>
<% end %>