activo
activo copied to clipboard
Formtastic support markup issue
Looks like the buttons in the demo theme don't match the expected formtastic output. I think this is a bit misleading from a documentation standpoint.
I realize that there's a button, rather than an input, but support for buttons is coming ( https://github.com/justinfrench/formtastic/issues/11 )
formtasic currently emits:
fieldset class="buttons"> ol> li class="commit button"> input class="create" id="model_submit" name="commit" type="submit" value="Create model"> /li> /ol> /fieldset>
To claim formtastic support, rather than using a div wrapper, the demo and styles should be changed to a field set.
Please let me know if you're interested in such a change, and i'll fix the style and submit a pull. I'd have just sent a pull request, but it looks like the demo is hosted at http://activo.dmfranc.com/preview/ rather than on the pages in the github branch.
Hello,
You are right about the buttons. The gh-pages branch is still about the first version of activo. But the preview page at http://activo.dmfranc.com/preview/ is the same as the activo.html file, in the root directory of the activo-2 branch.
If you're interested, in this gist is what I usually do when I use the theme: https://gist.github.com/1061491. It's in the comments (I basically use a normal button with a class "button").
I would really appreciate if you could fix this and send me a pull request. Thanks for using the theme and for filling this issue!
Are you still maintaining activo1?
off topic: Also, are you interested in the activo-rails project? As this is set up as a theme, rather than something rails specific, I think it would be nice to get a whole bunch of rails specific documentation into activo-rails. see https://github.com/jellybob/activo-rails/issues/21
I don't want to duplicate work between the two projects, if I can help it. I've been striving to improve the documentation on using this theme, and have made some progress with contributions to jellybob's fork.
I will try to maintain both (I hope it doesn't get too time consuming).
I've seen activo-rails before and it looks very good. In the gist I shown you, most of the helpers are made by jellybob (starting at line 95). But I never used it extensively. Can you tell me if it does play nice with the web-app-theme plugin? I tried it once but I also haven't managed to find how to change the stylesheets. Are they kept inside the gem? I think there isn't a generator like there is in web-app-theme. Maybe I should ask @jellybob.
PS: I've been talking with the author of web-app-theme and created a version for him of the new branch, but it's not complete yet (however, this version will not include the formtastic_changes.sass and attrtastic_changes.sass).
I've been using the themed generator, with decent success. see https://github.com/standardtoaster/activo-rails/blob/master/README.md for my caveats.
@jellybob hasn't used web-app-theme, he just made a gem that would toss in the layout and give those helpers. It's a fork of your activo, so I'm unsure how pulls and pushes would work. I've asked him in another issue in his repo.
Is there a reason that web-app-theme doesn't support form/attrtastic? I think the helpers would be helpful ( ;) ) for their users as well. It would be pretty cool to be able to say something like layout 'web_app_theme', :theme => activo2 or something.
My intention was to write a formtastic generator for web-app-theme once i'd gotten my head around how these themes all work.
Side note: I've published a change to activo-rails that fixes formtasic HABTM checkbox formatting. Is there a decent way for that to be pushed back to here from @jellybob's fork? I'm pretty new to github, so this is a bit confusing.
About the side note: I'm not an expert on this subject but I think we can clone my repo, git fetch jellybob's fork and cherry-pick the specific commit (it's somewhat what it's asked here). The problem is that it seems the files are located in different places in the two repos...
Since activo-rails works well with web-app-theme, maybe we should focus on his fork. His helpers probably work with @pilu's web-app-theme.
And just like you said, it would be cool if we could generate formtastic forms using web-app-theme (with a specific option for formtastic). It seems @andreferraro made something similar already: https://github.com/andreferraro/web-app-theme.
What I don't like about web-app-theme, and DO like about activo-rails is that there's no copy of assets into your project.
It would be nice if web-app-theme was an engine with some scaffold generators, rather than just a generator. It would make it way easier to switch themes. In fact, I'm starting to think it would be a good idea to extract the generators from @andreferraro into activo-rails, and start a newish project. This would also make it easier to take one of the web-app-themes, change the colours around or something, then re-contribute it back. Also, CSS updates and such would magically appear in apps when the gem updates.
But the assets web-app-theme copies are the themes you choose and the layout, right? I think it's understandable, because most of the times you need to change the theme (personally, I often use activo but I always change the iconset, colors, fonts etc. from project to project) and the layout.
What you like about activo-rails it's what I dislike about it :P But I totally understand your point of view and the benefits associated.
PS: I edited your comment because I typed the wrong username in my previous comment.
Hi there,
One thing to keep in mind here is that it seems we're both focused on Activo 2 at the moment - @tobsch has been working on updating activo-rails for Rails 3.1, and to use the Activo 2 assets. Given that, I think we should be basing this conversation around that.
I more then happy for the Activo 1 version of Activo-rails to stick around, but I don't have a lot of free time at the moment so I don't want to be the one maintaining it. Since this is the sort of gem that really needs to be in place from the start to be useful I'm not planning to support older versions of Rails once 3.1 is officially released.
@dmfrancisco - the core Actvio assets are kept inside the gem, for the new version we have a script which pulls in the latest version of your Activo 2 branch and then puts everything in the right place which will make keeping up with changes much easier.
If you're interested I'd love to work more closely on the Rails support. Personally I'm not a fan of the web-app-theme plugin, since it fills my project with files which aren't actually related to what I'm doing. That can certainly make things a bit clearer for folks who are new to Rails, but long term I think the approach of using an engine is far more effective, and makes updating to newer versions a lot less error prone (upgrading my main Actvio application to Activo 2 took me all of 30 minutes, including the upgrade to Rails 3.1).
Well, we can cover all of our bases by leaving in the Theme generator.
There should be a way to shove static assets into the public directory, so that you can statically serve assets without going through the rails stack, but overrides should likely be in specific files, so that you can always regenerate the theme without your changes getting wiped.
A good case in point is the formtastic enhancements that i'm looking at. If you re-ran the generator, you'd loose your changes, but if you wanted the updates, you'd have to manually merge them in (with web-app-theme)
I think for 90% of applications, an engine with customizations would be more than adequate, but i'd like to leave room for people who have higher traffic trying to use this setup.
I just noticed you commented while I was typing.
You can in fact override the defaults from Actvio-rails - either by adding extra styles in application.css, or replacing templates. Because of the way Rails' load order works if you put a template with the same name in your application then it will load that rather then the one from Activo. I've not tried this out, but I believe that will also be the case of any assets once we move to the Rails 3.1 asset pipeline.
Maybe the final solution should consist of three gems:
- activo (just the assets, asset pipeline compatible in app/assets as engine)
- activo-helpers (the @jellybob activo-rails as we know it)
- activo-web-app-theme (a compatibility layer for web_app_theme)
IMHO a theme generator is no really needed anymore with rails 3.1 but I don't want to flame around - It for sure has it's space.
I tend to write a lot of internal glue apps in rails, which heavily use scaffolds. Mostly, my stake is to make prettier scaffold apps with less effort. and formtastic.
Seeing that somebody has already modified web-app-theme, there's nothing we really need to do, except maybe leave some docs that let people know that you can use the web-app-theme generators with activo-rails, as it is. maybe also leave a nicer note in the activo readme as well.
I can submit my formtastic CSS fixes to the activo2 branch, and when you guys pull it in next, they'll all be there.
@standardtoaster I haven't looked into this in much detail, but I believe the new asset pipeline allows you to compile everything into static files for deployment, so that you can avoid hit the entire Rails stack just to serve up a stylesheet.
Personally I'm not sure that a separate activo-helpers gem makes a lot of sense. If people don't want to use the helpers there's nothing that forces them to, other then the ones that we require to place data in the header and sidebar, but even they could potentially be made optional by checking for an appropriately named partial if they're not present.
I'm certainly agreed on generators not being needed, but as you say, if someone wants them there's no reason to block that.
okay guys, maybe it is not needed. the only thing itching me, was that there are two gems at the moment (activo and activo-rails). I thought they both have a reason to live. Is the web_app generator-stuff needed in times of rails 3.1?
the generators give a scaffold. They're also a pretty good reference implementation if you don't' want to reverse engineer the demo page.
I like the separation of the two gems, as there may be non-rails users that want to leverage the theme. It also makes it easy to have it included in web-app-theme in the future AND be available via activo-rails for engine users.
Definitely changes will have to be made, for example, to formtastic_changes.sass and the web-app-theme base.css over time. In my comment I was referring to the style.sass file, which should be (like the web-app-theme themes) just about colors, alignments, etc., and so there shouldn't be a reason to update it (or add fixes to it) I guess. In my opinion, it's cleaner to modify this file than adding overriding styles.
But I like your ideas and were this is going :)
So if we're settled then, i'll do some CSS/documentation updates, and send a pull request to @dmfrancisco.
@jellybob has already merged my changes into activo-rails, so i'll send another pull request once i update the v1 theme with my new changes.
Then, when somebody updates activo2 in activo-rails, it will also have the changes, and we'll all be happy?
Last question. As activo-rails is a fork of activo, does anyone know how I can send pull requests to activo? activo just shows a "your fork" button :( Does activo-rails even have to be a fork from activo, as it should never really be sending pull requests?
EDIT: Sentence that didn't make sense
That's a very good point. Originally it was much closer to Activo, so I just forked, but when I get a moment I'll see if I can split it out into its own repo.
Sent from my iPad
On 2 Jul 2011, at 23:22, [email protected] wrote:
So if we're settled then, i'll do some CSS/documentation updates, and send a pull request to @dmfrancisco.
@jellybob has already merged my changes into activo-rails, So once he's merged my changes, i'll do a pull request into activo-rails with the integrated changes.
Then, when somebody updates activo2 in activo-rails, it will also have the changes, and we'll all be happy?
Last question. As activo-rails is a fork of activo, does anyone know how I can send pull requests to activo? activo just shows a "your fork" button :( Does activo-rails even have to be a fork from activo, as it should never really be sending pull requests?
Reply to this email directly or view it on GitHub: https://github.com/dmfrancisco/activo/issues/4#issuecomment-1490756
Hey @jellybob,
Any update on splitting activo-rails out into it's own repo?