Browse Source

Add support for color schemes in Plush too.

This alters the interface spec for all skins:
1. The colorschemes folder is now scanned for files <color>.css and folders <color>
2. The colorscheme parameter for the templates now contains <color> instead of <color>.css
tags/0.6.0
ShyPike 14 years ago
parent
commit
dbc997532a
  1. 2
      SABnzbd.py
  2. 2
      interfaces/Classic/templates/inc_top.tmpl
  3. 4
      interfaces/Mobile/templates/main.tmpl
  4. 2
      interfaces/Plush/templates/_inc_header.tmpl
  5. 6
      interfaces/smpl/templates/main.tmpl
  6. 4
      sabnzbd/api.py

2
SABnzbd.py

@ -343,6 +343,8 @@ def CheckColor(color, web_dir):
""" Check existence of color-scheme """
if color and os.path.exists(os.path.join(web_dir,'static/stylesheets/colorschemes/'+color+'.css')):
return color
elif color and os.path.exists(os.path.join(web_dir,'static/stylesheets/colorschemes/'+color)):
return color
else:
return ''

2
interfaces/Classic/templates/inc_top.tmpl

@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="$statpath/static/stylesheets/default.css"/>
<link rel="stylesheet" type="text/css" href="$statpath/static/stylesheets/defaultcolors.css"/>
<!--#if $color_scheme#-->
<link rel="stylesheet" type="text/css" href="$statpath/static/stylesheets/colorschemes/$color_scheme"/>
<link rel="stylesheet" type="text/css" href="$statpath/static/stylesheets/colorschemes/${color_scheme}.css"/>
<!--#end if#-->
<!--#if $varExists('have_refresh') and $have_refresh#-->
<meta http-equiv="refresh" content="$have_refresh">

4
interfaces/Mobile/templates/main.tmpl

@ -6,10 +6,10 @@
<title>SAB+ Mobile</title>
<style type="text/css" media="screen">@import "static/stylesheets/jqtouch.css?$version";</style>
<link rel="stylesheet" type="text/css" href="static/stylesheets/colorschemes/$color_scheme?$version"/>
<link rel="stylesheet" type="text/css" href="static/stylesheets/colorschemes/${color_scheme}.css?$version"/>
<script src="static/javascripts/mobile.js?$version" type="application/x-javascript" charset="utf-8"></script>
<script type="text/javascript">
var apikey = "$session";
var TconfirmDelete = "$T('Mobile-confirm-delete')";

2
interfaces/Plush/templates/_inc_header.tmpl

@ -16,7 +16,7 @@
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/jqueryui/overcast/jquery-ui-1.8.9.custom.css?$version"/>
#if $color_scheme#
<link rel="shortcut icon" type="image/ico" href="${path}static/stylesheets/colorschemes/$color_scheme/images/sabnzbdplus.ico"/>
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/colorschemes/$color_scheme/$color_scheme.css?$version"/>
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/colorschemes/$color_scheme/${color_scheme}.css?$version"/>
#else#
<link rel="shortcut icon" type="image/ico" href="${path}static/stylesheets/colorschemes/gold/images/sabnzbdplus.ico"/>
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/colorschemes/gold/gold.css?$version"/>

6
interfaces/smpl/templates/main.tmpl

@ -7,7 +7,7 @@
<title>SABnzbd+</title>
<link rel="stylesheet" type="text/css" href="static/stylesheets/smpl.css?smpl$version"/>
<!--#if $color_scheme#-->
<link rel="stylesheet" type="text/css" href="static/stylesheets/colorschemes/$color_scheme?smpl$version"/>
<link rel="stylesheet" type="text/css" href="static/stylesheets/colorschemes/${color_scheme}.css?smpl$version"/>
<!--#else#-->
<link rel="stylesheet" type="text/css" href="static/stylesheets/colorschemes/white.css?smpl$version"/>
<!--#end if#-->
@ -1042,7 +1042,7 @@ function loadingJSON(){
function initDynamicTable() {
//dataTable = data;
<!--#if $color_scheme == 'black.css'#-->
<!--#if $color_scheme == 'black'#-->
options = PlotKit.Base.officeBlack();
<!--#else #-->
options = PlotKit.Base.officeBlue();
@ -1055,7 +1055,7 @@ function loadingJSON(){
function chartReload(data) {
<!--#if $color_scheme == 'black.css'#-->
<!--#if $color_scheme == 'black'#-->
var colorScheme = "Black";
<!--#else #-->
var colorScheme = "Blue";

4
sabnzbd/api.py

@ -1383,9 +1383,7 @@ def build_header(prim):
color = sabnzbd.WEB_COLOR
else:
color = sabnzbd.WEB_COLOR2
if color:
color = color + '.css'
else:
if not color:
color = ''
header = { 'T': Ttemplate, 'Tspec': Tspec, 'Tx' : Ttemplate, 'version':sabnzbd.__version__, 'paused': Downloader.do.paused,

Loading…
Cancel
Save