Permalink
Browse files

first commit

  • Loading branch information...
1 parent 9bcbcd3 commit 3061320deb66e7d4ee14a8a63600ad59b17631dd griggsk committed Nov 29, 2010
Showing with 30,815 additions and 0 deletions.
  1. +12 −0 .loadpath
  2. +24 −0 .project
  3. +10 −0 Rakefile
  4. +10 −0 app/controllers/application_controller.rb
  5. +13 −0 app/controllers/computers_controller.rb
  6. +3 −0 app/helpers/application_helper.rb
  7. +17 −0 app/helpers/computers_helper.rb
  8. +4 −0 app/models/computer.rb
  9. +25 −0 app/views/computers/.tmp_index.html.erb.276~
  10. +25 −0 app/views/computers/.tmp_index.html.erb.89844~
  11. +24 −0 app/views/computers/index.html.erb
  12. +42 −0 app/views/layouts/.tmp_nosearch.html.erb.45528~
  13. +42 −0 app/views/layouts/.tmp_nosearch.html.erb.8608~
  14. +31 −0 app/views/layouts/computers.html.erb
  15. +110 −0 config/boot.rb
  16. +44 −0 config/database.yml
  17. +41 −0 config/environment.rb
  18. +17 −0 config/environments/development.rb
  19. +28 −0 config/environments/production.rb
  20. +28 −0 config/environments/test.rb
  21. +7 −0 config/initializers/backtrace_silencers.rb
  22. +10 −0 config/initializers/inflections.rb
  23. +5 −0 config/initializers/mime_types.rb
  24. +21 −0 config/initializers/new_rails_defaults.rb
  25. +15 −0 config/initializers/session_store.rb
  26. +5 −0 config/locales/en.yml
  27. +45 −0 config/routes.rb
  28. +118 −0 db/computer_availability.sql
  29. +12 −0 db/migrate/20101108163033_create_computers.rb
  30. +18 −0 db/migrate/20101108170827_computer_availability.rb
  31. +29 −0 db/schema.rb
  32. +14 −0 db/seeds.rb
  33. +2 −0 doc/README_FOR_APP
  34. +11 −0 index.html
  35. +22,012 −0 log/development.log
  36. 0 log/production.log
  37. 0 log/server.log
  38. 0 log/test.log
  39. +30 −0 public/404.html
  40. +30 −0 public/422.html
  41. +30 −0 public/500.html
  42. 0 public/favicon.ico
  43. BIN public/images/Legend_300px.jpg
  44. BIN public/images/Legend_600px.jpg
  45. BIN public/images/Legend_900px.jpg
  46. BIN public/images/Mac_in_use_10px.jpg
  47. BIN public/images/Mac_in_use_30px.jpg
  48. BIN public/images/Mac_open_10px.jpg
  49. BIN public/images/Mac_open_30px.jpg
  50. BIN public/images/Map_600px.jpg
  51. BIN public/images/Map_900px.jpg
  52. BIN public/images/PC_in_use_10px.jpg
  53. BIN public/images/PC_in_use_30px.jpg
  54. BIN public/images/PC_open_10px.jpg
  55. BIN public/images/PC_open_30px.jpg
  56. BIN public/images/Thumbs.db
  57. BIN public/images/map_200x200.jpg
  58. BIN public/images/map_300px.jpg
  59. BIN public/images/map_400x400.jpg
  60. BIN public/images/rails.png
  61. +287 −0 public/index.html
  62. +2 −0 public/javascripts/application.js
  63. +963 −0 public/javascripts/controls.js
  64. +973 −0 public/javascripts/dragdrop.js
  65. +1,128 −0 public/javascripts/effects.js
  66. +4,320 −0 public/javascripts/prototype.js
  67. +5 −0 public/robots.txt
  68. +68 −0 public/stylesheets/iphone.css
  69. +4 −0 script/about
  70. +3 −0 script/console
  71. +3 −0 script/dbconsole
  72. +3 −0 script/destroy
  73. +3 −0 script/generate
  74. +3 −0 script/performance/benchmarker
  75. +3 −0 script/performance/profiler
  76. +3 −0 script/plugin
  77. +3 −0 script/runner
  78. +3 −0 script/server
  79. +7 −0 test/fixtures/computers.yml
  80. +8 −0 test/functional/computers_controller_test.rb
  81. +9 −0 test/performance/browsing_test.rb
  82. +38 −0 test/test_helper.rb
  83. +8 −0 test/unit/computer_test.rb
  84. +4 −0 test/unit/helpers/computers_helper_test.rb
