mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-18 05:08:09 +01:00
improve project show page and improve caching
This commit is contained in:
parent
8151cd9473
commit
2fc3f65368
10 changed files with 143 additions and 85 deletions
|
|
@ -1,26 +0,0 @@
|
|||
<% project = project_settings -%>
|
||||
<div id='<%= dom_id(project) %>' class='project'>
|
||||
<div class='project_settings'><%= t('projects.this_project') %>
|
||||
<% if project.completed? -%><%= t('projects.was_marked_complete') %>
|
||||
<% elsif project.hidden? -%><%= t('projects.was_marked_hidden') %>
|
||||
<% else -%><%= t('projects.is_active') %>
|
||||
<% end -%>
|
||||
<% if project.default_context.nil? -%>
|
||||
<%= t('projects.with_no_default_context') %>
|
||||
<% else -%>
|
||||
<%= t('projects.with_default_context', :context_name => project.default_context.name) %>
|
||||
<% end -%>
|
||||
<% if project.default_tags.nil? || project.default_tags.blank? -%>
|
||||
<%= t('projects.with_no_default_tags') %>.
|
||||
<% else -%>
|
||||
<%= t('projects.with_default_tags', :tags => project.default_tags) %>.
|
||||
<% end -%>
|
||||
<%= link_to_edit_project(project, t('projects.edit_project_settings')) %>
|
||||
</div>
|
||||
<% unless project.description.blank? -%>
|
||||
<div class='project_description'><%= Tracks::Utils.render_text(project.description) %></div>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div id='<%= dom_id(project, 'edit') %>' class='edit-form' style='display:none;'>
|
||||
<div class='placeholder'> </div>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,18 @@
|
|||
<h2 id="project_name_container"><%= show_project_name(project) %> </h2>
|
||||
<a
|
||||
role="button" title=""
|
||||
data-placement="bottom" rel="tracks-popover" href="#"
|
||||
data-original-title="Details of project" data-html="true"
|
||||
data-content="<%= render(partial: "project_settings", object: project) %>"><i class="icon-info-sign"></i></a>
|
||||
<h3 class="project-name-container"><%= show_project_name(project) %> </h3>
|
||||
<div class="project-badges">
|
||||
<a class="badge" title=""
|
||||
data-placement="bottom" rel="tracks-popover" href="#"
|
||||
data-original-title="<%= project.name %>" data-html="true"
|
||||
data-content="<div class='project-details'><%= project_details(project) %></div>">
|
||||
<i class="icon-info-sign"></i> Details
|
||||
</a>
|
||||
<a class="badge hide tracks-badge-description" title="Show project description" href="#">
|
||||
<i class="icon-book"></i> Description
|
||||
</a>
|
||||
</div>
|
||||
<% unless project.description.blank? %>
|
||||
<div class='project-description alert alert-info'>
|
||||
<button type="button" class="close">×</button>
|
||||
<small><%= Tracks::Utils.render_text(project.description) %></small>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -17,29 +17,26 @@
|
|||
<%= render :partial => "project_settings_container", :locals => {:project => @project} %>
|
||||
<% end %>
|
||||
|
||||
<% cache("not_done_project", @not_done_todos.empty?) do -%>
|
||||
<% cache ["not_done_project", @not_done_todos.empty?] do -%>
|
||||
<%= render partial: "todos/empty_message_container", locals: {:show => @not_done_todos.empty?, :container_name => "not_done"} %>
|
||||
<% end -%>
|
||||
|
||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => false, :parent_container_type => 'project' }) %>
|
||||
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
<% cache [@project, "deferred_pending"] do -%>
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
<% end -%>
|
||||
|
||||
<%= show_done_todos(@done, done_todo_options) unless @done.nil? %>
|
||||
|
||||
<% # use the first completed todo (which is the last one to be completed) as cache invariant
|
||||
cache [@project, @done.first, "project_completed"] do -%>
|
||||
<%= show_done_todos(@done, done_todo_options) unless @done.nil? %>
|
||||
<% end -%>
|
||||
|
||||
<%# TODO: new note impl -%>
|
||||
<div class="container">
|
||||
<div id="notes">
|
||||
<div class="add_note_link"><%= link_to t('projects.add_note'), '#' %> </div>
|
||||
<h2><%= t('projects.notes') %></h2>
|
||||
<div id="empty-n" style="display:<%= @project.notes.empty? ? 'block' : 'none'%>;">
|
||||
<div class="message"><p><%= t('projects.no_notes_attached') %></p></div>
|
||||
</div>
|
||||
<%= render :partial => "notes/notes_summary", :collection => @project.notes %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="new-note" style="display:none;">
|
||||
<%# render :partial => "notes/note_edit_form", :object => @new_note, :locals => {:submit_text => t('projects.add_note_submit')} %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue