Streamlined now Postgres-enabled

Posted by jgehtland Sun, 27 Jan 2008 10:55:19 GMT

Streamlined is now proud to be 100% Postgres-compliant. If you are a Postgres user, Streamlined now does everything you want and has a full test suite to prove it.

Posted in , ,  | 1 comment | no trackbacks

Streamlined goes test/spec

Posted by Jason Rudolph Fri, 21 Dec 2007 16:54:54 GMT

If you grab the latest edge Streamlined bits, you’ll want to make sure you have the test/spec gem installed. All the tests now use test/spec’s describe-style goodness, but it will take a while still to convert all the tests to have more meaningful behavior-driven names.

Posted in  | Tags , ,  | no comments | no trackbacks

Major Streamlined::UI Refactoring

Posted by Stu Fri, 27 Jul 2007 18:35:22 GMT

In the course of fixing a bug, I bit off of significant refactoring I have wanted to do for a while. Instead of saying this:

# old way 
class PoetUI < Streamlined::UI
  # declarative settings
end

You can now say this:

# new way
Streamlined.ui_for(Poet) do
  # declarative settings
end

The new syntax is more testable, since it does not rely on singleton methods and inheritance. It also makes it much easier to break the default 1-1 relationship between models and ui instances. The old syntax is still supported, via a bit of method_missing trickery. But I am sure there are some breakages, and I would like to deprecate the old syntax over time. Kick the tires and let me know if you have any problems.

Posted in ,  | no comments | no trackbacks

How to customize the look of the list view

Posted by Luis Sat, 21 Jul 2007 01:13:01 GMT

Whenever I talk to someone about Streamlined, they usually ask about how they can customize the look. I’m going to cover how to change the look of the list / index view as of the state of the edge before the 0.9 release comes out.

You can do this by creating a UI class for your model by executing “rake streamlined:model MODEL=your_model_name”. This will create a ModelUI class in app/streamlined and affects the views for that model.

If you’ve tried Streamlined before, then you’ll know that when you’re viewing the list view for a model, then you’ll see a paginated table that contains all the instances of the model. Each row has one instance, along with three buttons: one to go to the show view of the instance, the second to go to the edit view of the instance and a third to delete the instance. Below the table, there’s a few more buttons with the most important one being the one to create a new model instance.

There’s already pretty good documentation on how to modify which columns show up, so I’m going to focus on the other options.

First, you can add custom headers and/or custom footers by adding the lines
header_partials :list => 'shared/my_custom_header'
footer_partials :list => 'shared/my_custom_footer'
and then of course creating the header / footer partial and putting it in the place you specified. Second, you can turn off the delete button for each row. Perhaps you want to ensure that users delete from the show view or perhaps users should not delete instances of your model at all. Do this with
quick_delete_button false
Third, you can turn off the edit button for each row.
quick_edit_button false
Fourth, if your model is read only, then you can turn off the new and edit buttons by adding the line
read_only true
Note that you can still delete, so you’ll have to specify quick_delete_button false like above if you want that. I’m not sure if that’s the right behavior. Any thoughts on that? Fifth, you can turn off all the buttons that link to show/edit/delete by adding the line
table_row_buttons false
Sixth, you can turn off pagination via
pagination false
Seventh, you can turn off filtering via
table_filter false
Eighth, you can add custom CSS styles via
style_classes :list => {:row => 'person_row'}
which means that each row will have a CSS class person_row which you can then specify in a stylesheet.

That’s it for customizing the list view declaratively. I’ll make sure all of this gets into the wiki. Please let me know if I missed anything. If there’s another way you’d like to customize the list view, please add a ticket in Trac or leave a comment here.

Posted in ,  | Tags , ,  | 1 comment | no trackbacks

New in Edge: Render Filters

Posted by Matthew Mon, 25 Jun 2007 09:48:00 GMT

We’re excited to announce a new feature in Edge that will make it much easier to use Streamlined’s default actions while still having control over what gets rendered afterwards. Render filters allow you to tack additional code onto the end of a default action.

