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

#502 Change templates set through administration UI #705

Closed
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@Knah-Tsaeb

Knah-Tsaeb commented Dec 7, 2016

Hi,
I make a theme changer refer #502 and #22.
In this change,

  • I decide to tpl dir cannot be set, is always tpl (like plugins dir), but I think is not really a problem. All theme are in tpl dir.
  • I move the original theme in tpl/Default
  • I add in configure page a new select option (old theme need to be update)
  • I have test with fresh install and update from old config format
  • I add a new function for return list of available theme and I put it on applications/Utils.php ( no idea if is a good place)
  • I not move image from images to tpl/Default/images, for not break other theme.

Have a nice day !

@Knah-Tsaeb

This comment has been minimized.

Show comment
Hide comment
@Knah-Tsaeb

Knah-Tsaeb Dec 7, 2016

Huuuuu, test fail : (
I'm not using test, if anyone can look a problem.

Knah-Tsaeb commented Dec 7, 2016

Huuuuu, test fail : (
I'm not using test, if anyone can look a problem.

@ArthurHoaro

This comment has been minimized.

Show comment
Hide comment
@ArthurHoaro

ArthurHoaro Dec 7, 2016

Member

Hi! Thanks for your contribution!
You can run and fix tests using make test in Shaarli's root directory.

A few general remarks though:

  • why did you hard code tpl instead of using raintpl_dir+theme settings?
  • prefer lower case folder name (default).
  • the CSS should also be moved under the theme directory.
  • the doc/ folder is auto generated from Github's wiki.
Member

ArthurHoaro commented Dec 7, 2016

Hi! Thanks for your contribution!
You can run and fix tests using make test in Shaarli's root directory.

A few general remarks though:

  • why did you hard code tpl instead of using raintpl_dir+theme settings?
  • prefer lower case folder name (default).
  • the CSS should also be moved under the theme directory.
  • the doc/ folder is auto generated from Github's wiki.

@ArthurHoaro ArthurHoaro added in progress and removed in review labels Dec 7, 2016

@Knah-Tsaeb

This comment has been minimized.

Show comment
Hide comment
@Knah-Tsaeb

Knah-Tsaeb Dec 7, 2016

why did you hard code tpl instead of using raintpl_dir+theme settings?

Why not ? I don't find a good reason for personalise this setting. But why not.

prefer lower case folder name (default).

Me not ;-), I consider a name of template like proper name like title of book or music. Is a personal preference and vision, not a rule or law.

the CSS should also be moved under the theme directory.

Sorry I not precise for CSS, yes they move into tpl folder, and the user.css keep in inc dir for non breaking existing user personalisation.

the doc/ folder is auto generated from Github's wiki.

Ok my bad, I undo this.

I try to fix test tomorrow, now is children time.

Knah-Tsaeb commented Dec 7, 2016

why did you hard code tpl instead of using raintpl_dir+theme settings?

Why not ? I don't find a good reason for personalise this setting. But why not.

prefer lower case folder name (default).

Me not ;-), I consider a name of template like proper name like title of book or music. Is a personal preference and vision, not a rule or law.

the CSS should also be moved under the theme directory.

Sorry I not precise for CSS, yes they move into tpl folder, and the user.css keep in inc dir for non breaking existing user personalisation.

the doc/ folder is auto generated from Github's wiki.

Ok my bad, I undo this.

I try to fix test tomorrow, now is children time.

@ArthurHoaro

This comment has been minimized.

Show comment
Hide comment
@ArthurHoaro

ArthurHoaro Dec 7, 2016

Member

Why not ? I don't find a good reason for personalise this setting. But why not.

Someone might be already using it, and there is no apparent reason to remove this feature.

Me not ;-), I consider a name of template like proper name like title of book or music

Maybe, but I was talking about the folder name: all folders are in lower case in Shaarli (well, except in tests). That's not very important, but I'd like to keep consistency.

Good luck with the tests, feel free to ask if you need help.

Member

ArthurHoaro commented Dec 7, 2016

Why not ? I don't find a good reason for personalise this setting. But why not.

Someone might be already using it, and there is no apparent reason to remove this feature.

Me not ;-), I consider a name of template like proper name like title of book or music

Maybe, but I was talking about the folder name: all folders are in lower case in Shaarli (well, except in tests). That's not very important, but I'd like to keep consistency.

Good luck with the tests, feel free to ask if you need help.

@Knah-Tsaeb

This comment has been minimized.

Show comment
Hide comment
@Knah-Tsaeb

Knah-Tsaeb Dec 8, 2016

Ok, one test fail on my machine, but work on Travis, yeah \o/

Knah-Tsaeb commented Dec 8, 2016

Ok, one test fail on my machine, but work on Travis, yeah \o/

@ArthurHoaro

Hi! I've reviewed your PR and made a bunch of comments to improve it. Nothing major, but it requires attention.

Show outdated Hide outdated index.php
@@ -28,9 +28,9 @@
</div>
<div class="dailyTitle">
<img src="../images/floral_left.png" width="51" height="50" class="nomobile" alt="floral_left">
<img src="../../images/floral_left.png" width="51" height="50" class="nomobile" alt="floral_left">

This comment has been minimized.

@ArthurHoaro

ArthurHoaro Dec 8, 2016

Member

In RainTPL you can use src="images/floral_left.png#", the # meaning it will create a path from the root directory.
But aren't these image theme related?

@ArthurHoaro

ArthurHoaro Dec 8, 2016

Member

In RainTPL you can use src="images/floral_left.png#", the # meaning it will create a path from the root directory.
But aren't these image theme related?

Show outdated Hide outdated tpl/default/includes.html
Show outdated Hide outdated tpl/default/linklist.html
Show outdated Hide outdated tpl/default/shaarli.css
Show outdated Hide outdated application/Utils.php
Show outdated Hide outdated application/PageBuilder.php
@@ -1148,6 +1149,7 @@ function renderPage($conf, $pluginManager)
$conf->set('general.timezone', $tz);
$conf->set('general.title', escape($_POST['title']));
$conf->set('general.header_link', escape($_POST['titleLink']));
$conf->set('resource.theme', escape($_POST['theme']));

This comment has been minimized.

@ArthurHoaro

ArthurHoaro Dec 8, 2016

Member

It might be a good idea to delete the page cache after writing this conf:

invalidateCaches($conf->get('resource.page_cache'));
@ArthurHoaro

ArthurHoaro Dec 8, 2016

Member

It might be a good idea to delete the page cache after writing this conf:

invalidateCaches($conf->get('resource.page_cache'));

This comment has been minimized.

@Knah-Tsaeb

Knah-Tsaeb Dec 8, 2016

That work without clearing cache. But I can add it.

@Knah-Tsaeb

Knah-Tsaeb Dec 8, 2016

That work without clearing cache. But I can add it.

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 3, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 3, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 3, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 3, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 3, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 5, 2017

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 5, 2017

@virtualtam virtualtam referenced this pull request Jan 5, 2017

Open

[Announcements] Releases / Roadmap #353

14 of 20 tasks complete

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this pull request Jan 7, 2017

@virtualtam virtualtam referenced this pull request Feb 10, 2017

Closed

How to change theme #780

portailp added a commit to PortailPro/Shaarli that referenced this pull request Mar 20, 2017

portailp added a commit to PortailPro/Shaarli that referenced this pull request Mar 20, 2017

portailp added a commit to PortailPro/Shaarli that referenced this pull request Mar 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment