mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-09 17:14:20 +01:00
Updated to svn tags/tracks-1.6
This commit is contained in:
parent
103fcb8049
commit
02496f2d44
2274 changed files with 0 additions and 0 deletions
44
app/views/contexts/_context.rhtml
Normal file
44
app/views/contexts/_context.rhtml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<% @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 << "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', :wants_render => false, :escape => false} , :options=>"{method:'put'}" } %>
|
||||
<% 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?
|
||||
# fix (hack) for #713
|
||||
set_behavior_for_delete_icon
|
||||
set_behavior_for_star_icon
|
||||
set_behavior_for_edit_icon
|
||||
set_behavior_for_toggle_checkbox
|
||||
end
|
||||
-%>
|
||||
</div><!-- [end:items] -->
|
||||
</div><!-- [end:c<%= context.id %>] -->
|
||||
35
app/views/contexts/_context_form.rhtml
Normal file
35
app/views/contexts/_context_form.rhtml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<% context = context_form
|
||||
@context = context-%>
|
||||
<div id="<%= dom_id(context, 'edit') %>" class="edit-form" style="display:none;">
|
||||
<% form_tag(context_path(context), {:id => dom_id(context, 'edit_form'), :class => "inline-form "+dom_id(context, 'edit_form')+"-edit-context-form edit-context-form", :method => :put}) do -%>
|
||||
<%= error_messages_for 'context' %>
|
||||
|
||||
<label for="context_name">Context name</label><br/>
|
||||
<%= text_field('context', 'name', :class => 'context-name') %><br/>
|
||||
|
||||
<label for="context_hide">Hide from front page?</label>
|
||||
<%= check_box('context', 'hide', :class => 'context-hide') %>
|
||||
<input type="hidden" name="wants_render" value="true" />
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="<%= dom_id(context, 'submit') %>" tabindex="15">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
Update
|
||||
</button>
|
||||
<a href="javascript:void(0);" onclick="Element.toggle('<%= dom_id(context) %>');Element.toggle('<%= dom_id(context, 'edit') %>');" class="negative">
|
||||
<%=image_tag("cancel.png", :alt => "") %>
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
|
||||
<% end %>
|
||||
<%= apply_behavior ".edit-context-form", make_remote_form(
|
||||
:before => "this.up('div.edit-form').down('button.positive').startWaiting()",
|
||||
:condition => "!(this.up('div.edit-form').down('button.positive')).isWaiting()"),
|
||||
:external => true
|
||||
@context = nil %>
|
||||
</div>
|
||||
|
||||
36
app/views/contexts/_context_listing.rhtml
Normal file
36
app/views/contexts/_context_listing.rhtml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<% context = context_listing %>
|
||||
<div id="<%= dom_id(context, "container") %>" class="list">
|
||||
<div id="<%= dom_id(context) %>" class="context sortable_row" style="display:'';">
|
||||
<div class="position">
|
||||
<span class="handle">DRAG</span>
|
||||
</div>
|
||||
<div class="data">
|
||||
<%= link_to_context( context ) %> <%= " (" + count_undone_todos_phrase(context,"actions") + ")" %>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<% if context.hide? %>
|
||||
<span class="grey">HIDDEN</span>
|
||||
<% else %>
|
||||
<span class="grey">VISIBLE</span>
|
||||
<% end %>
|
||||
<a class="delete_context_button" href="<%= formatted_context_path(context, :js) %>" title="delete the context '<%= context.name %>'"><%= image_tag( "blank.png", :title => "Delete context", :class=>"delete_item") %></a>
|
||||
<%= apply_behavior "a.delete_context_button:click", { :prevent_default => true, :external => true} do |page, element|
|
||||
page.confirming "'Are you sure that you want to ' + this.title + '?'" do
|
||||
element.up('.context').start_waiting
|
||||
page << remote_to_href(:method => 'delete')
|
||||
end
|
||||
end -%>
|
||||
<a class="edit_context_button" href="#"><%= image_tag( "blank.png", :title => "Edit context", :class=>"edit_item") %></a>
|
||||
<%= apply_behavior 'a.edit_context_button:click', :prevent_default => true do |page, element|
|
||||
element.up('.context').toggle
|
||||
editform = element.up('.list').down('.edit-form')
|
||||
editform.toggle
|
||||
editform.visual_effect(:appear)
|
||||
editform.down('input').focus
|
||||
end
|
||||
-%>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'context_form', :object => context %>
|
||||
</div>
|
||||
14
app/views/contexts/_mobile_context.rhtml
Normal file
14
app/views/contexts/_mobile_context.rhtml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<%
|
||||
# select actions from this context
|
||||
@not_done = @not_done_todos.select {|t| t.context_id == mobile_context.id }
|
||||
|
||||
if not @not_done.empty?
|
||||
# only show a context when there are actions in it
|
||||
-%>
|
||||
<h2><%=mobile_context.name%></h2>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<%= render :partial => "todos/mobile_todo",
|
||||
:collection => @not_done,
|
||||
:locals => { :parent_container_type => "context" }-%>
|
||||
</table>
|
||||
<% end -%>
|
||||
2
app/views/contexts/_mobile_context_listing.rhtml
Normal file
2
app/views/contexts/_mobile_context_listing.rhtml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<% context = mobile_context_listing -%>
|
||||
<div id="ctx"><%= link_to context.name, formatted_context_path(context, :m) %><%= " (" + count_undone_todos_phrase(context,"actions") + ")" %></div>
|
||||
8
app/views/contexts/_text_context.rhtml
Normal file
8
app/views/contexts/_text_context.rhtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<%
|
||||
context = text_context
|
||||
todos_in_context = todos.select { |t| t.context_id == context.id }
|
||||
if todos_in_context.length > 0
|
||||
-%>
|
||||
<%= context.name.upcase %>:
|
||||
<%= render :partial => "todos/text_todo", :collection => todos_in_context -%>
|
||||
<% end -%>
|
||||
12
app/views/contexts/create.js.rjs
Normal file
12
app/views/contexts/create.js.rjs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
if @saved
|
||||
page.hide 'contexts-empty-nd'
|
||||
page.insert_html :bottom, "list-contexts", :partial => 'context_listing', :locals => { :context_listing => @context }
|
||||
page.sortable "list-contexts", get_listing_sortable_options
|
||||
page.hide 'status'
|
||||
page['badge_count'].replace_html @down_count
|
||||
page.call "Form.reset", "context-form"
|
||||
page.call "Form.focusFirstElement", "context-form"
|
||||
else
|
||||
page.show 'status'
|
||||
page.replace_html 'status', "#{error_messages_for('context')}"
|
||||
end
|
||||
6
app/views/contexts/destroy.js.rjs
Normal file
6
app/views/contexts/destroy.js.rjs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
page.visual_effect :fade, dom_id(@context, "container"), :duration => 0.5
|
||||
page.delay(0.5) do
|
||||
page[dom_id(@context, "container")].remove
|
||||
end
|
||||
page['badge_count'].replace_html @down_count
|
||||
page.notify :notice, "Deleted context '#{@context.name}'", 5.0
|
||||
1
app/views/contexts/error.js.rjs
Normal file
1
app/views/contexts/error.js.rjs
Normal file
|
|
@ -0,0 +1 @@
|
|||
page.notify :error, @error_message || "An error occurred on the server.", 8.0
|
||||
54
app/views/contexts/index.html.erb
Normal file
54
app/views/contexts/index.html.erb
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<div id="display_box">
|
||||
<div id="list-contexts">
|
||||
<div id="contexts-empty-nd" style="<%= @no_contexts ? 'display:block' : 'display:none'%>">
|
||||
<div class="message"><p>Currently there are no contexts</p></div>
|
||||
</div>
|
||||
<%= render :partial => 'context_listing', :collection => @contexts %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="input_box">
|
||||
<div id="context_new_container">
|
||||
|
||||
<div id="toggle_context_new" class="hide_form">
|
||||
<a title="Hide new context form" accesskey="n">« Hide form</a>
|
||||
<% apply_behavior '#toggle_context_new a:click', :prevent_default => true do |page|
|
||||
page << "TracksForm.toggle('toggle_context_new', 'context_new', 'context-form',
|
||||
'« Hide form', 'Hide new context form',
|
||||
'Create a new context »', 'Add a context');"
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
|
||||
<div id="context_new" class="context_new" style="display:block">
|
||||
<% form_remote_tag(
|
||||
:url => contexts_path,
|
||||
:method => :post,
|
||||
:html=> { :id => 'context-form', :name => 'context', :class => 'inline-form'},
|
||||
:before => "$('context_new_submit').startWaiting()",
|
||||
:complete => "$('context_new_submit').stopWaiting()",
|
||||
:condition => "!$('context_new_submit').isWaiting()") do -%>
|
||||
|
||||
<div id="status"><%= error_messages_for('context') %></div>
|
||||
|
||||
<label for="context_name">Context name</label><br />
|
||||
<%= text_field( "context", "name" ) %><br />
|
||||
|
||||
<label for="context_hide">Hide from front page?</label>
|
||||
<%= check_box( "context", "hide" ) %><br />
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="context_new_submit">
|
||||
<%= image_tag("accept.png", :alt => "") + 'Add Context' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<% end -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
sortable_element 'list-contexts', get_listing_sortable_options
|
||||
-%>
|
||||
5
app/views/contexts/index.text.erb
Normal file
5
app/views/contexts/index.text.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<% @contexts.each do |c| -%>
|
||||
|
||||
<%= c.name.upcase %>
|
||||
<%= count_undone_todos_phrase_text(c)%>. Context is <%= c.hidden? ? "Hidden" : "Active" %>.
|
||||
<% end -%>
|
||||
2
app/views/contexts/index_mobile.rhtml
Normal file
2
app/views/contexts/index_mobile.rhtml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h2>Visible Contexts</h2><%= render :partial => 'mobile_context_listing', :collection => @active_contexts %>
|
||||
<h2>Hidden Contexts</h2><%= render :partial => 'mobile_context_listing', :collection => @hidden_contexts %>
|
||||
14
app/views/contexts/mobile_show_context.rhtml
Normal file
14
app/views/contexts/mobile_show_context.rhtml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<%
|
||||
# select actions from this context
|
||||
@not_done = @not_done_todos.select {|t| t.context_id == @context.id }
|
||||
|
||||
if not @not_done.empty?
|
||||
# only show a context when there are actions in it
|
||||
%>
|
||||
<h2><%=@context.name%></h2>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<%= render :partial => "todos/mobile_todo",
|
||||
:collection => @not_done,
|
||||
:locals => { :parent_container_type => "context" }%>
|
||||
</table>
|
||||
<% end -%>
|
||||
12
app/views/contexts/show.html.erb
Normal file
12
app/views/contexts/show.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div id="display_box">
|
||||
<%= render :partial => "contexts/context", :locals => { :context => @context, :collapsible => false } %>
|
||||
<% unless @max_completed==0 -%>
|
||||
<%= render :partial => "todos/completed", :locals => { :done => @done, :suppress_context => true, :collapsible => false, :append_descriptor => "in this context (last #{prefs.show_number_completed})" } %>
|
||||
<% end -%>
|
||||
|
||||
</div><!-- [end:display_box] -->
|
||||
|
||||
<div id="input_box">
|
||||
<%= render :partial => "shared/add_new_item_form" %>
|
||||
<%= render "sidebar/sidebar" %>
|
||||
</div><!-- End of input box -->
|
||||
6
app/views/contexts/update.js.rjs
Normal file
6
app/views/contexts/update.js.rjs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
status_message = 'Context saved'
|
||||
page.notify :notice, status_message, 5.0
|
||||
page.replace_html dom_id(@context, 'container'), :partial => 'context_listing', :object => @context
|
||||
page.sortable "list-contexts", get_listing_sortable_options
|
||||
|
||||
page.hide "busy"
|
||||
Loading…
Add table
Add a link
Reference in a new issue