ecm_time_tracking_backend 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecm/time_tracking/backend/entries_controller.rb +13 -0
- data/app/views/ecm/time_tracking/backend/entries/_sums_table.haml +2 -2
- data/lib/ecm/time_tracking/backend/configuration.rb +4 -0
- data/lib/ecm/time_tracking/backend/version.rb +1 -1
- data/lib/generators/ecm/time_tracking/backend/install/templates/initializer.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 928ed1cccc4267d2464a6b8940e1ac4ff6097365
|
4
|
+
data.tar.gz: 6f2642b636f7dcdd252cc68917a1c5fa6a5d502d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a35dc0f03363a97ba7680448e7133080d40b1517689ecb288c3e14b0c813eda28076a04bd998810c13b980c902cfe64c18c4a0c80824a37131d64e6cd88307
|
7
|
+
data.tar.gz: c1a78319849c98fa7cb45e920e1a014f04e531ff2772a0693a2d83b2fbd3a2f9bc1b2292b53355eed297b4e34bf3d1309c038dde89e1c4ffd0c018a7429266c7
|
@@ -8,6 +8,19 @@ module Ecm
|
|
8
8
|
|
9
9
|
private
|
10
10
|
|
11
|
+
def current_tracker_id
|
12
|
+
proc = Configuration.current_tracker_id_proc
|
13
|
+
instance_exec &proc
|
14
|
+
end
|
15
|
+
|
16
|
+
def load_scope
|
17
|
+
resource_class.where(tracker_id: current_tracker_id)
|
18
|
+
end
|
19
|
+
|
20
|
+
def collection_scope
|
21
|
+
resource_class.where(tracker_id: current_tracker_id)
|
22
|
+
end
|
23
|
+
|
11
24
|
def permitted_params
|
12
25
|
p = params.dup; p[:entry][:tracker_id] = current_user.id
|
13
26
|
p.require(:entry).permit(:begin_at, :end_at, :tracker_id, :break_length_in_minutes, :entry_type_id)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
.panel.panel-default
|
2
2
|
.panel-heading
|
3
3
|
.panel-title
|
4
|
-
%h3= Ecm::TimeTracking::
|
4
|
+
%h3= Ecm::TimeTracking::SoftwareDeveloperSumsService.model_name.human
|
5
5
|
.table
|
6
|
-
- sums = Ecm::TimeTracking::
|
6
|
+
- sums = Ecm::TimeTracking::SoftwareDeveloperSumsService.call(entries: entries)
|
7
7
|
- if sums.success?
|
8
8
|
= render_resource(sums, as: :bootstrap_attribute_table) do |table|
|
9
9
|
= table.row :overtime do |resource|
|
@@ -22,4 +22,10 @@ Ecm::TimeTracking::Backend.configure do |config|
|
|
22
22
|
[
|
23
23
|
]
|
24
24
|
}
|
25
|
+
|
26
|
+
# Proc that will be used to retrieve the current tracker id.
|
27
|
+
#
|
28
|
+
# Default: config.current_tracker_id_proc = ->(controller) { controller.current_user.try(:id) }
|
29
|
+
#
|
30
|
+
config.current_tracker_id_proc = ->(controller) { controller.current_user.try(:id) }
|
25
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_time_tracking_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|