# HG changeset patch # User nanaya # Date 1433673522 -32400 # Node ID 91dabc034389d3438c1c7a2be00d140b4375a1a5 # Parent 433bc70e1781a82737706db2caef7f79bdac01d9 Improved styling for show. diff -r 433bc70e1781 -r 91dabc034389 app/assets/stylesheets/_layout.scss --- a/app/assets/stylesheets/_layout.scss Sun Jun 07 13:05:31 2015 +0900 +++ b/app/assets/stylesheets/_layout.scss Sun Jun 07 19:38:42 2015 +0900 @@ -28,7 +28,7 @@ } main { - flex: 1; + flex: 1 0 auto; width: 100%; display: flex; diff -r 433bc70e1781 -r 91dabc034389 app/assets/stylesheets/_show-paste.scss --- a/app/assets/stylesheets/_show-paste.scss Sun Jun 07 13:05:31 2015 +0900 +++ b/app/assets/stylesheets/_show-paste.scss Sun Jun 07 19:38:42 2015 +0900 @@ -1,5 +1,5 @@ #paste-show { - flex: 1; + flex: 1 0 auto; display: flex; flex-direction: column; @@ -31,8 +31,22 @@ } #paste { - flex: 1; - overflow: auto; + flex: 1 0 auto; + + font-family: $monospace; + ol { + background-color: #eee; + } + li { + background-color: #fff; + &:hover { + background-color: $info; + } + + &:target { + background-color: $info; + } + } } #paste-show-nav { diff -r 433bc70e1781 -r 91dabc034389 app/assets/stylesheets/_variables.scss --- a/app/assets/stylesheets/_variables.scss Sun Jun 07 13:05:31 2015 +0900 +++ b/app/assets/stylesheets/_variables.scss Sun Jun 07 19:38:42 2015 +0900 @@ -5,3 +5,5 @@ $danger-dark: darken($danger, 60%); $info: scale-color(#0f0, $lightness: 90%); $info-dark: darken($info, 60%); + +$monospace: Consolas, monospace; diff -r 433bc70e1781 -r 91dabc034389 app/helpers/pastes_helper.rb --- a/app/helpers/pastes_helper.rb Sun Jun 07 13:05:31 2015 +0900 +++ b/app/helpers/pastes_helper.rb Sun Jun 07 19:38:42 2015 +0900 @@ -15,4 +15,8 @@ def paste_privacy_options { "public" => "0", "private" => "1" } end + + def paste_line_number(i, lines) + "#{" " * (lines.size.to_s.length - i.to_s.length)}#{i}" + end end diff -r 433bc70e1781 -r 91dabc034389 app/views/layouts/application.html.erb --- a/app/views/layouts/application.html.erb Sun Jun 07 13:05:31 2015 +0900 +++ b/app/views/layouts/application.html.erb Sun Jun 07 19:38:42 2015 +0900 @@ -7,6 +7,7 @@ <%= stylesheet_link_tag "application", :media => "all" %> + <%= yield(:before_page_header) %>

<%= content_for :title %>

diff -r 433bc70e1781 -r 91dabc034389 app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Sun Jun 07 13:05:31 2015 +0900 +++ b/app/views/pastes/show.html.erb Sun Jun 07 19:38:42 2015 +0900 @@ -7,33 +7,35 @@

  • <%= link_to 'Markdown', '#md', :data => { :toggle => 'pill' } %>
  • -
    -
    -
    <%= @paste.paste %>
    -
    -
    -
    
    -    
    -
    -
    -
    +
    + <% lines = @paste.paste.split("\n") %> + <%# list number contains + "." + <2.5 * spaces (approx)> %> +
      + <% lines.each.with_index(1) do |line, i| %> +
    1. + <%= line %> +
    2. + <% end %> +
    -<%= form_for @paste, :method => :delete, :authenticity_token => false do |f| %> +