diff --git a/.gitignore b/.gitignore index bd1d8742..433e85a0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ nbproject vendor/plugins/query_trace/ db/schema.rb .dotest +public/javascripts/cache +public/stylesheets/cache \ No newline at end of file diff --git a/app/controllers/application.rb b/app/controllers/application.rb index b24dfd54..16cb0518 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -32,13 +32,13 @@ class ApplicationController < ActionController::Base before_filter :set_time_zone prepend_before_filter :login_required prepend_before_filter :enable_mobile_content_negotiation - after_filter :restore_content_type_for_mobile after_filter :set_charset include ActionView::Helpers::TextHelper include ActionView::Helpers::SanitizeHelper + extend ActionView::Helpers::SanitizeHelper::ClassMethods helper_method :format_date, :markdown # By default, sets the charset to UTF-8 if it isn't already set @@ -148,21 +148,15 @@ class ApplicationController < ActionController::Base # during the processing and then setting it to 'text/html' in an # 'after_filter' -LKM 2007-04-01 def mobile? - return params[:format] == 'm' || response.content_type == MOBILE_CONTENT_TYPE + return params[:format] == 'm' end def enable_mobile_content_negotiation if mobile? - request.accepts.unshift(Mime::Type::lookup(MOBILE_CONTENT_TYPE)) + request.format = :m end end - def restore_content_type_for_mobile - if mobile? - response.content_type = 'text/html' - end - end - def create_todo_from_recurring_todo(rt, date=nil) # create todo and initialize with data from recurring_todo rt todo = current_user.todos.build( { :description => rt.description, :notes => rt.notes, :project_id => rt.project_id, :context_id => rt.context_id}) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 6038f3f3..99824886 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -76,7 +76,7 @@ class TodosController < ApplicationController format.m do @return_path=cookies[:mobile_url] # todo: use function for this fixed path - @return_path='/mobile' if @return_path.nil? + @return_path='/m' if @return_path.nil? if @saved redirect_to @return_path else diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 42ebe65e..170c6aca 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -1,5 +1,5 @@ module NotesHelper def truncated_note(note, characters = 50) - sanitize(textilize_without_paragraph(truncate(note.body, characters, "..."))) + sanitize(textilize_without_paragraph(truncate(note.body, :length => characters, :omission => "..."))) end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ce2c0364..c0a6640d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -20,12 +20,12 @@ module ProjectsHelper def project_next_prev html = '' unless @previous_project.nil? - project_name = truncate(@previous_project.name, 40, "...") + project_name = truncate(@previous_project.name, :length => 40, :omission => "...") html << link_to_project(@previous_project, "« #{project_name}") end html << ' | ' if @previous_project && @next_project unless @next_project.nil? - project_name = truncate(@next_project.name, 40, "...") + project_name = truncate(@next_project.name, :length => 40, :omission => "...") html << link_to_project(@next_project, "#{project_name} »") end html @@ -34,12 +34,12 @@ module ProjectsHelper def project_next_prev_mobile html = '' unless @previous_project.nil? - project_name = truncate(@previous_project.name, 40, "...") + project_name = truncate(@previous_project.name, :length => 40, :omission => "...") html << link_to_project_mobile(@previous_project, "5", "« 5-#{project_name}") end html << ' | ' if @previous_project && @next_project unless @next_project.nil? - project_name = truncate(@next_project.name, 40, "...") + project_name = truncate(@next_project.name, :length => 40, :omission => "...") html << link_to_project_mobile(@next_project, "6", "6-#{project_name} »") end html diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 79e058e9..f260b7e6 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -117,7 +117,11 @@ module TodosHelper "" + link_to(t.name, {:action => "tag", :controller => "todos", :id => t.name+".m"}) + ""}.join('') +<<<<<<< HEAD/app/helpers/todos_helper.rb if tag_list.empty? then "" else "#{tag_list}" end +======= + if not tag_list.empty? then "#{tag_list}" end +>>>>>>> f3d7fac2a4e602c21c754770903217c0a5035629/app/helpers/todos_helper.rb end def deferred_due_date diff --git a/app/models/message_gateway.rb b/app/models/message_gateway.rb index 8fcb78d3..501650e0 100644 --- a/app/models/message_gateway.rb +++ b/app/models/message_gateway.rb @@ -1,5 +1,7 @@ class MessageGateway < ActionMailer::Base include ActionView::Helpers::SanitizeHelper + extend ActionView::Helpers::SanitizeHelper::ClassMethods + def receive(email) user = User.find(:first, :include => [:preference], :conditions => ["preferences.sms_email = ?", email.from[0].strip]) if user.nil? diff --git a/app/models/user.rb b/app/models/user.rb index 8a85b64b..fd649b10 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -188,7 +188,7 @@ class User < ActiveRecord::Base end def at_midnight(date) - return TimeZone[prefs.time_zone].local(date.year, date.month, date.day, 0, 0, 0) + return ActiveSupport::TimeZone[prefs.time_zone].local(date.year, date.month, date.day, 0, 0, 0) end def generate_token diff --git a/app/views/contexts/_mobile_context.rhtml b/app/views/contexts/_mobile_context.rhtml index 3122bc32..a9f829ae 100644 --- a/app/views/contexts/_mobile_context.rhtml +++ b/app/views/contexts/_mobile_context.rhtml @@ -6,9 +6,17 @@ if not @not_done.empty? # only show a context when there are actions in it -%>

<%=mobile_context.name%>

+<<<<<<< HEAD/app/views/contexts/_mobile_context.rhtml