[eXPlainPMT Developers] [SVN commit] r12 - in /trunk: app/controllers/main_controller.rb app/helpers/main_helper.rb app/views/main/ app/views/main/dashboard.rhtml config/routes.rb test/functional/main_controller_test.rb test/functional/routing_test.rb

johnwilger@gmail.com johnwilger at gmail.com
Tue Sep 27 12:58:13 EDT 2005


Author: jwilger
Date: Tue Sep 27 12:58:05 2005
New Revision: 12

Log:
Added static "Dashboard" view mockup. No CSS styling applied yet.


Added:
    trunk/app/controllers/main_controller.rb
    trunk/app/helpers/main_helper.rb
    trunk/app/views/main/
    trunk/app/views/main/dashboard.rhtml
    trunk/test/functional/main_controller_test.rb
    trunk/test/functional/routing_test.rb
Modified:
    trunk/config/routes.rb

Added: trunk/app/controllers/main_controller.rb
==============================================================================
--- trunk/app/controllers/main_controller.rb (added)
+++ trunk/app/controllers/main_controller.rb Tue Sep 27 12:58:05 2005
@@ -1,0 +1,4 @@
+class MainController < ApplicationController
+  def dashboard
+  end
+end

Added: trunk/app/helpers/main_helper.rb
==============================================================================
--- trunk/app/helpers/main_helper.rb (added)
+++ trunk/app/helpers/main_helper.rb Tue Sep 27 12:58:05 2005
@@ -1,0 +1,2 @@
+module MainHelper
+end

Added: trunk/app/views/main/dashboard.rhtml
==============================================================================
--- trunk/app/views/main/dashboard.rhtml (added)
+++ trunk/app/views/main/dashboard.rhtml Tue Sep 27 12:58:05 2005
@@ -1,0 +1,129 @@
+<!DOCTYPE html 
+  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8" />
+  <title>eXPlainPMT &raquo; Dashboard</title>
+</head>
+<body>
+  <div id="Header">
+    <div id="CurrentUserInfo">
+      Logged in as: <%= link_to 'John Wilger', :action => 'user_profile' %>
+      (<%= link_to 'log out', :action => 'log_out' %>)
+    </div>
+    <h1>eXPlainPMT :: Dashboard</h1>
+  </div>
+
+  <div id="MyProjects">
+    <h2>My Projects</h2>
+    <ul>
+      <li><%= link_to 'Project One', :action => 'project_overview' %></li>
+      <li><%= link_to 'Project Two', :action => 'project_overview' %></li>
+      <li><%= link_to 'Project Three', :action => 'project_overview' %></li>
+      <li><%= link_to 'Project Four', :action => 'project_overview' %></li>
+      <li><%= link_to 'Project Five', :action => 'project_overview' %></li>
+    </ul>
+  </div>
+
+  <div id="MyStoryCards">
+    <form action="<%= url_for :action => 'print_story_cards' %>" method="post">
+      <h2>My Story Cards</h2>
+      <input id="PrintStoryCards" type="submit" name="submit" value="Print Selected" />
+      <table>
+        <tr>
+          <th>&nbsp;</th>
+          <th>Project</th>
+          <th>ID</th>
+          <th>Name</th>
+          <th>Status</th>
+          <th>&nbsp;</th>
+          <th>&nbsp;</th>
+        </tr>
+        <tr>
+          <td><input type="checkbox" name="selected_stories[]" value="1" /></td>
+          <td><%= link_to 'Project Three', :action => 'project_overview' %></td>
+          <td><%= link_to 'SC4', :action => 'view_story_card' %></td>
+          <td><%= link_to 'check out', :action => 'view_story_card' %></td>
+          <td>In Progress</td>
+          <td><%= link_to 'release', :action => 'release_story_card' %></td>
+          <td><%= link_to 'edit', :action => 'edit_story_card' %></td>
+        </tr>
+        <tr>
+          <td><input type="checkbox" name="selected_stories[]" value="5" /></td>
+          <td><%= link_to 'Project Three', :action => 'project_overview' %></td>
+          <td><%= link_to 'SC19', :action => 'view_story_card' %></td>
+          <td><%= link_to 'redeem a coupon', :action => 'view_story_card' %></td>
+          <td>Blocked</td>
+          <td><%= link_to 'release', :action => 'release_story_card' %></td>
+          <td><%= link_to 'edit', :action => 'edit_story_card' %></td>
+        </tr>
+        <tr>
+          <td><input type="checkbox" name="selected_stories[]" value="9" /></td>
+          <td><%= link_to 'Project Two', :action => 'project_overview' %></td>
+          <td><%= link_to 'SC1', :action => 'view_story_card' %></td>
+          <td><%= link_to 'create new work-item', :action => 'view_story_card' %></td>
+          <td>Complete</td>
+          <td><%= link_to 'release', :action => 'release_story_card' %></td>
+          <td><%= link_to 'edit', :action => 'edit_story_card' %></td>
+        </tr>
+      </table>
+    </form>
+  </div>
+
+  <div id="UpcomingMilestones">
+    <h2>Upcoming Milstones</h2>
+    <table>
+      <tr>
+        <th>Project</th>
+        <th>Milestone</th>
+        <th>Date</th>
+      </tr>
+      <tr>
+        <td><%= link_to 'Project Three', :action => 'project_overview' %></td>
+        <td><%= link_to 'Version 1.6 Release', :action => 'view_milestone' %></td>
+        <td>10/31/2005</td>
+      </tr>
+      <tr>
+        <td><%= link_to 'Project Two', :action => 'project_overview' %></td>
+        <td><%= link_to 'Project Post-Mortem', :action => 'view_milestone' %></td>
+        <td>10/15/2005</td>
+      </tr>
+    </table>
+  </div>
+
+  <div id="RecentActivity">
+    <h2>Recent Activity</h2>
+    <table>
+      <tr>
+        <th>&nbsp;</th>
+        <th>Project</th>
+        <th>When?</th>
+        <th>What?</th>
+        <th>Who?</th>
+      </tr>
+      <tr>
+        <td><%= image_tag 'story_card_icon_small', :alt => 'SC', :size => '10x10' %></td>
+        <td><%= link_to 'Project Four', :action => 'project_overview' %></td>
+        <td>9/27/2005 12:33pm</td>
+        <td>New story card added: "<%= link_to 'calculate probability', :action => 'view_story_card' %>"</td>
+        <td><%= link_to 'J. Brown', :action => 'user_profile' %></td>
+      </tr>
+      <tr>
+        <td><%= image_tag 'feature_icon_small', :alt => 'FE', :size => '10x10' %></td>
+        <td><%= link_to 'Project Three', :action => 'project_overview' %></td>
+        <td>9/27/2005 09:24am</td>
+        <td>Changed feature: "<%= link_to 'Secure Checkout', :action => 'view_feature' %>"</td>
+        <td><%= link_to 'M. Rogers', :action => 'user_profile' %></td>
+      </tr>
+      <tr>
+        <td><%= image_tag 'defect_icon_small', :alt => 'DF', :size => '10x10' %></td>
+        <td><%= link_to 'Project Two', :action => 'project_overview' %></td>
+        <td>9/26/2005 10:55pm</td>
+        <td>New defect reported: "<%= link_to 'DF82', :action => 'view_defect' %>"</td>
+        <td><%= link_to 'D. Vader', :action => 'user_profile' %></td>
+      </tr>
+    </table>
+  </div>
+</body>
+</html>

