home page renders... sort of

This commit is contained in:
Reinier Balt 2012-04-11 17:36:22 +02:00
parent fde64e0b3d
commit 4605b17d3c
16 changed files with 131 additions and 295 deletions

22
Gemfile
View file

@ -12,24 +12,24 @@ gem "mysql2"
gem "highline", "~>1.5.0"
gem "RedCloth"
# gem "sanitize", "~>1.2.1"
# gem "will_paginate"
gem "has_many_polymorphs", :git => "git://github.com/lrbalt/has_many_polymorphs.git", :branch => "try"
gem "sanitize", "~>1.2.1"
gem "will_paginate"
gem "acts_as_list", "~>0.1.4"
gem "aasm", "~>2.2.0"
# TODO: gem "rubyjedi-actionwebservice", :require => "actionwebservice"
# gem "rubycas-client", "~>2.2.1"
# gem "ruby-openid", :require => "openid"
# gem "open_id_authentication"
# gem 'htmlentities', '~> 4.3.0'
# gem "mail"
# gem "swf_fu"
gem 'htmlentities', '~> 4.3.0'
gem "mail"
gem "swf_fu"
gem "rails_autolink"
# if RUBY_VERSION.to_f >= 1.9
# gem "soap4r-ruby1.9"
# else
# gem "soap4r", "~>1.5.8"
# end
if RUBY_VERSION.to_f >= 1.9
gem "soap4r-ruby1.9"
else
gem "soap4r", "~>1.5.8"
end
# Gems used only for assets and not required
# in production environments by default.

View file

@ -1,11 +1,3 @@
GIT
remote: git://github.com/lrbalt/has_many_polymorphs.git
revision: bb0a7af8ac7418717954cab42a5476ca9806f858
branch: try
specs:
has_many_polymorphs (3.0.0.beta1)
activerecord
GEM
remote: https://rubygems.org/
specs:
@ -54,6 +46,7 @@ GEM
multi_json (~> 1.0)
highline (1.5.2)
hike (1.2.1)
htmlentities (4.3.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
@ -67,6 +60,7 @@ GEM
mime-types (1.18)
multi_json (1.2.0)
mysql2 (0.3.11)
nokogiri (1.4.7)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@ -83,6 +77,8 @@ GEM
activesupport (= 3.2.3)
bundler (~> 1.0)
railties (= 3.2.3)
rails_autolink (1.0.6)
rails (~> 3.1)
railties (3.2.3)
actionpack (= 3.2.3)
activesupport (= 3.2.3)
@ -93,16 +89,22 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sanitize (1.2.1)
nokogiri (~> 1.4.1)
sass (3.1.15)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
soap4r-ruby1.9 (2.0.5)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
swf_fu (2.0.1)
coffee-script
rails (~> 3.1)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
@ -112,6 +114,7 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
will_paginate (3.0.3)
PLATFORMS
ruby
@ -122,11 +125,17 @@ DEPENDENCIES
acts_as_list (~> 0.1.4)
bcrypt-ruby (~> 3.0.0)
coffee-rails (~> 3.2.1)
has_many_polymorphs!
highline (~> 1.5.0)
htmlentities (~> 4.3.0)
jquery-rails
mail
mysql2
rails (= 3.2.3)
rails_autolink
sanitize (~> 1.2.1)
sass-rails (~> 3.2.3)
soap4r-ruby1.9
sqlite3
swf_fu
uglifier (>= 1.0.3)
will_paginate

View file

@ -6,17 +6,19 @@ module ApplicationHelper
# current page. If that matches the url, the link is marked id = "current"
#
def navigation_link(name, options = {}, html_options = nil, *parameters_for_method_reference)
if html_options
html_options = html_options.stringify_keys
convert_options_to_javascript!(html_options)
tag_options = tag_options(html_options)
else
tag_options = nil
end
url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference)
id_tag = (request.request_uri == url) ? " id=\"current\"" : ""
"<a href=\"#{url}\"#{tag_options}#{id_tag}>#{name || url}</a>"
link_to name, options, html_options
# TODO: check if this needs to be converted
# if html_options
# html_options = html_options.stringify_keys
# convert_options_to_javascript!(html_options)
# tag_options = tag_options(html_options)
# else
# tag_options = nil
# end
# url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference)
# id_tag = (request.request_uri == url) ? " id=\"current\"" : ""
#
# "<a href=\"#{url}\"#{tag_options}#{id_tag}>#{name || url}</a>"
end
def days_from_today(date)
@ -235,7 +237,7 @@ module ApplicationHelper
end
def determine_done_path
case @controller.controller_name
case controller.controller_name
when "contexts"
done_todos_context_path(@context)
when "projects"
@ -252,7 +254,7 @@ module ApplicationHelper
end
def determine_all_done_path
case @controller.controller_name
case controller.controller_name
when "contexts"
all_done_todos_context_path(@context)
when "projects"

