mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
Moved settings for Tracks from the file settings.yml to the database. Running 'rake migrate' will update your database appropriately, and add the default settings into it. Then you should be able to visit <code>http://0.0.0.0:3000/user/preferences</code> to view and edit your settings. The advantage is that you don't need to mess about with the settings.yml file, and each of the users can have their own settings.
I'm intending this to be the last big change before releasing 1.04. Can people with access to the trunk through subversion check out this changeset and report any bugs? git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@182 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
c8f986a7ec
commit
e50389788b
21 changed files with 164 additions and 94 deletions
|
|
@ -1,13 +1,8 @@
|
|||
The main README file is in tracks/doc/README_FOR_APP, and the change log in tracks/doc/CHANGELOG. If you downloaded this application as a *.zip file, then there is documentation for the app in tracks/doc/app. If you open the index.html file in a browser, you can view the documentation for the methods, as well as viewing README_FOR_APP and CHANGELOG in more attractive format. If you checked out the application with Subversion, you need to generate the documentation. Navigate inside the tracks directory in a terminal, then issue the following command:
|
||||
rake appdoc
|
||||
|
||||
This will generate the documentation as above in tracks/doc/app.
|
||||
|
||||
Database schemas for MySQL, PostgreSQL and SQLite are available in tracks/db, along with some example contents in tracks_1.031_content.sql.
|
||||
The main README file is in tracks/doc/README_FOR_APP, and the change log in tracks/doc/CHANGELOG.
|
||||
|
||||
** IMPORTANT **
|
||||
|
||||
Before you do anything else, you need to copy certain files and rename the copy:
|
||||
Before you do anything else, you need to copy the following file and rename the copy:
|
||||
|
||||
tracks/config/database.yml.tmpl -> tracks/config/database.yml
|
||||
|
||||
|
|
|
|||
|
|
@ -11,15 +11,10 @@ class ApplicationController < ActionController::Base
|
|||
include LoginSystem
|
||||
|
||||
before_filter :set_session_expiration
|
||||
before_filter :get_current_user
|
||||
|
||||
# Contstants from settings.yml
|
||||
#
|
||||
DATE_FORMAT = app_configurations["formats"]["date"]
|
||||
WEEK_STARTS_ON = app_configurations["formats"]["week_starts"]
|
||||
NO_OF_ACTIONS = app_configurations["formats"]["hp_completed"]
|
||||
STALENESS_STARTS = app_configurations["formats"]["staleness_starts"]
|
||||
|
||||
# Count the number of uncompleted actions, excluding those in hidden contexts
|
||||
# Count the number of uncompleted actions, excluding those
|
||||
# in hidden contexts
|
||||
#
|
||||
def count_shown_items(hidden)
|
||||
count = 0
|
||||
|
|
@ -57,4 +52,10 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_current_user
|
||||
@user = @session['user']
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ContextController < ApplicationController
|
|||
@item.attributes = @params["todo"]
|
||||
|
||||
if @item.due?
|
||||
@item.due = Date.strptime(@params["todo"]["due"], DATE_FORMAT)
|
||||
@item.due = Date.strptime(@params["todo"]["due"], @user.preferences["date_format"])
|
||||
else
|
||||
@item.due = ""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@ class LoginController < ApplicationController
|
|||
user.is_admin = 1 if User.find_all.empty?
|
||||
if user.save
|
||||
@session['user'] = User.authenticate(user.login, @params['user']['password'])
|
||||
@user = @session['user']
|
||||
@user.preferences = { "date_format" => "%d/%m/%Y", "week_starts" => "1", "no_completed" => "5", "staleness_starts" => "7", "due_style" => "1", "admin_email" => "butshesagirl@rousette.org.uk", "loginhash" => "change-me"}
|
||||
@user.save
|
||||
flash['notice'] = "Signup successful"
|
||||
redirect_back_or_default :controller => "todo", :action => "list"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class ProjectController < ApplicationController
|
|||
@item.attributes = @params["todo"]
|
||||
|
||||
if @item.due?
|
||||
@item.due = Date.strptime(@params["todo"]["due"], DATE_FORMAT)
|
||||
@item.due = Date.strptime(@params["todo"]["due"], @user.preferences["date_format"])
|
||||
else
|
||||
@item.due = ""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class TodoController < ApplicationController
|
|||
self.init
|
||||
@on_page = "home"
|
||||
@page_title = "TRACKS::List tasks"
|
||||
@done = @done[0..(NO_OF_ACTIONS-1)]
|
||||
@done = @done[0..(@user.preferences["no_completed"].to_i-1)]
|
||||
|
||||
@contexts_to_show = @contexts.clone
|
||||
@contexts_to_show = @contexts_to_show.collect {|x| (!x.hide? and !x.find_not_done_todos.empty?) ? x:nil }.compact
|
||||
|
|
@ -44,7 +44,7 @@ class TodoController < ApplicationController
|
|||
@item.attributes = @params["todo"]
|
||||
|
||||
if @item.due?
|
||||
@item.due = Date.strptime(@params["todo"]["due"], DATE_FORMAT)
|
||||
@item.due = Date.strptime(@params["todo"]["due"], @user.preferences["date_format"])
|
||||
else
|
||||
@item.due = ""
|
||||
end
|
||||
|
|
@ -115,7 +115,7 @@ class TodoController < ApplicationController
|
|||
item.attributes = @params["item"]
|
||||
|
||||
if item.due?
|
||||
item.due = Date.strptime(@params["item"]["due"], DATE_FORMAT)
|
||||
item.due = Date.strptime(@params["item"]["due"], @user.preferences["date_format"])
|
||||
else
|
||||
item.due = ""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class UserController < ApplicationController
|
||||
scaffold :user
|
||||
layout 'standard'
|
||||
|
||||
def index
|
||||
render_text "This will be our jumping-off point for managing user functions!"
|
||||
|
|
@ -8,4 +8,33 @@ class UserController < ApplicationController
|
|||
def admin
|
||||
render_text "You'll only be allowed to go here if you're an administrator."
|
||||
end
|
||||
|
||||
def preferences
|
||||
@page_title = "TRACKS::Preferences"
|
||||
@prefs = @user.preferences
|
||||
end
|
||||
|
||||
def edit_preferences
|
||||
@page_title = "TRACKS::Edit Preferences"
|
||||
@prefs = @user.preferences
|
||||
|
||||
render :action => "preference_edit_form", :object => @prefs
|
||||
end
|
||||
|
||||
def update_preferences
|
||||
@user.preferences = { "date_format" => "#{@params['prefs']['date_format']}",
|
||||
"week_starts" => "#{@params['prefs']['week_starts']}",
|
||||
"no_completed" => "#{@params['prefs']['no_completed']}",
|
||||
"staleness_starts" => "#{@params['prefs']['staleness_starts']}",
|
||||
"due_style" => "#{@params['prefs']['due_style']}",
|
||||
"admin_email" => "#{@params['prefs']['admin_email']}",
|
||||
"loginhash" => "#{@params['prefs']['loginhash']}"
|
||||
}
|
||||
if @user.save
|
||||
redirect_to :action => 'preferences'
|
||||
else
|
||||
render :action => 'edit_preferences'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -6,7 +6,8 @@ module ApplicationHelper
|
|||
#
|
||||
def format_date(date)
|
||||
if date
|
||||
formatted_date = date.strftime("#{ApplicationController::DATE_FORMAT}")
|
||||
date_format = @user.preferences["date_format"]
|
||||
formatted_date = date.strftime("#{date_format}")
|
||||
else
|
||||
formatted_date = ''
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
module TodoHelper
|
||||
|
||||
require 'user_controller'
|
||||
# Counts the number of uncompleted items in the specified context
|
||||
#
|
||||
def count_items(context)
|
||||
|
|
@ -46,11 +47,11 @@ module TodoHelper
|
|||
def staleness_class(item)
|
||||
if item.due || item.done?
|
||||
return ""
|
||||
elsif item.created_at < (ApplicationController::STALENESS_STARTS*3).days.ago
|
||||
elsif item.created_at < (@user.preferences["staleness_starts"].to_i*3).days.ago
|
||||
return " stale_l3"
|
||||
elsif item.created_at < (ApplicationController::STALENESS_STARTS*2).days.ago
|
||||
elsif item.created_at < (@user.preferences["staleness_starts"].to_i*2).days.ago
|
||||
return " stale_l2"
|
||||
elsif item.created_at < (ApplicationController::STALENESS_STARTS).days.ago
|
||||
elsif item.created_at < (@user.preferences["staleness_starts"].to_i).days.ago
|
||||
return " stale_l1"
|
||||
else
|
||||
return ""
|
||||
|
|
@ -78,7 +79,7 @@ module TodoHelper
|
|||
"<a title='" + format_date(due) + "'><span class=\"amber\">Due Tomorrow</span></a> "
|
||||
# due 2-7 days away
|
||||
when 2..7
|
||||
if app_configurations["formats"]["due_style"] == 1
|
||||
if @user.preferences["due_style"] == "1"
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due on " + due.strftime("%A") + "</span></a> "
|
||||
else
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due in " + @days.to_s + " days</span></a> "
|
||||
|
|
@ -101,8 +102,10 @@ module TodoHelper
|
|||
end
|
||||
|
||||
def calendar_setup( input_field )
|
||||
str = "Calendar.setup({ ifFormat:\"#{ApplicationController::DATE_FORMAT}\""
|
||||
str << ",firstDay:#{ApplicationController::WEEK_STARTS_ON},showOthers:true,range:[2004, 2010]"
|
||||
date_format = @user.preferences["date_format"]
|
||||
week_starts = @user.preferences["week_starts"]
|
||||
str = "Calendar.setup({ ifFormat:\"#{date_format}\""
|
||||
str << ",firstDay:#{week_starts},showOthers:true,range:[2004, 2010]"
|
||||
str << ",step:1,inputField:\"" + input_field + "\",cache:true,align:\"TR\" })"
|
||||
javascript_tag str
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ class User < ActiveRecord::Base
|
|||
has_many :projects, :order => "position ASC"
|
||||
has_many :todos, :order => "completed DESC"
|
||||
has_many :notes, :order => "created_at DESC"
|
||||
|
||||
serialize :preferences
|
||||
|
||||
attr_protected :is_admin
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ class User < ActiveRecord::Base
|
|||
protected
|
||||
|
||||
def self.sha1(pass)
|
||||
Digest::SHA1.hexdigest("#{app_configurations["admin"]["loginhash"]}--#{pass}--")
|
||||
Digest::SHA1.hexdigest("change-me--#{pass}--")
|
||||
end
|
||||
|
||||
before_create :crypt_password
|
||||
|
|
@ -35,4 +37,5 @@ protected
|
|||
validates_presence_of :password, :login, :word
|
||||
validates_uniqueness_of :login, :on => :create
|
||||
validates_confirmation_of :password, :on => :create
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@
|
|||
<li><%= link_to( "Home", {:controller => "todo", :action => "list"}, {:accesskey=>"t", :title=>"Home"} ) %></li>
|
||||
<li><%= link_to( "Contexts", {:controller => "context", :action => "list"}, {:accesskey=>"c", :title=>"Contexts"} ) %></li>
|
||||
<li><%= link_to( "Projects", {:controller => "project", :action => "list"}, {:accesskey=>"p", :title=>"Projects"} ) %></li>
|
||||
<li><%= link_to( "Completed", {:controller => "todo", :action => "completed"}, {:accesskey=>"d", :title=>"Completed"} ) %></li>
|
||||
<li><%= link_to( "Done", {:controller => "todo", :action => "completed"}, {:accesskey=>"d", :title=>"Completed"} ) %></li>
|
||||
<li><%= link_to( "Notes", {:controller => "note", :action => "index"}, :title => "Show all notes" ) %></li>
|
||||
<li><%= link_to( "Preferences", {:controller => "user", :action => "preferences"}, :title => "Show my preferences" ) %></li>
|
||||
<li><a href="javascript:toggleAll('notes','block')" accesskey="S" title="Show all notes">Show</a></li>
|
||||
<li><a href="javascript:toggleAll('notes','none')" accesskey="H" title="Hide all notes">Hide</a></li>
|
||||
<li><%= link_to(image_tag("feed-icon", :size => "16X16", :border => 0), {:controller => "feed", :action => "na_feed", :name => "#{@session['user']['login']}", :token => "#{@session['user']['word']}"}, :title => "Subscribe to an RSS feed of your next actions" ) %></li>
|
||||
|
|
|
|||
29
tracks/app/views/user/preference_edit_form.rhtml
Normal file
29
tracks/app/views/user/preference_edit_form.rhtml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<div id="display_box" class="container context">
|
||||
<h2>Help on preferences</h2>
|
||||
<p>The preference settings should mostly be self-explanatory, but some hints are included below: </p>
|
||||
<ul>
|
||||
<li><strong>staleness_starts:</strong> the number of days before items with no due date get marked as stale (with a yellow highlight)</li>
|
||||
<li><strong>loginhash:</strong> text included in your encrypted password to make it more secure.</li>
|
||||
<li><strong>date_format:</strong> the format in which you'd like dates to be shown. For example, for the date 31st January 2006, %d/%m/%Y will show 31/01/2006, %b-%e-%y will show Jan-31-06. See the <a href="http://uk2.php.net/strftime" title="PHP strftime manual">strftime manual</a> for more formatting options for the date.</li>
|
||||
<li><strong>no_completed:</strong> number of completed actions to show on the home page</li>
|
||||
<li><strong>admin_email:</strong> email address for the admin user of Tracks (displayed on the signup page for users to contact to obtain an account)</li>
|
||||
<li><strong>week_starts:</strong> day of the week shown as the start of the week on the popup calendar. 0 = Sunday, 1 = Monday etc.</li>
|
||||
<li><strong>due_style:</strong> style in which due dates for the range 2-7 days away is shown. 0 = "Due in 3 days", 1 = "Due on Wednesday"</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="input_box" class="container context">
|
||||
<%= start_form_tag :action => 'update_preferences' %>
|
||||
<table>
|
||||
<% @prefs.each do |k,v| %>
|
||||
<tr>
|
||||
<td><label><%= k %>:</label></td>
|
||||
<td><input name="prefs[<%= k %>]" type="text" value="<%= v %>" /></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr><td><%= submit_tag "Update" %></td>
|
||||
<td><%= link_to "Cancel", :controller => 'user', :action => 'preferences' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= end_form_tag %>
|
||||
</div>
|
||||
15
tracks/app/views/user/preferences.rhtml
Normal file
15
tracks/app/views/user/preferences.rhtml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div id="display_box" class="container context">
|
||||
|
||||
<h2>Your preferences</h2>
|
||||
|
||||
<ul id="prefs">
|
||||
<li>Date format: <span class="highlight"><%= @prefs["date_format"] %></span></li>
|
||||
<li>Week starts on: <span class="highlight"><%= @prefs["week_starts"] %></span></li>
|
||||
<li>Show the last <span class="highlight"><%= @prefs["no_completed"] %></span> completed items on the home page</li>
|
||||
<li>Staleness starts after <span class="highlight"><%= @prefs["staleness_starts"] %></span> days</li>
|
||||
<li>Due style: <span class="highlight"><%= @prefs["due_style"] %></span></li>
|
||||
<li>Admin email: <span class="highlight"><%= @prefs["admin_email"] %></span></li>
|
||||
<li>Loginhash: <span class="highlight"><%= @prefs["loginhash"] %></span></li>
|
||||
</ul>
|
||||
<%= link_to "Edit preferences", :controller => 'user', :action => 'edit_preferences' %>
|
||||
</div>
|
||||
|
|
@ -48,8 +48,4 @@ end
|
|||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
|
||||
# Include your application configuration below
|
||||
def app_configurations
|
||||
@app_cfg = nil if ENV['RAILS_ENV'] == 'development'
|
||||
@app_cfg ||= YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml"))
|
||||
end
|
||||
# Include your application configuration below
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# It's very important not to use TAB characters in this file
|
||||
# Use two spaces instead of a TAB
|
||||
# week_starts is the day you want the calendar to display first (0=Sunday, 1=Monday etc.)
|
||||
# hp_completed is the number of completed items you want displayed on the home page
|
||||
# staleness_starts is the number of days before actions start to go yellow with age!
|
||||
# due_style 0 is "due in N days" for N=2..7
|
||||
# due_style 1 is "due on weekdayname" for N=2..7
|
||||
#
|
||||
formats:
|
||||
date: %d/%m/%Y
|
||||
week_starts: 1
|
||||
hp_completed: 5
|
||||
staleness_starts: 7
|
||||
due_style: 0
|
||||
admin:
|
||||
email: butshesagirl@rousette.org.uk
|
||||
loginhash: change-me
|
||||
14
tracks/db/migrate/006_add_preferences_to_user_table.rb
Normal file
14
tracks/db/migrate/006_add_preferences_to_user_table.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class AddPreferencesToUserTable < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column "users", "preferences", :text
|
||||
@users = User.find(:all)
|
||||
@users.each do |u|
|
||||
u.preferences = { "date_format" => "%d/%m/%Y", "week_starts" => "1", "no_completed" => "5", "staleness_starts" => "7", "due_style" => "1", "admin_email" => "butshesagirl@rousette.org.uk", "loginhash" => "change-me"}
|
||||
u.save
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column "users", "preferences"
|
||||
end
|
||||
end
|
||||
|
|
@ -2,18 +2,18 @@
|
|||
# migrations feature of ActiveRecord to incrementally modify your database, and
|
||||
# then regenerate this schema definition.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 5) do
|
||||
ActiveRecord::Schema.define(:version => 6) do
|
||||
|
||||
create_table "contexts", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "hide", :boolean, :default => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
end
|
||||
|
||||
create_table "notes", :force => true do |t|
|
||||
t.column "user_id", :integer, :null => false
|
||||
t.column "project_id", :integer, :null => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "project_id", :integer, :default => 0, :null => false
|
||||
t.column "body", :text
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
|
|
@ -21,29 +21,30 @@ ActiveRecord::Schema.define(:version => 5) do
|
|||
|
||||
create_table "projects", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "done", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "description", :text, :default => ""
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "description", :text
|
||||
end
|
||||
|
||||
create_table "todos", :force => true do |t|
|
||||
t.column "context_id", :integer, :limit => 11, :default => 0, :null => false
|
||||
t.column "description", :string, :limit => 100, :default => "", :null => false
|
||||
t.column "context_id", :integer, :default => 0, :null => false
|
||||
t.column "project_id", :integer
|
||||
t.column "description", :string, :default => "", :null => false
|
||||
t.column "notes", :text
|
||||
t.column "done", :boolean, :default => false
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "done", :boolean, :default => false, :null => false
|
||||
t.column "created_at", :datetime
|
||||
t.column "due", :date
|
||||
t.column "completed", :datetime
|
||||
t.column "project_id", :integer, :limit => 11
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.column "login", :string, :limit => 80
|
||||
t.column "password", :string, :limit => 40
|
||||
t.column "login", :string, :limit => 80, :default => "", :null => false
|
||||
t.column "password", :string, :limit => 40, :default => "", :null => false
|
||||
t.column "word", :string
|
||||
t.column "is_admin", :boolean, :default => false
|
||||
t.column "is_admin", :boolean, :default => false, :null => false
|
||||
t.column "preferences", :text
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Homepage: http://www.rousette.org.uk/projects/
|
||||
* Author: bsag (http://www.rousette.org.uk/)
|
||||
* Contributors: Nicholas Lee, Lolindrath, Jim Ray, Arnaud Limbourg, Timothy Martens, Luke Melia, John Leonard (for great installation tutorials on Windows XP)
|
||||
* Version: 1.03
|
||||
* Version: 1.04
|
||||
* Copyright: (cc) 2004-2006 rousette.org.uk
|
||||
* License: GNU GPL
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ Trac (for bug reports and feature requests): http://dev.rousette.org.uk/report/6
|
|||
|
||||
Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
|
||||
|
||||
== Version 1.031
|
||||
== Version 1.04
|
||||
|
||||
1. Tidied up the interface a bit, fixing mistakes in the wording.
|
||||
2. The number of actions reported is now correctly pluralized depending on the number of actions (e.g. 1 action, 2 actions).
|
||||
|
|
@ -35,6 +35,7 @@ Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
|
|||
17. The next action count badge is now dynamically updated whenever you add or delete a next action, so that you don't have to refresh to see the count updated.
|
||||
18. Validation errors are now reported in a status box (just above the new next action form).
|
||||
19. There's a rake task (upgrade_sqlite_db) which allows you to safely upgrade databases created with version 1.03, afterwhich you can run rake migrate to complete the process. From there, rake migrate should work OK.
|
||||
20. Moved settings for Tracks from the file settings.yml to the database. Running 'rake migrate' will update your database appropriately, and add the default settings into it. Then you should be able to visit <tt>http://0.0.0.0:3000/user/preferences</tt> to view and edit your settings. The advantage is that you don't need to mess about with the settings.yml file, and each of the users can have their own settings.
|
||||
|
||||
== Version 1.03
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Homepage: http://www.rousette.org.uk/projects/
|
||||
* Author: bsag (http://www.rousette.org.uk/)
|
||||
* Contributors: Nicholas Lee, Lolindrath, Jim Ray, Arnaud Limbourg, Timothy Martens, Luke Melia, John Leonard (for great installation tutorials on Windows XP)
|
||||
* Version: 1.031
|
||||
* Version: 1.04
|
||||
* Copyright: (cc) 2004-2006 rousette.org.uk
|
||||
* License: GNU GPL
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ While fully usable for everyday use, Tracks is still a work in progress. Make su
|
|||
|
||||
== Installation (for trunk version <b>only</b>)
|
||||
|
||||
Before you start, you need to make sure that you have Ruby 1.8.2 installed. Rails 1.0 and RedCloth are now included in the vendor directory of the distribution, so you don't need to install them yourself. You also need some kind of database. MySQL is probably the most popular, but it's also easy to use PostgreSQL or SQLite. If you have Mac OS X Tiger, you already have Ruby 1.8.2 and SQLite3 installed, so all you need to do after installing Rails and Redcloth is to install the sqlite3-ruby gem (1.1.0). See http://dev.rousette.org.uk/wiki/Tracks/Install for more details on installing all the necessary components on all the supported platforms.
|
||||
Before you start, you need to make sure that you have Ruby 1.8.2 installed. Rails 1.0 and RedCloth are now included in the vendor directory of the distribution, so you don't need to install them yourself. You also need some kind of database. MySQL is probably the most popular, but it's also easy to use PostgreSQL or SQLite/SQLite3. If you have Mac OS X Tiger, you already have Ruby 1.8.2 and SQLite3 installed, so all you need to do after installing Rails and Redcloth is to install the sqlite3-ruby gem (1.1.0). See http://dev.rousette.org.uk/wiki/Tracks/Install for more details on installing all the necessary components on all the supported platforms.
|
||||
|
||||
=== New users
|
||||
|
||||
|
|
@ -36,18 +36,16 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
|
|||
|
||||
* Copy the file <tt>config/database.yml.tmpl</tt> to <tt>config/database.yml</tt>.
|
||||
* Open the <tt>tracks/config/database.yml</tt> file, and enter your username and password details for the database you just set up. If you're running in production mode, you only really need to set up the entry under 'production'. <b>NB</b>: If you do set up the entry for 'test', make sure that you specify a different database, or when you run tests, they will overwrite your data. <b>NB:</b> It's very important that you don't use TABS in any of the .yml files. Just use spaces to indent.
|
||||
* The file tracks/Rakefile contains various useful tasks you can run. The first one you need to run copies all the other files and directories with *.tmpl extensions and removes the extension:
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake setup_tracks</tt>
|
||||
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
* Run 'rake migrate', which will create the necessary tables in your database, including some required contents:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake migrate</tt>
|
||||
|
||||
* Check over the file <tt>config/settings.yml</tt>, and make sure that the settings are to your liking.
|
||||
* If you'd also like some example data to play with, you can import it from tracks_1.04_content.sql (in <tt>tracks/db</tt>). You don't have to use the example data, but if you don't, you'll need to visit <tt>http://YOURURL/contexts</tt> first to add a few contexts before you add any next actions. Note that no users are provided in the content file, so you'll need to visit the signup page (http://YOURURL/signup) to create some users.
|
||||
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
|
||||
* Run the following command at your command line (<b>Important:</b> If you already have an application running on WEBrick (Tracks or anything else), make sure that you stop the server, or run Tracks on a different port using the <tt>--port</tt> option):
|
||||
|
|
@ -55,6 +53,8 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
|
|||
<tt>ruby script/server -e production</tt>
|
||||
|
||||
* In a browser, go to <tt>http://0.0.0.0:3000/signup</tt>. This will allow you to choose a username and password for the admin user. Thereafter, anyone else trying to access <tt>/signup</tt> will get a message that they are not allowed to sign up, and are given your email address to contact for permission. When you are logged in as the admin user, you can visit <tt>/signup</tt> to sign up additional users (who will not be able to view any of your next actions, contexts, projects or notes, but can set up their own separate tasks), and visit <tt>/login</tt> to login yourself.
|
||||
* Add some contexts at <tt>http://0.0.0.0:3000/contexts</tt> and projects at <tt>http://0.0.0.0:3000/projects</tt> and then you're ready to add all your next actions.
|
||||
* You can set various preferences by visiting <tt>http://0.0.0.0:3000/user/preferences</tt>. These are stored on a per-user basis in the database.
|
||||
* Have fun!
|
||||
|
||||
==== SQLite/SQLite3
|
||||
|
|
@ -70,7 +70,6 @@ Then cd into the db directory and run rake migrate. This should create the datab
|
|||
|
||||
* For safety, rename your current Tracks directory to 'tracks-old' or something similar.
|
||||
* The 'rake migrate' script should be able to update your database tables with the contents in place, but it's very important to make a MySQL dump of both the contents and tables before you go any further. KEEP THIS BACKUP IN A SAFE PLACE IN CASE YOU HAVE TO REVERT TO IT.
|
||||
* <b>Make sure that you check <tt>settings.yml.tmpl</tt> for new info</b>, and add any new fields to your <tt>settings.yml</tt> file. Some new settings have been added in the past couple of versions, and not having the correct settings is a common cause of errors.
|
||||
* Before you do anything else, <b>BACK UP YOUR DATABASE</b> (tables and content). Then make a separate export of the contents only (assuming that you want to move your data to the new version.)
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
|
||||
|
|
|
|||
|
|
@ -11,19 +11,5 @@ task :setup_tracks => :environment do
|
|||
puts f_only + " created"
|
||||
end
|
||||
end
|
||||
# Check the config dir for template files
|
||||
# We can't convert the database.yml.tmpl file, because database.yml needs
|
||||
# to exist for rake to run tasks!
|
||||
cd("config") do
|
||||
FileList["settings.yml.tmpl"].each do |template_file|
|
||||
f = File.basename(template_file) # with suffix
|
||||
f_only = File.basename(template_file,".tmpl") # without suffix
|
||||
if File.exists?(f_only)
|
||||
puts f_only + " already exists"
|
||||
else
|
||||
cp(f, f_only)
|
||||
puts f_only + " created"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -340,6 +340,11 @@ a.footer_link:hover {color: #fff; background-color: #cc3334 !important;}
|
|||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
background: #ffC;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
/* Backgrounds marking out 'staleness' of a task based on age of creation date
|
||||
The colour of the background gets progressively yellower with age */
|
||||
|
|
@ -439,6 +444,10 @@ div#list-projects, div#list-contexts {
|
|||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.container form {
|
||||
border: none;
|
||||
}
|
||||
|
||||
div.project_description {
|
||||
background: #eee;
|
||||
padding: 5px;
|
||||
|
|
@ -556,4 +565,5 @@ div.message {
|
|||
list-style: disc;
|
||||
}
|
||||
|
||||
ul.warning { list-style-type: circle; font-size: 1em; }
|
||||
ul.warning { list-style-type: circle; font-size: 1em; }
|
||||
ul#prefs {list-style-type: disc; margin-left: 5px;}
|
||||
Loading…
Add table
Add a link
Reference in a new issue