Permalink
Browse files

色々修正

  • Loading branch information...
yuiseki committed Dec 22, 2010
1 parent fd3b7ef commit 3bc0aa3cc4cbc7101a887231e273e61f468affd7
Showing with 1,642 additions and 9 deletions.
  1. +1 −0 app.rb
  2. +11 −5 extras/back.rb
  3. +1 −1 helpers/gdocs.rb
  4. +1 −0 public/back
  5. +1,625 −0 tmp/access_log
  6. +1 −1 views/layout.haml
  7. +2 −2 views/style.sass
View
1 app.rb
@@ -22,6 +22,7 @@ def sitemap(path, desc)
end
get'/', {'sitemap' => ['/', 'サイトのトップページです']} do
+ content_type 'text/html', :charset => 'utf-8'
@title = options.settings["site"]["title"]
@desc = "サイトのトップページです"
@result = get_recents
View
@@ -1,19 +1,25 @@
# 背景画像をランダムに選んでリダイレクトする
-get '/back.jpg' do
- files = Dir.glob("public/back/summer/*.jpg")
- send_file files[rand(files.size)]
+get '/back_image' do
+ #files = Dir.glob("public/back/*.jpg")
+ #files = Dir::entries("public/back/")
+ @files = []
+ Dir::foreach('public/back/') do |f|
+ next if f == "." or f == ".." or f == ".gitignore"
+ @files.push f
+ end
+ send_file 'public/back/'+@files[rand(@files.size)]
end
# 背景画像一覧
get '/back' do
@files = []
- Dir::foreach('public/back/summer/') do |f|
+ Dir::foreach('public/back/') do |f|
next if f == "." or f == ".." or f == ".gitignore"
@files.push f
end
@files.map do |file|
- "<img src='/back/summer/#{file}' width='300' height='240'>"
+ "<img src='/back/#{file}' width='300' height='240'>"
end.join("\n")
end
View
@@ -33,7 +33,7 @@ def get_recents
# 日時でソートする
rows.sort {|a, b| Time.parse(b[0]) <=> Time.parse(a[0])}
# pagerizeまでの暫定処理
- rows = rows[0...8]
+ rows = rows[0...10]
# キャッシュを残す
FasterCSV.open(cache_path, "w") do |csv|
rows.each do |row|
View
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,5 +1,5 @@
!!!
-%html
+%html{html_attrs('ja')}
%head
%meta{ 'http-equiv' => 'content', :content => 'text/html; charset=utf-8'}
%link{:rel=>"stylesheet", :type=>"text/css", :href=>"/style.css"}
View
@@ -1,6 +1,6 @@
body
- background-color: pink
- background-image: url(/back.jpg)
+ background-color: gray
+ background-image: url(/back_image)
font-family: san-selif
background-size: contain

0 comments on commit 3bc0aa3

Please sign in to comment.