active_analytics 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -15
  3. data/app/controllers/active_analytics/application_controller.rb +24 -4
  4. data/app/controllers/active_analytics/assets_controller.rb +29 -0
  5. data/app/controllers/active_analytics/pages_controller.rb +9 -10
  6. data/app/controllers/active_analytics/referrers_controller.rb +9 -5
  7. data/app/controllers/active_analytics/sites_controller.rb +4 -4
  8. data/app/models/active_analytics/views_per_day.rb +22 -3
  9. data/app/views/active_analytics/assets/_charts.css +249 -0
  10. data/app/{assets/stylesheets/active_analytics/style.css → views/active_analytics/assets/_style.css} +37 -38
  11. data/app/views/active_analytics/assets/application.css.erb +2 -0
  12. data/app/{assets/javascripts/active_analytics → views/active_analytics/assets}/application.js +1 -3
  13. data/app/views/active_analytics/assets/ariato.css +875 -0
  14. data/app/views/active_analytics/assets/ariato.js +322 -0
  15. data/app/views/active_analytics/pages/_table.html.erb +6 -17
  16. data/app/views/active_analytics/pages/index.html.erb +1 -1
  17. data/app/views/active_analytics/pages/show.html.erb +7 -8
  18. data/app/views/active_analytics/referrers/_table.html.erb +9 -2
  19. data/app/views/active_analytics/referrers/index.html.erb +2 -2
  20. data/app/views/active_analytics/referrers/show.html.erb +6 -3
  21. data/app/views/active_analytics/sites/_histogram.html.erb +9 -2
  22. data/app/views/active_analytics/sites/_histogram_header.html.erb +10 -0
  23. data/app/views/active_analytics/sites/show.html.erb +2 -2
  24. data/app/views/layouts/active_analytics/_footer.html.erb +3 -3
  25. data/app/views/layouts/active_analytics/_header.html.erb +1 -3
  26. data/app/views/layouts/active_analytics/application.html.erb +5 -3
  27. data/config/routes.rb +2 -1
  28. data/lib/active_analytics/version.rb +1 -1
  29. data/lib/active_analytics.rb +47 -4
  30. metadata +15 -11
  31. data/app/assets/javascripts/active_analytics/ariato.js +0 -746
  32. data/app/assets/stylesheets/active_analytics/application.css +0 -15
  33. data/app/assets/stylesheets/active_analytics/ariato.css +0 -3548
  34. data/app/assets/stylesheets/active_analytics/charts.css +0 -424