Matthew demonstrated these filters in a very early form at the Streamlined tutorial at RailsConf last month. They have since become much more useful and flexible. By using these filters, we’ve been able to stop copying and pasting default actions into our controllers only to make a single small change. Now, we can make the small change declaratively without redefining the action.

For example, what if you prefer that Streamlined redirect back to the list view instead of the show view after updating a record? You would add this render filter to your controller:

render_filter :update, :success => Proc.new {
  redirect_to :action => 'list'
}

What this says is that the Streamlined’s default update action should redirect back to the list action on success. (Render paths can also be defined for failure.)

The contents of the Proc are called in the context of the controller action itself, allowing you to redirect, assign new instance vars, etc. (Pretty much anything you can do inside a controller action.)

More examples and documentation can be found on the wiki.

Posted in  | 2 comments | no trackbacks

New Features in Edge

Posted by jgehtland Fri, 15 Jun 2007 10:55:19 GMT

Here’s some new features we’ve added in Edge, which are all documented over on the Wiki as well:

  • per-relationship options for modifying the display of the select box. If you need to pass options in to modify how the select box is displayed for a to-n relationship, you can do that with the
    :options_for_select
    attribute.
  • per-model-and-CRUD-context options for specifying a custom css class for items from that model. If, in your _ui.rb file, you do something like:
    class PersonUI < Streamlined::UI
       style_classes :list => {:row => 'person_row'}
    end
    
    Each row in the list (in LIST context only) will be wrapped in the CSS style “person_row”.
  • added an :update_only option for columns
  • added support for HTML wrappers around columns

And plenty more. Keep an eye on the Wiki and the Trac Timeline for more.

Posted in  | 2 comments | no trackbacks

New Screencasts Online

Posted by jgehtland Wed, 16 May 2007 21:52:05 GMT

We’ve just posted three new screencasts for the newest version of Streamlined, we hope you’ll enjoy them.

We’ll have many more online in the next few days, but here are the first. Enjoy! Feedback welcome!

Posted in ,  | no comments | 6 trackbacks

New Features in Edge Streamlined

Posted by jgehtland Sun, 06 May 2007 23:34:26 GMT

We’ve had a busy few weeks, so here’s an update on some of the new features we’ve added in Edge recently:

Enumerations

We’ve added the ability to denote a column as an enumeration. For example, in the sample project, an instance of Team has a column called :sport. It contains a string, but instead of being a free input, by making it an enumeration, the user is given a drop-down which provides them their options. The syntax looks like this:

user_columns :sport, {:enumeration => Sport.SPORTS}

The value passed to :enumeration can be any array.

Associations editable everywhere

In the original version of Streamlined, associations were only editable through Ajax from the list view. During create and edit, the associations were hidden. Now, associations can be edited from list, edit or create views, and by default, all three. To change that behavior, you can use any of the following options:

  • :read_only. The association only displays, cannot be edited in any view.
  • :create_only. The association can only be edited during creation of the record.
  • :edit_in_list => false. Turns off editing of the association in the list view.

Usage:

user_columns :players, {:edit_in_list => false},
                    :coach, {:create_only => true},
                    :mascot, {:read_only}

Unassigned in drop-down

Streamlined has long had a feature that attempts to detect if you have validations on an association that require it to be filled in. If so, Streamlined removes the “Unassigned” option from the drop-down, preventing the user being presented with an invalid choice. In Edge, we’ve expanded that behavior, and now you can provide a global or per-model override to the text “Unassigned”.

Usage:

user_columns :coach, {:unsassigned_value => 'None'}

Ability to suppress quick delete button from list view

You can now turn off per-row delete buttons in the list view by marking quick_delete_button as false.

Usage:

class TeamUI < Streamlined::UI
   quick_delete_button false
end

Disabling live filtering

You can also disable the display of the filter box on any list view by marking table_filter as false.

Usage:

class TeamUI < Streamlined::UI
   table_filter false
end

That’s a pretty good list for now. We’ll be talking about more changes in upcoming posts. Don’t forget to check out the sample project for real examples of the plugin in action.

Posted in  | no comments | no trackbacks

Updates on 0.1.0

Posted by jgehtland Thu, 22 Mar 2007 10:32:25 GMT

First of all, thanks to everybody who jumped in on the beta and has been sending comments. We know the code is in high flux, and those who have stuck with it, we appreciate the feedback a lot. Thanks!

Second, I’d like to give some previews to the kinds of changes you will find when we release the new codebase. Perhaps most importantly to a lot of you, the declarative syntax for managing columns and relationships has been simplified and combined. You can expect your old version:

class EmployeeUI < Streamlined::UI
   user_columns :name, :email, :hire_date

   relationship :boss, {:summary => {:name => :name, :fields => [:first_name, :last_name]}
end

to look more like this:

class EmployeeUI < Streamlined::UI
   user_columns  :name, {:link_to=>{:action=>'edit'}}, 
                        :email,
                        :hire_date, {:read_only=>true},
                        :boss, {:show_view=> [:name, {:fields=>[:first_name,:last_name]}]}

   edit_columns   :name, :email
end

As you can see, relationship are combined into columns, and order is maintained across both. So if you moved :boss up to right after :name, the relationship column for :boss would be the second column in the list table.

Also, the optional overrides ‘edit_columns’ and ‘show_columns’ give you a way to specify those subviews. If not specified, they simply inherit from the list view.

You might also notice the addition of :link_to as an option for any column, which can take the standard url_for or RESTful url methods, or a raw URL.

Another major change is that we’ve changed the default behavior for editing/showing to non-Ajax. Instead of Prototype Windows being the default, we’ll use standard redirects. However, switching between the two types is as simple as including the right helper in your controllers. And the decision can be per-controller. For example:

class DepartmentsController < ApplicationController
    acts_as_streamlined
    include Streamlined::Helpers::PrototypeWindowsLinkHelper
end

That will switch the DepartmentsController to use the Prototype Windows-style edit and show behavior. Obviously, to change the style app-wide, you would just include that helper in ApplicationController.

That’s probably enough for this brain dump; look for all of this over on the Trac wiki today, with a downloadable sample project as well.

Posted in ,  | no comments | no trackbacks

Pre-announcing: Streamlined 0.1.0

Posted by jgehtland Fri, 16 Mar 2007 13:58:55 GMT

We’re very pleased to announce the imminent release of Streamlined 0.1.0. We’ve been looking over the tickets, notes, comments, hate mail, etc. we’ve gotten and taken almost all of it to heart. Streamlined 0.1.0 is an entirely refactored codebase, and includes the following changes over 0.0.7.1:

  • 100% C0 code coverage
  • declarative column options for:
    • which view to render in (list, edit, new, show)
    • custom headers
    • read-only columns
    • abstracts columns (any method on the object available)
    • per-column link attributes (causes the value to be turned into a link to the provided URL)
    • per-column popup link
  • declarative model options for:
    • whether to show per-item action buttons in the list view (edit/delete/show)
    • use of non-ajax or ajaxified views
  • 100% unobtrusive javascript

These changes will lead to a host of new features over the next several weeks, including:

  • complete RESTful support for all views, including export formats
  • per-user configuration and preferences, including column ordering and default sort per-user
  • smart folder functionality per-model, with optional per-user smart folders
  • a more easily extended set of default relationship views
  • and, perhaps above all, documentation

We’re looking for testers right now. If you are interested, contact us at contact AT relevancellc DOT com or on the dicsussion list and we’ll give you access to the subversion Edge branch. We’ll publicly release Edge at the end of next week, and go 0.1 the week after that.

We’re really excited about release, and, if you look at the changes in the codebase, we think you will be too.

Posted in ,  | 1 comment | no trackbacks

Older Posts

Older Posts: 1 2