View file

@ -2,22 +2,22 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%= stylesheet_link_tag 'standard','superfish','niftyCorners', 'jquery-ui-1.8.17.custom', :cache => 'tracks-cached' %>
<%#= stylesheet_link_tag 'standard','superfish','niftyCorners', 'jquery-ui-1.8.17.custom', :cache => 'tracks-cached' %>
<%= stylesheet_link_tag "print", :media => "print" %>
<%= javascript_include_tag 'jquery-1.7.1.min', 'jquery-ui-1.8.17.custom.min',
<%#= javascript_include_tag 'jquery-1.7.1.min', 'jquery-ui-1.8.17.custom.min',
'jquery.truncator','jquery.jeditable.mini', 'jquery.cookie', 'jquery.blockUI',
'jquery.form',
:cache => 'jquery-cached' %>
<%= javascript_tag_for_i18n_datepicker %>
<%= javascript_include_tag 'hoverIntent','superfish','application',
<%#= javascript_tag_for_i18n_datepicker %>
<%#= javascript_include_tag 'hoverIntent','superfish','application',
'accesskey-hints','niftycube','swfobject',
:cache => 'tracks-cached' %>
<%= javascript_include_tag('jquery.simulate.drag-sortable') if ENV['RAILS_ENV']=='cucumber' -%>
<% #= javascript_include_tag('jquery.simulate.drag-sortable') if ENV['RAILS_ENV']=='cucumber' -%>
<%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
<%= javascript_tag "var SOURCE_VIEW = '#{@source_view}';" %>
<%= javascript_tag "var TAG_NAME = '#{@tag_name}';" if @tag_name %>
<%= csrf_meta_tag %>
<script type="text/javascript">
var SOURCE_VIEW = '<%=@source_view%>';
var defaultContexts = <%= default_contexts_for_autocomplete rescue '{}' %>;
var defaultTags = <%= default_tags_for_autocomplete rescue '{}' %>;
var dateFormat = '<%= date_format_for_date_picker %>';
@ -38,7 +38,7 @@
<title><%= @page_title %></title>
</head>
<body class="<%= @controller.controller_name %>">
<body class="<%= controller.controller_name %>">
<div id="topbar">
<%= NOTIFY_BAR %>
@ -60,7 +60,7 @@
</div>
<div id="navcontainer">
<ul class="sf-menu">
<li><%= navigation_link(t('layouts.navigation.home'), home_path, {:accesskey => "t", :title => t('layouts.navigation.home_title')} ) %></li>
<li><%= navigation_link(t('layouts.navigation.home'), root_path, {:accesskey => "t", :title => t('layouts.navigation.home_title')} ) %></li>
<li><%= navigation_link(t('layouts.navigation.starred'), tag_path("starred"), :title => t('layouts.navigation.starred_title')) %></li>
<li><%= navigation_link(t('common.projects'), projects_path, {:accesskey=>"p", :title=>t('layouts.navigation.projects_title')} ) %></li>
<li><%= navigation_link(t('layouts.navigation.tickler'), tickler_path, {:accesskey =>"k", :title => t('layouts.navigation.tickler_title')} ) %></li>
@ -101,7 +101,7 @@
<%= render_flash %>
</div>
<div id="content" class="<%= @controller.controller_name %>">
<div id="content" class="<%= controller.controller_name %>">
<%= yield %>
</div>

