2011-08-09 11:06:53 +02:00
|
|
|
.main
|
|
|
|
.content
|
|
|
|
%label{:for => :post_content}="Content"
|
|
|
|
%textarea.content{:id => :post_content,
|
|
|
|
:name => 'post[content]'}=@post.content
|
|
|
|
.title
|
|
|
|
%label{:for => :post_title}="Title"
|
|
|
|
%input{:id => :post_title,
|
|
|
|
:name => 'post[title]',
|
|
|
|
:value => @post.title}
|
|
|
|
.further
|
2011-08-09 18:05:59 +02:00
|
|
|
.markup
|
|
|
|
%label{:for => :post_markup}="markup"
|
|
|
|
%select{:id => :post_markup, :name => 'post[markup]'}
|
|
|
|
-[:markdown, :textile].each do |markup|
|
|
|
|
-if @post.markup.to_sym == markup
|
|
|
|
%option{:selected => :selected}=markup
|
|
|
|
-else
|
|
|
|
%option=markup
|
2011-08-09 11:06:53 +02:00
|
|
|
.written
|
|
|
|
%label{:for => :post_written}="written"
|
|
|
|
%input{:id => :post_written,
|
|
|
|
:name => 'post[written]', :value => @post.written}
|
|
|
|
.released
|
|
|
|
%label{:for => :post_released}="released"
|
|
|
|
%input{:type => :checkbox, :name => 'post[released]',
|
|
|
|
:class => "post-released-#{@post.released}", :value => 0,
|
|
|
|
:checked => @post.released, :id => :post_released}
|
|
|
|
.author
|
|
|
|
%label{:for => :post_author}="Author"
|
|
|
|
%select{:name => 'post[account_id]', :id => :post_author}
|
|
|
|
-Account.all(:order => [:id]).each do |account|
|
|
|
|
-if @post.account == account
|
|
|
|
%option{:value => account.id, :selected => :selected}
|
|
|
|
=account.username
|
|
|
|
-else
|
|
|
|
%option{:value => account.id}=account.username
|
|
|
|
.tags
|
2011-08-09 14:59:55 +02:00
|
|
|
%label{:for => :post_tags}="Tags (#{Tag.all.count})"
|
2011-08-09 11:06:53 +02:00
|
|
|
%select{:name => 'post[tags]', :id => :post_tags, :size => 10, :multiple => true}
|
2011-08-09 18:05:59 +02:00
|
|
|
- post_tags = @post.tags
|
2011-08-09 14:59:55 +02:00
|
|
|
- Tag.all(:order => [:name.asc]).each do |tag|
|
2011-08-09 18:05:59 +02:00
|
|
|
-if @post.has_tag tag
|
|
|
|
%option{:selected => :selected, :value => tag.id}=tag.name
|
|
|
|
-else
|
|
|
|
%option{:value => tag.id}=tag.name
|