OSDN Git Service

now show Unit#explanation and update CSS, fix specs
authorokimoto <okimoto@good-day.co.jp>
Wed, 31 Mar 2010 06:26:26 +0000 (15:26 +0900)
committerokimoto <okimoto@good-day.co.jp>
Wed, 31 Mar 2010 06:26:26 +0000 (15:26 +0900)
app/views/admin/problems/edit.html.erb
app/views/admin/problems/new_form.html.erb
app/views/admin/units/_form.html.erb
app/views/admin/units/show.html.erb
public/stylesheets/mint.css
spec/views/admin/problems/edit.html.erb_spec.rb

index e71d15d..f1a495b 100644 (file)
@@ -11,5 +11,9 @@
 </div>
 <p><%= f.submit(_("Update")) %></p>
 <%- end -%>
+<h2>設定の解説</h2>
+<div class="hikidoc">
+<%= hikidoc(@form.unit.explanation) %>
+</div>
 
 <p><%= link_to _('Back to list'), admin_problems_path %></p>
index b4449a5..5d8a457 100644 (file)
@@ -7,3 +7,7 @@
   </div>
   <p><%= f.submit(_("Create")) %></p>
 <%- end -%>
+<h2>設定の解説</h2>
+<div class="hikidoc">
+<%= hikidoc(@form.unit.explanation) %>
+</div>
index b3421ca..9ed977d 100644 (file)
@@ -4,6 +4,8 @@
     <tr><th><%= form.label(:name) %></th><td><%= form.text_field(:name) %></td></tr>
     <tr><th><%= form.label(:symbol) %></th><td><%= form.text_field(:symbol) %></td></tr>
   </table>
+  <h2>説明</h2>
+  <%= form.text_area(:explanation, :size => '80x10') %>
   <p><%= form.submit %></p>
 <%- end -%>
 
index bb63113..faffae5 100644 (file)
@@ -5,6 +5,11 @@
   <tr><th>シンボル</th><td><%=h @unit.symbol %></td></tr>
 </table>
 
+<h2>説明</h2>
+<div class="hikidoc">
+<%= hikidoc(@unit.explanation) %>
+</div>
+
 <p>
   <%= link_to 'Edit', edit_admin_unit_path(@unit) %>
   <%= link_to 'Destroy', admin_unit_path(@unit), :confirm => _('Are you sure?'), :method => :delete %>
index 9c145ad..465fb4d 100644 (file)
@@ -108,48 +108,48 @@ ul#settings {
   content: "年";
 }
 
-/* For help (hikidoc) */
-#help h2 {
+/* For hikidoc */
+div.hikidoc h2 {
   font-size: 120%;
   margin-top: 15px;
   margin-bottom: 10px;
   border-bottom: 1px solid #333;
 }
-#help h3 {
+div.hikidoc h3 {
   font-size: 100%;
   margin-top: 10px;
   padding-left: 5px;
   border-left: 5px solid #228B22;
 }
-#help p {
+div.hikidoc p {
   text-indent: 1em;
   margin: 5px 0;
   line-height: 1.3em;
 }
-#help pre {
+div.hikidoc pre {
   margin: 10px 5px;
   padding: 5px;
   line-height: 1.5em;
   background-color: #e6ffec;
   border: 1px solid #8fbc8f;
 }
-#help div.try {
+div.hikidoc div.try {
   margin: 10px 5px;
 }
-#help div.try textarea {
+div.hikidoc div.try textarea {
   width: 300px;
 }
-#help div.try pre.mathml {
+div.hikidoc div.try pre.mathml {
   width: 300px;
   margin: 0;
   color: #888;
   border: 1px solid #aaa;
   background-color: white;
 }
-#help dl {
+div.hikidoc dl {
   margin: 10px;
 }
-#help dl dd {
+div.hikidoc dl dd {
   margin-left: 10px;
 }
 
index 0fca480..6f5d1af 100644 (file)
@@ -19,7 +19,7 @@ describe "/admin/problems/edit" do
         problem = Factory.build(problem_label)
         problem.should_receive(:id).at_least(1).and_return(1)
         unit = problem.unit
-        Unit.should_receive(:find).and_return(unit)
+        Unit.should_receive(:find).at_least(1).and_return(unit)
         assigns[:problem] = problem
         assigns[:form] = unit.form_class.new
         render 'admin/problems/edit'