View file

@ -5,7 +5,15 @@
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=h @initial_project_name-%>" />
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=h @initial_context_name-%>" />
<div id="multiple_error_status"><%= error_messages_for("item", :object_name => 'action') %></div>
<div id="multiple_error_status">
<% if todo.errors.any? -%>
<ul>
<% todo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<% end -%>
</div>
<label for="todo_notes"><%= t('shared.multiple_next_actions') %></label>
<%= text_area_tag( "todo[multiple_todos]", "", :cols => 29, :rows => 6, :tabindex => next_tab_index) %>

View file

@ -6,7 +6,15 @@
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%= h(@initial_context_name)-%>" />
<input type="hidden" id="new_todo_starred" name="new_todo_starred" value="false" />
<div id="error_status"><%= error_messages_for("item", :object_name => 'action') %></div>
<div id="error_status">
<% if todo.errors.any? -%>
<ul>
<% todo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<% end -%>
</div>
<label for="todo_description" style="float:left"><%= Todo.human_attribute_name('description') %></label>
<a href="#" id="new_todo_starred_link" class="undecorated_link" ><%= image_tag("blank.png", :title =>t('todos.star_action'), :class => "todo_star", :style=> "float: right")%></a>

View file

@ -3,10 +3,7 @@
<h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_found') %></p></div>
</div>
<%= render(
:partial => "contexts/context",
:collection => @contexts_to_show,
:locals => { :collapsible => true }) -%>
<%= render(:partial => @contexts_to_show, :locals => { :collapsible => true }) -%>
<% unless @done.nil? -%>
<%= render(
:partial => "todos/completed",

View file

@ -4,12 +4,10 @@
<div class="message"><p><%= t('todos.no_deferred_actions') %></p></div>
</div>
<%= render :partial => "contexts/context", :collection => @contexts,
:locals => { :collapsible => true } %>
</div><!-- End of display_box -->
<%= render :partial => @contexts, :locals => { :collapsible => true } %>
</div>
<div id="input_box">
<%= render :partial => "shared/add_new_item_form" %>
<%= render :file => "sidebar/sidebar.html.erb" %>
</div><!-- End of input box -->
</div>

View file

@ -20,6 +20,7 @@ module Tracksapp
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
config.autoload_paths += Dir["#{config.root}/lib/**/"]
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.

View file

@ -59,6 +59,60 @@ Tracksapp::Application.routes.draw do
root :to => 'todos#index'
match "tickler" => "todos#list_deferred"
match 'review' => "projects#review"
match 'logout' => 'users#logout'
match 'calendar' => "todos#calendar"
match 'done' => "stats#done", :as => 'done_overview'
match 'integrations' => "integrations#index"
match 'integrations/rest_api' => "integrations#rest_api", :as => 'rest_api_docs'
match 'integrations/cloudmailin' => 'integrations#cloudmailin'
match 'integrations/search_plugin.xml' => "integrations#search_plugin", :as => 'search_plugin'
match 'integrations/google_gadget.xml' => 'integrations#google_gadget', :as => 'google_gadget'
match 'preferences' => "preferences#index"
match 'preferences/render_date_format' => "preferences#render_date_format"
resources :contexts do
collection do
post 'order'
get 'done'
end
member do
get 'done_todos'
get 'all_done_todos'
end
end
resources :projects do
member do
get 'done_todos'
get 'all_done_todos'
get 'set_reviewed' # TODO: convert to PUT/POST
end
collection do
get 'done'
post 'order'
post 'alphabetize'
post 'actionize'
end
end
resources :todos do
member do
put 'toggle_check'
put 'toggle_star'
put 'defer'
end
collection do
get 'done'
get 'all_done'
post 'check_deferred'
post 'filter_to_context'
post 'filter_to_project'
end
end
match 'todos/tag/:name' => 'todos#tag', :as => :tag
resources :notes
# map.resources :users,
# :member => {:change_password => :get, :update_password => :post,

View file

@ -1,241 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Ruby on Rails: Welcome aboard</title>
<style type="text/css" media="screen">
body {
margin: 0;
margin-bottom: 25px;
padding: 0;
background-color: #f0f0f0;
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
font-size: 13px;
color: #333;
}
h1 {
font-size: 28px;
color: #000;
}
a {color: #03c}
a:hover {
background-color: #03c;
color: white;
text-decoration: none;
}
#page {
background-color: #f0f0f0;
width: 750px;
margin: 0;
margin-left: auto;
margin-right: auto;
}
#content {
float: left;
background-color: white;
border: 3px solid #aaa;
border-top: none;
padding: 25px;
width: 500px;
}
#sidebar {
float: right;
width: 175px;
}
#footer {
clear: both;
}
#header, #about, #getting-started {
padding-left: 75px;
padding-right: 30px;
}
#header {
background-image: url("assets/rails.png");
background-repeat: no-repeat;
background-position: top left;
height: 64px;
}
#header h1, #header h2 {margin: 0}
#header h2 {
color: #888;
font-weight: normal;
font-size: 16px;
}
#about h3 {
margin: 0;
margin-bottom: 10px;
font-size: 14px;
}
#about-content {
background-color: #ffd;
border: 1px solid #fc0;
margin-left: -55px;
margin-right: -10px;
}
#about-content table {
margin-top: 10px;
margin-bottom: 10px;
font-size: 11px;
border-collapse: collapse;
}
#about-content td {
padding: 10px;
padding-top: 3px;
padding-bottom: 3px;
}
#about-content td.name {color: #555}
#about-content td.value {color: #000}
#about-content ul {
padding: 0;
list-style-type: none;
}
#about-content.failure {
background-color: #fcc;
border: 1px solid #f00;
}
#about-content.failure p {
margin: 0;
padding: 10px;
}
#getting-started {
border-top: 1px solid #ccc;
margin-top: 25px;
padding-top: 15px;
}
#getting-started h1 {
margin: 0;
font-size: 20px;
}
#getting-started h2 {
margin: 0;
font-size: 14px;
font-weight: normal;
color: #333;
margin-bottom: 25px;
}
#getting-started ol {
margin-left: 0;
padding-left: 0;
}
#getting-started li {
font-size: 18px;
color: #888;
margin-bottom: 25px;
}
#getting-started li h2 {
margin: 0;
font-weight: normal;
font-size: 18px;
color: #333;
}
#getting-started li p {
color: #555;
font-size: 13px;
}
#sidebar ul {
margin-left: 0;
padding-left: 0;
}
#sidebar ul h3 {
margin-top: 25px;
font-size: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
}
#sidebar li {
list-style-type: none;
}
#sidebar ul.links li {
margin-bottom: 5px;
}
.filename {
font-style: italic;
}
</style>
<script type="text/javascript">
function about() {
info = document.getElementById('about-content');
if (window.XMLHttpRequest)
{ xhr = new XMLHttpRequest(); }
else
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
xhr.open("GET","rails/info/properties",false);
xhr.send("");
info.innerHTML = xhr.responseText;
info.style.display = 'block'
}
</script>
</head>
<body>
<div id="page">
<div id="sidebar">
<ul id="sidebar-items">
<li>
<h3>Browse the documentation</h3>
<ul class="links">
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
<li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
<li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
</ul>
</li>
</ul>
</div>
<div id="content">
<div id="header">
<h1>Welcome aboard</h1>
<h2>You&rsquo;re riding Ruby on Rails!</h2>
</div>
<div id="about">
<h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
<div id="about-content" style="display: none"></div>
</div>
<div id="getting-started">
<h1>Getting started</h1>
<h2>Here&rsquo;s how to get rolling:</h2>
<ol>
<li>
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
<p>To see all available options, run it without parameters.</p>
</li>
<li>
<h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
<p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
</li>
<li>
<h2>Create your database</h2>
<p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
</li>
</ol>
</div>
</div>
<div id="footer">&nbsp;</div>
</div>
</body>
</html>