Skip to content

Fix CSS paths rev #2#2124

Closed
marjohn56 wants to merge 1 commit intoopnsense:masterfrom
marjohn56:Fix-CSS-paths-#2
Closed

Fix CSS paths rev #2#2124
marjohn56 wants to merge 1 commit intoopnsense:masterfrom
marjohn56:Fix-CSS-paths-#2

Conversation

@marjohn56
Copy link
Member

change css paths in default.volt and head.inc to use theme paths.

Copy *.css files from opensense/www/css to opnsense/www/themes/opnsense/build/csss EXCEPT the *font.css

change css paths in default.volt and head.inc to use theme paths.

Copy *.css files from opensense/www/css to opnsense/www/themes/opnsense/build/csss EXCEPT the *font.css
@fichtner fichtner self-assigned this Jan 23, 2018
@fichtner
Copy link
Member

So I agree with this, but we need to make sure we put a symbolic link to the old location in order to not break any other pages that would expect those files where they are. Let me take care of this post-merge this afternoon.

@fichtner fichtner requested a review from AdSchellevis January 23, 2018 08:52
@fichtner
Copy link
Member

I revise that last comment: break existing themes that users may have created and that are missing those files... a symbolic link will not entirely fix it... mhhh...

@marjohn56
Copy link
Member Author

I did do a global search for all references and I think I have got them all.

That was also the reason for leaving the existing css files where they are too. :)

@AdSchellevis
Copy link
Member

I agree we should move all css into the theme directory, but we should add some glue here to use the default when there's none specified to avoid breakage. I'll let this here for a moment, as soon I'll have time to fix the "use default" I will pull this in.

@fichtner fichtner assigned AdSchellevis and unassigned fichtner Jan 23, 2018
AdSchellevis added a commit that referenced this pull request Jan 27, 2018
…ersal theme_file_or_default() template function.

The legacy code will still use a plain file_exists() for the optional theme.js, which keeps both in a working state after this commit.
To be able to move more files into the template directories for #2124 we need to keep existing plugins functional, so we could integrate these changes into a minor release.
@AdSchellevis
Copy link
Member

@marjohn56 I would like to suggest that we don't rename the files that are in there now to retain backwards compatibility with the theme's already in place, cbcb9da contains a fix to use theme versions as overrides.

To overlay jquery.tokenize.css in the new code, we can now use the following:

<link rel="stylesheet" type="text/css" href="{{theme_file_or_default('/css/jquery.tokenize.css', theme_name)}}

Shall I rewrite the template files (both new and legacy) to support both, or do you want to give it a try?

@marjohn56
Copy link
Member Author

It will take you far less time to do it than me and it will be correct first time. :)

@AdSchellevis
Copy link
Member

@marjohn56 ok, no problem, I'll keep this PR open until it's fixed.

@marjohn56
Copy link
Member Author

The only other part of the themes that needs correction, but will need a full re-write as it's old style is the gateways.php files. Currently they are using fixed colours and I have no idea where to start on that.

AdSchellevis added a commit that referenced this pull request Jan 28, 2018
@AdSchellevis
Copy link
Member

@marjohn56 this 2461ca2 should provide you with the possibility to override the css files in your theme. @fichtner this won't solve the duplication of fonts, because their compiled into the theme css. Maybe we better leave those as they are.

fichtner pushed a commit that referenced this pull request Feb 5, 2018
… new and legacy code

PR: #2124

(cherry picked from commit 2461ca2)
(cherry picked from commit cbcb9da)
(cherry picked from commit 1fbbece)
(cherry picked from commit 15bb3ac)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants