Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create a craptastic main page and fix so templates are rendered

  • Loading branch information...
commit 24e1a0cd4effca31bbbf142ece2f72b52c58b9e7 1 parent 90f3814
@paulcbetts authored
View
28 lib/controllers.rb
@@ -40,7 +40,7 @@
include GetText
Ramaze::Global.public_root = File.join AppConfig::RootDir, 'public'
-
+Ramaze::Global.template_root = File.join AppConfig::RootDir, 'views'
### Helper Classes
@@ -68,12 +68,23 @@ def do_send_file(subpath)
def get_mime_type; 'video/mp4'; end
end
+class EncodingItem
+ def source_url
+ "#{Yikes.url_base}/files/#{subpath_target}"
+ end
+
+ def screenshot_url
+ "#{Yikes.url_base}/preview/#{screenshot_subpath}"
+ end
+end
### Controllers
class MainController < Ramaze::Controller
+ engine :Erubis
+
def index
- 'Hello, world!'
+ @items = Yikes.instance.state.get_finished_items
end
end
@@ -95,12 +106,12 @@ def podcast_xml
xml.channel do
xml.title "Yikes video feed of #{Pathname.new(app.library).basename.to_s}"
- xml.link url_base
+ xml.link Yikes.url_base
xml.language "en-us"
xml.copyright "Copyright 2008 Paul Betts"
xml.tag! "itunes:summary", "Converted videos, from #{app.library}"
xml.description "Converted videos, from #{app.library}"
- xml.tag! "itunes:image", "#{url_base}/FILLMEIN.png"
+ xml.tag! "itunes:image", "#{Yikes.url_base}/FILLMEIN.png"
xml.tag! "itunes:category", "Videos"
app.get_finished_items.each do |x|
@@ -108,8 +119,8 @@ def podcast_xml
next unless x.succeeded
xml.title x.subpath
xml.tag! "itunes:subtitle", x.source_path
- xml.enclosure(:url => "#{url_base}/files/#{x.subpath_target}", :length => "100000", :type => "video/mp4")
- xml.guid "#{url_base}/files/#{x.subpath_target}"
+ xml.enclosure(:url => x.source_url, :length => "100000", :type => "video/mp4")
+ xml.guid x.source_url
xml.pubDate x.finished_at.to_s
xml.tag! "itunes:duration", "3:00"
end
@@ -118,11 +129,6 @@ def podcast_xml
xml.target!
end
-
- def url_base
- #"http://#{Platform.hostname}.local:4000"
- "http://localhost:4000"
- end
end
class FilesController < StaticFileControllerBase
View
8 lib/main.rb
@@ -215,6 +215,14 @@ def should_daemonize?
end
def get_logger; @log; end
+
+class << self
+ def url_base
+ #"http://#{Platform.hostname}.local:4000"
+ "http://localhost:4000"
+ end
+end
+
end
def logger
View
6 lib/state.rb
@@ -161,8 +161,12 @@ def subpath_target
end
def screenshot_path
+ File.join Platform.screenshot_dir, screenshot_subpath
+ end
+
+ def screenshot_subpath
md = Digest::MD5.new << @subpath
- File.join Platform.screenshot_dir, md.to_s + ".jpg"
+ md.to_s + ".jpg"
end
class << self
View
BIN  public/images/itunes_subscribe.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/topbluefade.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
29 public/stylesheets/default.css
@@ -1,34 +1,23 @@
body {
- font-family: "Trebuchet MS", "Arial";
- color: #333;
+ background: #fff url(../images/topbluefade.gif) repeat-x;
}
p {
margin: 15px;
+ font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
}
-hr {
- margin: 40px;
-}
-
-#logo {
- float: left;
- width: 273px;
- height: 273px;
+h1 {
+ font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
}
-#header {
- margin-right: 50px;
- text-align: right;
+h3 {
+ margin: 0px;
+ font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
}
-.content {
- position: absolute;
- width: 70%;
- left: 15%;
- background-color: #f8faff;
- padding: 10px;
- border: 1px solid #e5e5e5;
+hr {
+ margin: 40px;
}
/* Janked from scaffold.css */
View
0  view/.keep_me → views/.keep_me
File renamed without changes
View
52 views/index.rhtml
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
+ <title>Yikes! It's your videos on your iPod!</title>
+ <link rel="Stylesheet" href="<%=Yikes.url_base%>/stylesheets/default.css" type="text/css" media="screen" />
+ <link rel="Stylesheet" href="<%=Yikes.url_base%>/stylesheets/tablekit.css" type="text/css" media="screen" />
+ <script src="<%=Yikes.url_base%>/javascripts/fastinit.js" type="text/javascript"></script>
+ <script src="<%=Yikes.url_base%>/javascripts/tablekit.js" type="text/javascript"></script>
+ <script src="<%=Yikes.url_base%>/javascripts/prototype.js" type="text/javascript"></script>
+ <script src="<%=Yikes.url_base%>/javascripts/scriptaculus.js" type="text/javascript"></script>
+</head>
+
+<body>
+ <div>
+ <h1>Yikes!</h1>
+ <h3>From your computer to your iPod in a snap</h3>
+ </div>
+
+ <div>
+ <h2>Videos recently converted:</h2>
+ <table id="data" class="sortable resizable">
+ <tr>
+ <th></th> <!-- Succeeded icon -->
+ <th>Screenshot</th> <!-- Image -->
+ <th>Filename</th>
+ <th>Date</th>
+ </tr>
+
+ <% for item in @items %>
+ <tr>
+ <td></td>
+ <td><img align="center" width="50%" height="50%" src="<%= item.screenshot_url %>" /></td>
+ <td><a href="<%== item.source_url %>"><%== item.subpath %></a></td>
+ <td><%= item.created_at %></td>
+ </tr>
+ <% end %>
+ </table>
+
+ </div>
+
+ <script language="javascript"> TableKit.Sortable.init("data"); </script>
+
+ <p>
+ <a href="<%=Yikes.url_base.sub("http", "itpc")%>/podcast"> <img src="<%=Yikes.url_base%>/images/itunes_subscribe.png" /> </a>
+ </p>
+</body>
+
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.