mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-06 01:08:50 +01:00
initial port of context-show view
This commit is contained in:
parent
7da6c6cad4
commit
ab0006dc34
8 changed files with 136 additions and 92 deletions
4
Gemfile
4
Gemfile
|
|
@ -17,7 +17,9 @@ gem 'jquery-rails'
|
|||
# Twitter Bootstrap
|
||||
gem 'therubyracer'
|
||||
gem 'less-rails'
|
||||
gem 'twitter-bootstrap-rails'
|
||||
# use dev version to get fontawsome 3.2.1
|
||||
#gem 'twitter-bootstrap-rails'
|
||||
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
|
||||
|
||||
# you may comment out the database driver you will not be using.
|
||||
# This will prevent a native build of the driver. Building native drivers is not
|
||||
|
|
|
|||
19
Gemfile.lock
19
Gemfile.lock
|
|
@ -5,6 +5,16 @@ GIT
|
|||
actionpack-xml_parser (1.0.0)
|
||||
actionpack (>= 4.0.0.rc1, < 4.1)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/seyhunak/twitter-bootstrap-rails.git
|
||||
revision: 61c14a7a853abefcaa9e6878ade5a48a6856fb55
|
||||
specs:
|
||||
twitter-bootstrap-rails (2.2.7)
|
||||
actionpack (>= 3.1)
|
||||
execjs
|
||||
rails (>= 3.1)
|
||||
railties (>= 3.1)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
|
|
@ -105,7 +115,7 @@ GEM
|
|||
metaclass (0.0.1)
|
||||
mime-types (1.23)
|
||||
mini_portile (0.5.0)
|
||||
minitest (4.7.4)
|
||||
minitest (4.7.5)
|
||||
mocha (0.14.0)
|
||||
metaclass (~> 0.0.1)
|
||||
mousetrap-rails (0.0.10)
|
||||
|
|
@ -183,11 +193,6 @@ GEM
|
|||
treetop (1.4.14)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
twitter-bootstrap-rails (2.2.7)
|
||||
actionpack (>= 3.1)
|
||||
execjs
|
||||
rails (>= 3.1)
|
||||
railties (>= 3.1)
|
||||
tzinfo (0.3.37)
|
||||
uglifier (2.1.1)
|
||||
execjs (>= 0.3.0)
|
||||
|
|
@ -235,7 +240,7 @@ DEPENDENCIES
|
|||
therubyracer
|
||||
timecop
|
||||
tolk
|
||||
twitter-bootstrap-rails
|
||||
twitter-bootstrap-rails!
|
||||
uglifier (>= 1.3.0)
|
||||
will_paginate
|
||||
yard
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@
|
|||
* Tracks CSS
|
||||
*/
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
background-color: #000;
|
||||
background-image: linear-gradient(to bottom, #FFFFFF, #F2F2F2);
|
||||
}
|
||||
/* Header */
|
||||
|
||||
.navbar-inner {
|
||||
border-radius: none;
|
||||
|
|
@ -29,4 +25,34 @@ span.badge_count {
|
|||
text-shadow: none;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
footer {
|
||||
margin-top: 50px;
|
||||
text-align: center;
|
||||
background-color: #000;
|
||||
background-image: linear-gradient(to bottom, #FFFFFF, #F2F2F2);
|
||||
}
|
||||
|
||||
/* Todo tags */
|
||||
span.tags {
|
||||
.label {
|
||||
a:hover, a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
a {
|
||||
text-shadow: none;
|
||||
color: #FFF;
|
||||
font-weight: normal;
|
||||
}
|
||||
margin-right: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Container */
|
||||
|
||||
h4 a {
|
||||
color: #222;
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ module TodosHelper
|
|||
|
||||
def empty_message_holder(container_name, show, title_param=nil)
|
||||
content_tag(:div, :id => "no_todos_in_view", :class => "container #{container_name}", :style => "display:" + (show ? "block" : "none") ) do
|
||||
content_tag(:h2) { t("todos.no_actions.title", :param=>title_param) } +
|
||||
content_tag(:h4) { t("todos.no_actions.title", :param=>title_param) } +
|
||||
content_tag(:div, :class => "message") do
|
||||
content_tag(:p) { t("todos.no_actions.#{container_name}", :param=>title_param) }
|
||||
end
|
||||
|
|
@ -114,7 +114,7 @@ module TodosHelper
|
|||
:title => t("todos.actions.#{settings[:parent_container_type]}_#{settings[:container_name]}", :param => settings[:title_param])
|
||||
})
|
||||
header = settings[:link_in_header].nil? ? "" : content_tag(:div, :class=>"add_note_link"){settings[:link_in_header]}
|
||||
header += content_tag(:h2) do
|
||||
header += content_tag(:h4) do
|
||||
toggle = settings[:collapsible] ? container_toggle("toggle_#{settings[:id]}") : ""
|
||||
"#{toggle} #{settings[:title]} #{settings[:append_descriptor]}".html_safe
|
||||
end
|
||||
|
|
@ -249,10 +249,10 @@ module TodosHelper
|
|||
|
||||
def date_span(todo=@todo)
|
||||
if todo.completed?
|
||||
content_tag(:span, {:class => :grey}) { format_date( todo.completed_at ) }
|
||||
content_tag(:span, {class: "label"}) { format_date( todo.completed_at ) }
|
||||
elsif todo.pending?
|
||||
title = t('todos.depends_on')+ ": " + todo.uncompleted_predecessors.map(&:description).join(', ')
|
||||
content_tag(:a, {:title => title}) { content_tag(:span, {:class => :orange}) { t('todos.pending') } }
|
||||
content_tag(:a, {:title => title}) { content_tag(:span, {class: "label label-info"}) { t('todos.pending') } }
|
||||
elsif todo.deferred?
|
||||
show_date( todo.show_from )
|
||||
else
|
||||
|
|
@ -281,7 +281,7 @@ module TodosHelper
|
|||
end
|
||||
|
||||
def tag_span (tag, mobile=false)
|
||||
content_tag(:span, :class => "tag #{tag.label}") { link_to(tag.name, tag_path(tag.name, :format => mobile ? :m : nil)) }
|
||||
content_tag(:span, :class => "label label-info #{tag.label}") { link_to(tag.name, tag_path(tag.name, :format => mobile ? :m : nil)) }
|
||||
end
|
||||
|
||||
def tag_list(todo=@todo, mobile=false)
|
||||
|
|
@ -351,7 +351,7 @@ module TodosHelper
|
|||
|
||||
def show_date_tag(date, the_class, text)
|
||||
content_tag(:a, :title => format_date(date)) do
|
||||
content_tag(:span, :class => the_class) { text }
|
||||
content_tag(:span, :class => "label label-#{the_class.to_s}") { text }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -366,21 +366,21 @@ module TodosHelper
|
|||
case days
|
||||
# overdue or due very soon! sound the alarm!
|
||||
when -1000..-1
|
||||
show_date_tag(d, :red, t('todos.scheduled_overdue', :days => (days * -1).to_s))
|
||||
show_date_tag(d, :important, t('todos.scheduled_overdue', :days => (days * -1).to_s))
|
||||
when 0
|
||||
show_date_tag(d, :amber, t('todos.show_today'))
|
||||
show_date_tag(d, :warning, t('todos.show_today'))
|
||||
when 1
|
||||
show_date_tag(d, :amber, t('todos.show_tomorrow'))
|
||||
show_date_tag(d, :warning, t('todos.show_tomorrow'))
|
||||
# due 2-7 days away
|
||||
when 2..7
|
||||
if prefs.due_style == Preference.due_styles[:due_on]
|
||||
show_date_tag(d, :orange, t('todos.show_on_date', :date => d.strftime("%A")) )
|
||||
show_date_tag(d, :important, t('todos.show_on_date', :date => d.strftime("%A")) )
|
||||
else
|
||||
show_date_tag(d, :orange, t('todos.show_in_days', :days => days.to_s) )
|
||||
show_date_tag(d, :important, t('todos.show_in_days', :days => days.to_s) )
|
||||
end
|
||||
# more than a week away - relax
|
||||
else
|
||||
show_date_tag(d, :green, t('todos.show_in_days', :days => days.to_s) )
|
||||
show_date_tag(d, :success, t('todos.show_in_days', :days => days.to_s) )
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,22 +4,15 @@
|
|||
done_todo_options = {:append_descriptor => suffix_completed, :suppress_context => true, :parent_container_type => 'context'}
|
||||
show_empty_containers = (@group_view_by == 'context')
|
||||
-%>
|
||||
<div id="display_box">
|
||||
|
||||
<%= empty_message_holder("not_done_project", @not_done_todos.empty?) %>
|
||||
|
||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'context'}) %>
|
||||
<%= empty_message_holder("not_done_context", @not_done_todos.empty?) %>
|
||||
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project, {:collapsible => false, :parent_container_type => 'context', :title_param => @context.name}) -%>
|
||||
<% end -%>
|
||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'context'}) %>
|
||||
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project, {:collapsible => false, :parent_container_type => 'context', :title_param => @context.name}) -%>
|
||||
<% end -%>
|
||||
|
||||
<%= show_done_todos(@done, done_todo_options) unless @done.nil? %>
|
||||
</div>
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
|
||||
<div id="input_box">
|
||||
<%= render :partial => "shared/add_new_item_form" %>
|
||||
<%= render :file => "sidebar/sidebar" %>
|
||||
</div>
|
||||
<%= show_done_todos(@done, done_todo_options) unless @done.nil? %>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><%= content_for?(:title) ? yield(:title) : "Tracksapp" %></title>
|
||||
<title><%= content_for?(:title) ? yield(:title) : @page_title %></title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||
|
|
@ -34,13 +34,13 @@
|
|||
<!-- Size should be 32 x 32 pixels -->
|
||||
<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
|
||||
</head>
|
||||
<body>
|
||||
<body class="<%= controller.controller_name %>">
|
||||
|
||||
<%= render partial: "shared/navbar" %>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span6 offset 3">
|
||||
<div class="span6 offset3">
|
||||
<%= bootstrap_flash %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,51 +1,18 @@
|
|||
<%
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
suppress_edit_button ||= todo.completed?
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
@z_index_counter = @z_index_counter - 1 # for IE z-index bug
|
||||
@rec_depth=0 # to prevent stack overflow on large dependency trees, see _successor.html.erb
|
||||
|
||||
# invalidate the cache every day because of staleness or
|
||||
# rendering of "due in x days" that change without touching updated at of the todo
|
||||
# also make different caches per source_view to handle difference in showing [C] and [P]
|
||||
cache [todo, current_user.date.strftime("%Y%m%d"), @source_view, current_user.prefs.verbose_action_descriptors] do
|
||||
%>
|
||||
<div id="<%= dom_id(todo) %>" class="item-container">
|
||||
<div id="<%= dom_id(todo, 'line') %>" class="item-show">
|
||||
<%= remote_star_icon(todo) %>
|
||||
<%= remote_toggle_checkbox(todo) %>
|
||||
<%= remote_edit_button(todo) unless suppress_edit_button %>
|
||||
<ul class="sf-menu sf-item-menu">
|
||||
<li style="z-index:<%=@z_index_counter%>"><a href="#" class="item-downarrow"><%= image_tag "downarrow.png", :class => "todo-submenu", :alt=> "" %></a>
|
||||
<ul id="ul<%= dom_id(todo) %>" class="todo-submenu">
|
||||
<li><%= remote_delete_menu_item(todo) %></li>
|
||||
<% unless todo.completed? || todo.deferred? -%>
|
||||
<li><%= remote_defer_menu_item(1, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(2, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(3, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(7, todo) %></li>
|
||||
<li><%= remote_promote_to_project_menu_item(todo) %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<%= grip_span(todo) %>
|
||||
<div class="description<%= staleness_class( todo ) %>">
|
||||
<%= date_span(todo) -%>
|
||||
<span class="todo.descr"><%= h todo.description %></span>
|
||||
<%= image_tag_for_recurring_todo(todo) if todo.from_recurring_todo? %>
|
||||
<%= tag_list(todo) %>
|
||||
<%= deferred_due_date(todo) %>
|
||||
<%= project_and_context_links( todo, parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
|
||||
<%= collapsed_notes_image(todo) unless todo.notes.blank? %>
|
||||
<%= collapsed_successors_image(todo) if todo.has_pending_successors %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
|
||||
<% #note: edit form will load here remotely -%>
|
||||
<div class="placeholder"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
-%>
|
||||
<div>
|
||||
<i class="<%= todo.starred? ? "icon-star" : "icon-star-empty"%>"></i>
|
||||
<i class="<%= todo.completed? ? "icon-check-sign" : "icon-check-empty"%>"></i>
|
||||
<i class="icon-edit"></i>
|
||||
<i class="icon-ellipsis-vertical"></i>
|
||||
<%= date_span(todo) -%>
|
||||
<%= todo.description %>
|
||||
<%= content_tag(:i, {class: "icon-refresh"}){} if todo.from_recurring_todo? %>
|
||||
<%= tag_list(todo) %>
|
||||
<%= deferred_due_date(todo) %>
|
||||
<%= project_and_context_links( todo, parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
|
||||
<i class="icon-file-text-alt"></i>
|
||||
<%= content_tag(:i, {class: "icon-play-sign"}){} if todo.has_pending_successors %>
|
||||
</div>
|
||||
51
app/views/todos/_todo.old.html.erb
Normal file
51
app/views/todos/_todo.old.html.erb
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<%
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
suppress_edit_button ||= todo.completed?
|
||||
parameters = "_source_view=#{@source_view}"
|
||||
parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
|
||||
@z_index_counter = @z_index_counter - 1 # for IE z-index bug
|
||||
@rec_depth=0 # to prevent stack overflow on large dependency trees, see _successor.html.erb
|
||||
|
||||
# invalidate the cache every day because of staleness or
|
||||
# rendering of "due in x days" that change without touching updated at of the todo
|
||||
# also make different caches per source_view to handle difference in showing [C] and [P]
|
||||
cache [todo, current_user.date.strftime("%Y%m%d"), @source_view, current_user.prefs.verbose_action_descriptors] do
|
||||
%>
|
||||
<div id="<%= dom_id(todo) %>" class="item-container">
|
||||
<div id="<%= dom_id(todo, 'line') %>" class="item-show">
|
||||
<%= remote_star_icon(todo) %>
|
||||
<%= remote_toggle_checkbox(todo) %>
|
||||
<%= remote_edit_button(todo) unless suppress_edit_button %>
|
||||
<ul class="sf-menu sf-item-menu">
|
||||
<li style="z-index:<%=@z_index_counter%>"><a href="#" class="item-downarrow"><%= image_tag "downarrow.png", :class => "todo-submenu", :alt=> "" %></a>
|
||||
<ul id="ul<%= dom_id(todo) %>" class="todo-submenu">
|
||||
<li><%= remote_delete_menu_item(todo) %></li>
|
||||
<% unless todo.completed? || todo.deferred? -%>
|
||||
<li><%= remote_defer_menu_item(1, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(2, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(3, todo) %></li>
|
||||
<li><%= remote_defer_menu_item(7, todo) %></li>
|
||||
<li><%= remote_promote_to_project_menu_item(todo) %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<%= grip_span(todo) %>
|
||||
<div class="description<%= staleness_class( todo ) %>">
|
||||
<%= date_span(todo) -%>
|
||||
<span class="todo.descr"><%= h todo.description %></span>
|
||||
<%= image_tag_for_recurring_todo(todo) if todo.from_recurring_todo? %>
|
||||
<%= tag_list(todo) %>
|
||||
<%= deferred_due_date(todo) %>
|
||||
<%= project_and_context_links( todo, parent_container_type, :suppress_context => suppress_context, :suppress_project => suppress_project ) %>
|
||||
<%= collapsed_notes_image(todo) unless todo.notes.blank? %>
|
||||
<%= collapsed_successors_image(todo) if todo.has_pending_successors %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="<%= dom_id(todo, 'edit') %>" class="edit-form" style="display:none">
|
||||
<% #note: edit form will load here remotely -%>
|
||||
<div class="placeholder"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue