OctoPrint-Wrapped 1.1.1__tar.gz → 1.2.0__tar.gz

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 (25) hide show
  1. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0/OctoPrint_Wrapped.egg-info}/PKG-INFO +1 -1
  2. {octoprint_wrapped-1.1.1/OctoPrint_Wrapped.egg-info → octoprint_wrapped-1.2.0}/PKG-INFO +1 -1
  3. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/js/wrapped.js +13 -2
  4. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/templates/wrapped_about.jinja2 +18 -1
  5. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/pyproject.toml +1 -1
  6. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/MANIFEST.in +0 -0
  7. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/OctoPrint_Wrapped.egg-info/SOURCES.txt +0 -0
  8. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/OctoPrint_Wrapped.egg-info/dependency_links.txt +0 -0
  9. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/OctoPrint_Wrapped.egg-info/entry_points.txt +0 -0
  10. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/OctoPrint_Wrapped.egg-info/requires.txt +0 -0
  11. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/OctoPrint_Wrapped.egg-info/top_level.txt +0 -0
  12. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/README.md +0 -0
  13. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/__init__.py +0 -0
  14. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/clientjs/wrapped.js +0 -0
  15. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/fonts/LICENSE +0 -0
  16. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/fonts/open-sans-v15-latin-700.woff +0 -0
  17. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/js/ko.src.svgtopng.js +0 -0
  18. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/pure-snow/LICENSE +0 -0
  19. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/pure-snow/pure-snow.css +0 -0
  20. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/static/pure-snow/pure-snow.js +0 -0
  21. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/templates/wrapped.svg.jinja2 +0 -0
  22. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/templates/wrapped_navbar_snowfall.jinja2 +0 -0
  23. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/octoprint_wrapped/templates/wrapped_navbar_wrapped.jinja2 +0 -0
  24. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/setup.cfg +0 -0
  25. {octoprint_wrapped-1.1.1 → octoprint_wrapped-1.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OctoPrint-Wrapped
3
- Version: 1.1.1
3
+ Version: 1.2.0
4
4
  Summary: Get your yearly OctoPrint stats and let it snow! Depends on the Achievements plugin.
5
5
  Author-email: Gina Häußge <gina@octoprint.org>
6
6
  License: AGPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OctoPrint-Wrapped
3
- Version: 1.1.1
3
+ Version: 1.2.0
4
4
  Summary: Get your yearly OctoPrint stats and let it snow! Depends on the Achievements plugin.
5
5
  Author-email: Gina Häußge <gina@octoprint.org>
6
6
  License: AGPL-3.0-or-later
@@ -47,7 +47,7 @@ $(function () {
47
47
  : now.getFullYear() - 1; // already January
48
48
  const years = self.availableYears();
49
49
 
50
- if (years.indexOf(year) !== -1 && self.withinWrappedSeason()) {
50
+ if (years.indexOf(year) !== -1) {
51
51
  return year;
52
52
  } else {
53
53
  return false;
@@ -62,7 +62,14 @@ $(function () {
62
62
  const year = self.currentWrapped();
63
63
  if (!year) return false;
64
64
 
65
- return OctoPrint.plugins.wrapped.getYearSvgUrl(year);
65
+ return self.svgUrlForYear(year);
66
+ });
67
+
68
+ self.pastYears = ko.pureComputed(() => {
69
+ const now = new Date();
70
+ const year = now.getFullYear();
71
+ const years = self.availableYears();
72
+ return years.filter((y) => y < year).sort((a, b) => b - a);
66
73
  });
67
74
 
68
75
  self.withinWrappedSeason = ko.pureComputed(() => {
@@ -74,6 +81,10 @@ $(function () {
74
81
  );
75
82
  });
76
83
 
84
+ self.svgUrlForYear = (year) => {
85
+ return OctoPrint.plugins.wrapped.getYearSvgUrl(year);
86
+ };
87
+
77
88
  self.requestData = () => {
78
89
  if (
79
90
  !self.loginState.hasPermission(
@@ -19,6 +19,23 @@
19
19
  </div>
20
20
  <p data-bind="visible: !withinWrappedSeason()">
21
21
  {% trans %}
22
- Nothing to see here at the moment! Come back between December 1st and January 10th!
22
+ Nothing to see for this year yet! Come back between December 1st and January 10th!
23
23
  {% endtrans %}
24
24
  </p>
25
+
26
+ <div id="plugin_wrapped_pastyears"
27
+ data-bind="visible: pastYears().length > 0">
28
+ <h4>
29
+ <a href="javascript:void()"
30
+ data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', parent: '#plugin_wrapped_pastyears', container: '.hide' }"><i class="fas fa-caret-right"></i> {{ _("Past years") }}</a>
31
+ </h4>
32
+
33
+ <div class="hide" data-bind="foreach: pastYears">
34
+ <h5 data-bind="text: $data"></h5>
35
+ <img data-bind="src.svgtopng: $root.svgUrlForYear($data)"
36
+ alt="OctoPrint Wrapped sharepic"
37
+ width="400"
38
+ height="400" />
39
+ </div>
40
+
41
+ </div>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "OctoPrint-Wrapped"
7
- version = "1.1.1"
7
+ version = "1.2.0"
8
8
  description = "Get your yearly OctoPrint stats and let it snow! Depends on the Achievements plugin."
9
9
  authors = [
10
10
  {name = "Gina Häußge", email = "gina@octoprint.org"}