alternative form style

This commit is contained in:
albert
2011-03-10 19:07:45 -05:00
parent 81aec6b950
commit 2549d643f3
4 changed files with 73 additions and 122 deletions

View File

@@ -1,63 +1,61 @@
<div id="edit"> <% unless CurrentUser.user.is_contributor? %>
<% unless CurrentUser.user.is_contributor? %> <div style="margin-bottom: 1em;">
<div style="margin-bottom: 1em;"> <p>Before editing, read the <%= link_to "how to tag guide", wiki_page_path(:id => "howto:tag") %>.</p>
<p>Before editing, read the <%= link_to "how to tag guide", wiki_page_path(:id => "howto:tag") %>.</p> </div>
</div> <% end %>
<% end %>
<%= form_for(post, :html => {:class => "simple_form"}) do |f| %> <%= form_for(post, :html => {:class => "simple_form"}) do |f| %>
<%= f.hidden_field :old_tags, :value => post.tag_string %> <%= f.hidden_field :old_tags, :value => post.tag_string %>
<div class="input"> <div class="input">
<% if post.is_rating_locked? %> <% if post.is_rating_locked? %>
This post is rating locked. This post is rating locked.
<% else %> <% else %>
<%= f.label :blank, "Rating" %> <%= f.label :blank, "Rating" %>
<fieldset class="ratings">
<%= f.radio_button :rating, :e %>
<%= f.label :rating_e, "Explicit" %>
<%= f.radio_button :rating, :q %>
<%= f.label :rating_q, "Questionable" %>
<%= f.radio_button :rating, :s %>
<%= f.label :rating_s, "Safe" %>
</fieldset>
<% end %>
</div>
<% if CurrentUser.user.is_privileged? %> <fieldset class="ratings">
<div class="input"> <%= f.radio_button :rating, :e %>
<%= f.label :blank, "Lock" %> <%= f.label :rating_e, "Explicit" %>
<fieldset class="locks">
<%= f.check_box :is_note_locked %>
<%= f.label :is_note_locked, "Notes" %>
<%= f.check_box :is_rating_locked %> <%= f.radio_button :rating, :q %>
<%= f.label :is_rating_locked, "Rating" %> <%= f.label :rating_q, "Questionable" %>
</fieldset>
</div> <%= f.radio_button :rating, :s %>
<%= f.label :rating_s, "Safe" %>
</fieldset>
<% end %> <% end %>
</div>
<% if CurrentUser.user.is_privileged? %>
<div class="input"> <div class="input">
<%= f.label :parent_id, "Parent" %> <%= f.label :blank, "Lock" %>
<%= f.text_field :parent_id, :size => 5 %>
</div> <fieldset class="locks">
<%= f.check_box :is_note_locked %>
<div class="input"> <%= f.label :is_note_locked, "Notes" %>
<%= f.label :source %>
<%= f.text_field :source %> <%= f.check_box :is_rating_locked %>
</div> <%= f.label :is_rating_locked, "Rating" %>
</fieldset>
<div class="input">
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string , :size => "50x3" %>
</div>
<div class="input">
<%= submit_tag "Submit" %>
</div> </div>
<% end %> <% end %>
</div>
<div class="input">
<%= f.label :parent_id, "Parent" %>
<%= f.text_field :parent_id, :size => 5 %>
</div>
<div class="input">
<%= f.label :source %>
<%= f.text_field :source %>
</div>
<div class="input">
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string , :size => "50x3" %>
</div>
<div class="input">
<%= submit_tag "Submit" %>
</div>
<% end %>

View File

@@ -1,5 +1,5 @@
<div class="uploads"> <div id="c-uploads">
<div class="new"> <div id="a-new">
<div id="upload-guide-notice"> <div id="upload-guide-notice">
<p>Before uploading, please read the <%= link_to "how to upload guide", wiki_pages_path(:title => "howto:upload") %>.</p> <p>Before uploading, please read the <%= link_to "how to upload guide", wiki_pages_path(:title => "howto:upload") %>.</p>
</div> </div>

View File

@@ -5,6 +5,4 @@
<% if CurrentUser.is_janitor? %> <% if CurrentUser.is_janitor? %>
<%= f.input :is_locked %> <%= f.input :is_locked %>
<% end %> <% end %>
<div id="multiple-buttons"> <%= f.button :submit, "Save" %><%= f.button :submit, "Cancel" %><%= f.button :submit, "Preview" %>
<%= f.button :submit, "Save" %><%= f.button :submit, "Cancel" %><%= f.button :submit, "Preview" %>
</div>

View File

@@ -266,30 +266,10 @@ body > header > h1 {
/*** Simple Form ***/ /*** Simple Form ***/
form.simple_form { form.simple_form {
input[type=submit] { margin: 1em 0;
margin-left: 10.3em;
}
div.input.boolean {
padding-left: 10em;
label {
margin: 0;
text-align: left;
display: inline;
width: none;
}
}
div#multiple-buttons {
margin-left: 10em;
input {
margin: 0 0.5em 0 0;
}
}
div.input { div.input {
margin-bottom: 0.5em; margin-bottom: 1em;
input[type=text], input[type=file], textarea { input[type=text], input[type=file], textarea {
width: 300px; width: 300px;
@@ -300,21 +280,14 @@ form.simple_form {
} }
label { label {
vertical-align: top; display: block;
display: inline-block;
width: 10em;
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
margin-top: 3px;
margin-right: 10px;
text-align: right;
} }
span.hint { span.hint {
margin-left: 11em;
color: #666; color: #666;
font-style: italic; font-style: italic;
vertical-align: top;
display: block; display: block;
} }
@@ -569,6 +542,14 @@ div#c-posts {
color: black; color: black;
} }
} }
section#edit {
fieldset {
label {
display: inline;
}
}
}
} }
} }
@@ -715,42 +696,16 @@ div.users {
} }
/*** Uploads ***/ /*** Uploads ***/
div.uploads { div#c-uploads {
div.new { div#a-new {
div#upload-guide-notice { div#upload-guide-notice {
margin-bottom: 2em; margin-bottom: 2em;
} }
}
}
fieldset.ratings {
/*** notify ***/ label {
.notify-container { display: inline;
position: fixed; }
top: 0;
left: 0;
width: 100%;
z-index: 1000;
.notify-notification {
position: relative;
.notify-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
background-color: #333;
z-index: 1;
}
.notify-message {
position: relative;
z-index: 2;
padding: 20px;
text-align: center;
color: #FFF;
} }
} }
} }