<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Streamlined: Tag features</title>
    <link>http://streamlinedframework.org/articles/tag/features?tag=features</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stop banging rocks together and build something</description>
    <item>
      <title>How to customize the look of the list view</title>
      <description>&lt;p&gt;Whenever I talk to someone about Streamlined, they usually ask about how they can customize the look.  I&amp;#8217;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.&lt;/p&gt;


	&lt;p&gt;You can do this by creating a UI class for your model by executing &amp;#8220;rake streamlined:model &lt;span class="caps"&gt;MODEL&lt;/span&gt;=your_model_name&amp;#8221;.  This will create a ModelUI class in app/streamlined and affects the views for that model.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;ve tried Streamlined before, then you&amp;#8217;ll know that when you&amp;#8217;re viewing the list view for a model, then you&amp;#8217;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&amp;#8217;s a few more buttons with the most important one being the one to create a new model instance.&lt;/p&gt;


	&lt;p&gt;There&amp;#8217;s already pretty good documentation on how to modify which columns show up, so I&amp;#8217;m going to focus on the other options.&lt;/p&gt;


First, you can add custom headers and/or custom footers by adding the lines
&lt;pre&gt;header_partials :list =&amp;gt; 'shared/my_custom_header'&lt;/pre&gt;
&lt;pre&gt;footer_partials :list =&amp;gt; 'shared/my_custom_footer'&lt;/pre&gt;
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
&lt;pre&gt;quick_delete_button false&lt;/pre&gt;

Third, you can turn off the edit button for each row.  
&lt;pre&gt;quick_edit_button false&lt;/pre&gt;

Fourth, if your model is read only, then you can turn off the new and edit buttons by adding the line
&lt;pre&gt;read_only true&lt;/pre&gt;
Note that you can still delete, so you&amp;#8217;ll have to specify quick_delete_button false like above if you want that.  I&amp;#8217;m not sure if that&amp;#8217;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
&lt;pre&gt;table_row_buttons false&lt;/pre&gt;

Sixth, you can turn off pagination via
&lt;pre&gt;pagination false&lt;/pre&gt;

Seventh, you can turn off filtering via
&lt;pre&gt;table_filter false&lt;/pre&gt;

Eighth, you can add custom &lt;span class="caps"&gt;CSS&lt;/span&gt; styles via
&lt;pre&gt;style_classes :list =&amp;gt; {:row =&amp;gt; 'person_row'}&lt;/pre&gt;
which means that each row will have a &lt;span class="caps"&gt;CSS&lt;/span&gt; class person_row which you can then specify in a stylesheet.

	&lt;p&gt;That&amp;#8217;s it for customizing the list view declaratively.  I&amp;#8217;ll make sure all of this gets into the wiki.  Please let me know if I missed anything.  If there&amp;#8217;s another way you&amp;#8217;d like to customize the list view, please add a ticket in Trac or leave a comment here.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Jul 2007 00:21:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:fd734609-98d7-45b5-a8a1-ffd572263206</guid>
      <author>Luis</author>
      <link>http://streamlinedframework.org/articles/2007/07/21/how-to-customize-the-look-of-the-list-view</link>
      <category>Features</category>
      <category>News</category>
      <category>list</category>
      <category>options</category>
      <category>features</category>
      <trackback:ping>http://streamlinedframework.org/articles/trackback/142</trackback:ping>
    </item>
    <item>
      <title>Build is Up</title>
      <description>&lt;p&gt;Yikes.  So, I’ve been in Canada all weekend at a conference, and my hard drive had a catastrophic failure.  I’ve been fighting it ever since, hence the extra two days to get the build up.  We’ve had to remove two features from this build due to lost work: Lightbox support (as an alternate to Prototype Windows) and Bill Katz’s Authorization plugin (we’ll release an 0.0.6 &lt;span class="caps"&gt;&lt;span class="caps"&gt;ASAP&lt;/span&gt;&lt;/span&gt; with just that in it).&lt;/p&gt;

&lt;p&gt;That being said, here’s what’s in 0.0.5:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Better error messages&lt;/b&gt;. We’re now dropping notes into the logs and on screen that tell you what happened as much as possible (no such relationship, no such type, Sparklines not installed, etc.).  If you have a weird problem, check the log for anything that starts with “STREAMLINED”.&lt;/li&gt;

&lt;li&gt;&lt;b&gt;New relationship syntax&lt;/b&gt;.  Don’t worry, the original syntax still works, but for all new models, use the new syntax.  It looks like this:
&lt;code&gt;
relationship :line_items, :view =&amp;amp;gt; {:name =&amp;amp;gt; :membership}, 
                       :summary =&amp;amp;gt; {:name =&amp;amp;gt; :list, :fields =&amp;amp;gt; [:customer, :amount]}
&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Sparklines Integration&lt;/b&gt;. This one requires RMagick to be installed and will try to tell you if it isn’t.  It also requires you to install the Sparklines plugin to the app before you run it.  The only graph we’ve implemented so far is a pie chart of the ratio of items associated to the total number of possible items.  Here’s the syntax example:

&lt;code&gt;
relationship :line_items, :summary =&amp;amp;gt; {:name =&amp;amp;gt; :graph, :type =&amp;amp;gt; :pie}
&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Optional pagination&lt;/b&gt;. There is a generator flag (—no-pagination) that will turn pagination off by default. Regardless of which you choose (on or off) you can override it in the _ui file.
&lt;code&gt;
class line_item_ui &amp;amp;lt; Streamlined::UI
    pagination true  # or false
end
&lt;/code&gt;

&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Uses Rails’ model generators&lt;/b&gt;. If Streamlined tries to create a model class for you, it will use Rails’ model generator instead of the custom one previously provided.  The models will now have unit and functional tests, etc.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Overlib integration&lt;/b&gt;. You simply specify one or more columns on your class as popup_columns, and fill in the body of _popup.html to display the appropriate information. Example:
&lt;code&gt;
class LineItemUI &amp;amp;lt;&amp;amp;lt; Streamlined_UI.rhtml
   popup_columns :name, :total
end
&lt;/code&gt;
 &lt;/li&gt;

&lt;li&gt;&lt;b&gt;acts_as_authenticated&lt;/b&gt;.  If you choose this option (—authentication=AAA), Streamlined will attempt to install the plugin from the remote repository.  It will then run the generator, which will create a model (user), a controller (account), and some login/logout views under app/views/account/.  It will also create a migration for User, and one to add a default user (username=admin, password=admin). Make sure to run them before launching the app.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;We’ll document all this much more thoroughly in the morning, but if you are just too anxious, you can&lt;a href="http://streamlinedframework.org/streamlined_generator-0.0.5.gem"&gt;&lt;span class="link-ico"&gt;&lt;span class="ico-external"&gt;&lt;/span&gt;&lt;/span&gt; get it now&lt;/a&gt; and hope these docs are enough. &lt;/p&gt;</description>
      <pubDate>Tue, 10 Oct 2006 10:54:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0a911b17-f5eb-4d74-b927-ef88ced0af70</guid>
      <author></author>
      <link>http://streamlinedframework.org/articles/2006/10/10/build-is-up</link>
      <category>features</category>
      <category>release</category>
      <trackback:ping>http://streamlinedframework.org/articles/trackback/19</trackback:ping>
    </item>
  </channel>
</rss>
