From cf1d88343d897d1a00e63d0b89b4c55376343fbb Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 23 May 2014 16:20:44 +0100 Subject: [PATCH 1/2] Add feature to General Config to display fuzzy dates instead of absolute dates. Add feature to General Config to trim the leading number "0" shown on hour of day and date of month. Affects UI dates on the Coming Episodes, Display Show, Manage > Backlog Overview, Home and History pages. Widen the General Config tab widths and tweak, format and align some texts. The many 'test date' variations in the General Config -> "Date and Time" drop down are useless during the month of May as both short and long styles are the same. Change the 'test date' to January 1 of the next year so short and long month styles are distinguishable. --- .../interfaces/default/comingEpisodes.tmpl | 16 +- .../interfaces/default/config_general.tmpl | 88 +++++++--- gui/slick/interfaces/default/displayShow.tmpl | 20 ++- gui/slick/interfaces/default/history.tmpl | 15 +- gui/slick/interfaces/default/home.tmpl | 13 +- gui/slick/interfaces/default/inc_top.tmpl | 7 +- .../default/manage_backlogOverview.tmpl | 14 +- gui/slick/js/fuzzyMoment.js | 164 ++++++++++++++++++ gui/slick/js/moment/moment.min.js | 6 + sickbeard/__init__.py | 8 +- sickbeard/webserve.py | 6 +- 11 files changed, 319 insertions(+), 38 deletions(-) create mode 100644 gui/slick/js/fuzzyMoment.js create mode 100644 gui/slick/js/moment/moment.min.js diff --git a/gui/slick/interfaces/default/comingEpisodes.tmpl b/gui/slick/interfaces/default/comingEpisodes.tmpl index 0d754156..f62df8d2 100644 --- a/gui/slick/interfaces/default/comingEpisodes.tmpl +++ b/gui/slick/interfaces/default/comingEpisodes.tmpl @@ -107,6 +107,17 @@ \$('#sbRoot').ajaxEpSearch(); + #set $fuzzydate = 'airdate' + #if $sickbeard.FUZZY_DATING: + fuzzyMoment({ + containerClass : '.${fuzzydate}', + dateHasTime : true, + dateFormat : '${sickbeard.DATE_PRESET}', + timeFormat : '${sickbeard.TIME_PRESET}', + trimZero : #if $sickbeard.TRIM_ZERO then "true" else "false"# + }); + #end if + }); //--> @@ -146,7 +157,8 @@ - $sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)$time.mktime($cur_result["localtime"].timetuple()) + ## forced to use a div to wrap airdate, the column sort went crazy with a span +
$sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)
$time.mktime($cur_result["localtime"].timetuple()) $cur_result["show_name"] #if int($cur_result["paused"]): [paused] @@ -212,7 +224,7 @@ #set $show_div = "ep_listing listing_default" #if $sort == "show": -

+

#end if #for $cur_result in $sql_results: diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index 82128d6d..a96c2367 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -48,7 +48,7 @@

Some options may require a manual restart to take effect.

-
+
@@ -124,7 +124,7 @@
-
+
+
@@ -288,7 +296,7 @@ @@ -318,11 +326,11 @@ @@ -330,7 +338,7 @@ @@ -359,16 +367,32 @@

Date and Time

-
+
+ +
+ + +
+ +
+ + +