@@ -1,10 +1,10 @@
1
- body {
1
+ .active-analytics body {
2
2
  padding: 0;
3
3
  margin: 0;
4
4
  width: 100%;
5
5
  }
6
6
 
7
- body > header nav {
7
+ .active-analytics body > header nav {
8
8
  width: 100%;
9
9
  max-width: 1280px;
10
10
  margin: 0 auto;
@@ -15,23 +15,24 @@ body > header nav {
15
15
  min-height: 88px;
16
16
  }
17
17
 
18
- header nav .menubutton {
18
+ .active-analytics header nav .menubutton {
19
19
  margin-left: auto;
20
20
  }
21
21
 
22
- header .logo {
22
+ .active-analytics header .logo {
23
23
  margin-right: 8px;
24
24
  }
25
25
 
26
- header .logo svg {
26
+ .active-analytics header .logo svg {
27
27
  width: 24px;
28
28
  height: 24px;
29
29
  fill: none;
30
30
  stroke: rgba(var(--color-blue-500), 1);
31
31
  stroke-width: 1;
32
+ vertical-align: middle;
32
33
  }
33
34
 
34
- header .is-link {
35
+ .active-analytics header .is-link {
35
36
  text-transform: none;
36
37
  text-decoration: none;
37
38
  font-size: 1rem;
@@ -43,75 +44,72 @@ header .is-link {
43
44
  color: rgba(var(--color-grey-700), 1);
44
45
  }
45
46
 
46
- header .is-link:hover {
47
+ .active-analytics header .is-link:hover {
47
48
  background: rgba(var(--color-grey-50), 1);
48
49
  }
49
50
 
50
- main {
51
+ .active-analytics main {
51
52
  width: 100%;
52
53
  max-width: 1280px;
53
54
  margin: 0 auto;
54
55
  padding: 0 24px;
55
56
  }
56
57
 
57
- main h2 {
58
+ .active-analytics main h2 {
58
59
  word-break: break-word;
60
+ display: flex;
61
+ gap: var(--space);
59
62
  }
60
63
 
61
- section {
64
+ .active-analytics section {
62
65
  margin-bottom: var(--space-4x);
63
66
  }
64
67
 
65
- .grid-auto {
66
- --col-min-width: calc(var(--space) * 38);
68
+ .active-analytics .tooltip-date {
69
+ color: rgba(var(--color-grey-100), 1);
67
70
  }
68
71
 
69
- .tooltip-date {
70
- color: rgba(var(--color-grey-100), 1);
72
+ .active-analytics .card h3 {
73
+ display: flex;
71
74
  }
72
75
 
73
- .card {
74
- position: relative;
75
- overflow: visible;
76
+ .active-analytics .card h3 small {
77
+ color: rgba(var(--color-red-500), 1);
76
78
  }
77
79
 
78
- .card h3 {
79
- display: flex;
80
+ .active-analytics .card h3 small.is-success {
81
+ color: rgba(var(--color-green-500), 1);
80
82
  }
81
83
 
82
- .card h3 a {
84
+ .active-analytics .card h3 a {
83
85
  margin-left: auto;
84
86
  font-weight: 400;
85
87
  font-size: 1rem;
86
88
  }
87
89
 
88
- .card table {
89
- margin: 0 -24px;
90
+ .active-analytics .card table {
91
+ margin: 0 -24px -24px;
90
92
  width: calc(100% + 48px);
91
93
  }
92
94
 
93
- .card table.charts-css {
94
- margin-bottom: -24px;
95
- }
96
-
97
- tr td:first-of-type {
95
+ .active-analytics tr td:first-of-type {
98
96
  padding: 12px 0px 12px 24px;
99
97
  }
100
98
 
101
- tr td:last-of-type {
99
+ .active-analytics tr td:last-of-type {
102
100
  padding: 12px 24px 12px 0;
103
101
  }
104
102
 
105
- td a {
103
+ .active-analytics td a {
106
104
  word-break: break-word;
107
105
  }
108
106
 
109
- td.number {
107
+ .active-analytics td.number {
110
108
  text-align: right;
111
109
  font-variant-numeric: tabular-nums;
112
110
  }
113
111
 
114
- .referer-favicon {
112
+ .active-analytics .referer-favicon {
115
113
  width: 16px;
116
114
  height: 16px;
117
115
  display: inline-block;
@@ -120,7 +118,7 @@ td.number {
120
118
  margin-right: 4px;
121
119
  }
122
120
 
123
- div.is-empty {
121
+ .active-analytics div.is-empty {
124
122
  display: flex;
125
123
  align-items: center;
126
124
  justify-content: center;
@@ -129,33 +127,34 @@ div.is-empty {
129
127
  color: rgba(var(--color-grey-300), 1);
130
128
  }
131
129
 
132
- body > footer {
130
+ .active-analytics body > footer {
133
131
  max-width: 1280px;
134
132
  margin: 48px auto 0;
135
133
  padding: 24px;
136
134
  }
137
135
 
138
- body > footer ul {
136
+ .active-analytics body > footer ul {
139
137
  margin: 0;
140
138
  list-style-type: none;
141
139
  padding: 0;
142
140
  }
143
141
 
144
- body > footer .card {
142
+ .active-analytics body > footer .card {
145
143
  margin: 0;
146
144
  background: rgba(var(--color-grey-50), 1);
147
145
  }
148
- body > footer .card p {
146
+
147
+ .active-analytics body > footer .card p {
149
148
  padding: 0 0 2px;
150
149
  color: rgba(var(--color-grey-400), 1);
151
150
  }
152
151
 
153
152
  @media (max-width: 480px) {
154
- header nav .menubutton {
153
+ .active-analytics header nav .menubutton {
155
154
  margin-top: 24px;
156
155
  }
157
156
 
158
- [role="dialog"] {
157
+ .active-analytics [role="dialog"] {
159
158
  min-width: 280px;
160
159
  }
161
160
  }
@@ -0,0 +1,2 @@
1
+ <%= render "charts" %>
2
+ <%= render "style" %>
@@ -1,5 +1,3 @@
1
- //= require active_analytics/ariato
2
-
3
1
  ActiveAnalytics = {}
4
2
 
5
3
  ActiveAnalytics.Header = function() {
@@ -13,4 +11,4 @@ ActiveAnalytics.Header.prototype.toggleDateRangeForm = function() {
13
11
  form.setAttribute("hidden", "hidden")
14
12
  }
15
13
 
16
- Ariato.launchWhenDomIsReady()
14
+ Ariato.launchWhenDomIsReady()