pboling/an_axe

View on GitHub
app/views/an_axe/forums/topics/_form.html.erb.haml

Summary

Maintainability
Test Coverage
%p
  %label{ :for => "topic_title" }
    = t("savage_beast.title_title")
  %br
  = form.text_field :title, :onchange => "/*TopicForm.editNewTitle(this);*/", :class => "primary", :tabindex => 10
  - if admin? or current_user.moderator_of?(@topic.forum)
    %label{ :style => "margin-left:1em;" }
      = form.check_box :sticky
      = t("savage_beast.sticky_title")
    %label{ :style => "margin-left:1em;" }
      = form.check_box :locked
      = t("savage_beast.locked_title")

- if @topic.new_record?
  %p
    %label{ :for => "topic_body" }
      = t("savage_beast.body_title")
    %br
    = form.text_area :body, :rows => 12, :tabindex => 20
  %p
    %label{ :for => "topic_post_tags" }
      Tags
    %br
    = form.text_field :body_list, :tabindex => 30
- if admin? and not @topic.new_record?
  %p#topic_forum_id
    %label{ :for => "topic_forum_id" }
      = t("savage_beast.forum_title")
    %br
    = form.select :forum_id, Forum.find(:all, :order => "position").map {|x| [x.name, x.id] }