mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 18:56:10 +01:00
first pass of all tests done
This commit is contained in:
parent
598891c1d3
commit
5e477a4d25
16 changed files with 46 additions and 23 deletions
|
|
@ -189,26 +189,26 @@ class ProjectsController < ApplicationController
|
|||
update_state_counts
|
||||
init_data_for_sidebar
|
||||
|
||||
template = 'projects/update.js.erb'
|
||||
template = 'projects/update'
|
||||
|
||||
# TODO: are these params ever set? or is this dead code?
|
||||
elsif boolean_param('update_status')
|
||||
template = 'projects/update_status.js.rjs'
|
||||
template = 'projects/update_status'
|
||||
elsif boolean_param('update_default_context')
|
||||
@initial_context_name = @project.default_context.name
|
||||
template = 'projects/update_default_context.js.rjs'
|
||||
template = 'projects/update_default_context'
|
||||
elsif boolean_param('update_default_tags')
|
||||
template = 'projects/update_default_tags.js.rjs'
|
||||
template = 'projects/update_default_tags'
|
||||
elsif boolean_param('update_project_name')
|
||||
@projects = current_user.projects
|
||||
template = 'projects/update_project_name.js.rjs'
|
||||
template = 'projects/update_project_name'
|
||||
else
|
||||
render :text => success_text || 'Success'
|
||||
return
|
||||
end
|
||||
else
|
||||
init_data_for_sidebar
|
||||
template = 'projects/update.js.erb'
|
||||
template = 'projects/update'
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class StatsController < ApplicationController
|
|||
# convert to array and fill in non-existing months
|
||||
@actions_done_last12months_array = convert_to_months_from_today_array(@actions_done_last12months, 13, :completed_at)
|
||||
@actions_created_last12months_array = convert_to_months_from_today_array(@actions_created_last12months, 13, :created_at)
|
||||
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 13, :completed_at)
|
||||
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 15, :created_at)
|
||||
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 16, :completed_at)
|
||||
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 16, :created_at)
|
||||
|
||||
# find max for graph in both arrays
|
||||
@max = [@actions_done_last12months_array.max, @actions_created_last12months_array.max].max
|
||||
|
|
@ -446,8 +446,8 @@ class StatsController < ApplicationController
|
|||
@seconds_per_day = 60*60*24
|
||||
|
||||
# define cut_off date and discard the time for a month, 3 months and a year
|
||||
@cut_off_year = 13.months.ago.beginning_of_day
|
||||
@cut_off_year_plus3 = 16.months.ago.beginning_of_day
|
||||
@cut_off_year = 12.months.ago.beginning_of_day
|
||||
@cut_off_year_plus3 = 15.months.ago.beginning_of_day
|
||||
@cut_off_month = 1.month.ago.beginning_of_day
|
||||
@cut_off_3months = 3.months.ago.beginning_of_day
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module RecurringTodosHelper
|
|||
edit_recurring_todo_path(@recurring_todo),
|
||||
:class => "icon edit_icon", :id => "link_edit_recurring_todo_#{@recurring_todo.id}")
|
||||
else
|
||||
str = '<a class="icon">' + image_tag("blank.png") + "</a> "
|
||||
str = content_tag(:a, image_tag("blank.png"), :class => "icon")
|
||||
end
|
||||
str
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<%= t('common.last' ) unless ( ['review','stalled','blocked','current'].include?(state) )%>
|
||||
<%= t('states.'+state+'_plural' )%>
|
||||
<%= t('common.projects') %><%= total_count==-1 ? "" : " ("+link_to(t('common.show_all'), done_projects_path)+")"%>
|
||||
<%= t('common.projects') %><%= total_count==-1 ? "" : " (#{link_to(t('common.show_all'), done_projects_path)})".html_safe%>
|
||||
|
||||
</h2>
|
||||
<% unless suppress_sort_menu %>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ function html_for_project_listing() {
|
|||
}
|
||||
|
||||
function html_for_sidebar() {
|
||||
return "<%= source_view_is(:project) ? escape_javascript(render(:file => 'sidebar/sidebar.html.erb')) : "" %>";
|
||||
return "<%= source_view_is(:project) ? escape_javascript(render(:file => 'sidebar/sidebar')) : "" %>";
|
||||
}
|
||||
|
||||
function html_for_project_settings() {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => :actions_done_lastyears_data)} -%>
|
||||
<%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %>
|
||||
<%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<% if @last_completed_recurring_todos.empty? -%>
|
||||
<div class="message"><p><%= t('projects.no_last_completed_recurring_todos') %></p></div>
|
||||
<% else -%>
|
||||
<%= render :partial => '/recurring_todos/recurring_todo', :collection => @last_completed_recurring_todos %>
|
||||
<%= render :partial => @last_completed_recurring_todos %>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => @chart_name)} -%>
|
||||
<br/>
|
||||
<p>
|
||||
<%= t('stats.click_to_update_actions') %> <%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %>
|
||||
<%= t('stats.click_to_update_actions') %> <%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>
|
||||
<%
|
||||
unless @further
|
||||
-%>
|
||||
<%= t('stats.click_to_show_actions_from_week',
|
||||
:link => link_to("here", {:controller => "stats", :action => "show_selected_actions_from_chart", :id=>"#{params[:id]}_end", :index => params[:index]}),
|
||||
<%= raw t('stats.click_to_show_actions_from_week',
|
||||
:link => link_to("here", show_actions_from_chart_path(:id=>"#{params[:id]}_end", :index => params[:index])),
|
||||
:week => params[:index])
|
||||
-%>
|
||||
<%
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@
|
|||
<% end -%>
|
||||
</div>
|
||||
|
||||
<p><%= t('todos.see_all_completed', :link => link_to(t("todos.all_completed_here"), determine_all_done_path)) %></p>
|
||||
<p><%= raw t('todos.see_all_completed', :link => link_to(t("todos.all_completed_here"), determine_all_done_path)) %></p>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue