You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/10/27 18:07:38 UTC
[21/40] allura git commit: [#7924] ticket:853 Remove icon theme
option from neighborhood custom css
[#7924] ticket:853 Remove icon theme option from neighborhood custom css
Choosing dark/white icon theme does not make sense now, since icons are
just text and the title bar color option applies to it too.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/446a0b8e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/446a0b8e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/446a0b8e
Branch: refs/heads/ib/7924
Commit: 446a0b8eebc7613d9602a1a151f8b01eed15c882
Parents: 4759e41
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Oct 23 16:15:07 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Oct 27 16:22:11 2015 +0200
----------------------------------------------------------------------
Allura/allura/model/neighborhood.py | 36 ++------------------
.../tests/functional/test_neighborhood.py | 7 ++--
Allura/allura/tests/model/test_neighborhood.py | 7 +---
3 files changed, 6 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/446a0b8e/Allura/allura/model/neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/neighborhood.py b/Allura/allura/model/neighborhood.py
index f46fc59..dcc1cf4 100644
--- a/Allura/allura/model/neighborhood.py
+++ b/Allura/allura/model/neighborhood.py
@@ -51,7 +51,6 @@ re_color_project_title = re.compile('color:(.+);\}')
re_bgcolor_barontop = re.compile('background\-color:([^;}]+);')
re_bgcolor_titlebar = re.compile('background\-color:([^;}]+);')
re_color_titlebar = re.compile('color:([^;}]+);')
-re_icon_theme = re.compile('neo-icon-set-(ffffff|454545)-256x350.png')
class Neighborhood(MappedClass):
@@ -169,14 +168,7 @@ class Neighborhood(MappedClass):
titlebarbackground = {'label': 'Title bar, background',
'name': 'titlebarbackground', 'value': '', 'type': 'color'}
titlebarcolor = {
- 'label': 'Title bar, foreground', 'name': 'titlebarcolor', 'value': '', 'type': 'color',
- 'additional': """<label>Icons theme:</label> <select name="css-addopt-icon-theme" class="add_opt">
- <option value="default">default</option>
- <option value="dark"%(titlebarcolor_dark)s>dark</option>
- <option value="white"%(titlebarcolor_white)s>white</option>
- </select>"""}
- titlebarcolor_dark = ''
- titlebarcolor_white = ''
+ 'label': 'Title bar, foreground', 'name': 'titlebarcolor', 'value': '', 'type': 'color'}
if self.css is not None:
for css_line in self.css.split('\n'):
@@ -209,17 +201,6 @@ class Neighborhood(MappedClass):
m = re_color_titlebar.search(css_line)
if m:
titlebarcolor['value'] = m.group(1)
- m = re_icon_theme.search(css_line)
- if m:
- icon_theme = m.group(1)
- if icon_theme == "ffffff":
- titlebarcolor_dark = ' selected="selected"'
- elif icon_theme == "454545":
- titlebarcolor_white = ' selected="selected"'
-
- titlebarcolor[
- 'additional'] = titlebarcolor['additional'] % {'titlebarcolor_dark': titlebarcolor_dark,
- 'titlebarcolor_white': titlebarcolor_white}
styles_list = []
styles_list.append(projecttitlefont)
@@ -254,19 +235,8 @@ class Neighborhood(MappedClass):
{'bgcolor': css_form_dict['titlebarbackground']}
if 'titlebarcolor' in css_form_dict and css_form_dict['titlebarcolor'] != '':
- icon_theme = ''
- if 'addopt-icon-theme' in css_form_dict:
- if css_form_dict['addopt-icon-theme'] == "dark":
- icon_theme = ".pad h2.dark small b.ico {background-image: url('%s%s');}" % (
- g.theme_href(''),
- 'images/neo-icon-set-ffffff-256x350.png')
- elif css_form_dict['addopt-icon-theme'] == "white":
- icon_theme = ".pad h2.dark small b.ico {background-image: url('%s%s');}" % (
- g.theme_href(''),
- 'images/neo-icon-set-454545-256x350.png')
-
- css_text += "/*titlebarcolor*/.pad h2.title, .pad h2.title small a {color:%s;} %s\n" % (
- css_form_dict['titlebarcolor'], icon_theme)
+ css_text += "/*titlebarcolor*/.pad h2.title, .pad h2.title small a {color:%s;}\n" % (
+ css_form_dict['titlebarcolor'])
return css_text
http://git-wip-us.apache.org/repos/asf/allura/blob/446a0b8e/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 13c2808..7281554 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -352,17 +352,14 @@ class TestNeighborhood(TestController):
'css-projecttitlecolor': 'green',
'css-barontop': '#555555',
'css-titlebarbackground': '#333',
- 'css-titlebarcolor': '#444',
- 'css-addopt-icon-theme': 'dark'},
+ 'css-titlebarcolor': '#444'},
extra_environ=dict(username='root'), upload_files=[])
neighborhood = M.Neighborhood.query.get(name='Adobe')
assert '/*projecttitlefont*/.project_title{font-family:arial,sans-serif;}' in neighborhood.css
assert '/*projecttitlecolor*/.project_title{color:green;}' in neighborhood.css
assert '/*barontop*/.pad h2.colored {background-color:#555555; background-image: none;}' in neighborhood.css
assert '/*titlebarbackground*/.pad h2.title{background-color:#333; background-image: none;}' in neighborhood.css
- assert "/*titlebarcolor*/.pad h2.title, .pad h2.title small a {color:#444;} " \
- ".pad h2.dark small b.ico {background-image: " \
- "url('/nf/_ew_/theme/allura/images/neo-icon-set-ffffff-256x350.png');}" in neighborhood.css
+ assert "/*titlebarcolor*/.pad h2.title, .pad h2.title small a {color:#444;}" in neighborhood.css
def test_max_projects(self):
# Set max value to unlimit
http://git-wip-us.apache.org/repos/asf/allura/blob/446a0b8e/Allura/allura/tests/model/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_neighborhood.py b/Allura/allura/tests/model/test_neighborhood.py
index c18b608..ae0f1dd 100644
--- a/Allura/allura/tests/model/test_neighborhood.py
+++ b/Allura/allura/tests/model/test_neighborhood.py
@@ -60,22 +60,17 @@ def test_neighborhood():
'titlebarbackground': u'#555',
'projecttitlefont': u'arial,sans-serif',
'projecttitlecolor': u'#333',
- 'titlebarcolor': u'#666',
- 'addopt-icon-theme': 'dark'}
+ 'titlebarcolor': u'#666'}
css_text = neighborhood.compile_css_for_picker(test_css_dict)
assert '#333' in css_text
assert '#444' in css_text
assert '#555' in css_text
assert '#666' in css_text
assert 'arial,sans-serif' in css_text
- assert 'images/neo-icon-set-ffffff-256x350.png' in css_text
neighborhood.css = css_text
styles_list = neighborhood.get_css_for_picker()
for style in styles_list:
assert test_css_dict[style['name']] == style['value']
- if style['name'] == 'titlebarcolor':
- assert '<option value="dark" selected="selected">' in style[
- 'additional']
# Check neighborhood custom css showing
neighborhood.features['css'] = 'none'