mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 20:08:51 +01:00
tidy up the templates and the js in them
This commit is contained in:
parent
90dc9a63aa
commit
8612c1a677
9 changed files with 281 additions and 301 deletions
|
|
@ -1,47 +1,47 @@
|
|||
<% @not_done = @not_done_todos.select {|t| t.context_id == context.id } %>
|
||||
<div id="c<%= context.id %>" class="container context" <%= "style=\"display:none\"" if collapsible && @not_done.empty? %>>
|
||||
<h2>
|
||||
<% if collapsible -%>
|
||||
<a href="#" class="container_toggle" id="toggle_c<%= context.id %>"><%= image_tag("collapse.png") %></a>
|
||||
<% apply_behavior '.container_toggle:click', :prevent_default => true do |page|
|
||||
page << " /* only handle the click if a previous click had finished its animation */
|
||||
if (todoItems.lastEffect == null || todoItems.lastEffect.state=='finished') {
|
||||
containerElem = this.up('.container')
|
||||
toggleTarget = containerElem.down('.toggle_target')
|
||||
if (Element.visible(toggleTarget))
|
||||
{
|
||||
todoItems.collapseNextActionListing(this, toggleTarget);
|
||||
todoItems.contextCollapseCookieManager.setCookie(todoItems.buildCookieName(containerElem), true)
|
||||
}
|
||||
else
|
||||
{
|
||||
todoItems.expandNextActionListing(this, toggleTarget);
|
||||
todoItems.contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem))
|
||||
}
|
||||
}
|
||||
<% if collapsible -%>
|
||||
<a href="#" class="container_toggle" id="toggle_c<%= context.id %>"><%= image_tag("collapse.png") %></a>
|
||||
<% apply_behavior '.container_toggle:click', :prevent_default => true do |page|
|
||||
page << " /* only handle the click if a previous click had finished its animation */
|
||||
if (todoItems.lastEffect == null || todoItems.lastEffect.state=='finished') {
|
||||
containerElem = this.up('.container')
|
||||
toggleTarget = containerElem.down('.toggle_target')
|
||||
if (Element.visible(toggleTarget))
|
||||
{
|
||||
todoItems.collapseNextActionListing(this, toggleTarget);
|
||||
todoItems.contextCollapseCookieManager.setCookie(todoItems.buildCookieName(containerElem), true)
|
||||
}
|
||||
else
|
||||
{
|
||||
todoItems.expandNextActionListing(this, toggleTarget);
|
||||
todoItems.contextCollapseCookieManager.clearCookie(todoItems.buildCookieName(containerElem))
|
||||
}
|
||||
}
|
||||
"
|
||||
end
|
||||
%>
|
||||
<% end -%>
|
||||
<% if source_view_is :context %>
|
||||
<span class="in_place_editor_field" id="context_name_in_place_editor"><%= context.name %></span>
|
||||
<%= in_place_editor 'context_name_in_place_editor', {
|
||||
:url => { :controller => 'contexts', :action => 'update', :id => context.id, :field => 'name', :update_context_name => true, :escape => false},
|
||||
:options=>"{method:'put'}", :script => true } %>
|
||||
<% else %>
|
||||
<%= link_to_context( context ) %>
|
||||
<% end %>
|
||||
end
|
||||
-%>
|
||||
<% end -%>
|
||||
<% if source_view_is :context %>
|
||||
<span class="in_place_editor_field" id="context_name_in_place_editor"><%= context.name %></span>
|
||||
<%= in_place_editor 'context_name_in_place_editor', {
|
||||
:url => { :controller => 'contexts', :action => 'update', :id => context.id, :field => 'name', :update_context_name => true, :escape => false},
|
||||
:options=>"{method:'put'}", :script => true } %>
|
||||
<% else %>
|
||||
<%= link_to_context( context ) %>
|
||||
<% end %>
|
||||
</h2>
|
||||
<div id="c<%= context.id %>items" class="items toggle_target">
|
||||
<div id="c<%= context.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
|
||||
<div class="message"><p>Currently there are no incomplete actions in this context</p></div>
|
||||
</div>
|
||||
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "context" } %>
|
||||
<% if @not_done.empty?
|
||||
<% if @not_done.empty?
|
||||
# fix (hack) for #713
|
||||
set_behavior_for_star_icon
|
||||
set_behavior_for_toggle_checkbox
|
||||
end
|
||||
-%>
|
||||
</div><!-- [end:items] -->
|
||||
</div><!-- [end:c<%= context.id %>] -->
|
||||
</div><!-- [end:c<%= context.id %>] -->
|
||||
|
|
@ -1,129 +1,122 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<% if @prefs.refresh != 0 -%>
|
||||
<meta http-equiv="Refresh" content="<%= @prefs["refresh"].to_i*60 %>;url=<%= request.request_uri %>">
|
||||
<% end -%>
|
||||
<%= javascript_include_tag "jquery-1.2.6.min" %>
|
||||
<% bundle do %>
|
||||
<%= javascript_include_tag *%w[
|
||||
hoverIntent superfish prototype
|
||||
effects dragdrop controls application
|
||||
calendar calendar-en calendar-setup
|
||||
accesskey-hints todo-items niftycube
|
||||
protoload flashobject lowpro
|
||||
] %>
|
||||
<%= stylesheet_link_tag *%w[ standard superfish calendar-system niftyCorners] %>
|
||||
<% end %>
|
||||
<%= javascript_include_tag :unobtrusive %>
|
||||
<%= stylesheet_link_tag "print", :media => "print" %>
|
||||
|
||||
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
|
||||
<%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => "RSS feed of next actions"}) %>
|
||||
<link rel="search" type="application/opensearchdescription+xml"
|
||||
title="Tracks"
|
||||
href="<%= search_plugin_path %>" />
|
||||
<% bundle do %>
|
||||
<%= javascript_include_tag *%w[
|
||||
hoverIntent superfish prototype
|
||||
effects dragdrop controls application
|
||||
calendar calendar-en calendar-setup
|
||||
accesskey-hints todo-items niftycube
|
||||
protoload flashobject lowpro
|
||||
] %>
|
||||
<%= stylesheet_link_tag *%w[ standard superfish calendar-system niftyCorners] %>
|
||||
<% end %>
|
||||
<%= javascript_include_tag :unobtrusive %>
|
||||
<%= stylesheet_link_tag "print", :media => "print" %>
|
||||
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
|
||||
<%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => "RSS feed of next actions"}) %>
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="Tracks" href="<%= search_plugin_path %>" />
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('ul.sf-menu').superfish({
|
||||
delay: 250,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast'
|
||||
});
|
||||
jQuery('ul.sf-item-menu').superfish({
|
||||
delay: 100,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast',
|
||||
onBeforeShow: function() {
|
||||
$(this.parent().parent().parent()).addClass("sf-item-selected");
|
||||
},
|
||||
onHide: function() {
|
||||
$(this.parent().parent().parent()).removeClass("sf-item-selected");
|
||||
}
|
||||
});
|
||||
Nifty("div#todo_new_action_container","normal");
|
||||
if ($('flash').visible()) { new Effect.Fade("flash",{duration:5.0}); }
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() { /* main menu */
|
||||
jQuery('ul.sf-menu').superfish({
|
||||
delay: 250,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast'
|
||||
});
|
||||
jQuery('ul.sf-item-menu').superfish({ /* context menu */
|
||||
delay: 100,
|
||||
animation: {opacity:'show',height:'show'},
|
||||
autoArrows: false,
|
||||
dropShadows: false,
|
||||
speed: 'fast',
|
||||
onBeforeShow: function() { /* highlight todo */
|
||||
$(this.parent().parent().parent()).addClass("sf-item-selected");
|
||||
},
|
||||
onHide: function() { /* remove hightlight from todo */
|
||||
$(this.parent().parent().parent()).removeClass("sf-item-selected");
|
||||
}
|
||||
});
|
||||
Nifty("div#todo_new_action_container","normal");
|
||||
if ($('flash').visible()) { new Effect.Fade("flash",{duration:5.0}); }
|
||||
});
|
||||
</script>
|
||||
<title><%= @page_title %></title>
|
||||
</head>
|
||||
|
||||
<title><%= @page_title %></title>
|
||||
<body class="<%= @controller.controller_name %>">
|
||||
<div id="topbar">
|
||||
<div id="date">
|
||||
<h1>
|
||||
<% if @count -%>
|
||||
<span id="badge_count" class="badge"><%= @count %></span>
|
||||
<% end -%>
|
||||
<%= user_time.strftime(@prefs.title_date_format) %>
|
||||
</h1>
|
||||
</div>
|
||||
<div id="minilinks">
|
||||
<%= link_to_function("Toggle notes", nil, {:accesskey => "S", :title => "Toggle all notes", :id => "toggle-notes-nav"}) do |page|
|
||||
page.select('body .todo_notes').each { |e| e.toggle }
|
||||
end
|
||||
-%> |
|
||||
<%= link_to "Logout (#{current_user.display_name}) »", logout_path %>
|
||||
</div>
|
||||
<div id="navcontainer">
|
||||
<ul class="sf-menu">
|
||||
<li><%= navigation_link("Home", home_path, {:accesskey => "t", :title => "Home"} ) %></li>
|
||||
<li><%= navigation_link("Starred", tag_path("starred"), :title => "See your starred actions" ) %></li>
|
||||
<li><%= navigation_link("Projects", projects_path, {:accesskey=>"p", :title=>"Projects"} ) %></li>
|
||||
<li><%= navigation_link("Tickler", tickler_path, {:accesskey =>"k", :title => "Tickler"} ) %></li>
|
||||
<li><a href="#">Organize</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Contexts", contexts_path, {:accesskey=>"c", :title=>"Contexts"} ) %></li>
|
||||
<li><%= navigation_link( "Notes", notes_path, {:accesskey => "o", :title => "Show all notes"} ) %></li>
|
||||
<li><%= navigation_link( "Repeating todos", {:controller => "recurring_todos", :action => "index"}, :title => "Manage recurring actions" ) %></li>
|
||||
</ul></li>
|
||||
<li><a href="#">View</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Calendar", calendar_path, :title => "Calendar of due actions" ) %></li>
|
||||
<li><%= navigation_link( "Done", done_path, {:accesskey=>"d", :title=>"Completed"} ) %></li>
|
||||
<li><%= navigation_link( "Feeds", {:controller => "feedlist", :action => "index"}, :title => "See a list of available feeds" ) %></li>
|
||||
<li><%= navigation_link( "Statistics", {:controller => "stats", :action => "index"}, :title => "See your statistics" ) %></li>
|
||||
</ul>
|
||||
<li><a href="#">Admin</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Preferences", preferences_path, {:accesskey => "u", :title => "Show my preferences"} ) %></li>
|
||||
<li><%= navigation_link( "Export", {:controller => "data", :action => "index"}, {:accesskey => "i", :title => "Import and export data"} ) %></li>
|
||||
<% if current_user.is_admin? -%>
|
||||
<li><%= navigation_link("Manage users", users_path, {:accesskey => "a", :title => "Add or delete users"} ) %></li>
|
||||
<% end -%>
|
||||
</ul></li>
|
||||
<li><a href="#">?</a>
|
||||
<ul>
|
||||
<li><%= link_to 'Integrate Tracks', integrations_path %></li>
|
||||
<li><%= link_to 'REST API Docs', url_for(:controller => 'integrations', :action => 'rest_api') %></li>
|
||||
</ul></li>
|
||||
<li><%= navigation_link(image_tag("system-search.png", :size => "16X16", :border => 0), {:controller => "search", :action => "index"}, :title => "Search All Items" ) %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render_flash %>
|
||||
</div>
|
||||
|
||||
</head>
|
||||
<body class="<%= @controller.controller_name %>">
|
||||
<div id="topbar">
|
||||
<div id="date">
|
||||
<h1>
|
||||
<% if @count %>
|
||||
<span id="badge_count" class="badge"><%= @count %></span>
|
||||
<% end %>
|
||||
<%= user_time.strftime(@prefs.title_date_format) %>
|
||||
</h1>
|
||||
</div>
|
||||
<div id="minilinks">
|
||||
<%= link_to_function("Toggle notes", nil, {:accesskey => "S", :title => "Toggle all notes", :id => "toggle-notes-nav"}) do |page|
|
||||
page.select('body .todo_notes').each { |e| e.toggle }
|
||||
end
|
||||
-%> |
|
||||
<%= link_to "Logout (#{current_user.display_name}) »", logout_path %>
|
||||
</div>
|
||||
|
||||
<div id="navcontainer">
|
||||
<ul class="sf-menu">
|
||||
<li><%= navigation_link("Home", home_path, {:accesskey => "t", :title => "Home"} ) %></li>
|
||||
<li><%= navigation_link("Starred", tag_path("starred"), :title => "See your starred actions" ) %></li>
|
||||
<li><%= navigation_link("Projects", projects_path, {:accesskey=>"p", :title=>"Projects"} ) %></li>
|
||||
<li><%= navigation_link("Tickler", tickler_path, {:accesskey =>"k", :title => "Tickler"} ) %></li>
|
||||
<li><a href="#">Organize</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Contexts", contexts_path, {:accesskey=>"c", :title=>"Contexts"} ) %></li>
|
||||
<li><%= navigation_link( "Notes", notes_path, {:accesskey => "o", :title => "Show all notes"} ) %></li>
|
||||
<li><%= navigation_link( "Repeating todos", {:controller => "recurring_todos", :action => "index"}, :title => "Manage recurring actions" ) %></li>
|
||||
</ul></li>
|
||||
<li><a href="#">View</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Calendar", calendar_path, :title => "Calendar of due actions" ) %></li>
|
||||
<li><%= navigation_link( "Done", done_path, {:accesskey=>"d", :title=>"Completed"} ) %></li>
|
||||
<li><%= navigation_link( "Feeds", {:controller => "feedlist", :action => "index"}, :title => "See a list of available feeds" ) %></li>
|
||||
<li><%= navigation_link( "Statistics", {:controller => "stats", :action => "index"}, :title => "See your statistics" ) %></li>
|
||||
</ul>
|
||||
<li><a href="#">Admin</a>
|
||||
<ul>
|
||||
<li><%= navigation_link( "Preferences", preferences_path, {:accesskey => "u", :title => "Show my preferences"} ) %></li>
|
||||
<li><%= navigation_link( "Export", {:controller => "data", :action => "index"}, {:accesskey => "i", :title => "Import and export data"} ) %></li>
|
||||
<% if current_user.is_admin? -%>
|
||||
<li><%= navigation_link("Manage users", users_path, {:accesskey => "a", :title => "Add or delete users"} ) %></li>
|
||||
<div id="content">
|
||||
<% unless @controller_name == 'feed' or session['noexpiry'] == "on" -%>
|
||||
<%= periodically_call_remote( :url => {:controller => "login", :action => "check_expiry"},
|
||||
:frequency => (5*60)) %>
|
||||
<% end -%>
|
||||
</ul></li>
|
||||
<li><a href="#">?</a>
|
||||
<ul>
|
||||
<li><%= link_to 'Integrate Tracks', integrations_path %></li>
|
||||
<li><%= link_to 'REST API Docs', url_for(:controller => 'integrations', :action => 'rest_api') %></li>
|
||||
</ul></li>
|
||||
<li><%= navigation_link(image_tag("system-search.png", :size => "16X16", :border => 0), {:controller => "search", :action => "index"}, :title => "Search All Items" ) %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= periodically_call_remote( :url => formatted_check_deferred_todos_path(:js),
|
||||
:method => :post,
|
||||
:frequency => (10*60)) %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<%= render_flash %>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<% unless @controller_name == 'feed' or session['noexpiry'] == "on" -%>
|
||||
<%= periodically_call_remote( :url => {:controller => "login", :action => "check_expiry"},
|
||||
:frequency => (5*60)) %>
|
||||
<% end -%>
|
||||
<%= periodically_call_remote( :url => formatted_check_deferred_todos_path(:js),
|
||||
:method => :post,
|
||||
:frequency => (10*60)) %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "shared/footer" %>
|
||||
</body>
|
||||
<%= render :partial => "shared/footer" %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,129 +1,121 @@
|
|||
<%
|
||||
@todo = nil
|
||||
@initial_context_name = @context.name unless @context.nil?
|
||||
@initial_context_name ||= @project.default_context.name unless @project.nil? || @project.default_context.nil?
|
||||
@initial_context_name ||= current_user.contexts.first.name unless current_user.contexts.first.nil?
|
||||
@initial_project_name = @project.name unless @project.nil?
|
||||
%>
|
||||
@todo = nil
|
||||
@initial_context_name = @context.name unless @context.nil?
|
||||
@initial_context_name ||= @project.default_context.name unless @project.nil? || @project.default_context.nil?
|
||||
@initial_context_name ||= current_user.contexts.first.name unless current_user.contexts.first.nil?
|
||||
@initial_project_name = @project.name unless @project.nil?
|
||||
-%>
|
||||
<div id="todo_new_action_container">
|
||||
|
||||
<div id="toggle_action_new" class="hide_form">
|
||||
<a title="Hide new action form" accesskey="n" href="#">« Hide form</a>
|
||||
<% apply_behavior '#toggle_action_new a:click', :prevent_default => true do |page|
|
||||
page << "TracksForm.toggle('toggle_action_new', 'todo_new_action', 'todo-form-new-action',
|
||||
'« Hide form', 'Hide next action form',
|
||||
'Add a next action »', 'Add a next action');"
|
||||
end
|
||||
%>
|
||||
page << "TracksForm.toggle('toggle_action_new', 'todo_new_action', 'todo-form-new-action',
|
||||
'« Hide form', 'Hide next action form',
|
||||
'Add a next action »', 'Add a next action');"
|
||||
end
|
||||
-%>
|
||||
</div>
|
||||
|
||||
<div id="todo_new_action" style="display:block">
|
||||
<div id="todo_new_action" style="display:block">
|
||||
<% form_remote_tag(
|
||||
:url => todos_path, :method => :post,
|
||||
:html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' },
|
||||
:before => "$('todo_new_action_submit').startWaiting()",
|
||||
:complete => "$('todo_new_action_submit').stopWaiting()",
|
||||
:condition => "!$('todo_new_action_submit').isWaiting() && askIfNewContextProvided()") do -%>
|
||||
|
||||
<% form_remote_tag(
|
||||
:url => todos_path, :method => :post,
|
||||
:html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' },
|
||||
:before => "$('todo_new_action_submit').startWaiting()",
|
||||
:complete => "$('todo_new_action_submit').stopWaiting()",
|
||||
:condition => "!$('todo_new_action_submit').isWaiting() && askIfNewContextProvided()") do -%>
|
||||
<div id="status"><%= error_messages_for("item", :object_name => 'action') %></div>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
function askIfNewContextProvided() {
|
||||
var contexts = new Array(<%= @contexts.map{|c| '\'' + c.name + '\''}.join(", ") %>);
|
||||
var givenContextName = $('todo_context_name').value;
|
||||
if (givenContextName.length == 0) return true; // show rails validation error
|
||||
for (var i = 0; i < contexts.length; ++i) {
|
||||
if (contexts[i] == givenContextName) {
|
||||
return true;
|
||||
<label for="todo_description">Description</label>
|
||||
<%= text_field( "todo", "description", "size" => 30, "tabindex" => 1, "maxlength" => 100, "autocomplete" => "off") %>
|
||||
|
||||
<label for="todo_notes">Notes</label>
|
||||
<%= text_area( "todo", "notes", "cols" => 29, "rows" => 6, "tabindex" => 2) %>
|
||||
|
||||
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=@initial_project_name-%>" />
|
||||
<label for="todo_project_name">Project</label>
|
||||
<input id="todo_project_name" name="project_name" autocomplete="off" tabindex="3" size="30" type="text" value="<%= @initial_project_name %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
|
||||
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=@initial_context_name-%>" />
|
||||
<label for="todo_context_name">Context</label>
|
||||
<input id="todo_context_name" name="context_name" autocomplete="off" tabindex="4" size="30" type="text" value="<%= @initial_context_name %>" />
|
||||
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
|
||||
|
||||
<label for="tag_list">Tags (separate with commas)</label>
|
||||
<%= text_field_tag "tag_list", nil, :size => 30, :tabindex => 5 %>
|
||||
|
||||
<div class="due_input">
|
||||
<label for="todo_due">Due</label>
|
||||
<%= text_field("todo", "due", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 6, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<div class="show_from_input">
|
||||
<label for="todo_show_from">Show from</label>
|
||||
<%= text_field("todo", "show_from", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 7, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<%= source_view_tag( @source_view ) %>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_new_action_submit" tabindex="8">
|
||||
<%= image_tag("accept.png", :alt => "") %>Add action
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
var contextNames = <%= context_names_for_autocomplete %>;
|
||||
|
||||
function askIfNewContextProvided() {
|
||||
var givenContextName = $('todo_context_name').value;
|
||||
if (givenContextName.length == 0) return true; // do nothing and depend on rails validation error
|
||||
for (var i = 0; i < contextNames.length; ++i) {
|
||||
if (contextNames[i] == givenContextName) return true;
|
||||
}
|
||||
return confirm('New context "' + givenContextName + '" will be also created. Are you sure?');
|
||||
}
|
||||
}
|
||||
return confirm('New context "' + givenContextName + '" will be also created. Are you sure?');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="status"><%= error_messages_for("item", :object_name => 'action') %></div>
|
||||
var projectAutoCompleter = new Autocompleter.Local('todo_project_name', 'project_list', <%= project_names_for_autocomplete %>, {choices:100,autoSelect:false});
|
||||
|
||||
<label for="todo_description">Description</label>
|
||||
<%= text_field( "todo", "description", "size" => 30, "tabindex" => 1, "maxlength" => 100, "autocomplete" => "off") %>
|
||||
function selectDefaultContext() {
|
||||
todoContextNameElement = $('todo_context_name');
|
||||
defaultContextName = todoContextNameElement.projectDefaultContextsMap[this.value];
|
||||
if (defaultContextName && !todoContextNameElement.editedByTracksUser) {
|
||||
todoContextNameElement.value = defaultContextName;
|
||||
}
|
||||
}
|
||||
Event.observe($('todo_project_name'), "focus", projectAutoCompleter.activate.bind(projectAutoCompleter));
|
||||
Event.observe($('todo_project_name'), "click", projectAutoCompleter.activate.bind(projectAutoCompleter));
|
||||
Event.observe($('todo_project_name'), "blur", selectDefaultContext.bind($('todo_project_name')));
|
||||
|
||||
<label for="todo_notes">Notes</label>
|
||||
<%= text_area( "todo", "notes", "cols" => 29, "rows" => 6, "tabindex" => 2) %>
|
||||
var contextAutoCompleter;
|
||||
function initializeNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
if (contextNamesForAutoComplete.length == 0 || contextNamesForAutoComplete[0].length == 0) {
|
||||
return;
|
||||
}
|
||||
contextAutoCompleter = new Autocompleter.Local('todo_context_name', 'context_list', contextNamesForAutoComplete, {choices:100,autoSelect:false});
|
||||
Event.observe($('todo_context_name'), "focus", function(){ $('todo_context_name').editedByTracksUser = true; });
|
||||
Event.observe($('todo_context_name'), "focus", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
Event.observe($('todo_context_name'), "click", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
}
|
||||
|
||||
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=@initial_project_name-%>" />
|
||||
<label for="todo_project_name">Project</label>
|
||||
<input id="todo_project_name" name="project_name" autocomplete="off" tabindex="3" size="30" type="text" value="<%= @initial_project_name %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
function updateContextNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
if (contextAutoCompleter) { // i.e. if we're already initialized
|
||||
contextAutoCompleter.options.array = contextNamesForAutoComplete
|
||||
} else {
|
||||
initializeNamesForAutoComplete(contextNamesForAutoComplete)
|
||||
}
|
||||
}
|
||||
initializeNamesForAutoComplete(contextNames);
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
projectAutoCompleter = new Autocompleter.Local('todo_project_name', 'project_list', <%= project_names_for_autocomplete %>, {choices:100,autoSelect:false});
|
||||
function selectDefaultContext() {
|
||||
todoContextNameElement = $('todo_context_name');
|
||||
defaultContextName = todoContextNameElement.projectDefaultContextsMap[this.value];
|
||||
if (defaultContextName && !todoContextNameElement.editedByTracksUser) {
|
||||
todoContextNameElement.value = defaultContextName;
|
||||
}
|
||||
}
|
||||
Event.observe($('todo_project_name'), "focus", projectAutoCompleter.activate.bind(projectAutoCompleter));
|
||||
Event.observe($('todo_project_name'), "click", projectAutoCompleter.activate.bind(projectAutoCompleter));
|
||||
Event.observe($('todo_project_name'), "blur", selectDefaultContext.bind($('todo_project_name')));
|
||||
</script>
|
||||
|
||||
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=@initial_context_name-%>" />
|
||||
<label for="todo_context_name">Context</label>
|
||||
<input id="todo_context_name" name="context_name" autocomplete="off" tabindex="4" size="30" type="text" value="<%= @initial_context_name %>" />
|
||||
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var contextAutoCompleter;
|
||||
function initializeNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
if (contextNamesForAutoComplete.length == 0 || contextNamesForAutoComplete[0].length == 0) {
|
||||
return;
|
||||
}
|
||||
contextAutoCompleter = new Autocompleter.Local('todo_context_name', 'context_list', contextNamesForAutoComplete, {choices:100,autoSelect:false});
|
||||
Event.observe($('todo_context_name'), "focus", function(){ $('todo_context_name').editedByTracksUser = true; });
|
||||
Event.observe($('todo_context_name'), "focus", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
Event.observe($('todo_context_name'), "click", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
}
|
||||
function updateContextNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
if (contextAutoCompleter) // i.e. if we're already initialized
|
||||
{
|
||||
contextAutoCompleter.options.array = contextNamesForAutoComplete
|
||||
}
|
||||
else
|
||||
{
|
||||
initializeNamesForAutoComplete(contextNamesForAutoComplete)
|
||||
}
|
||||
}
|
||||
initializeNamesForAutoComplete(<%= context_names_for_autocomplete %>);
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
</script>
|
||||
|
||||
<label for="tag_list">Tags (separate with commas)</label>
|
||||
<%= text_field_tag "tag_list", nil, :size => 30, :tabindex => 5 %>
|
||||
|
||||
<div class="due_input">
|
||||
<label for="todo_due">Due</label>
|
||||
<%= text_field("todo", "due", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 6, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<div class="show_from_input">
|
||||
<label for="todo_show_from">Show from</label>
|
||||
<%= text_field("todo", "show_from", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 7, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<%= source_view_tag( @source_view ) %>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_new_action_submit" tabindex="8">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
Add action
|
||||
</button>
|
||||
<%= calendar_setup( "todo_due" ) %>
|
||||
<%= calendar_setup( "todo_show_from" ) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
|
||||
<%= calendar_setup( "todo_due" ) %>
|
||||
<%= calendar_setup( "todo_show_from" ) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<div id="footer">
|
||||
<p>Send feedback on <%= TRACKS_VERSION %>: <a href="http://www.assembla.com/spaces/tracks-tickets/tickets">Bugs</a> | <a href="http://www.getontracks.org/forums/">Forum</a> | <a href="http://www.getontracks.org/wiki/">Wiki</a> | <a href="mailto:butshesagirl@rousette.org.uk?subject=Tracks feedback">Email</a> | <a href="http://www.getontracks.org/">Website</a> | <a href="http://www.getontracks.org/development/">Contribute</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1 +1 @@
|
|||
<li><%= link_to_context( context ) + " (" + count_undone_todos_phrase(context,"actions") + ")"%></li>
|
||||
<li><%= link_to_context( context ) + " (" + count_undone_todos_phrase(context,"actions") + ")"%></li>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<h3><%= list_name %> (<%= contexts.length %>)</h3>
|
||||
<ul>
|
||||
<% if contexts.empty? -%>
|
||||
<li>None</li>
|
||||
<% else -%>
|
||||
<%= render :partial => "sidebar/context", :collection => contexts -%>
|
||||
<% end -%>
|
||||
<% if contexts.empty? -%>
|
||||
<li>None</li>
|
||||
<% else -%>
|
||||
<%= render :partial => "sidebar/context", :collection => contexts -%>
|
||||
<% end -%>
|
||||
</ul>
|
||||
|
|
@ -1 +1 @@
|
|||
<li><%= link_to_project( project ) + " (" + count_undone_todos_phrase(project,"actions") + ")" %></li>
|
||||
<li><%= link_to_project( project ) + " (" + count_undone_todos_phrase(project,"actions") + ")" %></li>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<h3><%= list_name %> (<%= projects.length %>)</h3>
|
||||
<ul>
|
||||
<% if projects.empty? %>
|
||||
<li>None</li>
|
||||
<% else %>
|
||||
<%= render :partial => "sidebar/project", :collection => projects %>
|
||||
<% end %>
|
||||
<% if projects.empty? %>
|
||||
<li>None</li>
|
||||
<% else %>
|
||||
<%= render :partial => "sidebar/project", :collection => projects %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
@ -1,35 +1,30 @@
|
|||
<div id="sidebar">
|
||||
<% # show active items before hidden / completed items -%>
|
||||
<% # show active items before hidden / completed items -%>
|
||||
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Active Projects',
|
||||
:projects => @active_projects } -%>
|
||||
|
||||
<%= render :partial => "sidebar/context_list",
|
||||
:locals => { :list_name => 'Active Contexts',
|
||||
:contexts => @active_contexts } -%>
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Active Projects',
|
||||
:projects => @active_projects } -%>
|
||||
|
||||
<% if prefs.show_hidden_projects_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Hidden Projects',
|
||||
:projects => @hidden_projects } -%>
|
||||
<% end -%>
|
||||
<%= render :partial => "sidebar/context_list",
|
||||
:locals => { :list_name => 'Active Contexts',
|
||||
:contexts => @active_contexts } -%>
|
||||
|
||||
<% if prefs.show_completed_projects_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Completed Projects',
|
||||
:projects => @completed_projects } -%>
|
||||
<% end -%>
|
||||
<% if prefs.show_hidden_projects_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Hidden Projects',
|
||||
:projects => @hidden_projects } -%>
|
||||
<% end -%>
|
||||
|
||||
<% if prefs.show_hidden_contexts_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/context_list",
|
||||
:locals => { :list_name => 'Hidden Contexts',
|
||||
:contexts => @hidden_contexts } -%>
|
||||
<% end -%>
|
||||
|
||||
<div class="integrations-link"><ul>
|
||||
<li><%= link_to 'Integrate Tracks', integrations_path %></li>
|
||||
<li><%= link_to 'REST API Docs', url_for(:controller => 'integrations', :action => 'rest_api') %></li>
|
||||
</ul></div>
|
||||
<% if prefs.show_completed_projects_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/project_list",
|
||||
:locals => { :list_name => 'Completed Projects',
|
||||
:projects => @completed_projects } -%>
|
||||
<% end -%>
|
||||
|
||||
<% if prefs.show_hidden_contexts_in_sidebar -%>
|
||||
<%= render :partial => "sidebar/context_list",
|
||||
:locals => { :list_name => 'Hidden Contexts',
|
||||
:contexts => @hidden_contexts } -%>
|
||||
<% end -%>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue