Files | Admin


Release Name: REL 0.3.4

= MasterView - Rails-optimized (x)html friendly template engine
== Recent changes (Release 0.3.4)
Added mv:generate_all_rhtml rake task which generates all rhtml files to make it
more obvious for users who want to generate the rhtml files. Also changed the way
gen_partial and import_render work with regards to collections, object, and locals,
they now retain the values from the page even after rebuild. This allows you to have
different values on each page and even different values on the same page if use partials
multiple times on a page.

Make values in gen_partial and import_partial retain their page specific values, allowing you to specify different locals, collections, or objects for import_render than you do on gen_partial. Also allows you to reuse the partial multiple times on a page with different values. (thanks James Britt)

Fix rebuild template so that it uses the same list of XHTML empty elements to determine whether to collapse empty elements (thanks to Brian Jordan)

Fixed a problem with CruiseControl where ActionController was not defined when masterview was initialized. (thanks James Britt)

== Recent changes (Release 0.3.3) - Maintenance release plus auto_copy
Added auto copy feature which can be configured to automatically copy static files
like stylesheets, images, and javascripts from a non-standard location to the proper
location at runtime (under Rails public). This makes it easy to use HTML prototypes
and associated files with MasterView eliminating any manual copying.

This release fix adds doctype to generated code, and a bug in gen_replace which
outputted <% %> rather than <%= %> (thanks Jon Frisby). Fixed defect in multipart
form and stylesheet_link directives (thanks Rajavel Lenin).

Made REXML sax2parser configurable. Generator now creates example for custom
admin auth mixin controlling authentication with custom code. (thanks David Koontz)

Fix defect which prevented MasterView to be used with Goldberg or other plugins which
alter the view base unless MasterView was configured to generate the rhtml files.

Fix rails runtime detection when running in RadRails which launches using -e

Added rake task mv:clean_mv_rhtml task which removes the MasterView generated rhtml
if you have configured MasterView to generate to the file system. Only removes
files that it generates leaving other rhtml untouched. This is useful when switching
to not generating rhtml mode when it was previously enabled.

== Release 0.3.2 - Maintenance release plus custom admin auth
This release addresses a compatibility problem with Rails 1.2 where a view syntax
error would not display the normal debug output but instead displayed only a blank
screen. Also fixed a parsing problem with multiple parameters in some directives.
Added the ability to use custom mixin for authorization to MasterView admin screens.
Changed the MasterView generator to use request, flash, and params rather than
deprecated @request, @flash, and @params. Tested with Rails 1.2.2

== Release 0.3.1 - Maintenance release
This release addresses an issue with ruby 1.8.5, fixes a problem with the
deprecated/directive_base used for custom directives, updates a few out of
date docs, and accomodates a change to the API of the Rails 1.2 generator

== Recent changes (Release 0.3.0 - Major update - refactoring of directive API (for developing directives)
The directive API for creating directives has been refactored and simplified
and improvements have been made to better support directive extensions through
directive load path configuration and enabling multiple namespaces in directive markup.
This will enable directives to be developed more easily by both core developers
and MasterView users. The end goal is to make it extremely simple for anyone to
create their own custom directives and to share those with the community, and
thus the project can live and grow into many specialty areas. The directive API
refactoring is one more step towards those goals.

The old directive_base.rb which provided the API and implementation framework
for directives has been deprecated and moved to deprecated/directive_base.rb.
MasterView developers who have developed custom directives are strongly
encouraged to upgrade those directives to the new API as soon as possible.

To provide backwards compatibility during a transition period, you can continue to
use the original directive implementation framework by requiring the
masterview/deprecated/directive_base.rb file in your directive implementation and
changing the directive class to inherit from DirectiveBaseOld rather than DirectiveBase.

== Recent changes (Release 0.2.5)
Fix AdminPage compatibility with Rails 1.1.5+ which uses safe_load_paths to find controllers
Fix rake mv:view_rhtml RHTML=foo/_bar.rhtml was not able to find partials
Fix rails environment not being passed into configuration
Added default generate filter which will add in a default generate directive if none is found in template
Changed default_parser_options to be merged in with original set rather than to be absolute replacement
Corrected example settings.rb win32 tidy_path to point to tidy.dll not tidy.exe.

== Recent changes (Release 0.2.4)
Maintenance release to add scgi support for MasterView.
Also introduced interactive template page to admin pages allowing
template html to be tested in MasterView showing the rendered

== Recent changes (Release 0.2.3)

Changed default development settings for enable_admin_pages and
enable_view_rhtml = true (false in production) to make it easy
for new users to get up and running. Added check_box, radio_button,
select, collection_select directives. Refactor attr_value parsing
to be more robust taking into account nested objects. Internal rework
of directive handling to support alternate namespaces for directives.
Std app directives dir at rails app/masterview/directives will be
automatically added to MasterView load path if exists.

== Recent changes (Release 0.2.2)

Fixes problem when rails encounters exception in either compiling or
involving RuntimeError in the generated rhtml. The rails TemplateError
class looks at the file system for the template contents. So when
generate_rhtml is false (no file is generated) rails was not able to
find source and was not outputting an error page. Rails TemplateError
class was extended to look at MasterView store first and then fallback
to file system.

== Recent changes (Release 0.2.1)

Release 0.2.1 adds Mongrel support, a new image_tag directive
and some additional illustrations and links to videos. Also
javascript_include and stylesheet_link directives can infer the
path from the src attribute if the attr_value is empty.

Also added additional logging around startup and the version of
MasterView that is running and a new admin page to visually
see what MasterView features are currently loaded (tidy,
auto parsing on change, parse on startup, reading rhtml direct
from masterview (eliminating rhtml file generation))

== Recent changes (Release 0.2.0)

Release 0.2.0 features a number of significant improvements.

MasterView templates can now be compiled directly into the Rails
view cache, just like .rhtml files in your app/views directory.
Output generation of .rhtml files from a MasterView template
is now optional.

A keyword substitution mechanism is now supported for the
mv:generate and mv:import group of template processing directives
to enable you to more easily specify standard output file names
derived from the template filename and relative path.
Template markup of the form:


avoids having to replicate the name of the template file itself
or its relative path within the masterview templates directory.
See the MasterView User's Guide and Directives Reference for details.

A new configuration facility has been added to allow you to
customize the MasterView configuration using settings
files in your rails app config directory, following the
same approach as the Rails framework itself.
See the new Configuration Guide documentation for details.

Configuration settings for controlling logging level have been added.
The MasterView admin controller is now disabled by default.
Use the config.enable_admin_pages setting to enable
(usually want only in your config/masterview/environments/development.rb).

The documentation has been reworked and enhanced to provide
improved documentation on installation and usage, along with
a new Configuration Guide describing how to customize the
MasterView configuration.

UPGRADE NOTES: If you have customized your MasterView configuration
in the init.rb file of your existing plugin installation, you *MUST*
migrate your configuration to the new settings file configuration mechanism
(config/masterview/settings.rb and environment settings files).

Also note that a directive was renamed from gen_render to gen_partial to
more clearly represent the functionality and eliminate future confusion.
Be sure to change any references to gen_render to gen_partial.

The default location for MasterView templates is now the standard Rails
app/views directory.  Either move your existing templates into app/views
or update the MasterView config.template_src_dir_path setting in your
config/masterview/settings.rb to reference your existing templates source

== Recent changes (Release 0.1.0)

MasterView now by default generates five masterview template files instead
of one, though you can specify the --single-file option to only generate
one file. Using one masterview template file gives the most DRY implementation
but since all the views are in one file, it can become a point of contention
and is a little more difficult for designers to work with.
This Version 0.1.0 upgrade fixes that by generating one masterview template
for each action (list, new, edit, show, destroy). The layout and message
partials are defined in the list template and are imported into the other
files so that you can have a complete page rendering when working with style
and design of page. Similarly new defines the form partial which is imported
into edit, and show defines a _show partial which is imported into destroy.

One can edit the layout or other partials in the file they are defined in,
so for instance to edit the layout, edit the list template and once finished,
you can trigger the other templates to be rebuilt with the current information.
MasterView now contains an MasterView admin controller/view to visually see
all the status and details about the templates. You can rebuild any out of sync
templates from this page. Alternatively you can view and rebuild templates from
the command line as well using the built in rake commands (mv:list, mv:list_all,
mv:rebuild TEMPLATE=foo.html, mv:rebuild_all).

To make it easy to add additional actions which also import the layout,
MasterView now has a way to generate a starter template file for your action
by simply choosing from which other template file you want to import the layout
from. For instance say you want to add an action called hello to your Product
controller. Find the masterview template you want to get the layout imported
from which could be (product_list.html, product_new.html, product_edit.html, ...),
you can choose any of the templates that have the layout you want (it doesn't
matter whether they defined the layout or simply imported it. To generate the
starter template go to the MasterView Admin page http://yourserver/masterview
and click copy link next to the appropriate template. On the next screen indicate
the name of the action you wish to add (in this case 'hello') and click the submit
button. MasterView generates a starter template file product_hello.html which
imports the layout from the template file you chose and it creates some
placeholder divs in the template that you can edit to add your hello view code.
Alternatively there is also a
    rake mv:copy_layout TEMPLATE=product_list.html ACTION=hello
command to allow you to do the same thing via command line.

Note that you don't have to use the starter or generated files to use MasterView
(you can just add MasterView attribute directives manually), but I found that
once you had things started and wanted to reuse that same information, that
having an automated way to get the layout imported makes it much easier and
quicker to get things going. You can also change the default action div that is
generated by simply creating your own file in app/views/masterview/admin/empty.rhtml
which if found the copy_layout will use it, otherwise it uses the one from the gem/plugin.

== Description

MasterView is a ruby/rails optimized HTML/XHTML friendly template engine.
It is designed to use the full power and productivity of rails including
layouts, partials, and rails html helpers while still being editable/styleable
in a WYSIWYG HTML editor.

MasterView is distributed as a gem or a plugin. You may install it as a gem and
then generate a lightweight plugin which mainly refers to the gem *or* you can
simply install as a plugin which is self contained. I personally prefer installing
as a gem for ease of management, however if you are running at a shared hosting
environment you might not have authority to install this gem so you may install
as a self contained plugin.

If you are interested in the background story behind all this, it is at the end of this page.

Author:: Jeff Barczewski
Email:: jeff.barczewski (at) gmail (dot) com
Primary developers:: Jeff Barczewski, Deb Lewis
Rubyforge project:: masterview
License:: MIT open source license like Rails

== Goals

- Create/extend a template engine for rails that would be XHTML friendly and thus could be edited/styled with a WYSIWYG HTML editor even late in development without breaking template.
- Keep it simple. DRY. No extra config files, simple syntax with ruby flavor.
- Design it specifically for ruby and rails. Use the full power and not be limited in its capabilities over what can be done with ERb
- Work nicely with layouts, partials, and rails html helpers.
- Reduce complexity, work with existing rails code, no extra view logic or hashes than what is used by ERb. Scaffold generate initial templates or work from existing html prototype.
- Reduce the numbers of files, simplifying editing. Define partials and layouts naturallyl right in the template, no need to go to another file.
- Preview in browser without running an app. Allow for dummy data in the template so that the page can be viewed and styled independently of the application.
- Performance equal to ERb

== Prerequisites

        No external dependencies

        tidy (gem) and tidy library - if these are installed you can use tidy to cleanup html into valid xhtml for use by MasterView
        log4r (gem) - if this gem is installed then MasterView will use it for logging otherwise it defaults to using built in Logger.

== User Documentation

MasterView documentation is available online at the MasterView site:
and on the rubyforge project

== Installation

Detailed installation instructions for installing the masterview gems
or a self-contained copy of the plugin is provided in the MasterView
Installation Guide.

The Configuration Guide describes how to customize the configuration
of the MasterView template engine for your application.

== Usage

The MasterView User's Guide and a complete Directives Reference are provided
in the MasterView user documentation.  MasterView templates can be
created by hand simply by adding masterview directives markup to
an (x)html template, or generated for typical Rails controller/view
scenarios using the supplied masterview generator developer tool.

A MasterView Admin controller can optionally be activated in your application
to assist you during development with creating and managing your templates.

Changes: 0.3.4 - October 4th, 2007 Added rake task mv:generate_all_rhtml which calls mv:parse to generate all the rhtml files. Added to make it clearer for those wanting to generate their rhtml manually. Make values in gen_partial and import_partial retain their page specific values, allowing you to specify different locals, collections, or objects for import_render than you do on gen_partial. Also allows you to reuse the partial multiple times on a page with different values. (thanks James Britt) Fix rebuild template so that it uses the same list of XHTML empty elements to determine whether to collapse empty elements (thanks Brian Jordan) Fixed problem with CruiseControl where ActionController was not defined (thanks James Britt) 0.3.3 - July 1, 2007 Added xml doctype to generated code Fixed bug in gen_replace where it was generating <% %> rather than <%= %> (Thanks to Jon Frisby for indentifying) Fix defect in form tag not setting :multipart => true when form enctype=multipart/form-data (Thanks to Rajavel Lenin for identifying) Fix defect in stylesheet_link, was looking at attribute src rather than href (Thanks to Rajavel Lenin for identifying) Make REXML sax2parser selection configurable and use patched sax2parser if compatible REXML version 3.1.4-3.1.5 is installed (Thanks to David Koontz for help in indentifying issue) Update masterview_plugin generator which generates plugin stub to create examples/rails_app_admin_auth/admin_auth_mixin.rb Added auto_copy feature that can be configured to auto copy static files like stylesheets, images, and javascripts from a non-standard location to the proper location at runtime (under public). Fixed defect with integration of other plugins that can change view_base, causing templates to not be found from MasterView Fix rebuild template so that doctypes are retained when rebuilding or copying and in scaffold generation Fix rails runtime detection to include RadRails launch using -e Added rake mv:clean_mv_rhtml task which removes MasterView generated rhtml if generating to file system 0.3.2 - February 20, 2007 Fix bug in mv:attr directive where multiparam eval method like :a => #{hello 1,2} was not being parsed properly Added mv:select to alphabetical list on bottom of directives html doc page Fix incompatibility with Rails 1.2 template error - blank page on erb error Use template_changed_since? for compile checking when it is available Rails changeset 5587 Added config.admin_auth_mixin allowing configurable authorization for masterview admin Change generator to use request, flash, params rather than @request, @flash, @params which are deprecated Tested with Rails 1.2.2 0.3.1 - November 20, 2006 Fixed problem with deprecated/directive_base was missing registry include Update image_tag docs, indicating that it now simply passes through width and height rather than setting size Fixed problem with Ruby 1.8.5 Pathname.dirname now calls and was getting wrong number of arguments 1 for 2 (in FileMIO) Accomodate change with Rails 1.2 which changed number of arguments for force_file_collision, use custom method 0.3.0 - November 8, 2006 Fixed compatibility of AdminPages with edge rails using dependency mechanism Refactored directive api using DSL to simplify and solidify creation of directives Fix find_last_parent bug which failed to search nested arrays properly, found and patch submitted by Sergey Shalatskly Added form_remote, link_to_function, eval directives based on ideas from Sergey Shalatskly New method Configuration.add_directive_path to add directives directories to load path. Reworked directive framework to use DirectiveMetadata, support declarative metadata DSL Support multiple namespaces for directive attribute markup. Provide separate config defaults for builtin masterview directives (mv:) and addon directives (mvx:) Support installation-level config of directive dir metadata defaults using .metadata file in directives directory. Support app-level config of directive dir metadata defaults using path-entry options Internal rework of directive loading and management to handle namespaces, config options Internal cleanup in parser to remove old hooks for namespace and dir path options; supported by MV config. Internal restructuring to introduce MasterView::MIO namespace for i/o mechanisms. Add 'View Directives' page to MasterView Admin to display loaded directives info Fix missing context layout of View Configuration page in MasterView Admin Add Developer's Guide documentation (describe directive implementation framework) Change output of directives to use parens for methods Output xml declaration (version and encoding) and doctype if provided in template Added custom version of rexml sax2parser and baseparser which throws proper event for doctype Added directive API method find_parent_directive which allows for directives to find and communicate with their parents Changed form directive to output closing form tag rather than using end_form_tag helper which is deprecated in rails 1.2 Changed form_remote directive to allow normal output of </form> and not output end_form_tag helper since end_form_tag helper has been deprecated in rails 1.2 Updated sidebox.css to work better with small IE browser windows **UPGRADE CONSIDERATIONS: default namespace of extensions directives changed from mv: to mvx: upgrade any user created custom directives to use new directive API (see release notes) 0.2.5 - August 19th, 2006 Added default generate filter which will add in a default generate directive if none is found in template Changed default_parser_options to be merged in with original set rather than to be absolute replacement Corrected example settings.rb win32 tidy_path to point to tidy.dll not tidy.exe. Fix AdminPage compatibility with Rails 1.1.5+ which uses safe_load_paths to find controllers Fix rake mv:view_rhtml RHTML=foo/_bar.rhtml was not able to find partials Fix rails environment not being passed into configuration 0.2.4 - July 26, 2006 Added interactive render to admin pages with example templates Fixed problem where apache2 with scgi was failing to initialize MasterView Updated documentation. 0.2.3 - July 5th, 2006 Change default development settings for enable_admin_pages = true and enable_view_rhtml = true, remains false in production. Change generated message in files to indicate that list.html controls layout and _messages, while new.html controls _form... Added check_box directive Added radio_button directive Refactored attr_value option parser Added select directive Added config setting template_asset_base_ref_pattern, index by asset type, for extracting asset refs from template design-time refs for rails helpers. Internal rework of directive handling to provide infrastructure for enable alt directive name spaces (separate from builtin mv: namespace). Std app directives dir at rails app/masterview/directives will be automatically added to load path along with builtin mv: directives if present. Added quote_if method to directive_base and refactored directives to utilize so logic is consolidated. Added collection_select directive 0.2.2 - June 30th, 2006 - Fix bug when not generating rhtml that rails template error could not find source and thus would fail to generate rhtml error page 0.2.1 - June 28th, 2006 Added Mongrel support Added image_tag directive Update javascript_include directive to infer path from src if attr_value is empty Update stylesheet_link directive to infer path from src if attr_value is empty New illustration 0.2.0 - June 20th, 2006 - Big release. Added capability for eliminating rhtml generation, extends rails so that rhtml can be pulled directly from MasterView. Support template compilation directly into Rails view cache for templates in app/views (rhtml generation now optional) New mechanism for configuring MasterView from settings files; internal initialization rework. Configuration can now be driven by editing config/masterview/settings.rb and/or config/masterview/environments/*.rb. Add support for configuring MasterView logger and log_level; default level INFO for dev, WARN otherwise Add keyword substitution for generate/import attributes (mv:generate="{template_path}" notation) Added capability to view rhtml from MasterView Admin pages. Add 'View Configuration' page in MasterView Admin pages to display config settings. Reorganize and enhance documentation: doc/index.html; improved installation guide, added config guide, improved User Guide Internals: Renamed PartialExtension to GeneratedFileDefaultExtension Internals: Renamed partial_filename_extension to generated_file_default_extension Internals: Major internal rework of file handling and I/O. --UPGRADE NOTE: you *must* redo any config customizations in plugin init.rb to use new settings file and config vars --UPGRADE NOTE: default location for masterview template files is now the app/views directory in your Rails app --UPGRADE NOTE: directive gen_render was renamed gen_partial for clarity, update any templates which reference gen_render 0.1.6 - June 2nd - Implement basic dateselect and datetime_select in generator. Simplify only empty elements that are specified as empty in xhtml-1.0-Strict DTD. 0.1.5 - May 31st - Remove app_[ENV] customization hook in leau of a block based initializer approach (similar to rails) from Deborah Lewis which would allow customization from the environment config files. 0.1.4 - May 30th - Apply patch by Deborah Lewis to allow customized generated comment. Add omit_tag directive to conditionally suppress output of element tag. Add user configuration user.rb, user_RAILS_ENV.rb 0.1.3 - May 29th - Fixed generators to use m.file not m.template on non-erb files 0.1.2 - May 29th - Fix empty.rhtml not being found from rake mv:copy_layout 0.1.1 - May 29th - Fix minor issue with gem, masterview rake tasks were not availailable when using gem 0.1.0 - May 27th - Major additions. Added rake admin tasks, MasterView admin controller/views. Allow user to easily have distributed files and keep sync'd. Generator defaults to generating split files. 0.0.18 - May 12, 2006 - Refactored watcher 0.0.17 - May 4, 2006 - Added some additional css style and generator options, change the showOne option 0.0.16 - April 28, 2006 - Corrected gem version dependencies 0.0.15 - April 28, 2006 - Added gem version dependencies spec for masterview_gem_pack so that pack pulls the appropriate versions 0.0.14 - April 28, 2006 - Fixed a preview problem introduced by design time stylesheet inclusion. Show and Destroy content was hidden. Clarified design time message. 0.0.13 - April 27, 2006 - Cleaned up generated template improving indentation and simplified css. Added design time css to hide sections. Preview javascript was changed to be less invasive to generated code. 0.0.12 - April 24, 2006 - Fixed generator to use Controller name for files it generates, added attr directive, added more default styles to css, added styles to generator templates 0.0.11 - April 22, 2006 - Changed the main load file to rescue LoadErrors from log4r and tidy 0.0.6 - April 18, 2006 - Working on generator packaging 0.0.5 - April 18, 2006 - Changed packaging 0.0.4 - April 18, 2006 - Updated documentation 0.0.3 - April 18, 2006 - Repackaging 0.0.2 - April 16, 2006 - First public release