Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
class MobileController < ApplicationController
|
|
|
|
|
|
|
|
|
|
model :user
|
|
|
|
|
model :project
|
|
|
|
|
model :context
|
|
|
|
|
model :todo
|
|
|
|
|
|
|
|
|
|
layout 'mobile'
|
|
|
|
|
|
|
|
|
|
prepend_before_filter :login_required
|
2006-11-17 12:44:27 +00:00
|
|
|
before_filter :init, :except => :update
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
|
|
|
|
|
# Plain list of all next actions, paginated 6 per page
|
|
|
|
|
# Sorted by due date, then creation date
|
|
|
|
|
#
|
2006-11-17 12:44:27 +00:00
|
|
|
def index
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
@page_title = @desc = "All actions"
|
|
|
|
|
@todos_pages, @todos = paginate( :todos, :order => 'due IS NULL, due ASC, created_at ASC',
|
2006-11-15 09:05:07 +00:00
|
|
|
:conditions => ['user_id = ? and state = ?', @user.id, "active"],
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
:per_page => 6 )
|
2006-11-15 09:05:07 +00:00
|
|
|
@count = @all_todos.reject { |x| !x.active? || x.context.hide? }.size
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def detail
|
|
|
|
|
@item = check_user_return_item
|
|
|
|
|
@place = @item.context.id
|
|
|
|
|
end
|
|
|
|
|
|
2006-11-17 12:44:27 +00:00
|
|
|
def update
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
if params[:id]
|
2006-11-17 12:44:27 +00:00
|
|
|
@item = check_user_return_item
|
|
|
|
|
@item.update_attributes params[:item]
|
|
|
|
|
if params[:item][:state] == "1"
|
|
|
|
|
@item.state = "completed"
|
|
|
|
|
else
|
|
|
|
|
@item.state = "active"
|
|
|
|
|
end
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
else
|
2006-06-25 17:29:22 +00:00
|
|
|
if params[:item][:"show_from(1i)"] == ""
|
2006-11-15 09:05:07 +00:00
|
|
|
@item = Todo.create(params[:item]) if params[:item]
|
2006-06-25 17:29:22 +00:00
|
|
|
else
|
2006-11-15 09:05:07 +00:00
|
|
|
@item = Todo.create(params[:item]) if params[:item]
|
|
|
|
|
@item.defer!
|
|
|
|
|
end
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
2006-06-25 17:29:22 +00:00
|
|
|
@item.user_id = @user.id
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
|
|
|
|
|
if @item.save
|
2006-11-17 12:44:27 +00:00
|
|
|
redirect_to :action => 'index'
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
else
|
2006-06-25 17:29:22 +00:00
|
|
|
self.init
|
|
|
|
|
if params[:id]
|
|
|
|
|
render :partial => 'mobile_edit'
|
|
|
|
|
else
|
|
|
|
|
render :action => 'show_add_form'
|
|
|
|
|
end
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show_add_form
|
2006-11-17 12:44:27 +00:00
|
|
|
# Just render the view
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def filter
|
2006-06-25 17:29:22 +00:00
|
|
|
@type = params[:type]
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
case params[:type]
|
|
|
|
|
when 'context'
|
|
|
|
|
@context = Context.find( params[:context][:id] )
|
|
|
|
|
@page_title = @desc = "#{@context.name}"
|
2006-11-17 12:44:27 +00:00
|
|
|
@todos = Todo.find( :all, :order => 'due IS NULL, due ASC, created_at ASC',
|
|
|
|
|
:conditions => ['user_id = ? and state = ? and context_id = ?', @user.id, "active", @context.id] )
|
2006-11-15 09:05:07 +00:00
|
|
|
@count = @all_todos.reject { |x| x.completed? || x.context_id != @context.id }.size
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
when 'project'
|
|
|
|
|
@project = Project.find( params[:project][:id] )
|
|
|
|
|
@page_title = @desc = "#{@project.name}"
|
2006-11-17 12:44:27 +00:00
|
|
|
@todos = Todo.find( :all, :order => 'due IS NULL, due ASC, created_at ASC',
|
|
|
|
|
:conditions => ['user_id = ? and state = ? and project_id = ?', @user.id, "active", @project.id] )
|
2006-11-15 09:05:07 +00:00
|
|
|
@count = @all_todos.reject { |x| x.completed? || x.project_id != @project.id }.size
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
|
|
def check_user_return_item
|
|
|
|
|
item = Todo.find( params['id'] )
|
|
|
|
|
if @user == item.user
|
|
|
|
|
return item
|
|
|
|
|
else
|
2006-11-19 16:52:58 +00:00
|
|
|
notify :warning, "Item and session user mis-match: #{item.user.name} and #{@user.name}!"
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
render_text ""
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def init
|
2006-11-15 09:05:07 +00:00
|
|
|
@contexts = @user.contexts.find(:all, :order => 'position ASC')
|
|
|
|
|
@projects = @user.projects.find_in_state(:all, :active, :order => 'position ASC')
|
2006-11-17 12:44:27 +00:00
|
|
|
@all_todos = @user.todos.find(:all, :conditions => ['state = ? or state = ?', "active", "completed"])
|
Implemented a proper mobile view, designed for viewing on a mobile phone browser (so far only tested on 'small screen' view of Opera, which mimics Opera mini). To get the mobile view, enter the URL http://yoururl.com/mobile/
That will take you to the login page, and then to the mobile view. I've tried to make the interface as functional as possible, while still fitting neatly on a small screen, being very lightweight in terms of page size (those data plans are expensive!), and not requiring too much messing about with a phone keyboard.
The main screen lists all uncompleted next actions, 6 per page. If you select the double right arrow link, you'll be taken to a detail view which doubles as a place to view all the details, or an editing page (hit the back button to get back if you're just viewing, update to commit your edits).
At the bottom of each page there are two select boxes which allow you to filter the view to a particular context or project.
It needs a little more work, but it's quite functional right now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@263 a4c988fc-2ded-0310-b66e-134b36920a42
2006-06-18 17:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|