ushahidi / Ushahidi_Web

Ushahidi v2. A platform that allows information collection, visualization and interactive mapping, allowing anyone to submit information through text messaging using a mobile phone, email or web form.
http://www.ushahidi.com
Other
901 stars 624 forks source link

Allow admins to tweak CSS from the admin UI #628

Open rjmackay opened 12 years ago

rjmackay commented 12 years ago

Similar to wordpress css override or theme editing in the admin

GAWDS commented 12 years ago

Yea, my WP theme has a CSS override box built right into the admin panel for super fast, on the fly theme adjustments and fine tuning. Helps a lot for testing styles for various media too.

alanning commented 12 years ago

Was trying to think of the easiest way to do custom overrides and best I could come up with is adding a check for the existence of a custom css file in a specific location which, if found, would be included (linked) as the last css include. (I believe if it is the last included that it will override any prior css definitions.) Could be something like "custom.css" in the root folder.

If the admin UI could edit that custom file, vs. say something stored in the database, it would be independent of Ushahidi versions and themes and therefore would not have to be handled in any upgrade scenarios.

Could implement in stages: first the check for the file to give the basic override capability and then add the admin UI as time permits.

GAWDS commented 12 years ago

Sounds good to me. And I know that in my WP theme, if the admin custom CSS box is empty it does nothing and if there's something added it appends the style.css file with the custom classes, etc at the bottom of the css list as you described above. Somehow it's got that check programmed.. not sure of the specifics.

ghost commented 12 years ago

the Ztyle plug-in at http://community.ushahidi.com/index.php/plugins/plugin/ztyle-admin-styler works similarly to what allanning suggests by forcing a specific style sheet to be the last css loaded. It is very simple code, so may not be bulletproof, but I've had no issues with it. It comes with a reasonably handsome (IMO, since I wrote it)style sheet as a starter. It doesn't style everything in the Admin interface, I just made it to style everything I've had occasion to look at. Rob Baker has also used it and may have some improvements or suggestions. Of course, it doesn't have its own UI, and it isn't bult-in. Both of those would be nice. I would prefer it use an external file rather than storing styles in a database. That way a dev cold use whatever toolset he is familiar with to edit the file.

rjmackay commented 12 years ago

@svandru I wasn't thinking about styling the admin UI.. but more changing the frontend styling FROM the admin UI.. ie. not having to edit a css file on the server to do basic styling tweaks. Theme CSS is already the last thing to be loaded on the frontend (or will be after some other changes I've made).

I'm not thinking so much of developers here: they can already just tweak the theme. More just to make it easy for administrators who aren't really developers to tweak things.

bodacea commented 10 years ago

I've added this to the V3 features wishlist at https://phabricator.ushahidi.com/T582; please feel free to continue working on this for V2.