View
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<loadpath>
+ <pathentry path="" type="src"/>
+ <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
+ <pathentry path="GEM_LIB/activeresource-2.3.5/lib" type="var"/>
+ <pathentry path="GEM_LIB/activerecord-2.3.5/lib" type="var"/>
+ <pathentry path="GEM_LIB/actionpack-2.3.5/lib" type="var"/>
+ <pathentry path="GEM_LIB/rake-0.8.7/lib" type="var"/>
+ <pathentry path="GEM_LIB/activesupport-2.3.5/lib" type="var"/>
+ <pathentry path="GEM_LIB/rails-2.3.5/lib" type="var"/>
+ <pathentry path="GEM_LIB/actionmailer-2.3.5/lib" type="var"/>
+</loadpath>
View
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>computer_availability</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.aptana.ide.core.unifiedBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.aptana.ide.project.nature.web</nature>
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
+ <nature>org.radrails.rails.core.railsnature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,10 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
@@ -0,0 +1,10 @@
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+class ApplicationController < ActionController::Base
+ helper :all # include all helpers, all the time
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
+
+ # Scrub sensitive parameters from your log
+ # filter_parameter_logging :password
+end
@@ -0,0 +1,13 @@
+class ComputersController < ApplicationController
+layout('nosearch')
+ def index
+ @heading = "Computer Status"
+ @title = "Computer Status"
+ @pc_dataset = Computer.find_by_sql("SELECT * FROM compstatus WHERE computer_type='PC'").size
+ @mac_dataset = Computer.find_by_sql("SELECT * FROM compstatus WHERE computer_type='MAC'").size
+
+ @avail_pc = Computer.find_by_sql("SELECT * FROM compstatus WHERE status='0' AND computer_type='PC'").size
+ @avail_mac = Computer.find_by_sql("SELECT * FROM compstatus WHERE status='0' AND computer_type='MAC'").size
+ @rows = Computer.find_by_sql("SELECT * FROM compstatus")
+ end
+end
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
@@ -0,0 +1,17 @@
+module ComputersHelper
+ def get_fields(row)
+ @status = 'busy'
+ @type = 'pc'
+ if row.status.to_i == 0
+ @status = 'avail'
+ end
+
+ if row.computer_type.eql? 'MAC'
+ @type = 'mac'
+ end
+ @left = row.left_pos.to_s
+ @top = row.top_pos.to_s
+ @name = row.computer_name
+ end
+
+end
View
@@ -0,0 +1,4 @@
+class Computer < ActiveRecord::Base
+
+end
+
@@ -0,0 +1,25 @@
+<div class="top_pager">
+Available: PC (<%=@avail_pc%>/<%=@pc_dataset%>) | Mac (<%=@avail_mac%>/<%=@mac_dataset%>)
+</div>
+<div id="computer_map">
+<dl>
+
+<% @rows.each do |row|
+logger.debug("Row #{row}")
+ get_fields(row)
+ %>
+ <dt class="<%=@status%>_<%=@type%> icon" style="top:<%=@top%>px; left:<%=@left%>px;"> <%=@name%></dt>
+<%end%>
+
+</dl>
+<dl>
+ <dt class="avail_pc legend_icon" style="left:180px; top: -1410px;">PC Available</dt>
+ <dt class="busy_pc legend_icon" style="left:180px; top: -1400px;">PC Busy</dt>
+ <dt class="avail_mac legend_icon" style="left:180px; top: -1390px;">Mac Available</dt>
+ <dt class="busy_mac legend_icon" style="left:180px; top: -1380px;">Mac Busy</dt>
+</dl>
+<br />
+</div>
+<script type="text/javascript">
+setTimeout("window.location.reload()",90000);
+</script>
@@ -0,0 +1,25 @@
+<div class="top_pager">
+Available: PC (<%=@avail_pc%>/<%=@pc_dataset%>) | Mac (<%=@avail_mac%>/<%=@mac_dataset%>)
+</div>
+<div id="computer_map">
+<dl>
+
+<% @rows.each do |row|
+logger.debug("Row #{row}")
+ get_fields(row)
+ %>
+ <dt class="<%=@status%>_<%=@type%> icon" style="top:<%=@top%>px; left:<%=@left%>px;"> <%=@name%></dt>
+<%end%>
+
+</dl>
+<dl>
+ <dt class="avail_pc legend_icon" style="left:180px; top: -1410px;">PC Available</dt>
+ <dt class="busy_pc legend_icon" style="left:180px; top: -1400px;">PC Busy</dt>
+ <dt class="avail_mac legend_icon" style="left:180px; top: -1390px;">Mac Available</dt>
+ <dt class="busy_mac legend_icon" style="left:180px; top: -1380px;">Mac Busy</dt>
+</dl>
+<br />
+</div>
+<script type="text/javascript">
+setTimeout("window.location.reload()",90000);
+</script>
@@ -0,0 +1,24 @@
+<div class="top_pager">
+Available: PC (<%=@avail_pc%>/<%=@pc_dataset%>) | Mac (<%=@avail_mac%>/<%=@mac_dataset%>)
+</div>
+<div id="computer_map">
+<dl>
+
+<% @rows.each do |row|
+ get_fields(row)
+ %>
+ <dt class="<%=@status%>_<%=@type%> icon" style="top:<%=@top%>px; left:<%=@left%>px;"> <%=@name%></dt>
+<%end%>
+
+</dl>
+<dl>
+ <dt class="avail_pc legend_icon" style="left:180px; top: -1410px;">PC Available</dt>
+ <dt class="busy_pc legend_icon" style="left:180px; top: -1400px;">PC Busy</dt>
+ <dt class="avail_mac legend_icon" style="left:180px; top: -1390px;">Mac Available</dt>
+ <dt class="busy_mac legend_icon" style="left:180px; top: -1380px;">Mac Busy</dt>
+</dl>
+<br />
+</div>
+<script type="text/javascript">
+setTimeout("window.location.reload()",90000);
+</script>
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no, height=device-height" />
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="apple-mobile-web-app-status-bar-style" content="black" />
+<link rel="apple-touch-icon" href="/images/logo60.jpg" />
+<meta name="format-detection" content="telephone=no" />
+<!--everyone-->
+<link rel="stylesheet" type="text/css" href="/stylesheets/mobile.css" />
+<!--[if IE]><link rel="stylesheet" type="text/css" href="iphone.css" media="screen" /><![endif]-->
+<!--mobile-->
+<link href="/stylesheets/mobile.css" rel="stylesheet" type="text/css" media="handheld" />
+<!--smartphone-->
+<link rel="stylesheet" href="/stylesheets/iphone.css" media="screen" />
+
+<script type="text/javascript">
+//<![CDATA[
+window.scrollTo(0, 1);
+//]]>
+</script>
+
+<title><%=@title%> : OSU Libraries</title>
+</head>
+<body>
+
+<div id='small_header'>
+ <a href="http://m.library.oregonstate.edu/" class="home_link" accesskey="1"><span id="home_logo"></span></a>
+ <h1> <%=@heading%></h1>
+</div>
+
+<div id ='content'>
+ <%= yield %>
+</div>
+<div id ='footer'>
+<div>
+ <a href="tel:5417373331">(541) 737-3331</a> | <a href="http://m.library.oregonstate.edu/about.html">About</a> | <a href="http://osulibrary.oregonstate.edu/?opt_out=true">OSU Libraries</a> <br />
+ <a class ="osu_orange" href="http://m.oregonstate.edu/">OSU Mobile</a> | &copy; 2010 OSU Libraries
+</div>
+ </div>
+</body>
+</html>
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no, height=device-height" />
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="apple-mobile-web-app-status-bar-style" content="black" />
+<link rel="apple-touch-icon" href="/images/logo60.jpg" />
+<meta name="format-detection" content="telephone=no" />
+<!--everyone-->
+<link rel="stylesheet" type="text/css" href="/stylesheets/mobile.css" />
+<!--[if IE]><link rel="stylesheet" type="text/css" href="iphone.css" media="screen" /><![endif]-->
+<!--mobile-->
+<link href="/stylesheets/mobile.css" rel="stylesheet" type="text/css" media="handheld" />
+<!--smartphone-->
+<link rel="stylesheet" href="/stylesheets/iphone.css" media="screen" />
+
+<script type="text/javascript">
+//<![CDATA[
+window.scrollTo(0, 1);
+//]]>
+</script>
+
+<title><%=@title%> : OSU Libraries</title>
+</head>
+<body>
+
+<div id='small_header'>
+ <a href="http://m.library.oregonstate.edu/" class="home_link" accesskey="1"><span id="home_logo"></span></a>
+ <h1> <%=@heading%></h1>
+</div>
+
+<div id ='content'>
+ <%= yield %>
+</div>
+<div id ='footer'>
+<div>
+ <a href="tel:5417373331">(541) 737-3331</a> | <a href="http://m.library.oregonstate.edu/about.html">About</a> | <a href="http://osulibrary.oregonstate.edu/?opt_out=true">OSU Libraries</a> <br />
+ <a class ="osu_orange" href="http://m.oregonstate.edu/">OSU Mobile</a> | &copy; 2010 OSU Libraries
+</div>
+ </div>
+</body>
+</html>
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no, height=device-height" />
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta name="apple-mobile-web-app-status-bar-style" content="black" />
+<link rel="apple-touch-icon" href="/images/logo60.jpg" />
+<meta name="format-detection" content="telephone=no" />
+<link rel="stylesheet" href="/stylesheets/iphone.css" media="screen" />
+
+<script type="text/javascript">
+//<![CDATA[
+window.scrollTo(0, 1);
+//]]>
+</script>
+
+<title><%=@title%></title>
+</head>
+<body>
+
+
+<div id ='content'>
+ <%= yield %>
+</div>
+<div id ='footer'>
+ <div>
+ Code released under GNU License by Oregon State University Libraries
+ </div>
+ </div>
+</body>
+</html>
Oops, something went wrong.

0 comments on commit 3061320

Please sign in to comment.