]> git.openstreetmap.org Git - rails.git/commitdiff
Diary cleanup
authorSaman Bemel-Benrud <samanpwbb@gmail.com>
Sun, 17 Mar 2013 20:44:45 +0000 (20:44 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 14 Apr 2013 16:26:27 +0000 (17:26 +0100)
This commit includes a few basic changes to make the user diaries
friendlier and easier to read. I adjusted the text styles and added
a maximum width, to keep the line length under control.

app/assets/stylesheets/common.css.scss
app/views/diary_entry/_diary_entry.html.erb
app/views/site/_markdown_help.html.erb
config/locales/en.yml

index e57db18ce4a17890287203acd78d19dfa731fa71..99e10d165d02698ae7f1f05cee83284eaf4dde6b 100644 (file)
@@ -75,7 +75,7 @@ h1, h2 {
 }
 
 #content h2 {
-  font-size: 24px;
+  font-size: 21px;
 }
 
 h3 {
@@ -1118,6 +1118,7 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
 }
 
 .diary_post {
+  max-width: 740px;
   position: relative;
   margin-top: 20px;
   padding-top: 20px;
@@ -1133,12 +1134,9 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
     line-height: 21px;
   }
   small.deemphasize {
+    float: left;
     display: block;
   }
-  ul,
-  ol {
-    font-style: italic;
-  }
   ul.secondary-actions { display: inline-block;}
 }
 
@@ -1146,14 +1144,12 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
   display: inline;
 }
 
-.post_heading {
+#content  .post_heading {
   margin-bottom: 20px;
   h2 {
     margin-top: 0;
-    margin-bottom: 0;
+    margin-bottom: 10px;
     font-size: 24px;
-    float: left;
-    line-height: 32px;
   }
 }
 
@@ -1173,8 +1169,13 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
     padding-top: 20px;
     margin-top: 10px;
   }
