mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-02 11:00:16 +01:00
occurence -> occurrence
This commit is contained in:
parent
d1cd4b68eb
commit
d480569629
14 changed files with 50 additions and 44 deletions
|
|
@ -145,7 +145,7 @@ class RecurringTodosController < ApplicationController
|
|||
params.require(:recurring_todo).permit(
|
||||
# model attributes
|
||||
:context_id, :project_id, :description, :notes, :state, :start_from,
|
||||
:ends_on, :end_date, :number_of_occurences, :occurences_count, :target,
|
||||
:ends_on, :end_date, :number_of_occurrences, :occurrences_count, :target,
|
||||
:show_from_delta, :recurring_period, :recurrence_selector, :every_other1,
|
||||
:every_other2, :every_other3, :every_day, :only_work_days, :every_count,
|
||||
:weekday, :show_always, :context_name, :project_name, :tag_list,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ module ApplicationHelper
|
|||
when "no_end_date"
|
||||
return time_span_text(rt.start_from, I18n.t("todos.recurrence.pattern.from"))
|
||||
when "ends_on_number_of_times"
|
||||
return I18n.t("todos.recurrence.pattern.times", :number => rt.number_of_occurences)
|
||||
return I18n.t("todos.recurrence.pattern.times", :number => rt.number_of_occurrences)
|
||||
when "ends_on_end_date"
|
||||
starts = time_span_text(rt.start_from, I18n.t("todos.recurrence.pattern.from"))
|
||||
ends = time_span_text(rt.end_date, I18n.t("todos.recurrence.pattern.until"))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class RecurringTodo < ActiveRecord::Base
|
|||
|
||||
include AASM
|
||||
aasm :column => :state do
|
||||
state :active, :initial => true, :before_enter => Proc.new { |t| t.occurences_count = 0 }
|
||||
state :active, :initial => true, :before_enter => Proc.new { |t| t.occurrences_count = 0 }
|
||||
state :completed, :before_enter => Proc.new { |t| t.completed_at = Time.zone.now }, :before_exit => Proc.new { |t| t.completed_at = nil }
|
||||
|
||||
event :complete do
|
||||
|
|
@ -131,7 +131,7 @@ class RecurringTodo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def increment_occurrences
|
||||
self.occurences_count += 1
|
||||
self.occurrences_count += 1
|
||||
self.save
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ module RecurringTodos
|
|||
start_from: attributes[:start_from],
|
||||
end_date: attributes[:end_date],
|
||||
ends_on: attributes[:ends_on],
|
||||
number_of_occurences: attributes[:number_of_occurences],
|
||||
number_of_occurrences: attributes[:number_of_occurrences],
|
||||
project: attributes[:project],
|
||||
context: attributes[:context],
|
||||
project_id: attributes[:project_id],
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ module RecurringTodos
|
|||
get :show_from_delta
|
||||
end
|
||||
|
||||
def number_of_occurences
|
||||
get :number_of_occurences
|
||||
def number_of_occurrences
|
||||
get :number_of_occurrences
|
||||
end
|
||||
|
||||
def recurring_target_as_text
|
||||
|
|
@ -94,7 +94,7 @@ module RecurringTodos
|
|||
validate_not_blank(start_from, "The start date needs to be filled in")
|
||||
case ends_on
|
||||
when 'ends_on_number_of_times'
|
||||
validate_not_blank(number_of_occurences, "The number of recurrences needs to be filled in for 'Ends on'")
|
||||
validate_not_blank(number_of_occurrences, "The number of recurrences needs to be filled in for 'Ends on'")
|
||||
when "ends_on_end_date"
|
||||
validate_not_blank(end_date, "The end date needs to be filled in for 'Ends on'")
|
||||
else
|
||||
|
|
@ -155,7 +155,7 @@ module RecurringTodos
|
|||
end
|
||||
|
||||
def continues_recurring?(previous)
|
||||
return @recurring_todo.occurences_count < @recurring_todo.number_of_occurences unless @recurring_todo.number_of_occurences.nil?
|
||||
return @recurring_todo.occurrences_count < @recurring_todo.number_of_occurrences unless @recurring_todo.number_of_occurrences.nil?
|
||||
return true if self.end_date.nil? || self.ends_on == 'no_end_date'
|
||||
|
||||
case self.target
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<label for="recurring_todo[ends_on]"><%= t('todos.recurrence.ends_on') %>:</label><br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'no_end_date', @form_helper.ends_on == 'no_end_date')%> <%= t('todos.recurrence.no_end_date') %><br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', @form_helper.ends_on == 'ends_on_number_of_times')%>
|
||||
<%= raw t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurences, "size" => 3)) %><br/>
|
||||
<%= raw t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurrences, "size" => 3)) %><br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_end_date', @form_helper.ends_on == 'ends_on_end_date')%>
|
||||
<%= raw t('todos.recurrence.ends_on_date', :date => text_field_tag('recurring_todo_edit_end_date', format_date(@form_helper.end_date), "size" => 12, "class" => "Date", "autocomplete" => "off")) %><br/>
|
||||
</div></div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<br/>
|
||||
<label for="recurring_todo[ends_on]"><%= t('todos.recurrence.ends_on') %>:</label><br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'no_end_date', true)%> <%= t('todos.recurrence.no_end_date') %><br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', false)%> <%= raw t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurences, "size" => 3)) %> <br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', false)%> <%= raw t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurrences, "size" => 3)) %> <br/>
|
||||
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_end_date', false)%> <%= raw t('todos.recurrence.ends_on_date', :date => text_field(:recurring_todo, :end_date, "size" => 12, "class" => "Date", "autocomplete" => "off", "value" => "")) %><br/>
|
||||
</div></div>
|
||||
<div id="recurring_daily" style="display:block">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue