How does theming for ziya charts work? - ruby-on-rails

I'm implementing charts using The Ziya Charts Gem. Unfortunately, the documentation isn't really helpful or I haven't had enough coffee to figure out theming. I know I can set a theme using
chart.add(:theme, 'whatever')
Problem: I haven't found any predefined themes, nor have I found a reference to the required format.

If you install the ZiYa plug-in into your Rails application there should be a themes directory where you said. Just copy one of the existing themes, change its name to whatever you want, and then modify it however you like.
Another options for nice Flash charts is Open Flash Chart. I moved from Ziya/SWF Charts to Open Flash Chart when working on Flash charts in a Rails app I was working on. There is also a Rails plug-in for Open Flash Chart. Besides the fact that it is easier to work with, Open Flash Chart is open source, so if you can hack Flash you can customize it.

As I understand it, the themes are used by initializing the theme directory in your ziya.rb file like so:
Ziya.initialize(:themes_dir => File.join( File.dirname(__FILE__), %w[.. .. public charts themes]) )
And you'll need to set up the proper directory, in this case public/charts/themes. It doesn't come with any in there to start with as I recall. Are you having problems past this?

To partly answer my own question, there are some themes in the website sources which can be checked out at
svn co svn://rubyforge.org/var/svn/liquidrail/samples/charting
(then go to /public/charts/themes/)

Related

Blink.jl load(loadjs!/loadcss!/importhtml!) functions not working correctly

I hope someone here has used the Blink.jl package for building Julia and Electron apps.
I am having problems setting up and using it, though. The issue is with all of the functions in the api provided: load/loadcss/loadjs/importhtml. They do not seem to work, or I might be doing something wrong.
For example:
loadcss!(w, "styles.css")
does not apply any of the styles in the styles files in the directory.
importhtml!(w, 'index.html')
does not display the html page stored in the local directory. The app shows a blank screen.
I might be doing something wrong as i could not find documentation on how to use the package
I think I found out why, the methods take the full path and not the relative paths, even if files are inside the same folder. So, something like this works:
loadcss!(w, "D:\project\styles.css")
but this won't work:
loadcss!(w, "styles.css")

prestashop 1.6 theme customization by module

I usually buy themes at ThemeForest for prestashop, and I want receive updates for themes. But sometimes i need modify couple .tpl from theme.
I found in documentation the "file structure" of a module. And exist a folder called /themes/[theme_name]/modules. It is used for "Sub-folder for overriding .tpl files and languages files, if necessary." It looks like only for override modules inside of theme.
My Question:There are any way of override the .tpl of theme root folder using a module?.
This way I updated theme from themeforest without problems and after i can reinstall my module for customization of theme.
My Solution by now: The only way I found, and I do not like, is to create another copy of a theme. but then not be able to receive updates of theme
You can't override a theme for now. This functionality will be introduced in Prestashop 1.7 currently in development.
If you create a new module you will not be able to override default template files defined by the core. Or you'll have to override core controllers to use your templates then you'll lose core updates.
The simplest way to do so for now is to copy the theme and after each updates check for changes and report those changes into your copy...
Florian's answer is absolutely correct and until PS 1.7 certainly the recommended way to go.
I Just wanted to throw in that, if your changes are likely to be far fewer than those of theme updates, it could be worthwhile to create modified templates, say product_mod.tpl, and then override the initContent() function in the controller to show your modified template. You would then only need to compare the changes for the files you modified.
But, this would only be worthwhile if your modifications are much fewer than the changes in theme updates.

Embed PDF in a website, allow user to modify editable fields in PDF, and save back to the server

I am writing a Program in Rub On Rails 4.x and I have to take PDF files with defined fields that can be filled out, fill in data from a form submission(This part is DONE!), and lastly allow the user to modify the saved PDF file on the server and overwrite said PDF after making their modifications.
Like I said I have already gotten the PDF files filled out with what has been submitted in the form through pdftk . What I now need to do is provide a server side editing capability to the said PDF files on server generated from the first step of the process.
I have seen similar posts but none wanting to do the same thing I do. If I am wrong links would be great. Thanks in advance for all your help!
After lots of digging and research here is what I have found to be the facts surrounding this issue and implementing a program to allow embedding the PDF file, editing it, and saving it back to the server. This process would be great however from what I can tell there is nothing out there that really does this for Ruby On Rails. To quote #Nick Veys
Seems like you need to find a Javascript PDF editor you can load your PDF into, allow the user to modify it, and ultimately submit it back to the server. Seems like they exist, here's one for ASP projects
You are correct but still wrong in the sense that yes there is one for ASP projects however that is Microsoft Based, yes I know that it can run on Linux environments through Mono. However to the point it would appear in this instance that a Ruby On Rails specific solution is indeed needed.
The solution that we have come up with is as follows
1. Use a PDF editing package in the linux repositories like PDFtk
2. You then render a page with the PDF embeded on one side and a form representing the live fields in the PDF to take input.
3. Once submitted you use PDFtk to write the values into a new template PDF file and overwrite what was previously stored.
This requires a few additional steps to process the data than I really care for myself. However it is the best solution that our team could come up with, without bleeding the project budget dry for just 1 piece of functionality.
I hope this helps anyone else looking to do the same thing in Ruby On Rails.
I have done something like this using my company's .NET product. It can also be done using its Java version too.
http://www.gnostice.com/nl_article.asp?id=255&t=Save_Form_Submit_Data_Back_To_Original_PDF_Document_In_NET

Online Addon Builder - How to display custom icon for the extension inside Firefox's Addon Manager

Online Addon Builder - How to display custom icon for the extension inside Firefox's Addon Manager?
I know that's a more general question and before I can even submit this someone is going to throw a link at me but I've been there trust me...
I've built my addon using the online addon builder but I'm not ready to submit it to AMO for review quite yet as I feel it needs more to be complete. I can't find specific information relevant to exactly what I want to do using to online addon builder. I've installed and configured the localized SDK that is utilized using a tool called cfx and of course theres tons of documentation!
The Question: What all notable values can be set using the package.json that determine how the addon is displayed inside Addon Manager? What notable material/configurations can't be set using package.json and how do I implement them?
I've removed all warning and errors from my code but I'm using a hardcoded path to a image whereas before I was passing it as an arguement within the PageMod object to a content script. Why? I'm not sure but I know one of you know how to configure the extension where I can specify chrome://ez-magnetz/data/icon16.png or somehing similar. Which is better than using a JUID in the path name that can change.
My widget has an icon but how do I specify a primary icon for the extension to be displayed in the AM? (package.json||chrome.manifest)
Using the latter of the two(chrome.manifest) how do I include that inside my addon so that its detected?(For the purpose of an Extension Icon using the online addon builder if possible)
Will someone please provide me with a chrome.manifest template for a basic addon?
Do I need the install.rdf and what has precedence over configuration is it like:
install.rdf>>>chrome.manifest>>>package.json
I noticed very similar settings amongst them.
I've been to XUL school I see that there is useful information it just seems outdated in the context of my addon.
I've read the basic info on the package.json and implemented simple prefs and of course the addon's description.
My understanding is that I've created a bootstrapped addon using
Mozilla's Online Addon Builder. Is that correct? The only thing I
wish to do now is to have a personal icon displayed for my extension
in the Addon Manager!
+ I'd like to know how I may have and option for users to donate on AMO!
Thanks for any help in advance
To add an icon, just follow these two steps:
upload the icon you want to use to the data directory of your add-on, eg 'data/icon.png'
Add the relative path to the png file as an extra JSON property in the add-on info dialog, for example this:
{
"icon": "data/icon.png"
}
See this screenshot for an example of what it should look like:
https://dl.dropbox.com/u/44296964/Screen%20Shot%202013-01-07%20at%202.15.49%20PM.png
Aside: please only ask one question per post.

Easy way to find a view file in rails?

I develop rails applications with my designer who has minimum knowledge about rails.
She works on Windows through file-sharing from a Linux server.
She always has hard time finding view files to work on.
I usually use 'grep' to find a view file.
But she can't.
If you have a good suggestion, please share with me.
I have an idea which may be overkill.
Is there a way to automatically add comments around view files (including layouts and partials?) in html file?
Like this:
<!--Starting app/views/some_dir/some_file.html.erb-->
HTML here...
<!--Ending app/views/some_dir/some_file.html.erb-->
This way, my designer can find the file very easily.
Of course, this should be automatic and development environment only.
Thanks.
Sam
I use the Rails Footnotes gem (https://github.com/josevalim/rails-footnotes) in some of my projects which allows me to click a link in the footer of my app that opens the current view (also shows partials) in TextMate. Not sure if it could be customised to work with a Windows text editor but you could look at the URL to work out the file name.
I.e to open a file in MacVim, it creates the following link:
mvim://open?url=file:///Users/steveholt/Sites/foo/app/views/projects/log.html.haml
and for TextMate:
txmt://open?url=file:///Users/steveholt/Sites/foo/app/views/projects/log.html.haml

Resources