+  .comments {
+    max-width: 740px;
+  }
   .diary-comment {
     margin-top: 10px;
+    border-top: 1px dashed #ccc;
+    padding-top: 10px;
     &:first-child {
       margin-top: 20px;
       padding-top: 20px;
@@ -1182,7 +1183,6 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
     }
     p {
       margin-bottom: 10px;
-      margin-left: 70px;
     }
     .comment-heading {
       margin-bottom: 0;
@@ -1549,11 +1549,48 @@ a.button.submit {
 /* Rules for rich text */
 
 .richtext {
-  ul,
-  ol {
+  h1, h2 {
+    padding-bottom: 10px;
+    border-bottom: 1px dashed #cccccc;
+    margin-bottom: 10px;
+  }
+
+  h1 {
+    font-size: 24px;
+  }
+
+  h2 {
+    font-size: 18px;
+  }
+
+  h3 {
+    font-size: 14px;
+  }
+
+  img {
+    padding: 20px;
+    background-color: #f4f4ff;
+    display: block;
+    max-width: 100%;
+    margin: auto;
+    box-sizing: border-box;
+    -moz-box-sizing: border-box;
+  }
+
+  blockquote {
+    border-left: 20px solid #f4f4ff;
+    padding-left: 20px;
+    margin: 0;
+    color: #7E7E7E;
+  }
+
+  ul, ol {
+    font-style: italic;
+    padding-left: 20px;
     margin-bottom: 20px;
     margin-left: 20px;
   }
+
   ul li {
     list-style: disc;
   }
@@ -1563,6 +1600,15 @@ a.button.submit {
   }
 }
 
+.diary_post .richtext {
+    margin-top: 20px;
+  }
+
+.comments .richtext {
+  margin-left: 70px;
+  margin-top: 0;
+}
+
 /* Rules for rich text editors */
 
 .richtext_container {
@@ -1595,33 +1641,38 @@ a.button.submit {
     vertical-align: top;
     margin-left: 15px;
     background-color: #f8f8ff;
-    padding: 20px;
+    padding: 10px;
+    width: 200px;
 
-    p {
-      margin: 0px;
+    ul {
+      margin-bottom: 0;
+    }
+
+    h4.heading, li {
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 5px;
+      padding-bottom: 5px;
     }
 
-    th {
-      vertical-align: top;
-      text-align: left;
-      padding: 0px 15px 0px 0px !important;
+    li h4, li span {
+      display: block;
+      font-size: 11px;
     }
 
-    td {
-      font-family: fixed;
-      line-height: 16px;
-      text-align: left;
-      padding: 0px !important;
+    li h4 {
+      margin: 0;
+      float: left;
     }
 
-    input.richtext_doedit {
-      margin-top: 5px !important;
-      margin-right: 10px !important;
+    li span {
+      float: right;
+      width: 50%;
+      margin-left: 10px;
     }
 
+    input.richtext_doedit,
     input.richtext_dopreview {
-      margin-top: 5px !important;
-      margin-left: 10px !important;
+      margin-right: 10px;
     }
   }
 }
index a7d40c7920036bbfd3e8b7d1af4e0d2dfefdf77f..410e13047663bb32439a90da611a646906216a5c 100644 (file)
@@ -5,6 +5,11 @@
     <% end %>
 
     <h2><%= link_to h(diary_entry.title), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id %></h2>
+
+    <small class='deemphasize'>
+      <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
+    </small>
+
   </div>
 
   <div class="richtext" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
     <%= render :partial => "location", :object => diary_entry %>
   <% end %>
 
-  <small class='deemphasize'>
-    <%= raw(t 'diary_entry.diary_entry.posted_by', :link_user => (link_to h(diary_entry.user.display_name), :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name), :created => l(diary_entry.created_at, :format => :friendly), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'list', :display_name => nil, :language => diary_entry.language_code)) %>
-  </small>
-
   <ul class='secondary-actions clearfix'>
     <% if params[:action] == 'list' %>
       <li><%= link_to t('diary_entry.diary_entry.comment_link'), :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %></li>
index 832679716feac2b26a091cacc866702b4b9e88b1..07035477e78d9e72b9aa5c56cd0a8dad9dcaac9d 100644 (file)
@@ -1,29 +1,26 @@
-<table>
-  <thead>
-    <tr>
-      <th colspan="2"><%= t "site.markdown_help.title_html" %></th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <th><%= t "site.markdown_help.headings" %></th>
-      <td># <%= t "site.markdown_help.heading" %><br />## <%= t "site.markdown_help.subheading" %></td>
-    </tr>
-    <tr>
-      <th><%= t "site.markdown_help.unordered" %></th>
-      <td>* <%= t "site.markdown_help.first" %><br />* <%= t "site.markdown_help.second" %></td>
-    </tr>
-    <tr>
-      <th><%= t "site.markdown_help.ordered" %></th>
-      <td>1. <%= t "site.markdown_help.first" %><br />2. <%= t "site.markdown_help.second" %></td>
-    </tr>
-    <tr>
-      <th><%= t "site.markdown_help.link" %></th>
-      <td>[<%= t "site.markdown_help.text" %>](<%= t "site.markdown_help.url" %>)</td>
-    </tr>
-    <tr>
-      <th><%= t "site.markdown_help.image" %></th>
-      <td>![<%= t "site.markdown_help.alt" %>](<%= t "site.markdown_help.url" %>)</td>
-    </tr>
-  </tbody>
-</table>
+<h4 class='heading'><%= t "site.markdown_help.title_html" %></h4>
+<ul>
+  <li class='clearfix'>
+    <h4><%= t "site.markdown_help.headings" %></h4>
+    <span># <%= t "site.markdown_help.heading" %></span>
+    <span>## <%= t "site.markdown_help.subheading" %></span>
+  </li>
+  <li class='clearfix'>
+    <h4><%= t "site.markdown_help.unordered" %></h4>
+    <span>* <%= t "site.markdown_help.first" %></span>
+    <span>* <%= t "site.markdown_help.second" %></span>
+  </li>
+  <li class='clearfix'>
+    <h4><%= t "site.markdown_help.ordered" %></h4>
+    <span>1. <%= t "site.markdown_help.first" %></span>
+    <span>2. <%= t "site.markdown_help.second" %></span>
+  </li>
+  <li class='clearfix'>
+    <h4><%= t "site.markdown_help.link" %></h4>
+    <span>[<%= t "site.markdown_help.text" %>](<%= t "site.markdown_help.url" %>)</span>
+  </li>
+  <li class='clearfix'>
+    <h4><%= t "site.markdown_help.image" %></h4>
+    <span>![<%= t "site.markdown_help.alt" %>](<%= t "site.markdown_help.url" %>)</span>
+  </li>
+</ul>
index 58a62e52f01760829c87c860da95014741a7bca9..04ad99f129e0cf242079007709ff1056a01580ea 100644 (file)
@@ -4,6 +4,7 @@ en:
   time:
     formats:
       friendly: "%e %B %Y at %H:%M"
+      blog: "%e %B %Y"
   activerecord:
     # Translates all the model names, which is used in error handling on the web site
     models: