--- /dev/null
+class DiaryEntryController < ApplicationController
+end
layout 'site'
before_filter :authorize, :only => [:preferences, :api_details, :api_gpx_files]
- before_filter :authorize_web, :only => [:edit, :account, :go_public]
+ before_filter :authorize_web, :only => [:edit, :account, :go_public, :view]
before_filter :require_user, :only => [:edit, :account, :go_public]
def save
--- /dev/null
+module DiaryEntryHelper
+end
--- /dev/null
+class DiaryEntry < ActiveRecord::Base
+end
<span id="greeting">
<% if @user %>
- Welcome, <%= @user.display_name %> |
- <%= link_to 'account', {:controller => 'user', :action => 'account'}, {:id => 'loginanchor'}%> |
+ Welcome, <%= link_to @user.display_name, {:controller => 'user', :action => 'view', :display_name => @user.display_name}, {:id => 'loginanchor'}%> |
<%= link_to 'logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%>
<% else %>
<%= link_to 'log in', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> |
<tr><td>email</td><td><%= @user.email %></td></tr>
<tr><td>display name</td><td><%= @user.display_name %> (<%= link_to 'change...', :controller => 'user', :action => 'edit' %>)</td></tr>
<tr><td>account created</td><td><%= @user.creation_time %> (<%= time_ago_in_words(@user.creation_time) %> ago)</td></tr>
- <tr><td>description</td><td><%= @user.description %> (<%= link_to 'change...', :controller => 'user', :action => 'edit' %>)</td></tr>
+ <tr><td valign="top">description</td><td><%= simple_format(@user.description) %> (<%= link_to 'change...', :controller => 'user', :action => 'edit' %>)</td></tr>
</table>
<h2>Privacy</h2>
-<h2>Display name:</h2>
-
+<h2>Edit details:</h2>
<%= error_messages_for 'user' %>
-<%= start_form_tag :controller => 'user', :action => 'rename' %>
-<%= text_field :user, :display_name, :value => @user.display_name %>
+<%= start_form_tag :controller => 'user', :action => 'edit', :display_name => @user.display_name %>
+<table>
+ <tr><td>display name</td><td><%= text_field :user, :display_name, :value => @user.display_name %></td></tr>
+ <tr><td valign="top">description</td><td><%= text_area :user, :description, :value => @user.description %></td></tr>
+</table>
<%= submit_tag 'Change' %>
<%= end_form_tag %>
map.connect '/search.html', :controller => 'way_tag', :action => 'search'
map.connect '/login.html', :controller => 'user', :action => 'login'
map.connect '/logout.html', :controller => 'user', :action => 'logout'
- map.connect '/account', :controller => 'user', :action => 'account'
map.connect '/create-account.html', :controller => 'user', :action => 'new'
map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
map.connect '/user/:display_name', :controller => 'user', :action => 'view'
map.connect '/user/:display_name/diary', :controller => 'diary', :action => 'view'
+ map.connect '/user/:display_name/edit', :controller => 'user', :action => 'edit'
+ map.connect '/user/:display_name/account', :controller => 'user', :action => 'account'
# test pages
map.connect '/test/populate/:table/:from/:count', :controller => 'test', :action => 'populate'
alter table gpx_files drop column tmpname;
alter table users add column description text not null;
+create table diary_entries(id bigint not null auto_increment, user_id bigint not null, title varchar(255), body text, primary key(id));
--- /dev/null
+class CreateDiaryEntries < ActiveRecord::Migration
+ def self.up
+ create_table :diary_entries do |t|
+ end
+ end
+
+ def self.down
+ drop_table :diary_entries
+ end
+end