fix #1181. The project listing now had the small drag handle and all the controls to the left.

This commit is contained in:
Reinier Balt 2012-01-27 10:55:39 +01:00
parent 8b13ee88ab
commit e935066c18
6 changed files with 18 additions and 28 deletions

View file

@ -455,7 +455,7 @@ class StatsController < ApplicationController
@completed_actions = current_user.todos.completed.find(:all, { :select => "completed_at, created_at" }) @completed_actions = current_user.todos.completed.find(:all, { :select => "completed_at, created_at" })
actions_sum, actions_max = 0,0 actions_sum, actions_max = 0,0
actions_min = @completed_actions.first.completed_at - @completed_actions.first.created_at actions_min = @completed_actions.first ? @completed_actions.first.completed_at - @completed_actions.first.created_at : 0
@completed_actions.each do |r| @completed_actions.each do |r|
actions_sum += (r.completed_at - r.created_at) actions_sum += (r.completed_at - r.created_at)

View file

@ -13,7 +13,7 @@ module ApplicationHelper
else else
tag_options = nil tag_options = nil
end end
url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference) url = options.is_a?(String) ? options : self.url_for(options, *parameters_for_method_reference)
id_tag = (request.request_uri == url) ? " id=\"current\"" : "" id_tag = (request.request_uri == url) ? " id=\"current\"" : ""
"<a href=\"#{url}\"#{tag_options}#{id_tag}>#{name || url}</a>" "<a href=\"#{url}\"#{tag_options}#{id_tag}>#{name || url}</a>"
@ -53,7 +53,7 @@ module ApplicationHelper
else else
# overdue or due very soon! sound the alarm! # overdue or due very soon! sound the alarm!
if days == -1 if days == -1
t('todos.next_actions_due_date.overdue_by', :days => days * -1) t('todos.next_actions_due_date.overdue_by', :days => days * -1)
elsif days < -1 elsif days < -1
t('todos.next_actions_due_date.overdue_by_plural', :days => days * -1) t('todos.next_actions_due_date.overdue_by_plural', :days => days * -1)
else else
@ -123,7 +123,7 @@ module ApplicationHelper
def link_to_edit_project (project, descriptor = sanitize(project.name)) def link_to_edit_project (project, descriptor = sanitize(project.name))
link_to(descriptor, link_to(descriptor,
url_for({:controller => 'projects', :action => 'edit', :id => project.id}), url_for({:controller => 'projects', :action => 'edit', :id => project.id}),
{:id => "link_edit_#{dom_id(project)}", :class => "project_edit_settings"}) {:id => "link_edit_#{dom_id(project)}", :class => "project_edit_settings icon"})
end end
def link_to_edit_context (context, descriptor = sanitize(context.name)) def link_to_edit_context (context, descriptor = sanitize(context.name))
@ -155,7 +155,7 @@ module ApplicationHelper
end end
def render_flash def render_flash
render :partial => 'shared/flash', :object => flash render :partial => 'shared/flash', :object => flash
end end
def recurrence_time_span(rt) def recurrence_time_span(rt)
@ -287,7 +287,7 @@ module ApplicationHelper
done_tag_path(@tag_name) done_tag_path(@tag_name)
else else
done_todos_path done_todos_path
end end
else else
done_todos_path done_todos_path
end end

View file

@ -51,7 +51,7 @@ module ProjectsHelper
project_path(project, :format => 'js'), project_path(project, :format => 'js'),
{ {
:id => "delete_project_#{project.id}", :id => "delete_project_#{project.id}",
:class => "delete_project_button", :class => "delete_project_button icon",
:x_confirm_message => t('projects.delete_project_confirmation', :name => project.name), :x_confirm_message => t('projects.delete_project_confirmation', :name => project.name),
:title => t('projects.delete_project_title') :title => t('projects.delete_project_title')
} }

View file

@ -6,27 +6,17 @@ suppress_delete_button ||= false
-%> -%>
<div id="<%= dom_id(project, "container") %>" class="list"> <div id="<%= dom_id(project, "container") %>" class="list">
<div id="<%= dom_id(project) %>" class="project sortable_row" style="display:block"> <div id="<%= dom_id(project) %>" class="project sortable_row" style="display:block">
<%= suppress_delete_button ? "" : link_to_delete_project(project, image_tag( "blank.png", :title => t('projects.delete_project_title'), :class=>"delete_item")) %>
<% unless suppress_drag_handle -%> <%= suppress_edit_button ? "" : link_to_edit_project(project, image_tag( "blank.png", :title => t('projects.edit_project_title'), :class=>"edit_item")) %>
<div class="position"> <%= image_tag('grip.png',
<span class="handle"><%= t('common.drag_handle') %></span> :width => '7', :height => '16', :border => '0',
</div> :title => t('common.drag_handle'), :class => 'grip') unless suppress_drag_handle -%>
<% end -%> <div class="project_description">
<div class="data">
<span class="<%= needsreview_class( project ) %>"> <span class="<%= needsreview_class( project ) %>">
<%= link_to_project( project ) %> <%= link_to_project( project ) %>
<%= " (" + count_undone_todos_and_notes_phrase(project,"actions") + ")" %> <%= " (" + count_undone_todos_and_notes_phrase(project,"actions") + ")" %>
</span> </span>
</div> </div>
<div class="buttons">
<span class="grey"><%= project.aasm_current_state.to_s.upcase %></span>
<%= suppress_delete_button ? "" : link_to_delete_project(project, image_tag( "blank.png", :title => t('projects.delete_project_title'), :class=>"delete_item")) %>
<%= suppress_edit_button ? "" : link_to_edit_project(project, image_tag( "blank.png", :title => t('projects.edit_project_title'), :class=>"edit_item")) %>
</div>
</div> </div>
<div id="<%= dom_id(project, 'edit') %>" class="edit-form" style="display:none;"></div> <div id="<%= dom_id(project, 'edit') %>" class="edit-form" style="display:none;"></div>
</div> </div>

View file

@ -806,7 +806,7 @@ var ProjectListPage = {
/* make the three lists of project sortable */ /* make the three lists of project sortable */
$(['active', 'hidden', 'completed']).each(function() { $(['active', 'hidden', 'completed']).each(function() {
$("#list-"+this+"-projects").sortable({ $("#list-"+this+"-projects").sortable({
handle: '.handle', handle: '.grip',
update: update_order update: update_order
}); });
}); });

View file

@ -426,13 +426,13 @@ input.item-checkbox {
vertical-align: middle; vertical-align: middle;
} }
.rec_description, .description { .rec_description, .description, .project_description {
margin-left: 80px; margin-left: 80px;
position:relative; position:relative;
} }
.rec_description { .project_description {
margin-left: 80px; margin-left: 50px;
} }
.stale_l1 { .stale_l1 {