Modified: trunk/config/routes.rb
==============================================================================
--- trunk/config/routes.rb (original)
+++ trunk/config/routes.rb Tue Sep 27 12:58:05 2005
@@ -8,7 +8,7 @@
 
   # You can have the root of your site routed by hooking up '' 
   # -- just remember to delete public/index.html.
-  # map.connect '', :controller => "welcome"
+  map.connect '', :controller => 'main', :action => 'dashboard'
 
   # Allow downloading Web Service WSDL as a file with an extension
   # instead of a file named 'wsdl'

Added: trunk/test/functional/main_controller_test.rb
==============================================================================
--- trunk/test/functional/main_controller_test.rb (added)
+++ trunk/test/functional/main_controller_test.rb Tue Sep 27 12:58:05 2005
@@ -1,0 +1,19 @@
+require File.dirname(__FILE__) + '/../test_helper'
+require 'main_controller'
+
+# Re-raise errors caught by the controller.
+class MainController; def rescue_action(e) raise e end; end
+
+class MainControllerTest < Test::Unit::TestCase
+  def setup
+    @controller = MainController.new
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+  end
+
+  def test_dashboard
+    get :dashboard
+    assert_response :success
+    assert_template 'dashboard'
+  end
+end

Added: trunk/test/functional/routing_test.rb
==============================================================================
--- trunk/test/functional/routing_test.rb (added)
+++ trunk/test/functional/routing_test.rb Tue Sep 27 12:58:05 2005
@@ -1,0 +1,7 @@
+require File.expand_path( File.dirname( __FILE__ ) + '/../test_helper' )
+
+class RoutingTest < Test::Unit::TestCase
+  def test_root_points_to_main_dashboard
+    assert_routing '', :controller => 'main', :action => 'dashboard'
+  end
+end




More information about the Explainpmt-developers mailing list