Skip to content

Commit

Permalink
readability, terminate the -
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Jul 23, 2010
1 parent f190df1 commit 0b8f9a5
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions app/views/admin/blogs/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<%= error_messages_for :blog -%>
<% form_for [:admin, @blog] do |f| -%>

<div class='field'>
<%= f.label :title -%>
<%= f.text_field :title, :class => 'larger', :style => 'width: 944px' -%>
</div>

<div class='field'>
<%= f.label :excerpt -%>
<%= f.text_area :excerpt, :rows => 5, :cols => 140, :class => 'wymeditor' -%>
</div>

<div class='field'>
<%= f.label :body -%>
<%= f.text_area :body, :rows => 20, :cols => 140, :class => 'wymeditor' -%>
</div>

<p>
<%= link_to "&raquo; Hide/Show Advanced Options", "#",
:id => 'toggle_advanced_options',
:rel => 'Click to access meta tag settings and menu options' %>
</p>

<div id='more_options' style="display:none;">
<div class="hemisquare">
<div class='field'>
<%= f.label :publishing_date, "Date published" -%>
<%= f.datetime_select :publishing_date -%>
</div>

<div class='field'>
<label>Allow comments</label>
<%= f.check_box :allow_comment -%>
Expand All @@ -42,14 +42,14 @@
Allowed characters are: lowercase letters, numbers, underscores and dashes.
</small>
</div>

<div class='field'>
<label>Draft</label>
<%= f.check_box :draft -%>
<%= f.label :draft, "Save as Draft", :class => "stripped" %>
</div>
</div>

<div class="hemisquare right_side">
<div class='field'>
<%= f.label :category_list, "Categories" %>
Expand All @@ -58,7 +58,7 @@
Separate with commas, e.g. "Programming, Web Design"
</small>
</div>

<div class='field'>
<%= f.label :tag_list, "Tags" %>
<%= f.text_field :tag_list %><br/>
Expand All @@ -76,7 +76,7 @@
</div>
</div>
</div>

<%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false} %>
<% end -%>
Expand All @@ -94,9 +94,12 @@
scrollTop: $('#toggle_advanced_options').parent().offset().top
}, 250);
});

$('#blog_title').keyup(function(){
slug = $(this).val().replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').replace(/-{2,}/,'-').toLowerCase();
slug = $(this).val().replace(/\s+/g,'-')
.replace(/[^a-zA-Z0-9\-]/g,'')
.replace(/\-{2,}/,'-')
.toLowerCase();
$('#blog_permalink').val(slug);
})
});
Expand Down

0 comments on commit 0b8f9a5

Please sign in to comment.