<!-- Rapid-Pages provides tags for working with entire pages. It includes the main `<page>` tag which is the starting point for all pages in Rapid, various supporting tags for things such as stylesheet and javascript includes. Also defines the standard error pages for permission-denied and not-found. --> <!-- The basic page structure for all the pages in a Hobo Rapid application. Providing the doctype, page title, standard stylesheet javascript includes, the ajax progress spinner, default header with app-name, account navigation, main navigation, and live search, empty section for the page content, flash message (if any) and an empty page footer. The easiest way to see what this tag does is to look at the source. ### Attributes - `title` - the page title, will have ": `<app-name>`" appended - `full-title` - the full page title. Set this if you do not want the app name suffix. --> <def tag="page" attrs="title, full-title"> <% full_title ||= "#{title} : #{app_name}" %> <html merge-attrs> <head param> <title param><%= strip_tags full_title %></title> <do param="stylesheets"> <!-- note that this is probably overridden in your app/views/taglibs/themes/xxx/xxx.dryml --> <stylesheet name="reset, hobo-rapid"/> <theme-stylesheet /> <stylesheet name="application" param="app-stylesheet"/> </do> <do param="scripts"> <javascript param name="prototype, effects, dragdrop, controls, rails, lowpro, hobo-rapid"/> <if-ie version="lt IE 7" param="fix-ie6"> <javascript name="IE7"/> <javascript name="ie7-recalc"/> </if-ie> <do param="custom-scripts"/> <javascript param="application-javascript" name="application"/> </do> <%= csrf_meta_tag %> </head> <body param> <set-scoped flash-rendered="&false"> <ajax-progress param/> <header class="page-header" param> <account-nav if="&login_url(Hobo::Model::UserBase.default_user_model)" param/> <h1 param="app-name"><a href="#{base_url}/"><app-name/></a></h1> <live-search param if="&defined_route? :site_search"/> <main-nav current="&title" param/> </header> <section with-flash-messages param="content"/> <footer class="page-footer" param/> <page-scripts param/> </set-scoped> </body> </html> </def> <!-- Renderes dynamically generated JavaScript required by `hobo-rapid.js`, including the information required to perform automatic part updates --> <def tag="page-scripts"> <do param="default"> <hobo-rapid-javascripts/> <part-contexts-javascripts/> </do> </def> <!-- nodoc. --> <def tag="index-page" polymorphic/> <!-- nodoc. --> <def tag="new-page" polymorphic/> <!-- nodoc. --> <def tag="show-page" polymorphic/> <!-- nodoc. --> <def tag="edit-page" polymorphic/> <!-- The page rendered by default in the case of a permission-denied error ### Attributes - `message` - The main message to display. Defaults to "That operation is not allowed" --> <def tag="permission-denied-page" attrs="message"> <% message ||= "That operation is not allowed" %> <page merge> <body: class="permission-denied"/> <content: param> <header param="content-header"> <h2 param="heading"><message/></h2> <div class="debug" if="&Rails.env.development?"> <h3>Exception:</h3> <pre><%= h @permission_error.pretty_inspect %></pre> <h3>params:</h3> <pre><%= h params.pretty_inspect %></pre> </div> </header> </content:> </page> </def> <!-- The page rendered by default in the case of a not-found error ### Attributes - `message` - The main message to display. Defaults to "The page you requested cannot be found." --> <def tag="not-found-page" attrs="message"> <% message ||= t("hobo.messages.not_found", :default=>["The page you requested cannot be found."]) %> <page merge> <body: class="not-found"/> <content: param> <header param="content-header"> <h2 param="heading"><message/></h2> </header> </content:> </page> </def> <!-- Renders one of five HTML DOCTYPE declarations, according to the `version` attribute. ### Attributes - 'version' - the doctype version, must be one of: - HTML 4.01 STRICT - HTML 4.01 TRANSITIONAL - XHTML 1.0 STRICT - XHTML 1.0 TRANSITIONAL - XHTML 1.1 See the source for the actual output --> <def tag="doctype" attrs="version"><%=raw( case version.upcase when "HTML 4.01 STRICT" '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ' + '"http://www.w3.org/TR/html4/strict.dtd">' when "HTML 4.01 TRANSITIONAL" '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ' + '"http://www.w3.org/TR/html4/loose.dtd">' when "XHTML 1.0 STRICT" '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' when "XHTML 1.0 TRANSITIONAL" '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' when "XHTML 1.1" '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ' + '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' end) %></def> <!-- Renders an `<html>` tag along with the DOCTYPE specified in the `doctype` attribute. ### Attributes - `doctype` - the version of the DOCTYPE required. See the `version` attribute to `<doctype>` --> <def tag="html" attrs="doctype"> <% doctype ||= 'XHTML 1.0 TRANSITIONAL' -%> <doctype version="&doctype"/> <% attributes.reverse_merge!(:xmlns => "http://www.w3.org/1999/xhtml") if doctype.upcase =~ /^XHTML/ -%> <%=raw "<html#{tag_options(attributes, true)}>" %> <set-scoped xmldoctype="&doctype.upcase =~ /^XHTML/"><do param="default"/></set-scoped> <%=raw "</html>" %> </def> <!-- empty tags should be written as <br> in HTML and <br /> in XHTML --> <!-- nodoc. --> <def tag="empty-tag" attrs="tag-name"><%= element(tag_name, attributes, nil, true, true) %></def> <!-- nodoc. --> <def tag="base"><empty-tag tag-name="base" merge/></def> <!-- nodoc. --> <def tag="meta"><empty-tag tag-name="meta" merge/></def> <!-- nodoc. --> <def tag="link"><empty-tag tag-name="link" merge/></def> <!-- nodoc. --> <def tag="img"><empty-tag tag-name="img" merge/></def> <!-- nodoc. --> <def tag="br"><empty-tag tag-name="br" merge/></def> <!-- nodoc. --> <def tag="hr"><empty-tag tag-name="hr" merge/></def> <!-- nodoc. --> <def tag="frame"><empty-tag tag-name="frame" merge/></def> <!-- nodoc. --> <def tag="area"><empty-tag tag-name="area" merge/></def> <!-- nodoc. --> <def tag="param"><empty-tag tag-name="param" merge/></def> <!-- nodoc. --> <def tag="col"><empty-tag tag-name="col" merge/></def> <!-- Renders a conditional comment in order to have some content ignored by all browsers other than Internet Explorer ### Example <if-ie version="lt IE 7"> ... </if-ie> --> <def tag="if-ie" attrs="version"> <%=raw "<!--[if #{version || 'IE'}]>" %><do param="default"/><%=raw "<![endif]-->" %> </def> <!-- Simple wrapper for the `stylesheet_link_tag` helper. The `name` attribute can be a comma-separated list of stylesheet names. --> <def tag="stylesheet" attrs="name"> <%= stylesheet_link_tag *(comma_split(name) + [attributes]) %> </def> <!-- Simple wrapper for the `javascript_include_tag` helper. The `name` attribute can be a comma-separated list of script file names. --> <def tag="javascript" attrs="name"> <if test="&name.is_a?(Symbol)"> <%= javascript_include_tag name %> </if> <else> <repeat with="&comma_split(name)"> <%= javascript_include_tag this %> </repeat> </else> </def> <!-- Renders a Rails flash message wrapped in a `<div>` tag ### Attributes - `type` - which flash message to display. Defaults to `:notice` ### CSS Classes The flash is output in a `<div class="flash notice">`, where `notice` is the `type` specified. --> <def tag="flash-message" attrs="type"> <% type = type ? type.to_sym : :notice -%> <div class="flash #{type}" if="&flash[type]" merge-attrs><%= flash[type] %></div> </def> <!-- Renders `<flash-message>` for every flash type given in the `names` attribute (comma separated), or for all flash messages that have been set if `names` is not given --> <def tag="flash-messages" attrs="names"><%= scope.flash_rendered = true if scope.respond_to? :flash_rendered names = names.nil? ? flash.keys : comma_split(names) names.map { |name| flash_message :type => name }.safe_join %></def> <!-- Renders `<div id="ajax-progress"><div><span id="ajax-progress-text"></span></div></div>`. The theme will style this as an ajax progress 'spinner' --> <def tag="ajax-progress"> <div id="ajax-progress" merge-attrs> <div> <span id="ajax-progress-text"></span> </div> </div> </def>