mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
'Start/Stop tracking' on issues#show
This commit is contained in:
20
app/views/stopwatch_issue_timers/_new.html.erb
Normal file
20
app/views/stopwatch_issue_timers/_new.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<h3 class="title"><%= l(:button_log_time) %> - <%= format_date User.current.today %> - <%= "#{@issue.tracker} #{@issue.id}: #{truncate @issue.subject}" %></h3>
|
||||
|
||||
<%= labelled_form_for @time_entry, url: stopwatch_timers_path, method: :post, remote: true do |f| %>
|
||||
<% @time_entry.hours ||= 0 %>
|
||||
<%= f.hidden_field :issue_id, value: @issue.id %>
|
||||
|
||||
<fieldset class="box tabular">
|
||||
<legend><%= t 'stopwatch_timers.entry_form.legend_new' %></legend>
|
||||
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
|
||||
<p><%= f.text_field :comments, :size => 100, :maxlength => 1024, :required => Setting.timelog_required_fields.include?('comments') %></p>
|
||||
<% @time_entry.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :time_entry, value %></p>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_create) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
8
app/views/stopwatch_issue_timers/start.js.erb
Normal file
8
app/views/stopwatch_issue_timers/start.js.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% if @started_time_entry %>
|
||||
window.stopwatch.timerStarted(
|
||||
<%= raw Stopwatch::Timer.new(User.current).to_json %>
|
||||
);
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= j render partial: 'new' %>');
|
||||
showModal('ajax-modal', '700px');
|
||||
<% end %>
|
||||
5
app/views/stopwatch_issue_timers/stop.js.erb
Normal file
5
app/views/stopwatch_issue_timers/stop.js.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
window.stopwatch.updateStartStopLink(
|
||||
'#stopwatch_stop_timer_<%= @issue.id %>',
|
||||
'<%= j Stopwatch::IssueLinks.new(@issue).start_timer %>'
|
||||
);
|
||||
window.stopwatch.timerStopped();
|
||||
Reference in New Issue
Block a user