Permalink
Browse files

added a ridiculous dog picture and also some Sass

  • Loading branch information...
1 parent 123d947 commit 60a01aef7056a73482a343f65fcecceee9b7850a @cndreisbach cndreisbach committed Oct 22, 2009
View
4 app/helpers/app_helper.rb
@@ -11,21 +11,17 @@ def input(type, name, value = nil, options = {})
label = options[:label] || name.titlecase
html_id = options[:id] || name
<<-HTML
- <p>
<label for="#{html_id}">#{label}</label>
<input type="#{type.to_s}" id="#{html_id}" name="#{name}" value="#{h(value.to_s)}" />
- </p>
HTML
end
def text_area(name, value = nil, options = {})
label = options[:label] || name.titlecase
html_id = options[:id] || name
<<-HTML
- <p>
<label for="#{html_id}">#{label}</label>
<textarea name="#{name}" id="#{html_id}">#{h(value.to_s)}</textarea>
- </p>
HTML
end
View
5 app/routes/sites.rb
@@ -46,4 +46,9 @@ class Main
@site.update_attribute(:status_record, params[:status])
""
end
+
+ get "/watchdog.css" do
+ content_type 'text/css', :charset => 'utf-8'
+ sass :stylesheet
+ end
end
View
4 app/templates/layout.mustache
@@ -3,11 +3,13 @@
<head>
<title>Watchdog</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="/stylesheets/global.css" type="text/css" />
+ <link rel="stylesheet" href="/watchdog.css" type="text/css" />
</head>
<body>
+ <div id="main">
<h1><a href="/">Watchdog</a></h1>
{{{yield}}}
+ </div>
</body>
</html>
View
55 app/templates/stylesheet.sass
@@ -0,0 +1,55 @@
+=rounded
+ -moz-border-radius: 5px
+ -webkit-border-radius: 5px
+
+body
+ width: 800px
+ margin: 20px auto
+ padding: 10px
+ font-family: Helvetica, "Liberation Sans", "Bitstream Vera Sans", sans-serif
+ font-size: 100%
+ background-image: url('images/watchdog.png')
+ background-position: 100% 10px
+ background-repeat: no-repeat
+
+a
+ color: black
+
+dt
+ float: left
+ width: 150px
+ text-transform: capitalize
+
+dd
+ margin-bottom: 20px
+
+fieldset
+ border: none
+ padding: 0
+ margin-bottom: 1em
+
+ label
+ display: block
+ margin: 0.25em 0
+ input, textarea
+ margin-bottom: 1em
+
+ul
+ &.sites
+ padding: 0
+
+ li
+ +rounded
+ list-style-type: none
+ margin: 5px 0
+ padding: 10px
+ background-color: #eee
+
+ &.success
+ background-color: #cfc
+
+ &.fail
+ background-color: #fcc
+
+ &.errors
+ color: #c00
View
6 app/views/show_site.rb
@@ -3,9 +3,13 @@ module Views
class ShowSite < Mustache
attr_reader :site
- [:id, :name, :url, :match_text, :threshold, :email].each do |attribute|
+ [:id, :name, :url, :threshold, :email].each do |attribute|
define_method("site_#{attribute}") { site.send(attribute) }
end
+
+ def site_match_text
+ site.match_text.empty? ? "No match text" : site.match_text
+ end
end
end
end
View
BIN public/images/watchdog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
57 public/stylesheets/global.css
@@ -1,57 +0,0 @@
-body {
- font-family: "Lucida Grande", "Lucida Sans Unicode", sans-serif;
-}
-
-a {
- color: black;
-}
-
-fieldset {
- border: none;
- padding: 0;
-}
-
-label {
- float: left;
- width: 150px;
-}
-
-dt {
- float: left;
- width: 150px;
- text-transform: capitalize;
-}
-
-dd {
- margin-bottom: 20px;
-}
-
-ul.sites {
- padding: 0;
-}
-
-ul.sites li {
- list-style-type: none;
- margin: 5px 0;
- padding: 10px;
- background-color: #eee;
-}
-
-ul.sites li em, ul.sites li em {
- opacity: 0.3;
- font-style: normal;
- font-size: 0.7em;
-}
-
-ul.sites li.success {
- background-color: #cfc;
-}
-
-ul.sites li.fail {
- background-color: #fcc;
-}
-
-ul.errors {
- color: #c00;
-}
-

0 comments on commit 60a01ae

Please sign in to comment.