Changeset 853

Show
Ignore:
Timestamp:
05/22/08 08:33:15
Author:
lrbalt
Message:

adds search to tracks. you can search now on todos, projects and notes. This patch was contributed by Jeffrey Gipson. Thanks Jeffrey!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tracks/app/controllers/todos_controller.rb

    r837 r853  
    6868      format.html { redirect_to :action => "index" } 
    6969      format.m do 
     70        @return_path=cookies[:mobile_url] 
     71        # todo: use function for this fixed path 
     72        @return_path='/mobile' if @return_path.nil? 
    7073        if @saved 
    7174          redirect_to mobile_abbrev_url 
  • trunk/tracks/app/helpers/todos_helper.rb

    r838 r853  
    121121      str = "(#{str})" unless str.blank? 
    122122    else 
    123       if (['project', 'tag', 'stats'].include?(parent_container_type)) 
     123      if (['project', 'tag', 'stats', 'search'].include?(parent_container_type)) 
    124124        str << item_link_to_context( @todo ) 
    125125      end 
    126       if (['context', 'tickler', 'tag', 'stats'].include?(parent_container_type)) && @todo.project_id 
     126      if (['context', 'tickler', 'tag', 'stats', 'search'].include?(parent_container_type)) && @todo.project_id 
    127127        str << item_link_to_project( @todo ) 
    128128      end 
  • trunk/tracks/app/models/todo.rb

    r760 r853  
    99  acts_as_state_machine :initial => :active, :column => 'state' 
    1010   
    11   # when entering active state, also remove completed_at date.  
    12   # Looks like :exit of state completed is not run, see #679 
     11  # when entering active state, also remove completed_at date. Looks like :exit 
     12  # of state completed is not run, see #679 
    1313  state :active, :enter => Proc.new { |t| t[:show_from], t.completed_at = nil, nil } 
    1414  state :project_hidden 
     
    3939  attr_protected :user 
    4040 
    41   # Description field can't be empty, and must be < 100 bytes 
    42   # Notes must be < 60,000 bytes (65,000 actually, but I'm being cautious) 
     41  # Description field can't be empty, and must be < 100 bytes Notes must be < 
     42  # 60,000 bytes (65,000 actually, but I'm being cautious) 
    4343  validates_presence_of :description 
    4444  validates_length_of :description, :maximum => 100 
     
    9292   
    9393  def run_initial_state_actions 
    94     #only run the initial state actions if the standard initial state hasn't been changed 
     94    # only run the initial state actions if the standard initial state hasn't 
     95    # been changed 
    9596    if self.class.initial_state.to_sym == current_state 
    9697      original_run_initial_state_actions 
  • trunk/tracks/app/views/layouts/standard.html.erb

    r837 r853  
    6060  <li><%= navigation_link(image_tag("menustar.gif", :size => "16X16", :border => 0), tag_path("starred"), :title => "See your starred actions" ) %></li> 
    6161  <li><%= navigation_link(image_tag("stats.gif", :size => "16X16", :border => 0), {:controller => "stats", :action => "index"}, :title => "See your statistics" ) %></li> 
     62  <li><%= navigation_link(image_tag("system-search.png", :size => "16X16", :border => 0), {:controller => "search", :action => "index"}, :title => "Search All Items" ) %></li> 
    6263</ul> 
    6364</div> 
  • trunk/tracks/app/views/notes/_notes.rhtml

    r753 r853  
    3333                    :update => dom_id(note, 'container'), 
    3434                    :complete => visual_effect(:appear, dom_id(note, 'container')) do -%> 
    35          <%= render :partial => "note_edit_form", :object => note %> 
     35         <%= render :partial => "notes/note_edit_form", :object => note %> 
    3636     <% end -%> 
    3737     </div> 
  • trunk/tracks/app/views/projects/_project.rhtml

    r848 r853  
    99    <%= in_place_editor 'project_name_in_place_editor', { :url => { :controller => 'projects', :action => 'update', :id => project.id, :field => 'name', :wants_render => false, :escape => false}  , :options=>"{method:'put'}" } %> 
    1010  </h2> 
    11   <% unless @project.description.blank? -%> 
    12     <div class="project_description"><%= sanitize(@project.description) %></div> 
     11  <% unless project.description.blank? -%> 
     12    <div class="project_description"><%= sanitize(project.description) %></div> 
    1313  <% end -%> 
    1414   
    15   <% if @project.completed? -%> 
     15  <% if project.completed? -%> 
    1616    <p class="project_completed">Project has been marked as completed</p> 
    17   <% elsif @project.completed? -%> 
     17  <% elsif project.completed? -%> 
    1818    <p class="project_completed">Project has been marked as hidden</p> 
    1919  <% end -%> 
  • trunk/tracks/app/views/projects/_project_listing.rhtml

    r668 r853  
    11<%  project = project_listing 
     2    suppress_drag_handle ||= false 
     3    suppress_edit_button ||= false 
    24    @project_listing_zindex = @project_listing_zindex.nil? ? 200 : @project_listing_zindex - 1 
    35-%> 
    46<div id="<%= dom_id(project, "container") %>" class="list" style="z-index:<%= @project_listing_zindex %>"> 
    57  <div id="<%= dom_id(project) %>" class="project sortable_row" style="display:''"> 
    6     <div class="position"> 
     8    <% unless suppress_drag_handle -%> 
     9      <div class="position"> 
    710      <span class="handle">DRAG</span> 
    8     </div>   
     11      </div>  
     12    <% end -%>  
    913    <div class="data"> 
    1014      <%= link_to_project( project ) %><%= " (" + count_undone_todos_and_notes_phrase(project,"actions") + ")" %> 
     
    2327           end 
    2428         end -%> 
     29      <% unless suppress_edit_button -%> 
    2530      <a class="edit_project_button" id="<%= dom_id(project, 'editbutton') %>" href="<%= formatted_edit_project_path(project, :js) %>" title="delete the project '<%= project.name %>'"><%= image_tag( "blank.png", :title => "Edit project", :class=>"edit_item") %></a> 
    2631         <%= apply_behavior 'a.edit_project_button:click', { :prevent_default => true, :external => true } do |page, element| 
     
    2934            end 
    3035         -%> 
     36      <% end -%> 
    3137    </div> 
    3238  </div> 
  • trunk/tracks/app/views/todos/_todo.html.erb

    r837 r853  
    33  suppress_context ||= false 
    44  suppress_project ||= false 
     5  suppress_edit_button ||= false 
    56%> 
    67<div id="<%= dom_id(todo) %>" class="item-container"> 
    78  <div id="<%= dom_id(todo, 'line') %>"> 
    89    <%= remote_delete_icon %> 
    9     <%= remote_edit_icon %> 
     10    <%= remote_edit_icon unless suppress_edit_button %> 
    1011    <%= remote_star_icon %> 
    1112    <%= remote_toggle_checkbox unless source_view_is :deferred %> 
  • trunk/tracks/public/stylesheets/standard.css

    r844 r853  
    610610        margin:20px 0px 8px 13px; 
    611611} 
     612 
     613.search-result-group h2 { 
     614        margin:20px 0px 8px 13px 
     615} 
     616 
    612617div.alpha_sort { 
    613618        margin-top:-20px; 
  • trunk/tracks/test/functional/todos_controller_test.rb

    r837 r853  
    347347                   "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2", 
    348348                   "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"", 
    349                    "project_id"=>"1",  
    350                    "notes"=>"test notes", "state"=>"0"}
     349                   "project_id"=>"1", 
     350                   "notes"=>"test notes", "state"=>"0"}, "tag_list"=>"test, test2"
    351351    assert_template 'todos/new' 
    352352  end