mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-08 16:44:20 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
6
app/views/projects/_default_context_autocomplete.rhtml
Normal file
6
app/views/projects/_default_context_autocomplete.rhtml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<div class="page_name_auto_complete" id="default_context_list" style="display:none;z-index:9999"></div>
|
||||
<script type="text/javascript">
|
||||
defaultContextAutoCompleter = new Autocompleter.Local('project[default_context_name]', 'default_context_list', <%= context_names_for_autocomplete %>, {choices:100,autoSelect:false});
|
||||
Event.observe($('project[default_context_name]'), "focus", defaultContextAutoCompleter.activate.bind(defaultContextAutoCompleter));
|
||||
Event.observe($('project[default_context_name]'), "click", defaultContextAutoCompleter.activate.bind(defaultContextAutoCompleter));
|
||||
</script>
|
||||
5
app/views/projects/_edit_project.rhtml
Normal file
5
app/views/projects/_edit_project.rhtml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%= hidden_field( "project", "id" ) %>
|
||||
<label for="project_name">Project name</label><br />
|
||||
<%= text_field( "project", "name" ) %>
|
||||
<br />
|
||||
<br />
|
||||
2
app/views/projects/_mobile_project_listing.rhtml
Normal file
2
app/views/projects/_mobile_project_listing.rhtml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<% project = mobile_project_listing %>
|
||||
<div id="pjr"><%= link_to project.name, formatted_project_path(project) %><%= " (" + count_undone_todos_and_notes_phrase(project,"actions") + ")" %></div>
|
||||
26
app/views/projects/_project.rhtml
Normal file
26
app/views/projects/_project.rhtml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<% @not_done = project.not_done_todos -%>
|
||||
|
||||
<div id="p<%= project.id %>" class="container project">
|
||||
<h2>
|
||||
<% if collapsible %>
|
||||
<a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("collapse.png") %></a>
|
||||
<% end %>
|
||||
<span class="in_place_editor_field" id="project_name_in_place_editor"><%= project.name %></span>
|
||||
<%= 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'}" } %>
|
||||
</h2>
|
||||
<% unless @project.description.blank? -%>
|
||||
<div class="project_description"><%= sanitize(@project.description) %></div>
|
||||
<% end -%>
|
||||
|
||||
<% if @project.completed? -%>
|
||||
<p class="project_completed">Project has been marked as completed</p>
|
||||
<% elsif @project.completed? -%>
|
||||
<p class="project_completed">Project has been marked as hidden</p>
|
||||
<% end -%>
|
||||
<div id="p<%= project.id %>items" class="items toggle_target">
|
||||
<div id="p<%= project.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
|
||||
<div class="message"><p>Currently there are no incomplete actions in this project</p></div>
|
||||
</div>
|
||||
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
|
||||
</div><!-- [end:items] -->
|
||||
</div><!-- [end:p<%= project.id %>] -->
|
||||
44
app/views/projects/_project_form.rhtml
Normal file
44
app/views/projects/_project_form.rhtml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<%
|
||||
project = project_form
|
||||
%>
|
||||
<% form_tag project_path(project), { :id => dom_id(project, 'edit_form'), :class => "inline-form "+dom_id(project, 'edit_form')+"-edit-project-form", :method => :put } do -%>
|
||||
|
||||
<label for="project_name">Name:</label><br/>
|
||||
<%= text_field :project, 'name', :class => 'project-name' %><br/>
|
||||
|
||||
<label for="project_description">Description (optional):</label><br/>
|
||||
<%= text_area :project, 'description', "cols" => 30, "rows" => 4, :class => 'project-description' %><br/>
|
||||
|
||||
<label for="project_done">Project status:</label><br/>
|
||||
<% ['active', 'hidden', 'completed'].each do | state | %>
|
||||
<%= radio_button(:project, 'state', state) %> <%= state.titlecase %>
|
||||
<% end %><br/>
|
||||
|
||||
<label for="project[default_context_name]">Default Context</label><br/>
|
||||
<%= text_field_tag("project[default_context_name]", project.default_context.name, {:tabindex=>1,:size=> 25}) %>
|
||||
<%= render :partial => 'default_context_autocomplete' %>
|
||||
<br/>
|
||||
|
||||
<input type="hidden" name="wants_render" value="true" />
|
||||
<div class="submit_box">
|
||||
<div class="widgets" id="<%= dom_id(project, 'widgets') %>">
|
||||
<button type="submit" class="positive" id="<%= dom_id(project, 'submit') %>" tabindex="15">
|
||||
<%=image_tag("accept.png", :alt => "") %>
|
||||
Update
|
||||
</button>
|
||||
<a href="javascript:void(0);" id="<%= dom_id(project, 'cancel') %>" onclick="Element.toggle('<%= dom_id(project) %>');Element.toggle('<%= dom_id(project, 'edit') %>');" class="negative">
|
||||
<%=image_tag("cancel.png", :alt => "") %>
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
|
||||
<% end -%>
|
||||
|
||||
|
||||
<%= apply_behavior "."+dom_id(project, 'edit_form')+"-edit-project-form", make_remote_form(
|
||||
:before => "$('"+dom_id(project, 'submit')+"').startWaiting();",
|
||||
:condition => "!$('"+dom_id(project, 'submit')+"').isWaiting()",
|
||||
:external => false) %>
|
||||
|
||||
41
app/views/projects/_project_listing.rhtml
Normal file
41
app/views/projects/_project_listing.rhtml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<% project = project_listing
|
||||
@project_listing_zindex = @project_listing_zindex.nil? ? 200 : @project_listing_zindex - 1
|
||||
-%>
|
||||
<div id="<%= dom_id(project, "container") %>" class="list" style="z-index:<%= @project_listing_zindex %>">
|
||||
<div id="<%= dom_id(project) %>" class="project sortable_row" style="display:''">
|
||||
<div class="position">
|
||||
<span class="handle">DRAG</span>
|
||||
</div>
|
||||
<div class="data">
|
||||
<%= link_to_project( project ) %><%= " (" + count_undone_todos_and_notes_phrase(project,"actions") + ")" %>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<span class="grey"><%= project.current_state.to_s.upcase %></span>
|
||||
<a class="delete_project_button"
|
||||
href="<%= formatted_project_path(project, :js) %>"
|
||||
title="delete the project '<%= project.name %>'"><%= image_tag( "blank.png",
|
||||
:title => "Delete project",
|
||||
:class=>"delete_item") %></a>
|
||||
<%= apply_behavior "a.delete_project_button:click", { :prevent_default => true, :external => true } do |page, element|
|
||||
page.confirming "'Are you sure that you want to ' + this.title + '?'" do
|
||||
element.up('.project').start_waiting
|
||||
page << remote_to_href(:method => 'delete')
|
||||
end
|
||||
end -%>
|
||||
<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>
|
||||
<%= apply_behavior 'a.edit_project_button:click', { :prevent_default => true, :external => true } do |page, element|
|
||||
element.up('div.project').start_waiting
|
||||
page << remote_to_href(:method => 'get')
|
||||
end
|
||||
-%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="<%= dom_id(project, 'edit') %>" class="edit-form" style="display:none;">
|
||||
</div>
|
||||
</div>
|
||||
<% if controller.action_name == 'create' %>
|
||||
<script>
|
||||
new Effect.Appear('<%= dom_id(project) %>');
|
||||
</script>
|
||||
<% end %>
|
||||
19
app/views/projects/_project_state_group.rhtml
Normal file
19
app/views/projects/_project_state_group.rhtml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<div class="project-state-group" id="list-<%= state %>-projects-container" <%= " style=\"display:none\"" if project_state_group.empty? %>>
|
||||
<h2><span id="<%= state %>-projects-count" class="badge"><%= project_state_group.length %></span><%= state.titlecase %> Projects</h2>
|
||||
<div class="alpha_sort">
|
||||
<%= link_to("Sort Alphabetically", alphabetize_projects_path(:state => state),
|
||||
:class => "alphabetize_link", :title => "Sort these projects alphabetically") %>
|
||||
<% apply_behavior '.alphabetize_link:click', :prevent_default => true do |page, element|
|
||||
page.confirming 'Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.' do
|
||||
page << "alphaSort = this.up('.alpha_sort');
|
||||
alphaSort.startWaiting();"
|
||||
page << remote_to_href(:complete => "alphaSort.stopWaiting()")
|
||||
end
|
||||
end
|
||||
%></div>
|
||||
|
||||
<div id="list-<%= state %>-projects" class="project-list">
|
||||
<%= render :partial => 'project_listing', :collection => project_state_group %>
|
||||
</div>
|
||||
<%= sortable_element "list-#{state}-projects", get_listing_sortable_options("list-#{state}-projects") %>
|
||||
</div>
|
||||
6
app/views/projects/alphabetize.js.rjs
Normal file
6
app/views/projects/alphabetize.js.rjs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
list_id = "list-#{@state}-projects"
|
||||
page.replace_html list_id,
|
||||
:partial => 'project_listing',
|
||||
:collection => @projects
|
||||
page.sortable list_id, get_listing_sortable_options(list_id)
|
||||
|
||||
17
app/views/projects/create.js.rjs
Normal file
17
app/views/projects/create.js.rjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
if @saved and @go_to_project
|
||||
page.redirect_to project_path(@project)
|
||||
elsif @saved
|
||||
page.hide 'status'
|
||||
page['badge_count'].replace_html @down_count
|
||||
page.hide 'projects-empty-nd'
|
||||
page.show 'list-active-projects-container'
|
||||
page.replace_html "active-projects-count", @active_projects_count
|
||||
page.insert_html :bottom, "list-active-projects", :partial => 'project_listing', :locals => { :project_listing => @project }
|
||||
page.sortable "list-active-projects", get_listing_sortable_options('list-active-projects')
|
||||
page.call "Form.reset", "project-form"
|
||||
page.call "Form.focusFirstElement", "project-form"
|
||||
else
|
||||
page.show 'status'
|
||||
page.replace_html 'status', "#{error_messages_for('project')}"
|
||||
end
|
||||
page.hide "busy"
|
||||
13
app/views/projects/destroy.js.rjs
Normal file
13
app/views/projects/destroy.js.rjs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
page.visual_effect :fade, dom_id(@project, "container"), :duration => 0.5
|
||||
page.delay(0.5) do
|
||||
page[dom_id(@project, "container")].remove
|
||||
page.replace_html "active-projects-count", @active_projects_count
|
||||
page.replace_html "hidden-projects-count", @hidden_projects_count
|
||||
page.replace_html "completed-projects-count", @completed_projects_count
|
||||
page.set_element_visible("list-hidden-projects-container", @hidden_projects_count > 0)
|
||||
page.set_element_visible("list-active-projects-container", @active_projects_count > 0)
|
||||
page.set_element_visible("list-completed-projects-container", @completed_projects_count > 0)
|
||||
end
|
||||
page.notify :notice, "Deleted project '#{@project.name}'", 5.0
|
||||
page['badge_count'].replace_html @down_count
|
||||
page.hide "busy"
|
||||
5
app/views/projects/edit.js.rjs
Normal file
5
app/views/projects/edit.js.rjs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
page[dom_id(@project, 'edit')].replace_html :partial => 'project_form', :locals => { :project_form => @project }
|
||||
page[@project].hide
|
||||
page[@project].stop_waiting
|
||||
page[dom_id(@project, 'edit')].show
|
||||
page[dom_id(@project, 'edit_form')].down('input.project-name').focus
|
||||
1
app/views/projects/error.js.rjs
Normal file
1
app/views/projects/error.js.rjs
Normal file
|
|
@ -0,0 +1 @@
|
|||
page.notify :error, @error_message || "An error occurred on the server.", 8.0
|
||||
64
app/views/projects/index.html.erb
Normal file
64
app/views/projects/index.html.erb
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<div id="display_box">
|
||||
<div id="projects-empty-nd" style="<%= @no_projects ? 'display:block' : 'display:none'%>">
|
||||
<div class="message"><p>Currently there are no projects</p></div>
|
||||
</div>
|
||||
<%= render :partial => 'project_state_group', :object => @active_projects, :locals => { :state => 'active'} %>
|
||||
<%= render :partial => 'project_state_group', :object => @hidden_projects, :locals => { :state => 'hidden'} %>
|
||||
<%= render :partial => 'project_state_group', :object => @completed_projects, :locals => { :state => 'completed'} %>
|
||||
</div>
|
||||
|
||||
<% @project = @new_project -%>
|
||||
<div id="input_box">
|
||||
<div id="project_new_project_filler">
|
||||
<div id="project_new_project_container">
|
||||
|
||||
<div id="toggle_project_new" class="hide_form">
|
||||
<a title="Hide new project form" accesskey="n">« Hide form</a>
|
||||
<% apply_behavior '#toggle_project_new a:click', :prevent_default => true do |page|
|
||||
page << "TracksForm.toggle('toggle_project_new', 'project_new', 'project-form',
|
||||
'« Hide form', 'Hide new project form',
|
||||
'Create a new project »', 'Add a project');"
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
|
||||
<div id="project_new" class="project_new" style="display:block">
|
||||
<% form_remote_tag(:url => projects_path, :method => :post,
|
||||
:html=> { :id=>'project-form', :name=>'project', :class => 'inline-form'},
|
||||
:before => "$('project_new_project_submit').startWaiting()",
|
||||
:complete => "$('project_new_project_submit').stopWaiting()",
|
||||
:condition => "!$('project_new_project_submit').isWaiting()") do -%>
|
||||
|
||||
<div id="status"><%= error_messages_for('project') %></div>
|
||||
|
||||
<label for="project_name">Name:</label><br />
|
||||
<%= text_field 'project', 'name', "tabindex" => 1 %><br />
|
||||
|
||||
<label for="project_description">Description (optional):</label><br />
|
||||
<%= text_area 'project', 'description', "cols" => 30, "rows" => 4, "tabindex" => 2 %><br />
|
||||
|
||||
<% unless @contexts.empty? -%>
|
||||
<label for="default_context_name">Default Context (optional):</label><br />
|
||||
<%= text_field_tag("project[default_context_name]", @project.default_context.name, :tabindex => 3) %>
|
||||
<%= render :partial => 'default_context_autocomplete' %>
|
||||
<br />
|
||||
<% end -%>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="project_new_project_submit">
|
||||
<%= image_tag("accept.png", :alt => "") + 'Add Project' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/><br/>
|
||||
<input id="go_to_project" type="checkbox" tabindex="5" name="go_to_project"/><label for="go_to_project"> Take me to the new project page</label><br />
|
||||
|
||||
<% end -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
6
app/views/projects/index.text.erb
Normal file
6
app/views/projects/index.text.erb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<% @projects.each do |p| -%>
|
||||
|
||||
<%= p.name.upcase %>
|
||||
<%= p.description + "\n" unless p.description.blank? -%>
|
||||
<%= count_undone_todos_phrase_text(p)%>. Project is <%= p.state %>.
|
||||
<% end -%>
|
||||
8
app/views/projects/index_mobile.rhtml
Normal file
8
app/views/projects/index_mobile.rhtml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h2>Active projects</h2>
|
||||
<%= render :partial => 'mobile_project_listing', :collection => @active_projects%>
|
||||
|
||||
<h2>Hidden projects</h2>
|
||||
<%= render :partial => 'mobile_project_listing', :collection => @hidden_projects %>
|
||||
|
||||
<h2>Completed projects</h2>
|
||||
<%= render :partial => 'mobile_project_listing', :collection => @completed_projects %>
|
||||
6
app/views/projects/index_text_projects_and_actions.rhtml
Normal file
6
app/views/projects/index_text_projects_and_actions.rhtml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<% @projects.each do |p| -%>
|
||||
<%= p.name.upcase -%>
|
||||
<% actions = p.todos.select { |t| t.active? } -%>
|
||||
<%= render :partial => "todos/text_todo", :collection => actions -%>
|
||||
|
||||
<% end -%>
|
||||
27
app/views/projects/project_mobile.rhtml
Normal file
27
app/views/projects/project_mobile.rhtml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<% project = @project %>
|
||||
<%= project_next_prev_mobile %>
|
||||
<h2><%=project.name%></h2>
|
||||
<% unless @project.description.blank? -%>
|
||||
<div class="project_description"><%= sanitize(@project.description) %></div>
|
||||
<% end -%>
|
||||
<%= render :partial => "todos/mobile_todo", :collection => @not_done, :locals => { :parent_container_type => "project" }%>
|
||||
<h2>Deferred actions for this project</h2>
|
||||
<% if @deferred.empty? -%>
|
||||
There are no deferred actions for this project
|
||||
<% else -%>
|
||||
<%= render :partial => "todos/mobile_todo", :collection => @deferred, :locals => { :parent_container_type => "project" }%>
|
||||
<% end
|
||||
-%>
|
||||
<h2>Completed actions for this project</h2>
|
||||
<% if @done.empty? -%>
|
||||
There are no completed actions for this project
|
||||
<% else -%>
|
||||
<%= render :partial => "todos/mobile_todo", :collection => @done, :locals => { :parent_container_type => "project" }%>
|
||||
<% end %>
|
||||
<h2>Notes</h2>
|
||||
<% if @project.notes.empty? -%>
|
||||
There are no notes for this project
|
||||
<% else -%><%= render :partial => "notes/mobile_notes_summary", :collection => @project.notes %>
|
||||
<% end -%>
|
||||
<h2>Settings</h2>
|
||||
This project is <%= project.current_state.to_s %>. <%= @project_default_context %>
|
||||
78
app/views/projects/show.html.erb
Normal file
78
app/views/projects/show.html.erb
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<div id="display_box">
|
||||
<div id="project-next-prev">
|
||||
<%= project_next_prev %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "projects/project", :locals => { :project => @project, :collapsible => false } %>
|
||||
<%= render :partial => "todos/deferred", :locals => { :deferred => @deferred, :collapsible => false, :append_descriptor => "in this project" } %>
|
||||
<% unless @max_completed==0 -%>
|
||||
<%= render :partial => "todos/completed", :locals => { :done => @done, :collapsible => false, :suppress_project => true, :append_descriptor => "in this project" } %>
|
||||
<% end -%>
|
||||
|
||||
<div class="container">
|
||||
<div id="notes">
|
||||
<div class="add_note_link"><%= link_to_function( "Add a note", "Element.toggle('new-note'); Form.focusFirstElement('form-new-note');", :id=>"add_note_href") %></div>
|
||||
<h2>Notes</h2>
|
||||
<div id="empty-n" style="display:<%= @project.notes.empty? ? 'block' : 'none'%>;">
|
||||
<%= render :partial => "shared/empty",
|
||||
:locals => { :message => "Currently there are no notes attached to this project"} %>
|
||||
</div>
|
||||
<%= render :partial => "notes/notes_summary", :collection => @project.notes %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="new-note" style="display:none;">
|
||||
<% form_remote_tag :url => notes_path,
|
||||
:method => :post,
|
||||
:update => "notes",
|
||||
:position => "bottom",
|
||||
:complete => "new Effect.Highlight('notes');$('empty-n').hide();Form.reset('form-new-note');",
|
||||
:html => {:id=>'form-new-note', :class => 'inline-form'} do %>
|
||||
<%= hidden_field( "new_note", "project_id", "value" => "#{@project.id}" ) %>
|
||||
<%= text_area( "new_note", "body", "cols" => 50, "rows" => 3, "tabindex" => 1 ) %>
|
||||
<br /><br />
|
||||
<input type="submit" value="Add note" name="add-new-note" tabindex="2" />
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div id="project_status">
|
||||
<h2>Status</h2>
|
||||
<div>
|
||||
<% ['active', 'hidden', 'completed'].each do | state | %>
|
||||
<% span_class = @project.current_state.to_s == state ? 'active_state' : 'inactive_state' %>
|
||||
<span class="<%= state %>"><%= radio_button(:project, 'state', state) %> <span class="<%= span_class %>"><%= state.titlecase %></span></span>
|
||||
<% end %>
|
||||
<% apply_behavior "#project_status input:click",
|
||||
remote_function(:url => project_path(@project), :method => :put,
|
||||
:with => "'wants_render=false&update_status=true&project[state]='+this.value" )
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div id="default_context">
|
||||
<h2>Default Context</h2>
|
||||
<div>
|
||||
<% form_remote_tag( :url => project_path(@project), :method => :put,
|
||||
:html=> { :id => 'set-default-context-action',
|
||||
:name => 'default_context',
|
||||
:class => 'inline-form' }) do -%>
|
||||
<%= hidden_field_tag("update_default_context", true) %>
|
||||
<%= text_field_tag("project[default_context_name]",
|
||||
@project.default_context.name,
|
||||
{ :tabindex => 9,:size => 25 }) %>
|
||||
<%= submit_tag "Set Default Context for this Project", { :tabindex => 10 } %>
|
||||
<%= render :partial => 'default_context_autocomplete' %>
|
||||
<% end -%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- [end:display_box] -->
|
||||
|
||||
<div id="input_box">
|
||||
<%= render :partial => "shared/add_new_item_form" %>
|
||||
<%= render "sidebar/sidebar" %>
|
||||
</div><!-- End of input box -->
|
||||
16
app/views/projects/update.js.rjs
Normal file
16
app/views/projects/update.js.rjs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
status_message = 'Project saved'
|
||||
page.notify :notice, status_message, 5.0
|
||||
if @state_changed
|
||||
page[dom_id(@project, 'container')].remove
|
||||
page.insert_html :bottom, "list-#{@project.state}-projects", :partial => 'project_listing', :object => @project
|
||||
else
|
||||
page.replace_html dom_id(@project, 'container'), :partial => 'project_listing', :object => @project
|
||||
end
|
||||
page.sortable "list-#{@project.state}-projects", get_listing_sortable_options("list-#{@project.state}-projects")
|
||||
page.replace_html "active-projects-count", @active_projects_count
|
||||
page.replace_html "hidden-projects-count", @hidden_projects_count
|
||||
page.replace_html "completed-projects-count", @completed_projects_count
|
||||
|
||||
page.set_element_visible("list-hidden-projects-container", @hidden_projects_count > 0)
|
||||
page.set_element_visible("list-active-projects-container", @active_projects_count > 0)
|
||||
page.set_element_visible("list-completed-projects-container", @completed_projects_count > 0)
|
||||
11
app/views/projects/update_default_context.js.rjs
Normal file
11
app/views/projects/update_default_context.js.rjs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
if @project.default_context.nil?
|
||||
page.notify :notice, "Removed default context", 5.0
|
||||
else
|
||||
if source_view_is :project
|
||||
page['default_context_name_id'].value = @project.default_context.name
|
||||
page['todo_context_name'].value = @project.default_context.name
|
||||
end
|
||||
page.notify :notice, "Set project's default context to #{@project.default_context.name}", 5.0
|
||||
end
|
||||
page.hide "busy"
|
||||
|
||||
10
app/views/projects/update_status.js.rjs
Normal file
10
app/views/projects/update_status.js.rjs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
page.select('#project_status .active span').each do |element|
|
||||
element.className = @project.current_state == :active ? 'active_state' : 'inactive_state'
|
||||
end
|
||||
page.select('#project_status .hidden span').each do |element|
|
||||
element.className = @project.current_state == :hidden ? 'active_state' : 'inactive_state'
|
||||
end
|
||||
page.select('#project_status .completed span').each do |element|
|
||||
element.className = @project.current_state == :completed ? 'active_state' : 'inactive_state'
|
||||
end
|
||||
page.notify :notice, "Set project status to #{@project.current_state}", 5.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue