-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme manager: improvements #732
Conversation
{loop="$theme_available"} | ||
<option value="{$value}" | ||
{if="$value===$theme"} | ||
selected="selected" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think selected
takes no value (else W3C checkers raise an error):
<option value="toto" selected>Toto</option>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, both are valid. But I thought that only selected="selected"
was.
@@ -43,7 +43,7 @@ License: CC-BY (http://creativecommons.org/licenses/by/3.0/) | |||
Copyright: (c) 2014 Designmodo | |||
Source: http://designmodo.com/linecons-free/ | |||
|
|||
Files: images/floral_left.png, images/floral_right.png, images/squiggle.png, images/squiggle2.png, images/squiggle_closing.png | |||
Files: images/floral_left.png, images/floral_right.png, images/squiggle.png, images/squiggle_closing.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but there seems to be a regression regarding the positioning of the squiggle
on the Daily page: it used to be on the right and is now displayed on the left
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any breaking change recently, it may have changed a long time ago. I'll fix it.
* | ||
* @return array List of theme names. | ||
*/ | ||
public static function getThemes($tplDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to create a ThemeUtils
class to encapsulate theme operations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, why not.
*/ | ||
public function testGetThemesEmpty() | ||
{ | ||
mkdir('sandbox/tpl/', 0777, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsafe: this will leave a world-writable folder in case the tests fail
suggestions:
- create the folder in
setUp()
orsetUpClass
and remove it intearDown
ortearDownClass
0755
should be sufficient, theme directories do not need to be writable by the HTTP server user/group
@@ -328,4 +331,48 @@ public function testCheckCurrentResourcePermissionsErrors() | |||
ApplicationUtils::checkResourcePermissions($conf) | |||
); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsafe: this will leave world-writable folders in case the tests fail
suggestions:
- create a parent folder in
setUp()
orsetUpClass
and remove it intearDown
ortearDownClass
0755
should be sufficient, theme directories do not need to be writable by the HTTP server user/group
b50d341
to
cadbc84
Compare
cadbc84
to
508e398
Compare
Updated and rebased! |
@@ -1151,6 +1153,8 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
else // Show the configuration form. | |||
{ | |||
$PAGE->assign('title', $conf->get('general.title')); | |||
$PAGE->assign('theme', $conf->get('resource.theme')); | |||
$PAGE->assign('theme_available', ApplicationUtils::getThemes($conf->get('resource.raintpl_tpl'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shaarli\ThemeUtils::getThemes(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caught not testing :o
508e398
to
01c6e32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with @kalvn's Material theme
How to make theme compliant? |
Ok. So no need meta file or standardised CSS for now? |
Nope. |
Speeding things up a bit regarding #705:
ApplicationUtils
inc/
folder in theme directory renamed tocss/
fixes #22 #502
closes #705
ping @Knah-Tsaeb