0
0
Fork 0
zero-blog/views/admin_post_edit.haml

49 lines
1.8 KiB
Plaintext

.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
.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
.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}
-if @post.account.nil?
-@post.account = @account
-Account.all(:order => [:id]).each do |account|
-if @post.account.id == account.id
%option{:value => account.id, :selected => :selected}
=account.username
-else
%option{:value => account.id}=account.username
.tags
%label{:for => :post_tags}="Tags (#{Tag.all.count})"
%select{:name => 'post[tags][]', :id => :post_tags, :size => 10, :multiple => true}
- post_tags = @post.tags
- Tag.all(:order => [:name.asc]).each do |tag|
-if @post.has_tag tag
%option{:selected => :selected, :value => tag.id}=tag.name
-else
%option{:value => tag.id}=tag.name