From 669257673e8260bd97c99749ec2e5a5ad32f182b Mon Sep 17 00:00:00 2001 From: Martii Date: Sat, 24 Aug 2019 04:56:06 -0600 Subject: [PATCH] More icons with tooltips for the UI * Squeeze in a little more real estate for more the more important things. This is as small as I dare make it and still be readable which in turn adds some vertical white-space occasionally. * Fixing a Y2K+100 bug ;) NOTES: * Tested on desktops only... will do more testing after merge. Hopefully everything goes well. * Additional squeezing yet to come. --- libs/modelParser.js | 52 +++++++++++++++++++++++++ public/css/common.css | 53 ++++++++++++++++++++++++++ views/includes/announcementsPanel.html | 6 +-- views/includes/discussionList.html | 13 ++++--- views/includes/groupList.html | 2 +- views/includes/removedItemList.html | 10 +++-- views/includes/scriptList.html | 10 ++--- views/includes/userList.html | 2 +- 8 files changed, 128 insertions(+), 20 deletions(-) diff --git a/libs/modelParser.js b/libs/modelParser.js index 3e6b5786d..4d140d05a 100644 --- a/libs/modelParser.js +++ b/libs/modelParser.js @@ -55,6 +55,17 @@ var momentLangTinyDate = function (aDate) { return '[' + aDate.format("MMM 'YY") + ']'; } }; +var momentLangTinyDateIconic = function (aDate) { + if (aDate.year() === moment().year()) { + return '[' + aDate.format("MMM") + '' + + '
' + aDate.format("D") + '' + + '
]'; + } else { + return '[' + aDate.format("MMM") + '' + + '
' + + '
' + aDate.format("YYYY") + ']'; + } +}; moment.locale('en-tiny', { calendar : { sameDay : function () { @@ -95,6 +106,46 @@ moment.locale('en-tiny', { } }); +moment.locale('en-iconic', { + calendar : { + sameDay : function () { + return momentLangFromNow(this); + }, + lastDay : function () { + return momentLangFromNow(this); + }, + lastWeek : function () { + return momentLangFromNow(this); + }, + nextDay : function () { + return momentLangTinyDateIconic(this); + }, + nextWeek : function () { + return momentLangTinyDateIconic(this); + }, + sameElse : function () { + return momentLangTinyDateIconic(this); + } + }, + relativeTime : { + future : "​
in
%s", + past : "​
%s
ago", + s : function (aNumber, aWithoutSuffix, aKey, aIsFuture) { + return aNumber + "s"; + }, + m : "1m", + mm : "%dm", + h : "1h", + hh : "%dh", + d : "1d", + dd : "%dd", + M : "1M", + MM : "%dM", + y : "1y", + yy : "%dy" + } +}); + var parseDateProperty = function (aObj, aKey) { var date = null; @@ -104,6 +155,7 @@ var parseDateProperty = function (aObj, aKey) { aObj[aKey] = date; aObj[aKey + 'ISOFormat'] = date.toISOString(); aObj[aKey + 'Humanized'] = moment(date).locale('en-tiny').calendar(); + aObj[aKey + 'HumanizedIconic'] = moment(date).locale('en-iconic').calendar(); } } }; diff --git a/public/css/common.css b/public/css/common.css index 84d368ab4..82f5b7393 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -519,3 +519,56 @@ ul.flaggedList { cursor: pointer; } +/* Iconic dates */ + +time.iconic { + font-size: 0.9em; /* change iconic size here */ + display: block; + position: relative; + width: 3em; + height: 3em; + background-color: #fff; + margin: 0.25em auto; + border-radius: 0.5em; + box-shadow: 0 1px 0 #bdbdbd, 0 2px 0 #fff, 0 3px 0 #bdbdbd, 0 4px 0 #fff, 0 5px 0 #bdbdbd, 0 0 0 1px #bdbdbd; + overflow: hidden; + margin-top: 0; +} + +time.iconic * +{ + display: block; + width: 100%; + font-size: 0.75em; + font-weight: bold; + font-style: normal; + text-align: center; +} + +time.iconic strong +{ + position: absolute; + top: 0; + padding: 0.05em 0; + color: #fff; + background-color: #2c3e50; + border-bottom: 1px dotted #709ecc; + box-shadow: 0 2px 0 #2c3e50; +} + +time.iconic span +{ + width: 100%; + font-size: 0.9em; + letter-spacing: -0.05em; + padding-top: 1.4em; + color: #2f2f2f; +} + +time.iconic em +{ + font-size: 0.7em; + position: absolute; + bottom: 0; + color: #2c3e50; +} diff --git a/views/includes/announcementsPanel.html b/views/includes/announcementsPanel.html index b90b3645c..e40c1f26c 100644 --- a/views/includes/announcementsPanel.html +++ b/views/includes/announcementsPanel.html @@ -17,13 +17,13 @@ -

{{replies}} replies

+

{{replies}} replies

- + - + {{/announcementsDiscussionList}} diff --git a/views/includes/discussionList.html b/views/includes/discussionList.html index 7b4cde83b..4883a6ceb 100644 --- a/views/includes/discussionList.html +++ b/views/includes/discussionList.html @@ -6,10 +6,10 @@ {{#multipleCategories}} Category {{/multipleCategories}} - Users - Replies - Created - Updated + Users