using concat(text, binding) to make _nested.rhtml a bit prettier :)

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@631 561dde7e-7729-0410-be8e-ef83869d6c7d

<h4> </h4>
<%
  # This assumes that the association is included as a column in the active_scaffold_config.columns collection
  associated_columns = []
  associated_columns = params[:associations].split(" ") unless params[:associations].nil?
  unless associated_columns.empty?
    parent_id = params[:id]
    associated_columns.each do | column_name |
      column = active_scaffold_config.columns[column_name]
      association = column.association
      if column.through_association?
        constraints = {
          association.source_reflection.reverse => {
            association.through_reflection.reverse => parent_id
          }
        }
      else
        constraints = { association.reverse => parent_id }
      end
      begin
        controller = active_scaffold_controller_for(association.klass)
      rescue ActiveScaffold::ControllerNotFound => error
        concat "#{error.class} - #{error.message}", binding
      else
        concat render(:active_scaffold => controller.controller_path,
          :constraints => constraints,
          :label => as_("%s for %s", active_scaffold_config_for(association.klass).label, format_column(@record.to_label)),
          :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record}
        ), binding
      end
    end
  end
%>

<h4> </h4>
<%
  # This assumes that the association is included as a column in the active_scaffold_config.columns collection
  associated_columns = []
  associated_columns = params[:associations].split(" ") unless params[:associations].nil?
  unless associated_columns.empty?
    parent_id = params[:id]
    associated_columns.each do | column_name |
      column = active_scaffold_config.columns[column_name]
      association = column.association
      if column.through_association?
        constraints = {
          association.source_reflection.reverse => {
            association.through_reflection.reverse => parent_id
          }
        }
      else
        constraints = { association.reverse => parent_id }
      end
      begin
        controller = active_scaffold_controller_for(association.klass)
      rescue ActiveScaffold::ControllerNotFound => error %>
        <%= "#{error.class} - #{error.message}"%>
<%    else %>
    <%= render :active_scaffold => controller.controller_path,
               :constraints => constraints,
               :label => as_("%s for %s", active_scaffold_config_for(association.klass).label, format_column(@record.to_label)),
               :params => {:nested => true, :parent_column => column_name, :parent_model => association.active_record} %>
<%    end
    end
  end
%>


Remove text_field to configure theme name from General settings tab

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@424 820eb932-12ee-0310-9ca8-eeb645f39767

<% @page_heading = 'Blog settings' %>

  <%= start_form_tag :action => 'update'%>

Which settings group would you like to edit?

General Settings

Text Filter

Spam Protection

General Settings

      Blog name:
      <input name="setting[blog_name]" id="blog_name" type="text" value="<%= config_value(:blog_name) %>" />

      Blog subtitle:
      <input name="setting[blog_subtitle]" id="blog_subtitle" type="text" value="<%= config_value(:blog_subtitle) %>" />

      <input name="setting[default_allow_comments]" id="default_allow_comments" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:default_allow_comments)%> />
      <input name="setting[default_allow_comments]" type="hidden" value="0"/>
        Enable comments by default

      <input name="setting[default_allow_pings]" id="default_allow_pings" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:default_allow_pings)%> />
      <input name="setting[default_allow_pings]" type="hidden" value="0"/>
        Enable Trackbacks by default

      Display
      <input name="setting[limit_article_display]" size="4" id="limit_article_display" type="text" value="<%= config_value(:limit_article_display) %>" /> articles on my homepage by default.

      Display
      <input name="setting[limit_rss_display]" size="4" id="limit_rss_display" type="text" value="<%= config_value(:limit_rss_display) %>" /> articles in my rss feed by default.

Should the blog show mailto: links to your email address?

<input name="setting[link_to_author]" id="link_to_author" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:link_to_author)%> /><input name="setting[link_to_author]" type="hidden" value="0"/> Enable E-Mail public display

Would you like to include your latitude and longitude in your blog's HTML pages? See GeoURL for details.
Example: <tt>47.774,-122.201</tt>

      Latitude, Longitude:
      <input name="setting[geourl_location]" size="20" id="geourl_location" type="text" value="<%= config_value(:geourl_location) %>" />

<%= save("Save My Settings") %>

Text Filter

Your options depend on which gems you have installed. Following configurations are supported. RedCloth, BlueCloth and RubyPants gems are supported.

        <select name="setting[text_filter]" id="text_filter">
          <%= options_for_select text_filter_options, config_value(:text_filter) %>
        </select>
        Article filter

        <select name="setting[comment_text_filter]" id="comment_text_filter">
        <%= options_for_select text_filter_options, config_value(:comment_text_filter) %>
        </select>
        Comments filter

<%= save("Save My Settings") %>

Spam Protection

Enabling spam protection will make typo compare the IP address of posters against blacklists. Good defense against spam bots.

          <input name="setting[sp_global]" id="sp_global" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:sp_global)%> /><input name="setting[sp_global]" type="hidden" value="0"/>
          Enable spam protection

          Disable comments after
          <input name="setting[sp_article_auto_close]" size="4" id="sp_article_auto_close" type="text" value="<%= config_value(:sp_article_auto_close) %>" /> days

(Set to 0 to never disable comments)

Typo will automatically reject comments and trackbacks which contain over a certain amount of links in them.

          Max URLs:
          <input name="setting[sp_url_limit]" size="4" id="sp_url_limit" type="text" value="<%= config_value(:sp_url_limit) %>" /> links

(Set to 0 to never reject comments)

<%= save("Save My Settings") %>

    <%= save("Save My Settings") %>

  <%= end_form_tag %>

<% @page_heading = 'Blog settings' %>

  <%= start_form_tag :action => 'update'%>

Which settings group would you like to edit?

General Settings

Text Filter

Spam Protection

General Settings

      Blog name:
      <input name="setting[blog_name]" id="blog_name" type="text" value="<%= config_value(:blog_name) %>" />

      Blog subtitle:
      <input name="setting[blog_subtitle]" id="blog_subtitle" type="text" value="<%= config_value(:blog_subtitle) %>" />

      Blog theme:
      <input name="setting[theme]" id="theme" type="text" value="<%= config_value(:theme) %>" />

      <input name="setting[default_allow_comments]" id="default_allow_comments" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:default_allow_comments)%> />
      <input name="setting[default_allow_comments]" type="hidden" value="0"/>
        Enable comments by default

      <input name="setting[default_allow_pings]" id="default_allow_pings" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:default_allow_pings)%> />
      <input name="setting[default_allow_pings]" type="hidden" value="0"/>
        Enable Trackbacks by default

        Display
        <input name="setting[limit_article_display]" size="4" id="limit_article_display" type="text" value="<%= config_value(:limit_article_display) %>" /> articles on my homepage by default.

        Display
        <input name="setting[limit_rss_display]" size="4" id="limit_rss_display" type="text" value="<%= config_value(:limit_rss_display) %>" /> articles in my rss feed by default.

Should the blog show mailto: links to your email address?

<input name="setting[link_to_author]" id="link_to_author" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:link_to_author)%> /><input name="setting[link_to_author]" type="hidden" value="0"/> Enable E-Mail public display

Would you like to include your latitude and longitude in your blog's HTML pages? See GeoURL for details.
Example: <tt>47.774,-122.201</tt>

Latitude, Longitude:
      <input name="setting[geourl_location]" size="20" id="geourl_location" type="text" value="<%= config_value(:geourl_location) %>" />

<%= save("Save My Settings") %>

Text Filter

Your options depend on which gems you have installed. Following configurations are supported. RedCloth, BlueCloth and RubyPants gems are supported.

        <select name="setting[text_filter]" id="text_filter">
          <%= options_for_select text_filter_options, config_value(:text_filter) %>
        </select>
        Article filter

        <select name="setting[comment_text_filter]" id="comment_text_filter">
        <%= options_for_select text_filter_options, config_value(:comment_text_filter) %>
        </select>
        Comments filter

<%= save("Save My Settings") %>

Spam Protection

Enabling spam protection will make typo compare the IP address of posters against blacklists. Good defense against spam bots.

          <input name="setting[sp_global]" id="sp_global" type="checkbox" value="1" <%= 'checked="checked"' if config_value(:sp_global)%> /><input name="setting[sp_global]" type="hidden" value="0"/>
          Enable spam protection

          Disable comments after
          <input name="setting[sp_article_auto_close]" size="4" id="sp_article_auto_close" type="text" value="<%= config_value(:sp_article_auto_close) %>" /> days

(Set to 0 to never disable comments)

Typo will automatically reject comments and trackbacks which contain over a certain amount of links in them.

          Max URLs:
          <input name="setting[sp_url_limit]" size="4" id="sp_url_limit" type="text" value="<%= config_value(:sp_url_limit) %>" /> links

(Set to 0 to never reject comments)

<%= save("Save My Settings") %>

    <%= save("Save My Settings") %>

  <%= end_form_tag %>


Double-arg.

Double-arg.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <%= auto_discovery_link_tag(:rss, {:controller => 'observer', :action  =>  'rss'}, {:title => :app_rss.l}) %>
  <title><%= :app_title.l %>: <%= if @title.nil? then controller.action_name else @title.strip_html end %></title>
  <%= "<link rel=\"SHORTCUT ICON\" href=\"#{HTTP_DOMAIN}/favicon.ico\" />"%>

  <%= check_if_user_turned_javascript_on %>

  <%=
    css = nil
    if is_in_admin_mode?
      css = 'Admin'
    elsif is_robot?
      css = 'BlackOnWhite'
    else
      if CSS.member?(controller.action_name)
        css = controller.action_name
      else
        if @user.nil?
          css = 'BlackOnWhite'
        else
          css = @user.theme
        end
      end
      unless CSS.member?(css)
        css = CSS[rand(CSS.length)]
      end
    end
    stylesheet_link_tag('general.css?v=1', "#{css}.css?v=1")
  %>

  <%= sort_javascript_includes.map {|m| javascript_include_tag(m).sub(/\.js/,'.js?v=2')}.join('') %>

  <% if @header %>
    <%= @header %>
  <% end %>

  <% if is_in_admin_mode? %>

      DANGER: You are in administrator mode. Proceed with caution.

  <% end %>
  <%
    banner = :app_donate_banner.t
    if banner != "" %>

        <%= banner %>

  <% end %>

                <%= link_to(@page_title || :app_banner.t, :controller => 'observer', :action => 'index') %>

                <%= link_to(:app_intro.t, :controller => 'observer', :action => 'intro') %>

                <%= link_to(:app_how_to_use.t, :controller => 'observer', :action => 'how_to_use') %>

                <%= link_to(:app_how_to_help.t, :controller => 'observer', :action => 'how_to_help') %>

                <%= link_to(:app_donate.t, :controller => 'support', :action => 'donate') %>

                <%= link_to(:app_feature_tracker.t, :controller => 'pivotal', :action => 'index') %>

                <%= link_to(:app_send_a_comment.t, :controller => 'observer', :action => 'ask_webmaster_question') %>

                <%= link_to(:app_index_a_z.t, :controller => 'name', :action => 'observation_index') %>

                <%= link_to(:app_list_locations.t, :controller => 'location', :action => 'list_locations') %>

                <%= link_to(:app_list_projects.t, :controller => 'project', :action => 'list_projects') %>

                <%= :app_latest.t %>:

                <%= indent + link_to(:app_latest_changes.t, :controller => 'observer', :action => 'list_rss_logs') %>

                <%= indent + link_to(:app_newest_images.t, :controller => 'image', :action => 'list_images') %>

                <%= indent + link_to(:app_comments.t, :controller => 'comment', :action => 'list_comments') %>

                <%= indent + link_to(:app_news.t, :controller => 'observer', :action => 'news') %>

                <%= :app_observations_left.t %>:

                <%= indent + link_to(:app_create_observation.t, :controller => 'observer', :action => 'create_observation') %>

                <%= indent + link_to(:app_sort_by_date_obs.t, :controller => 'observer', :action => 'list_observations') %>

                <%= :app_species_list.t %>:

                <%= indent + link_to(:app_create_list.t, :controller => 'species_list', :action => 'name_lister') %>

                <%= indent + link_to(:app_sort_by_date_spl.t, :controller => 'species_list', :action => 'list_species_lists') %>

                <%= indent + link_to(:app_sort_by_title.t, :controller => 'species_list', :action => 'species_lists_by_title') %>

                <% if @user.nil? %>
                  <%= :app_account.t %>:

                  <%= indent + link_to(:app_login.t, :controller => 'account', :action => 'login') %>

                  <%= indent + link_to(:app_create_account.t, :controller => 'account', :action => 'signup') %>

                <% else %>
                  <%= :app_current_user.t %>:

                  <%= indent + h(@user.login) %>

                  <%= indent + link_to(:app_comments_for_you.t, :controller => 'comment', :action => 'show_comments_for_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_observations.t, :controller => 'observer', :action => 'observations_by_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_interests.t, :controller => 'interest', :action => 'list_interests') %>

                  <%= indent + link_to(:app_your_summary.t, :controller => 'observer', :action => 'show_user', :id => @user.id) %>

                  <%= indent + link_to(:app_preferences.t, :controller => 'account', :action => 'prefs') %>

                  <%= indent + link_to(:app_join_mailing_list.t, 'http://lists.mushroomobserver.org/listinfo.cgi/general-mushroomobserver.org') %>

                  <%= indent + link_to(:app_logout.t, :controller => 'account', :action => 'logout_user') %>

                  <% if @user.admin %>

                    <%= :app_admin.t %>:

                    <% if is_in_admin_mode? %>
                      <%= indent + link_to(:app_users.t, :controller => 'observer', :action => 'users_by_name') %>

                      <%= indent + link_to(:app_email_all_users.t, :controller => 'observer', :action => 'email_features') %>

                      <%= indent + link_to(:app_add_to_group.t, :controller => 'account', :action => 'add_user_to_group') %>

                      <%= indent + link_to(:app_turn_admin_off.t, :controller => 'account', :action => 'turn_admin_off') %>

                    <% else %>
                      <%= indent + link_to(:app_turn_admin_on.t, :controller => 'account', :action => 'turn_admin_on') %>

                    <% end %>
                  <% end %>
                <% end %>

                <%= :app_languages.t %>:

                <% for locale in all_locales %>
                  <%= indent + link_to(locale.sub('-','_').to_sym.t, h(reload_with_args(:user_locale => locale))) %>

                <% end %>

                <%= link_to(:app_contributors.t, :controller => 'observer', :action => 'users_by_contribution') %>

                <%= link_to(:app_site_stats.t, :controller => 'observer', :action => 'show_site_stats') %>

                <%= link_to(:translators_note_title.t, :controller => 'observer', :action => 'translators_note') %>

                  <%= link_to(:app_colors_from.t(:theme => css.to_sym.l), :controller => 'observer', :action => 'color_themes') %>

                  <%= :app_powered_by.t %>:

                  Ruby on Rails

                  <%= :app_preferred_browser.t %>:

                  FireFox
                  <% if @invalid.nil? %>

                  <% end %>

              <% form_tag(:controller => 'observer', :action => 'pattern_search') do %>
                <%= :app_find.t %>:
                  <%= text_field(:search, :pattern, :size => 30,
                                 :value => session[:pattern])%>
                <%= options = [
                  [ :OBSERVATIONS.l, :observation ],
                  [ :IMAGES.l, :image ],
                  [ :NAMES.l, :name ],
                  [ :LOCATIONS.l, :location ],
                  [ :SPECIES_LISTS.l, :species_list ],
                  [ :COMMENTS.l, :comment ],
                  [ :USERS.l, :user ],
                  [ :PROJECTS.l, :project ],
                  [ :app_search_google.l, :google ],
                ]
                select(:search, :type, options,
                       :selected => session[:search_type] || :observation) %>
                <%= submit_tag :app_search.l %>
                <% if (DEVELOPMENT || is_reviewer?) && query_params != {} %>
                  <%= link_to(:app_refine_search.l.nowrap, :controller => 'observer',
                              :action => 'refine_search',
                              :params => query_params) %> |
                <% end %>
                <%= link_to(:app_advanced_search.l.nowrap, :controller => 'observer',
                            :action => 'advanced_search_form') %>
              <% end %>

            <% if @timer_start %>

                <%= @timer_end ||= Time.now
                secs = '%.2f' % (@timer_end.to_f - @timer_start.to_f)
                @timer_start = nil
                if @num_results
                  '(' + :app_index_timer.t(:seconds => secs,
                                           :num => @num_results.to_i) + ')'
                else
                  '(' + :app_timer.t(:seconds => secs) + ')'
                end %>

            <% end %>

              <% if flash_notices? %>
                  <% boxify(flash_notice_level) do %>
                    <%= flash_get_notices %>
                  <% end %>
              <% end
              flash_clear %>

            <% if @right_tabs %>

                <%= @right_tabs.join('
') %>

            <% end %>

              <%= no_session = !session_working?
              no_javascript = !javascript_enabled? && session[:js_override] != :off
              no_ajax       = can_do_ajax? == false && javascript_enabled? && session[:js_override] != :on
              no_browser    = can_do_ajax? == nil   && javascript_enabled? && session[:js_override] != :on
              if no_session || no_javascript || no_ajax || no_browser
                new_tab_set do
                  add_tab(:app_no_session.t,    :controller => 'observer', :action => 'no_session')    if no_session
                  add_tab(:app_no_javascript.t, :controller => 'observer', :action => 'no_javascript') if no_javascript
                  add_tab(:app_no_ajax.t,       :controller => 'observer', :action => 'no_ajax')       if no_ajax
                  add_tab(:app_no_browser.t,    :controller => 'observer', :action => 'no_browser')    if no_browser
                end
              end
              render_tab_sets %>

<%= @title %>

              <%= @content_for_layout %>

            <% if Locale.code.to_s != 'en-US' %>

                <%= :app_translators_credit.tpl %>

            <% end %>

  <% if @javascripts && @javascripts.include?('cached_auto_complete') %>

      <%= image_tag('indicator.gif') %>

  <% end %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <%= auto_discovery_link_tag(:rss, {:controller => 'observer', :action  =>  'rss'}, {:title => :app_rss.l}) %>
  <title><%= :app_title.l %>: <%= if @title.nil? then controller.action_name else @title.strip_html end %></title>
  <%= "<link rel=\"SHORTCUT ICON\" href=\"#{HTTP_DOMAIN}/favicon.ico\" />"%>

  <%= check_if_user_turned_javascript_on %>

  <%=
    css = nil
    if is_in_admin_mode?
      css = 'Admin'
    elsif is_robot?
      css = 'BlackOnWhite'
    else
      if CSS.member?(controller.action_name)
        css = controller.action_name
      else
        if @user.nil?
          css = 'BlackOnWhite'
        else
          css = @user.theme
        end
      end
      unless CSS.member?(css)
        css = CSS[rand(CSS.length)]
      end
    end
    stylesheet_link_tag('general.css?v=1', "#{css}.css?v=1")
  %>

  <%= sort_javascript_includes.map {|m| javascript_include_tag(m) + '?v=2'}.join('') %>

  <% if @header %>
    <%= @header %>
  <% end %>

  <% if is_in_admin_mode? %>

      DANGER: You are in administrator mode. Proceed with caution.

  <% end %>
  <%
    banner = :app_donate_banner.t
    if banner != "" %>

        <%= banner %>

  <% end %>

                <%= link_to(@page_title || :app_banner.t, :controller => 'observer', :action => 'index') %>

                <%= link_to(:app_intro.t, :controller => 'observer', :action => 'intro') %>

                <%= link_to(:app_how_to_use.t, :controller => 'observer', :action => 'how_to_use') %>

                <%= link_to(:app_how_to_help.t, :controller => 'observer', :action => 'how_to_help') %>

                <%= link_to(:app_donate.t, :controller => 'support', :action => 'donate') %>

                <%= link_to(:app_feature_tracker.t, :controller => 'pivotal', :action => 'index') %>

                <%= link_to(:app_send_a_comment.t, :controller => 'observer', :action => 'ask_webmaster_question') %>

                <%= link_to(:app_index_a_z.t, :controller => 'name', :action => 'observation_index') %>

                <%= link_to(:app_list_locations.t, :controller => 'location', :action => 'list_locations') %>

                <%= link_to(:app_list_projects.t, :controller => 'project', :action => 'list_projects') %>

                <%= :app_latest.t %>:

                <%= indent + link_to(:app_latest_changes.t, :controller => 'observer', :action => 'list_rss_logs') %>

                <%= indent + link_to(:app_newest_images.t, :controller => 'image', :action => 'list_images') %>

                <%= indent + link_to(:app_comments.t, :controller => 'comment', :action => 'list_comments') %>

                <%= indent + link_to(:app_news.t, :controller => 'observer', :action => 'news') %>

                <%= :app_observations_left.t %>:

                <%= indent + link_to(:app_create_observation.t, :controller => 'observer', :action => 'create_observation') %>

                <%= indent + link_to(:app_sort_by_date_obs.t, :controller => 'observer', :action => 'list_observations') %>

                <%= :app_species_list.t %>:

                <%= indent + link_to(:app_create_list.t, :controller => 'species_list', :action => 'name_lister') %>

                <%= indent + link_to(:app_sort_by_date_spl.t, :controller => 'species_list', :action => 'list_species_lists') %>

                <%= indent + link_to(:app_sort_by_title.t, :controller => 'species_list', :action => 'species_lists_by_title') %>

                <% if @user.nil? %>
                  <%= :app_account.t %>:

                  <%= indent + link_to(:app_login.t, :controller => 'account', :action => 'login') %>

                  <%= indent + link_to(:app_create_account.t, :controller => 'account', :action => 'signup') %>

                <% else %>
                  <%= :app_current_user.t %>:

                  <%= indent + h(@user.login) %>

                  <%= indent + link_to(:app_comments_for_you.t, :controller => 'comment', :action => 'show_comments_for_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_observations.t, :controller => 'observer', :action => 'observations_by_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_interests.t, :controller => 'interest', :action => 'list_interests') %>

                  <%= indent + link_to(:app_your_summary.t, :controller => 'observer', :action => 'show_user', :id => @user.id) %>

                  <%= indent + link_to(:app_preferences.t, :controller => 'account', :action => 'prefs') %>

                  <%= indent + link_to(:app_join_mailing_list.t, 'http://lists.mushroomobserver.org/listinfo.cgi/general-mushroomobserver.org') %>

                  <%= indent + link_to(:app_logout.t, :controller => 'account', :action => 'logout_user') %>

                  <% if @user.admin %>

                    <%= :app_admin.t %>:

                    <% if is_in_admin_mode? %>
                      <%= indent + link_to(:app_users.t, :controller => 'observer', :action => 'users_by_name') %>

                      <%= indent + link_to(:app_email_all_users.t, :controller => 'observer', :action => 'email_features') %>

                      <%= indent + link_to(:app_add_to_group.t, :controller => 'account', :action => 'add_user_to_group') %>

                      <%= indent + link_to(:app_turn_admin_off.t, :controller => 'account', :action => 'turn_admin_off') %>

                    <% else %>
                      <%= indent + link_to(:app_turn_admin_on.t, :controller => 'account', :action => 'turn_admin_on') %>

                    <% end %>
                  <% end %>
                <% end %>

                <%= :app_languages.t %>:

                <% for locale in all_locales %>
                  <%= indent + link_to(locale.sub('-','_').to_sym.t, h(reload_with_args(:user_locale => locale))) %>

                <% end %>

                <%= link_to(:app_contributors.t, :controller => 'observer', :action => 'users_by_contribution') %>

                <%= link_to(:app_site_stats.t, :controller => 'observer', :action => 'show_site_stats') %>

                <%= link_to(:translators_note_title.t, :controller => 'observer', :action => 'translators_note') %>

                  <%= link_to(:app_colors_from.t(:theme => css.to_sym.l), :controller => 'observer', :action => 'color_themes') %>

                  <%= :app_powered_by.t %>:

                  Ruby on Rails

                  <%= :app_preferred_browser.t %>:

                  FireFox
                  <% if @invalid.nil? %>

                  <% end %>

              <% form_tag(:controller => 'observer', :action => 'pattern_search') do %>
                <%= :app_find.t %>:
                  <%= text_field(:search, :pattern, :size => 30,
                                 :value => session[:pattern])%>
                <%= options = [
                  [ :OBSERVATIONS.l, :observation ],
                  [ :IMAGES.l, :image ],
                  [ :NAMES.l, :name ],
                  [ :LOCATIONS.l, :location ],
                  [ :SPECIES_LISTS.l, :species_list ],
                  [ :COMMENTS.l, :comment ],
                  [ :USERS.l, :user ],
                  [ :PROJECTS.l, :project ],
                  [ :app_search_google.l, :google ],
                ]
                select(:search, :type, options,
                       :selected => session[:search_type] || :observation) %>
                <%= submit_tag :app_search.l %>
                <% if (DEVELOPMENT || is_reviewer?) && query_params != {} %>
                  <%= link_to(:app_refine_search.l.nowrap, :controller => 'observer',
                              :action => 'refine_search',
                              :params => query_params) %> |
                <% end %>
                <%= link_to(:app_advanced_search.l.nowrap, :controller => 'observer',
                            :action => 'advanced_search_form') %>
              <% end %>

            <% if @timer_start %>

                <%= @timer_end ||= Time.now
                secs = '%.2f' % (@timer_end.to_f - @timer_start.to_f)
                @timer_start = nil
                if @num_results
                  '(' + :app_index_timer.t(:seconds => secs,
                                           :num => @num_results.to_i) + ')'
                else
                  '(' + :app_timer.t(:seconds => secs) + ')'
                end %>

            <% end %>

              <% if flash_notices? %>
                  <% boxify(flash_notice_level) do %>
                    <%= flash_get_notices %>
                  <% end %>
              <% end
              flash_clear %>

            <% if @right_tabs %>

                <%= @right_tabs.join('
') %>

            <% end %>

              <%= no_session = !session_working?
              no_javascript = !javascript_enabled? && session[:js_override] != :off
              no_ajax       = can_do_ajax? == false && javascript_enabled? && session[:js_override] != :on
              no_browser    = can_do_ajax? == nil   && javascript_enabled? && session[:js_override] != :on
              if no_session || no_javascript || no_ajax || no_browser
                new_tab_set do
                  add_tab(:app_no_session.t,    :controller => 'observer', :action => 'no_session')    if no_session
                  add_tab(:app_no_javascript.t, :controller => 'observer', :action => 'no_javascript') if no_javascript
                  add_tab(:app_no_ajax.t,       :controller => 'observer', :action => 'no_ajax')       if no_ajax
                  add_tab(:app_no_browser.t,    :controller => 'observer', :action => 'no_browser')    if no_browser
                end
              end
              render_tab_sets %>

<%= @title %>

              <%= @content_for_layout %>

            <% if Locale.code.to_s != 'en-US' %>

                <%= :app_translators_credit.tpl %>

            <% end %>

  <% if @javascripts && @javascripts.include?('cached_auto_complete') %>

      <%= image_tag('indicator.gif') %>

  <% end %>


styles for new design

styles for new design

	<% if @page && @work && @collection
			 title = "#{@collection.title} -- #{@work.title} -- #{@page.title} (FromThePage)"
		 elsif @work && @collection
			 title = @collection.title + ' -- ' + @work.title + ' (FromThePage)'
		 elsif @article && @collection
			 title = @collection.title + ' -- ' + @article.title + ' (FromThePage)'
		 elsif @collection && @collection.title
			 title = @collection.title + ' (FromThePage)'
		 else
			 title = 'FromThePage'
		 end
	%>
	<title><%= title %></title>
	<%=	javascript_include_tag :defaults %>
	<%= stylesheet_link_tag 'application' %>
	<%= stylesheet_link_tag 'transcribe' %>

			<% if logged_in? %>
				<%= link_to('Log out', { :controller => 'account',
																 :action => 'logout',
																 :ol => 'l_hd_lo' }) %>
			<% else %>
				<%= link_to('Sign Up', { :controller => 'account',
																 :action => 'signup',
																 :ol => 'l_hd_signup' }) %>

/

				<%= link_to('Log in', { :controller => 'account',
																:action => 'login',
																 :ol => 'l_hd_li' }) %>
			<% end %>

/

			<%= link_to('Dashboard', { :controller => 'dashboard',
																 :ol => 'l_hd_dlink' }) %>

		<% if (@work && @work.title) || (@collection && @collection.title) %>

				<% if @collection %>
					<%= link_to(@collection.title,
						{ :controller => 'collection',
							:action => 'show',
							:collection_id => @collection.id,
							:ol => 'l_hd_c_link' }) %>
				<% end %>
				<%= "—" if @collection && @work %>
				<% if @work && @work.title %>
					<%= link_to(@work.title,
						{ :controller => 'display',
							:action => 'read_work',
							:work_id => @work.id,
							:ol => 'l_hd_w_link' }) %>
				<% end %>

		<% end %>

	<% if(flash[:notice]) %>

<%= flash[:notice] %>

	<% end %>
	<% if(flash[:error]) %>

<%= flash[:error] %>

	<% end %>

<%= @content_for_layout %>

  <% if @page && @work && @collection
       title = "#{@collection.title} -- #{@work.title} -- #{@page.title} (FromThePage)"
     elsif @work && @collection
       title = @collection.title + ' -- ' + @work.title + ' (FromThePage)'
     elsif @article && @collection
       title = @collection.title + ' -- ' + @article.title + ' (FromThePage)'
     elsif @collection && @collection.title
       title = @collection.title + ' (FromThePage)'
     else
       title = 'FromThePage'
     end
  %>
  <title><%= title %></title>
  <%=  javascript_include_tag :defaults %>
  <%= stylesheet_link_tag 'application' %>
  <%= stylesheet_link_tag 'transcribe' %>

    <%= link_to('Dashboard', { :controller => 'dashboard',
                               :ol => 'l_hd_dlink' }) %> |
    <% if logged_in? %>
	    <%= link_to('Log out', { :controller => 'account',
	                             :action => 'logout',
                               :ol => 'l_hd_lo' }) %>
    <% else %>
	    <%= link_to('Log in', { :controller => 'account',
	                            :action => 'login',
                               :ol => 'l_hd_li' }) %>
	    |
	    <%= link_to('Sign Up', { :controller => 'account',
	                             :action => 'signup',
                               :ol => 'l_hd_signup' }) %>
    <% end %>

        <%= link_to('FromThePage',
                    { :controller => 'static',
                      :action => 'splash',
                      :ol => 'l_hd_logo' },
                    { :class => 'site-logo' }) %>

      <% if (@work && @work.title) || (@collection && @collection.title) %>

	        <% if @collection %>
		        <%= link_to(@collection.title,
		                    { :controller => 'collection',
		                      :action => 'show',
		                      :collection_id => @collection.id,
                          :ol => 'l_hd_c_link' }) %>
	        <% end %>
	        <%= "—" if @collection && @work %>
	        <% if @work && @work.title %>
		        <%= link_to(@work.title,
		                    { :controller => 'display',
		                      :action => 'read_work',
		                      :work_id => @work.id,
                          :ol => 'l_hd_w_link' }) %>
	        <% end %>

      <% end %>

<% if(flash[:notice]) %>

<%= flash[:notice] %>

<% end %>
<% if(flash[:error]) %>

<%= flash[:error] %>

<% end %>

<%= @content_for_layout %>


Added status width and centered the icon

<%= link_to @model.to_s.capitalize, :model => params[:model], :action => "index" %>

<%= link_to image_tag('typus/arrow_right.gif'), { :page => @item_pages.current.previous, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.previous %> <%= link_to image_tag('typus/arrow_left.gif'), { :page => @item_pages.current.next, :filter_by => params[:filter_by], :filter_id => params[:filter_id], :model => params[:model], :status => params[:status], :search => params[:search], :order_by => params[:order_by], :sort_order => params[:sort_order] } if @item_pages.current.next %><%= " " if @item_pages.current.next %><%= link_to_function image_tag("typus/search_right.gif"), "['search'].each(Element.toggle);" if @model.search_fields.size > 0 %> <%= link_to image_tag("typus/add.gif", :title => "New #{@model}"), :action => "new" %>

<%= feedback %>

<div id="search" <%= "style=\"display: none;\"" if !params[:search] %> class="box">
	<% form_tag ({:action => 'index', :model => params[:model]}, :method => 'get') do %>

<%= text_field_tag :search, params[:search] %>  <%= submit_tag "Search", :name => nil %>

	<% end %>

<% if @model.count > 0 -%>

	<% if @items.size > 0 -%>

		<% @fields.each do |column| %>

		<a href="?order_by=<%= column %>&sort_order=<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "desc" : "asc" ) %><% else %><%= "asc" %><% end %>"><div class="<% if params[:order_by].include? column %><%= (@status = (params[:sort_order] == "asc") ? "order_desc" : "order_asc" ) %><% else %><%= "order" %><% end %>"><%= column.humanize %>

		<% end %>

		<% @items.each do |item| %>
		  <tr class="<%= cycle('even', 'odd') %>" id="item_<%= item.id %>">
		  <% @fields.each do |column| %>
		    <% if %w(id title name full_name first_name last_name).include? column -%>
		    <%= link_to item.send(column), :action => 'edit', :id => item.id %>
		    <% elsif %w(email).include? column -%>
		    <%= mail_to item.send(column), item.send(column), :title => "" %>
		    <% elsif %w(status).include? column -%>
		      <%= image_tag(status = item.send(column)? "typus/status_true.gif" : "typus/status_false.gif") %>
		    <% elsif %w(verified is_admin).include? column -%>
		      <%= status = item.send(column)? "Yes" : "No" %>
		    <% elsif %w(created_at updated_at).include? column -%>
		      <%= fmt_date(item.send(column)) %>
		    <% else -%>
		      <%=h item.send(column) %>
		    <% end -%>
		  <% end %>
		    <%= link_to image_tag("typus/trash.gif"), { :action => 'destroy', :id => item }, :confirm => "Remove this entry?" %>

		<% end %>

	<% else -%>

There are no <%= params[:model] %> under this filter.

	<% end -%>

<% else -%>

<%= link_to "Add the first #{params[:model].singularize}", :action => "new", :model => params[:model] %>

<% end -%>


Link to a user's details from their diary page.

<% if @this_user %>

<%= link_to @this_user.display_name, :controller => 'user', :action => 'view', :display_name => @this_user.display_name %>'s diary

  <% if @user and @this_user.id == @user.id %>
    <%= link_to 'new post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
  <% end %>
<% end %>

Recent diary entries:

<%= render :partial => 'diary_entry/diary_entry', :collection => @entries %>

<%= link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), :action => 'rss') %>
<%= auto_discovery_link_tag(:atom, :action => 'rss') %>

<% if @this_user %>

<%= @this_user.display_name %>'s diary

  <% if @user and @this_user.id == @user.id %>
    <%= link_to 'new post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
  <% end %>
<% end %>

Recent diary entries:

<%= render :partial => 'diary_entry/diary_entry', :collection => @entries %>

<%= link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), :action => 'rss') %>
<%= auto_discovery_link_tag(:atom, :action => 'rss') %>


Minor bug fix to get the image count right on eol_preview.

<% @title ||= :eol_preview_title.t %>

<%= :eol_preview_explanation.tp %>

<% odd_or_even = 0
image_count = 0
for name in @names.select(&:ok_for_export)
  odd_or_even = 1 - odd_or_even %>
  <div class="ListLine<%= odd_or_even %>"
       style="padding-top:10px; padding-bottom:10px;">

      <%= link_to(name.display_name.t, :controller => "name",
                  :action => "show_name", :id => name.id) %>

    <% if @image_data[name.id]
      image_count += @image_data[name.id].length
      for image_id, observation_id in @image_data[name.id] %>
        <%= thumbnail(image_id, :border => 0, :link => :show_observation,
                      :obs => observation_id, :votes => false,
                      :size => :thumbnail, :nodiv => true) %>
      <% end
    end %>

<% end %>

  <%= :eol_preview_name_count.t :count => @names.length %>

  <%= :eol_preview_image_count.t :count => image_count %>

<% @title ||= :eol_preview_title.t %>

<%= :eol_preview_explanation.tp %>

  <%= :eol_preview_name_count.t :count => @names.length %>

  <%= :eol_preview_image_count.t :count => @image_data.length %>

<% odd_or_even = 0
for name in @names.select(&:ok_for_export)
  odd_or_even = 1 - odd_or_even %>
  <div class="ListLine<%= odd_or_even %>"
       style="padding-top:10px; padding-bottom:10px;">

      <%= link_to(name.display_name.t, :controller => "name",
                  :action => "show_name", :id => name.id) %>

    <% if @image_data[name.id]
      for image_id, observation_id in @image_data[name.id] %>
        <%= thumbnail(image_id, :border => 0, :link => :show_observation,
                      :obs => observation_id, :votes => false,
                      :size => :thumbnail, :nodiv => true) %>
      <% end
    end %>

<% end %>


only show map to actual user

only show map to actual user

<% @this_user = User.find_by_display_name(@this_user.display_name) %>

<%= @this_user.display_name %>

<% if @user and @this_user.id == @user.id %>
<%= link_to 'my diary', :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
| <%= link_to 'new diary post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
| <%= link_to 'my traces', :controller => 'trace', :action=>'mine' %>
| <%= link_to 'my settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %>
<% else %>
<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @this_user.id %>
| <%= link_to 'diary', :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
| <%= link_to 'traces', :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
| <% if @user and @user.is_friends_with?(@this_user) %>
  <%= link_to 'remove as friend', :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
<% else %>
  <%= link_to 'add as friend', :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
<% end %>
<% end %>

<%= simple_format(@this_user.description) %>

<% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>

User location

  No home location has been set.
  <% if @user and @this_user.id == @user.id %>
  You can set your home location on your <%= link_to 'settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %> page.
  <% end %>
<% else %>

  <% if @user and @this_user.id == @user.id %>

Your friends

    <% if @this_user.friends.empty? %>
      You have not added any friends yet.
    <% else %>

      <% @this_user.friends.each do |friend| %>
      <% @friend = User.find_by_id(friend.friend_user_id) %>

      <%= link_to @friend.display_name, :controller => 'user', :action => 'view',  :display_name => @friend.display_name %>
      <% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %>
      (<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>)

      <%end%>

    <%end%>

  <%end%>

  <% if @user and @this_user.id == @user.id %>

Nearby users:

    <% if @this_user.nearby.empty? %>
      There are no users who admit to mapping nearby yet.
    <% else %>

    <%= render :partial => 'friend_map' %>

      <% @this_user.nearby.each do |nearby| %>

      <%= link_to nearby.display_name, :controller => 'user', :action => 'view',  :display_name => nearby.display_name %>
      <%= @this_user.distance(nearby).round %>km away
      (<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => nearby.id %>)

      <% end %>

    <% end %>
  <% end %>
<% end %>

<% @this_user = User.find_by_display_name(@this_user.display_name) %>

<%= @this_user.display_name %>

<% if @user and @this_user.id == @user.id %>
<%= link_to 'my diary', :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
| <%= link_to 'new diary post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
| <%= link_to 'my traces', :controller => 'trace', :action=>'mine' %>
| <%= link_to 'my settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %>
<% else %>
<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @this_user.id %>
| <%= link_to 'diary', :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
| <%= link_to 'traces', :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
| <% if @user and @user.is_friends_with?(@this_user) %>
  <%= link_to 'remove as friend', :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
<% else %>
  <%= link_to 'add as friend', :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
<% end %>
<% end %>

<%= simple_format(@this_user.description) %>

User location

<% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
  No home location has been set.
  <% if @user and @this_user.id == @user.id %>
  You can set your home location on your <%= link_to 'settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %> page.
  <% end %>
<% else %>

  <% if @user and @this_user.id == @user.id %>

Your friends

    <% if @this_user.friends.empty? %>
      You have not added any friends yet.
    <% else %>

      <% @this_user.friends.each do |friend| %>
      <% @friend = User.find_by_id(friend.friend_user_id) %>

      <%= link_to @friend.display_name, :controller => 'user', :action => 'view',  :display_name => @friend.display_name %>
      <% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %>
      (<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>)

      <%end%>

    <%end%>

  <%end%>

Nearby users:

  <% if @this_user.nearby.empty? %>
    There are no users who admit to mapping nearby yet.
  <% else %>

  <%= render :partial => 'friend_map' %>

    <% @this_user.nearby.each do |nearby| %>

    <%= link_to nearby.display_name, :controller => 'user', :action => 'view',  :display_name => nearby.display_name %>
    <%= @this_user.distance(nearby).round %>km away
    (<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => nearby.id %>)

    <%end%>

  <%end%>

<% end %>


fixed link to group from profile page.

fixed link to group from profile page.

<% unless logged_in? -%>
  <%= render :partial => 'profile/show', :locals => {:profile => @user.profiles.public} %>
<% else -%>
  <% if @user.friend_of?(current_user) -%>
    <%= link_to 'remove from my contacts'.t, {:controller => 'contact', :action => 'remove', :id => @user} %>
  <% elsif @user.profiles.visible_by(current_user).may_request_contact? -%>
    <%= link_to 'add to my contacts', {:controller => 'contact', :action => 'add', :id => @user} %>
  <% end -%>

Profile

  <%= render( :partial => 'profile/show',
     :locals => {:profile => @user.profiles.visible_by(current_user)} )%>
  <% if @user.friend_of?(current_user) or @user.peer_of?(current_user) -%>

Groups

      <% group_count = 0 -%>
      <% @user.groups.each do |g| %>
        <% if g.publicly_visible_members or current_user.member_of? g %>

<%= link_to_group(g) %>

          <% group_count += 1 -%>
        <% end -%>
      <% end -%>
      <% if group_count == 0 %>

<%= 'none'.t %>

      <% end %>

Activity

      tasks:

      <%= link_to 'tasks assigned to %s' %@user.display_name, url_for_user(@user, :action => 'tasks') %>

      pages participated in:

      <%= render :partial => 'pages/list/table', :locals => {:heading => true} %>

  <% end -%>
<% end -%>

<% unless logged_in? -%>
  <%= render :partial => 'profile/show', :locals => {:profile => @user.profiles.public} %>
<% else -%>
  <% if @user.friend_of?(current_user) -%>
    <%= link_to 'remove from my contacts'.t, {:controller => 'contact', :action => 'remove', :id => @user} %>
  <% elsif @user.profiles.visible_by(current_user).may_request_contact? -%>
    <%= link_to 'add to my contacts', {:controller => 'contact', :action => 'add', :id => @user} %>
  <% end -%>

Profile

  <%= render( :partial => 'profile/show',
     :locals => {:profile => @user.profiles.visible_by(current_user)} )%>
  <% if @user.friend_of?(current_user) or @user.peer_of?(current_user) -%>

Groups

      <% group_count = 0 -%>
      <% @user.groups.each do |g| %>
        <% if g.publicly_visible_members or current_user.member_of? g %>

            <%= link_to(g.display_name, :controller => 'groups', :action => 'show', :id => g) %>

          <% group_count += 1 -%>
        <% end -%>
      <% end -%>
      <% if group_count == 0 %>

<%= 'none'.t %>

      <% end %>

Activity

      tasks:

      <%= link_to 'tasks assigned to %s' %@user.display_name, url_for_user(@user, :action => 'tasks') %>

      pages participated in:

      <%= render :partial => 'pages/list/table', :locals => {:heading => true} %>

  <% end -%>
<% end -%>


Hmm, the "you have no cages" message was an h3.  not anymore.

Summary page for <%= @user.name %>

Cages

<% if @mycages.length == 0 %>
You have no cages
<% else %>

<% @div_id = "my_cages" %>
<%= render_partial 'cages/cage_list', @mycages %>

<% end %>

Current Medical Problems

<% if @mymedicalproblems.length == 0 %>
You are responsible for no medical problems.
<% else %>

Bat
Medical Problem
User
Date Opened
<% if @list_all %>
Date Closed
<% end %>

Treatment
<% @show_bat = true %>
<% for problem in @mymedicalproblems %>
<% @bat = problem.bat %>
<%= render_partial 'medical_problems/medical_problem_for_bat',  problem %>
<% end %>

<% end %>

Tasks

Feeding Tasks

<% if @my_feeding_tasks.length == 0 %>
  You have no cage feeding tasks.
<% else %>
<%= render_partial 'tasks/tasks_list' , nil, 'tasks' => @my_feeding_tasks %>
<% end %>

Weighing Tasks

<% if @my_weighing_tasks.length == 0 %>
  You have no cage weighing tasks.
<% else %>
<%= render_partial 'tasks/tasks_list' , nil, 'tasks' => @my_weighing_tasks %>
<% end %>

General Tasks

<% if @my_general_tasks.length == 0 %>
  You have no general tasks.
<% else %>
<%= render_partial 'tasks/tasks_list' , nil, 'tasks' => @my_general_tasks %>
<% end %>


Added some extra clarification on how to change the loading content

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :layout => 'lib/index' to your Buildfile.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=8" />
<% # Set the 'title' in your config to alter this setting %>
    <title><%= title %></title>
<% #
   # You may choose to load one or more bootstrap resources.  These are
   # JS targets that you would like to load at the top of the page.  Specify
   # these in your Buildfile with the 'bootstrap' config.
-%>
 <% if config.bootstrap %>

  <% end -%>
<% #
   # Bootstrap code is loaded at the top of your page to do any early setup
   # you might need, including basic browser detection.  The default
   # bootstrap code provided by SproutCore simply detects your browser
   # platform.  Add more by including templates targeting the bootstrap
-%>
  <% if @content_for_bootstrap %>

  <% end -%>
<% #
   # This line should appear in your head area to include the stylesheets
   # generated by your client.  If you need to include your own
   # stylesheets, you don't need to change it here.  Instead use the
   # required option in your config.
-%>
   <%= stylesheets_for_client %>
   <%= @content_for_page_styles %>

<% # The theme CSS class is added automatically based on your chosen theme.
   # If you need to specify a custom theme name, use CONFIG.theme_name
-%>
  <body class="<%= [theme_name(:default => 'sc-theme'), 'focus'].compact.join(' ') %>">
<% # This section is used to setup additional optional class names on the
   # body content based on JS-selected conditions.  Use this to make sure you
   # show the proper CSS as soon as the page appears.
-%>
<% unless @content_for_setup_body_class_names.blank? %>

<% end -%>
<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
<%= @content_for_body %>
<% #
   # This is where your loading screen will appear.  To add a loading screen
   # just declare content_for('loading') in one of your partials. If you use
   # sc-gen to generate your app, it will create a file called loading.rhtml
   # under english.lproj. You can insert the desired content there.
-%>
<% unless @content_for_loading.blank? %>

<%= @content_for_loading %>

<% end -%>
<% #
   # This is where the resources you declare will appear.  By default anything
   # you add to partials will be added to this section unless you specify
   # otherwise.  Note that resources are initially hidden so you can pull them
   # apart as needed on page load.
-%>
<% unless @content_for_resources.blank? %>

      <%= @content_for_resources -%>

<% end -%>
<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
<%= javascripts_for_client %>
<% unless @content_for_page_javascript.blank? %>
<%= @content_for_page_javascript %>
<% end -%>
<% #
   # If you use old-style view helpers in your page, this method must be
   # called to actually add the page views to your HTML.  Normally this will
   # not generate any content.
-%>
<% #render_page_views -%>
<% # Older SproutCore applications need SC.didLoad to be called after onload.
   # This is no longer required by SproutCore so it is off by default.  To
   # reenable set use_window_onload = true in yur config.
-%>
<% if config.use_window_onload %>

<% end -%>
<% #
   # The final content section can be used to add any last minute setup you
   # need to do before the page ends.  This is required for loading unit
   # tests among other things.
-%>
<%= @content_for_final -%>

<% # SPROUTCORE DEFAULT INDEX TEMPLATE
   # This template provide provides a basic wrapper for a SproutCore client.
   # Most of the time, it will be sufficient for your own needs.  However, if
   # you need to create your own template, you can do so by copying this file
   # into your client, naming it 'index.rhtml' and then adding the options
   # :layout => 'lib/index' to your Buildfile.
   #
   # See the comments in this file for more information on what you can
   # change.
-%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=8" />
<% # Set the 'title' in your config to alter this setting %>
    <title><%= title %></title>
<% #
   # You may choose to load one or more bootstrap resources.  These are
   # JS targets that you would like to load at the top of the page.  Specify
   # these in your Buildfile with the 'bootstrap' config.
-%>
 <% if config.bootstrap %>

  <% end -%>
<% #
   # Bootstrap code is loaded at the top of your page to do any early setup
   # you might need, including basic browser detection.  The default
   # bootstrap code provided by SproutCore simply detects your browser
   # platform.  Add more by including templates targeting the bootstrap
-%>
  <% if @content_for_bootstrap %>

  <% end -%>
<% #
   # This line should appear in your head area to include the stylesheets
   # generated by your client.  If you need to include your own
   # stylesheets, you don't need to change it here.  Instead use the
   # required option in your config.
-%>
   <%= stylesheets_for_client %>
   <%= @content_for_page_styles %>

<% # The theme CSS class is added automatically based on your chosen theme.
   # If you need to specify a custom theme name, use CONFIG.theme_name
-%>
  <body class="<%= [theme_name(:default => 'sc-theme'), 'focus'].compact.join(' ') %>">
<% # This section is used to setup additional optional class names on the
   # body content based on JS-selected conditions.  Use this to make sure you
   # show the proper CSS as soon as the page appears.
-%>
<% unless @content_for_setup_body_class_names.blank? %>

<% end -%>
<% #
   # This is where you root body element will appear.  To cause your
   # content to appear here, just declare content_for('body') in one of
   # your partials.
-%>
<%= @content_for_body %>
<% #
   # This is where your loading screen will appear.  To add a loading screen
   # just declare content_for('loading') in one of your partials.
-%>
<% unless @content_for_loading.blank? %>

<%= @content_for_loading %>

<% end -%>
<% #
   # This is where the resources you declare will appear.  By default anything
   # you add to partials will be added to this section unless you specify
   # otherwise.  Note that resources are initially hidden so you can pull them
   # apart as needed on page load.
-%>
<% unless @content_for_resources.blank? %>

      <%= @content_for_resources -%>

<% end -%>
<% #
   # This line should appear at the bottom of your page to include your
   # generated JavaScript and any libraries you reference.  If you need
   # to include other javascripts, add them to the :requires option of
   # your client in routes.rb instead of changing it here.
-%>
<%= javascripts_for_client %>
<% unless @content_for_page_javascript.blank? %>
<%= @content_for_page_javascript %>
<% end -%>
<% #
   # If you use old-style view helpers in your page, this method must be
   # called to actually add the page views to your HTML.  Normally this will
   # not generate any content.
-%>
<% #render_page_views -%>
<% # Older SproutCore applications need SC.didLoad to be called after onload.
   # This is no longer required by SproutCore so it is off by default.  To
   # reenable set use_window_onload = true in yur config.
-%>
<% if config.use_window_onload %>

<% end -%>
<% #
   # The final content section can be used to add any last minute setup you
   # need to do before the page ends.  This is required for loading unit
   # tests among other things.
-%>
<%= @content_for_final -%>


Show questionnaire link if we have any perms

<% p = logged_in? ? logged_in_person : nil-%>

	<% for questionnaire in @questionnaires %>
          <% authors = questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>

            <div id="questionnairesummary_<%=questionnaire.id%>">

				  <% if logged_in? and Questionnaire.permission_names.any? { |p| logged_in_person.permitted?(questionnaire, p) } -%>
                  	<%= link_to questionnaire.title, questionnaire %>
				  <% else -%>
				    <%=h questionnaire.title%>
					(<%= link_to "Answer", :controller => "answer", :action => "index", :id => questionnaire.id -%>)
				  <% end -%>

                  <% if questionnaire.tags.length > 0 %>
                    Tags:

                     <%=h questionnaire.tag_names.join(", ") %>

                  <% end -%>

                  <%= h authors %>

	<% end %>
  <%= will_paginate @questionnaires, :renderer => "RemoteLinkRenderer" %>

<% p = logged_in? ? logged_in_person : nil-%>

	<% for questionnaire in @questionnaires %>
          <% authors = questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>

            <div id="questionnairesummary_<%=questionnaire.id%>">

				  <% if logged_in? and logged_in_person.permitted?(questionnaire, "edit") -%>
                  	<%= link_to questionnaire.title, questionnaire %>
				  <% else -%>
				    <%=h questionnaire.title%>
					(<%= link_to "Answer", :controller => "answer", :action => "index", :id => questionnaire.id -%>)
				  <% end -%>

                  <% if questionnaire.tags.length > 0 %>
                    Tags:

                     <%=h questionnaire.tag_names.join(", ") %>

                  <% end -%>

                  <%= h authors %>

	<% end %>
  <%= will_paginate @questionnaires, :renderer => "RemoteLinkRenderer" %>


Removed credit card form sor paypal processor

<% if f.object.reference_card && processor.processor_handler != 'shop/test_payment_processor' %>

    <input type='radio' id='payment_<%= processor.id %>_type_reference' name='payment[<%= processor.id %>][type]' value='reference' <%= "checked='checked'" if f.object.type == 'reference' %> />
    <label for='payment_<%= processor.id %>_type_reference'> Pay using card on file: <%= f.object.reference_card %>

     <input type='radio'  id='payment_<%= processor.id %>_type_standard'  name='payment[<%= processor.id %>][type]' value='standard' <%= "checked='checked'" if f.object.type == 'standard' %>

      <label for='payment_<%= processor.id %>_type_standard'>Or Pay with:

<% end -%>

<% if !f.object.reference_card || processor.processor_handler == 'shop/test_payment_processor' %>

  <input type='hidden'  name='payment[<%= processor.id %>][type]' value='standard' />
    Pay with:

<% else -%>

<% end -%>

      <input class="radio_button" id="payment[<%= processor.id %>]_card_type_visa" name="payment[<%= processor.id %>][card_type]" type="radio" value="visa" <%= "checked='checked'" if f.object.card_type == 'visa' %> />

      Visa

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_mastercard" name="payment[<%= processor.id %>][card_type]" type="radio" value="master" <%= "checked='checked'" if f.object.card_type == 'master' %> />

      Mastercard

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_amex" name="payment[<%= processor.id %>][card_type]" type="radio" value="american_express" <%= "checked='checked'" if f.object.card_type == 'american_express' %> />

      Amex

  Card Number:

    <%= f.text_field :cc, :size => 20 %> CVC: <%= f.text_field :cvc, :size => 3 %>

    Expiration:

    Month <%= f.select :exp_month, (1..12).to_a.collect { |mon| mon.to_s } %> Year <%= f.select :exp_year, (Time.now.strftime("%Y").to_i..Time.now.strftime("%Y").to_i+15).to_a.collect { |yr| yr.to_s } %>

<% if processor.processor_handler != 'shop/test_payment_processor'%>

  <%= f.check_box :remember %>
    <% if admin -%>
        Remember this card information  for future administrative transactions
 (it will not be visible to the user)
    <% else -%>
        Remember this card information for future transactions
    <% end -%>

<% end -%>

<% if f.object.reference_card && processor.processor_handler != 'shop/test_payment_processor'%>

<% end -%>

<% if f.object.reference_card %>

    <input type='radio' id='payment_<%= processor.id %>_type_reference' name='payment[<%= processor.id %>][type]' value='reference' <%= "checked='checked'" if f.object.type == 'reference' %> />
    <label for='payment_<%= processor.id %>_type_reference'> Pay using card on file: <%= f.object.reference_card %>

     <input type='radio'  id='payment_<%= processor.id %>_type_standard'  name='payment[<%= processor.id %>][type]' value='standard' <%= "checked='checked'" if f.object.type == 'standard' %>

      <label for='payment_<%= processor.id %>_type_standard'>Or Pay with:

<% end -%>

<% if !f.object.reference_card %>

  <input type='hidden'  name='payment[<%= processor.id %>][type]' value='standard' />
    Pay with:

<% else -%>

<% end -%>

      <input class="radio_button" id="payment[<%= processor.id %>]_card_type_visa" name="payment[<%= processor.id %>][card_type]" type="radio" value="visa" <%= "checked='checked'" if f.object.card_type == 'visa' %> />

      Visa

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_mastercard" name="payment[<%= processor.id %>][card_type]" type="radio" value="master" <%= "checked='checked'" if f.object.card_type == 'master' %> />

      Mastercard

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_amex" name="payment[<%= processor.id %>][card_type]" type="radio" value="american_express" <%= "checked='checked'" if f.object.card_type == 'american_express' %> />

      Amex

  Card Number:

    <%= f.text_field :cc, :size => 20 %> CVC: <%= f.text_field :cvc, :size => 3 %>

    Expiration:

    Month <%= f.select :exp_month, (1..12).to_a.collect { |mon| mon.to_s } %> Year <%= f.select :exp_year, (Time.now.strftime("%Y").to_i..Time.now.strftime("%Y").to_i+15).to_a.collect { |yr| yr.to_s } %>

  <%= f.check_box :remember %>
    <% if admin -%>
        Remember this card information  for future administrative transactions
 (it will not be visible to the user)
    <% else -%>
        Remember this card information for future transactions
    <% end -%>

<% if f.object.reference_card %>

<% end -%>


Revert "Correct logo filename"

Revert "Correct logo filename"

This reverts commit 3a08696ec7df693fe856e871146388e6f94e9c14.

<%= link_to image_tag('navimg/logo_trans_small.png'), frontpage_url, :id=>'logo' %>

<%= link_to image_tag('navimg/logo-trans-small.png'), frontpage_url, :id=>'logo' %>


fixed issue with template select box

fixed issue with template select box

git-svn-id: 3551c6e76a45777ca67e5c8385b599cca19d6692@560 567b1171-46fb-0310-a4c9-b4bef9110e78

  choose a template
  <%= select_tag 'template', options_for_select([''] + Template.template_types), :onchange => "Template.navigate_to(this)" %>

  choose a template
  <%= select_tag 'template', options_for_select(Template.template_types.unshift('')), :onchange => "Template.navigate_to(this)" %>


beautified the indentation of example xml api response

<%= stylesheet_link_tag "code" %>

API Instructions

Parse a citation

(POST) (FIXME:hostname)/citations/create

Required argument: citation or citation[] - The string(s) to parse.

Header: Accept: text/xml

Returns a list of parsed citations in xml format. Each parsed citation includes a ContextObject with the citation as the referent.

Status code: 201

Examples

 Using Ruby:

require 'net/http'

Net::HTTP.start('localhost', 3000) do |http|
  response = http.post('/citations/create',
    'citation=A. Bookstein and S. T. Klein,  \
    Detecting content-bearing words by serial clustering,  \
    Proceedings of the Nineteenth Annual International ACM SIGIR Conference \
    on Research and Development in Information Retrieval,   \
    pp. 319327,   1995.',
    'Accept' => 'text/xml')

  puts "Code: #{response.code}"
  puts "Message: #{response.message}"
  puts "Body:\n #{response.body}"
end

 Using curl:

Parsing a single citation:

curl -H 'Accept: text/xml' -d "citation=Udvarhelyi, I.S., Gatsonis,
C.A., Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J.
Acute Myocardial Infarction in the Medicare population: process of
care and clinical outcomes. Journal of the American Medical
Association, 1992; 18:2530-2536.  "
http://0.0.0.0:3000/citations/create

Parsing multiple citations:

curl -H 'Accept: text/xml' -d "citation[]=Fielderman, A., Silvester,
G., Gatsonis, C.A., Hoenig, J., Flynn, S. Prognostic significance of
flow cytometric DNA analysis and proliferative index in stage I
non-small cell lung cancer. American Review of Respiratory Disease,
1992; 146:707-710.&citation[]=Udvarhelyi, I.S., Gatsonis, C.A.,
Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J. Acute
Myocardial Infarction in the Medicare population: process of care and
clinical outcomes. Journal of the American Medical Association, 1992;
18:2530-2536.  " http://0.0.0.0:3000/citations/create

Example Return:

<citations>
  <citation valid=true>
  <authors>
    <author>I S Udvarhelyi</author>
    <author>C A Gatsonis</author>
    <author>A M Epstein</author>
    <author>C L Pashos</author>
    <author>J P Newhouse</author>
    <author>B J McNeil</author>
  </authors>
  <title>Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes</title>
  <journal>Journal of the American Medical Association</ journal>
  <pages>18--2530</pages>
  <year>1992</year>
  <raw_string>Udvarhelyi, I.S., Gatsonis, C.A., Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J. Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes. Journal of the American Medical Association, 1992; 18:2530-2536.</raw_string>
  <ctx:context-objects xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='info:ofi/fmt:xml:xsd:ctx http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:ctx' xmlns:ctx='info:ofi/fmt:xml:xsd:ctx'>
    <ctx:context-object timestamp='2008-07-11T00:57:33-04:00'
    encoding='info:ofi/enc:UTF-8' version='Z39.88-2004' identifier=''>
      <ctx:referent>
        <ctx:metadata-by-val>
          <ctx:format>info:ofi/fmt:xml:xsd:journal</ctx:format>
          <ctx:metadata>
            <journal xmlns:rft='info:ofi/fmt:xml:xsd:journal' xsi:schemaLocation='info:ofi/fmt:xml:xsd:journal http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:journal'>
              <rft:atitle>Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes</rft:atitle>
              <rft:spage>18</rft:spage>
              <rft:date>1992</rft:date>
              <rft:stitle>Journal of the American Medical Association</rft:stitle>
              <rft:genre>article</rft:genre>
              <rft:epage>2530</rft:epage>
              <rft:au>I S Udvarhelyi</rft:au>
              <rft:au>C A Gatsonis</rft:au>
              <rft:au>A M Epstein</rft:au>
              <rft:au>C L Pashos</rft:au>
              <rft:au>J P Newhouse</rft:au>
              <rft:au>B J McNeil</rft:au>
            </journal>
          </ctx:metadata>
        </ctx:metadata-by-val>
      </ctx:referent>
    </ctx:context-object>
  </ctx:context-objects>
  </citation>
</citations>


Avoid using news_article association when listing revisions

News Article Revisions

Title
Version
Votes
Source

<% @versions.each do |version| %>

<% if version.version > 0 %>

  <%= link_to h(truncate(version.title, :length => 75)), { :action => :diff, :id => version.news_article_id,
    :version_a => version.version,
    :version_b => version.version - 1 }, :title => h(version.title) %>

<% else %>

  <span title="<%= h(version.title) %>"><%= h(truncate(version.title, :length => 75)) %>

<% end %>

  <%= version.version %>

  <%= version.votes %>

  <%#= version.source %>

<% end %>

<%= will_paginate @versions %>

News Article Revisions

Title
Version
Votes
Source

<% @versions.each do |version| %>

<% if version.news_article.versions_count > 1 %>

  <%= link_to h(truncate(version.title, :length => 75)), { :action => :diff, :id => version.news_article.id,
    :version_a => version.version,
    :version_b => version.version - 1 }, :title => h(version.title) %>

<% else %>

  <span title="<%= h(version.title) %>"><%= h(truncate(version.title, :length => 75)) %>

<% end %>

  <%= version.version %>

  <%= version.votes %>

  <%= version.news_article.source %>

<% end %>

<%= will_paginate @versions %>


fixing css class on update form (was still 'create')

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@596 561dde7e-7729-0410-be8e-ef83869d6c7d

<% url_options = params_for(:action => :update) -%>
<%=
if request.xhr?
  if active_scaffold_config.update.multipart?  # file_uploads
    form_remote_upload_tag url_options.merge({:iframe => true}),
                           :id => element_form_id(:action => :update),
                           :class => 'update',
                           :method => :put
  else
    form_remote_tag :url => url_options,
                    :after => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :update)}');",
                    :complete => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :update)}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :html => {
                      :href => url_for(url_options),
                      :id => element_form_id(:action => :update),
                      :class => 'update',
                      :method => :put
                    }
  end
else
  form_tag url_options,
           :id => element_form_id(:action => :update),
           :multipart => active_scaffold_config.update.multipart?,
           :class => 'update',
           :method => :put
end
%>

<%= @record.to_label.nil? ? active_scaffold_config.update.label : as_('Update %s', @record.to_label) %>

  <% if request.xhr? -%>
    <div id="<%= element_messages_id(:action => :update) %>" class="messages-container"><%= error_messages_for :record %>

  <% else -%>
    <%= render :partial => 'form_messages' %>
  <% end -%>

  <%= render :partial => 'form', :locals => { :columns => active_scaffold_config.update.columns } %>

    <%= submit_tag as_('Update'), :class => "submit" %>
    <%= link_to as_('Cancel'), params_for(:action => 'list'), :class => 'cancel' %>
    <%= loading_indicator_tag(:action => :update, :id => params[:id]) %>

</form>

<% url_options = params_for(:action => :update) -%>
<%=
if request.xhr?
  if active_scaffold_config.update.multipart?  # file_uploads
    form_remote_upload_tag url_options.merge({:iframe => true}),
                           :id => element_form_id(:action => :update),
                           :class => 'update',
                           :method => :put
  else
    form_remote_tag :url => url_options,
                    :after => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :update)}');",
                    :complete => "$('#{loading_indicator_id(:action => :update, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :update)}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :html => {
                      :href => url_for(url_options),
                      :id => element_form_id(:action => :update),
                      :class => 'update',
                      :method => :put
                    }
  end
else
  form_tag url_options,
           :id => element_form_id(:action => :update),
           :multipart => active_scaffold_config.update.multipart?,
           :class => 'create',
           :method => :put
end
%>

<%= @record.to_label.nil? ? active_scaffold_config.update.label : as_('Update %s', @record.to_label) %>

  <% if request.xhr? -%>
    <div id="<%= element_messages_id(:action => :update) %>" class="messages-container"><%= error_messages_for :record %>

  <% else -%>
    <%= render :partial => 'form_messages' %>
  <% end -%>

  <%= render :partial => 'form', :locals => { :columns => active_scaffold_config.update.columns } %>

    <%= submit_tag as_('Update'), :class => "submit" %>
    <%= link_to as_('Cancel'), params_for(:action => 'list'), :class => 'cancel' %>
    <%= loading_indicator_tag(:action => :update, :id => params[:id]) %>

</form>


fixes #40

fixes #40

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@212 820eb932-12ee-0310-9ca8-eeb645f39767

<% content_for("script") do %>
function item_added() {
  new Effect.Appear($('commentList').lastChild);
  Element.toggle('comment_loading');
  Element.toggle('comment_loaded');
}
function item_loading() {
  Element.toggle('commentform')
  new Effect.Appear('comment_loading');
  $('commentform').elements[2].value = '';
  $('commentform').elements[2].focus();
}

window.onload = function() {
  if( $('commentform').elements[1].value != '' ) {
    Element.toggle('guest_url');
  }
}
<% end %>

<%= render_partial "article", @article %>

<% if @article.allow_comments > 0 -%>

Comments...

    Leave a response

    <%= render_collection_of_partials "comment", @article.comments %>

<% end -%>

<% if @article.allow_pings > 0 -%>

Trackbacks...

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

    <%= render_collection_of_partials "trackback", @article.trackbacks %>

<% end -%>

<% if @article.allow_comments > 0 -%>
  <%= form_remote_tag :url => {:action => "comment", :id => @article.id},
                      :update => "commentList", :position=> "bottom",
                      :loading => "item_loading()",
                      :complete => "item_added()",
                      :html => {:id=>"commentform",:class=>"commentform"} %>

    write a comment....

        Your name

          <%= text_field "comment", "author", :size => 20 %> (leave url »)

        Your blog

          <%= text_field "comment", "url" %>

          Your message

          <%= text_area "comment", "body", "style"=> "width:300px;height:200px" %>

          <input type="submit" name="submit" value="submit" class="button" />

  <%= end_form_tag %>

    <%= image_tag "spinner.gif" %> Submitting comment

    Finished submitting comment.

<% end -%>

<% content_for("script") do %>
function item_added() {
  new Effect.Appear($('commentList').lastChild);
  Element.toggle('comment_loading');
  Element.toggle('comment_loaded');
}
function item_loading() {
  Element.toggle('commentform')
  new Effect.Appear('comment_loading');
  $('commentform').elements[2].value = '';
  $('commentform').elements[2].focus();
}

window.onload = function() {
  if( $('commentform').elements[1].value != '' ) {
    Element.toggle('guest_url');
  }
}
<% end %>

<%= render_partial "article", @article %>

<% if @article.allow_comments > 0 -%>

<%= responses(@article.comments, "response") %> to '<%= @article.title  %>'

    Leave a response

    <%= render_collection_of_partials "comment", @article.comments %>

<% end -%>

<% if @article.allow_pings > 0 -%>

<%= responses(@article.trackbacks, "trackback") %> to '<%= @article.title  %>'

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

    <%= render_collection_of_partials "trackback", @article.trackbacks %>

<% end -%>

<% if @article.allow_comments > 0 -%>
  <%= form_remote_tag :url => {:action => "comment", :id => @article.id},
                      :update => "commentList", :position=> "bottom",
                      :loading => "item_loading()",
                      :complete => "item_added()",
                      :html => {:id=>"commentform",:class=>"commentform"} %>

    write a comment....

        Your name

          <%= text_field "comment", "author", :size => 20 %> (leave url »)

        Your blog

          <%= text_field "comment", "url" %>

          Your message

          <%= text_area "comment", "body", "style"=> "width:300px;height:200px" %>

          <input type="submit" name="submit" value="submit" class="button" />

  <%= end_form_tag %>

    <%= image_tag "spinner.gif" %> Submitting comment

    Finished submitting comment.

<% end -%>


use pop up login instead of in page

use pop up login instead of in page

		<%= link_to image_tag("close.gif", :alt => "Close login box"), "#", :onclick => "closeLoginBox('login_box'); return false;" %>

        <% form_tag session_path do %>
          <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
          <%= hidden_field_tag "called_from[action]", controller.action_name -%>
          <%= hidden_field_tag "called_from[id]", params[:id] -%>

              Email:

              <%= text_field_tag 'login', nil, :class => 'field', :style => "width: 140px;" %>

                  Password:

              <%= password_field_tag 'password', nil, :class => 'field', :style => "width: 140px;" %>

              Remember me: <%= check_box_tag 'remember_me' %>

            <%= submit_tag "Log in", :disable_with => "Logging in..." %>

        <% end %>
        <%# if !REGISTRATION_CLOSED -%>

<%#= link_to "Sign up", signup_url %>

        <%# else -%>

        <%# end -%>

          <%= link_to "Forgotten password?", forgot_password_url %>

<% unless logged_in? -%>

About

MethodBox enables you to browse and download datasets, share methods and scripts, find fellow researchers with similar interests and share your knowledge.

Who?

 MethodBox is brought to you by a team from the University of Manchester in the UK, led by Carole Goble, Iain Buchan and Angela Dale.

MethodBox is part of the myGrid consortium, which brought you the Taverna Workflow Workbench for creating and executing scientific workflows, myExperiment for sharing workflows and Bio-catalogue for curating life science web-services.

Log in / Register

        <% form_tag session_path do %>
          <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
          <%= hidden_field_tag "called_from[action]", controller.action_name -%>
          <%= hidden_field_tag "called_from[id]", params[:id] -%>

              Email:

              <%= text_field_tag 'login', nil, :class => 'field', :style => "width: 140px;" %>

                  Password:

              <%= password_field_tag 'password', nil, :class => 'field', :style => "width: 140px;" %>

              Remember me: <%= check_box_tag 'remember_me' %>

            <%= submit_tag "Log in", :disable_with => "Logging in..." %>

        <% end %>
        <% if !REGISTRATION_CLOSED -%>

            Need an account?

            <%= link_to "Sign up", signup_url %>

        <% else -%>

            New user registration is currently closed

        <% end -%>

          <%= link_to "Forgotten password?", forgot_password_url %>

<% end -%>


Oops, I forgot this template change for themes to work

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@375 561dde7e-7729-0410-be8e-ef83869d6c7d

<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%= active_scaffold_config.theme %>-theme">

    <%= render :partial => 'list_header' %>

<tbody class="before_header" id="<%= before_header_id -%>">

  <div id="<%= active_scaffold_content_id -%>">
    <%= render :partial => 'list' %>

<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%= active_scaffold_config.theme %>">

    <%= render :partial => 'list_header' %>

<tbody class="before_header" id="<%= before_header_id -%>">

  <div id="<%= active_scaffold_content_id -%>">
    <%= render :partial => 'list' %>


fixed typo in asset history view

fixed typo in asset history view

    version
    updated on

<% @asset.versions.reverse.each do |version| -%>
  <tr class="<%= cycle('shade-odd', 'shade-even') %>" id="asset_<%= @asset.id %>_version_<%= version.version %>">

      <% if @current_user.may?(:edit, @page) and version.version < @asset.version -%>
        <%= destroy_version_link(version) %>
      <% end -%>

    <%= link_to_asset(version.thumbnails, :small, :crop! => '32x32') %>
    <%= link_to "version #{version.version}", version.url %>
    <%= full_time(version.updated_at) %>

<% end -%>

    version
    updated on

<% @asset.versions.reverse.each do |version| -%>
  <tr class="<%= cycle('shade-odd', 'shade-even') %>" id="asset_<%= @asset.id %>_version_<%= version.version %>">

      <% if @current_user.may?(:edit, @page) and version.version < @asset.version -%>
        <%= destroy_version_link(version) %>
      <% end -%>

    <%= link_to_asset(version.thumbnail, :small, :crop! => '32x32') %>
    <%= link_to "version #{version.version}", version.url %>
    <%= full_time(version.updated_at) %>

<% end -%>


use currency_fmt instead of cu_to_s in _booking

<% @booking = booking %>
  <tr id="booking_<%=h @booking.id %>">
    <%= in_place_editor_field :booking, :in_place_value_date %>

      <%= in_place_editor_field :booking, :title %>
      <%= '
' unless booking.comments.empty? %>
      <%= in_place_editor_field :booking, :comments %>

    <%= link_to h(booking.credit_account.title), :controller => :accounts, :action => :show, :id => booking.credit_account unless booking.credit_account.nil? %>
    <%= link_to h(booking.debit_account.title), :controller => :accounts, :action => :show, :id => booking.debit_account unless booking.debit_account.nil? %>
    <%= currency_fmt(booking.amount) %>

    <%= link_to 'Edit', { :action => 'edit', :id => booking }, :method => :post %>
    <%= link_to 'Destroy', { :action => 'destroy', :id => booking }, :confirm => 'Are you sure?', :method => :post %>
    <%= link_to_remote 'Copy', :url => { :action => 'copy', :id => booking }, :position => :after, :update => "booking_#{booking.id}" %>

<% @booking = booking %>
  <tr id="booking_<%=h @booking.id %>">
    <%= in_place_editor_field :booking, :in_place_value_date %>

      <%= in_place_editor_field :booking, :title %>
      <%= '
' unless booking.comments.empty? %>
      <%= in_place_editor_field :booking, :comments %>

    <%= link_to h(booking.credit_account.title), :controller => :accounts, :action => :show, :id => booking.credit_account unless booking.credit_account.nil? %>
    <%= link_to h(booking.debit_account.title), :controller => :accounts, :action => :show, :id => booking.debit_account unless booking.debit_account.nil? %>
    <%= cu_to_s(booking.rounded_amount) %>

    <%= link_to 'Edit', { :action => 'edit', :id => booking }, :method => :post %>
    <%= link_to 'Destroy', { :action => 'destroy', :id => booking }, :confirm => 'Are you sure?', :method => :post %>
    <%= link_to_remote 'Copy', :url => { :action => 'copy', :id => booking }, :position => :after, :update => "booking_#{booking.id}" %>


Spell checker for followups.

Spell checker for followups.

    <% if incoming_message.nil? %>

Send a follow up message
        to '<%=h @info_request.public_body.name %>'

    <% else %>

Send a follow up message
            <% if !incoming_message.safe_mail_from.nil? %>
                to <%= incoming_message.safe_mail_from %>
            <% end %>

    <% end %>

    <% if @info_request.stop_new_responses %>

Follow ups and new responses to this request have been stopped to prevent spam. Please
        contact us if you are <%= user_link(@info_request.user) %>
        and need to send a follow up.

    <% else %>

Use this to tell the public authority something, such as to clarify
        your request, or if they are late responding.

Please do not make new requests here.
        If you are asking for information which was not in your original request, then
        <%= link_to "file a new request", new_request_to_body_url(:public_body_id => @info_request.public_body.id.to_s) %>
        instead.

        <% if @info_request.calculate_status == 'waiting_response_overdue' %>

This request is currently overdue a response from <%=
            public_body_link(@info_request.public_body) %>.
            By law, the response had to be made no later than
            <%= simple_date(@info_request.date_response_required_by) %>
            (<%= link_to "more info", about_url + "#quickly_response" %>). You can say
            that under the <%=h(@info_request.law_used_act)%> they should have replied by now,
            and are breaking the law.

        <% end %>

        <% form_for(:outgoing_message, @outgoing_message, :html => { :id => 'followup_form' }, :url => incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => incoming_message.id)) do |o| %>

                <%= o.text_area :body, :rows => 10, :cols => 55 %>

                Privacy warning: Your follow up message, and any response
                to it, will also be displayed publically on this website.

                <%= hidden_field_tag 'submitted_followup', 1 %>
                <%= hidden_field_tag(:preview, 1 ) %>
                <%= submit_tag "Preview your follow up message" %>

        <% end %>

            <% if not @is_owning_user %>
            (You will be asked to sign in as <%= user_link(@info_request.user) %>)
            <% end %>

    <% end %>

    <% if incoming_message.nil? %>

Send a follow up message
        to '<%=h @info_request.public_body.name %>'

    <% else %>

Send a follow up message
            <% if !incoming_message.safe_mail_from.nil? %>
                to <%= incoming_message.safe_mail_from %>
            <% end %>

    <% end %>

    <% if @info_request.stop_new_responses %>

Follow ups and new responses to this request have been stopped to prevent spam. Please
        contact us if you are <%= user_link(@info_request.user) %>
        and need to send a follow up.

    <% else %>

Use this to tell the public authority something, such as to clarify
        your request, or if they are late responding.

Please do not make new requests here.
        If you are asking for information which was not in your original request, then
        <%= link_to "file a new request", new_request_to_body_url(:public_body_id => @info_request.public_body.id.to_s) %>
        instead.

        <% if @info_request.calculate_status == 'waiting_response_overdue' %>

This request is currently overdue a response from <%=
            public_body_link(@info_request.public_body) %>.
            By law, the response had to be made no later than
            <%= simple_date(@info_request.date_response_required_by) %>
            (<%= link_to "more info", about_url + "#quickly_response" %>). You can say
            that under the <%=h(@info_request.law_used_act)%> they should have replied by now,
            and are breaking the law.

        <% end %>

        <% form_for(:outgoing_message, @outgoing_message, :url => incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => incoming_message.id)) do |o| %>

                <%= o.text_area :body, :rows => 10, :cols => 55 %>

                Privacy warning: Your follow up message, and any response
                to it, will also be displayed publically on this website.

                <%= hidden_field_tag 'submitted_followup', 1 %>
                <%= hidden_field_tag(:preview, 1 ) %>
                <%= submit_tag "Preview your follow up message" %>

        <% end %>

            <% if not @is_owning_user %>
            (You will be asked to sign in as <%= user_link(@info_request.user) %>)
            <% end %>

    <% end %>


Escape lots of stuff that we missed in the delicious sidebar.  Closes #956

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@1092 820eb932-12ee-0310-9ca8-eeb645f39767

<% if @delicious -%>

<a href="http://<%=h @delicious.title %>"><%=h @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>
    <% if @sb_config['groupdate'] -%>
    <%=h group[:date].to_s.to_date.strftime("%b %d") %>
    <% end -%>

      <% for item in group[:container] %>

        <a href="<%=h item.link %>" title="<%=h item.description%>"><%=h item.title %>
        <% if @sb_config['description'] -%>

<%=h @sb_config['desclink'] ? item.description_link : item.description %>
        <% end -%>

      <% end -%>

    <% end -%>

<% end -%>

<% if @delicious -%>

<a href="http://<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>
    <% if @sb_config['groupdate'] -%>
    <%= group[:date].to_s.to_date.strftime("%b %d") %>
    <% end -%>

      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%=h item.description%>"><%=h item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end -%>

      <% end -%>

    <% end -%>

<% end -%>


ActionItem1025: reordering fields

ActionItem1025: reordering fields

<% @person ||= @profile %>

<%= required labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>

<% optional_field(@person, 'nickname') do %>
  <%= f.text_field(:nickname, :maxlength => 16, :size => 30) %>

    <%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %>

<% end %>

<%= optional_field(@person, 'contact_information', f.text_field(:contact_information)) %>
<%= optional_field(@person, 'contact_phone', labelled_form_field(_('Home phone'), text_field(:profile_data, :contact_phone))) %>
<%= optional_field(@person, 'cell_phone', f.text_field(:cell_phone)) %>
<%= optional_field(@person, 'comercial_phone', f.text_field(:comercial_phone)) %>
<%= optional_field(@person, 'sex', f.radio_group(:profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ])) %>
<%= optional_field(@person, 'birth_date', labelled_form_field(_('Birth date'), '
' + pick_date(:profile_data, :birth_date, {:start_year => (Date.today.year - 100), :end_year => (Date.today.year - 10)}) + '
')) %>
<%= optional_field(@person, 'nationality', f.text_field(:nationality)) %>
<%= optional_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
<%= optional_field(@person, 'state', f.text_field(:state)) %>
<%= optional_field(@person, 'city', f.text_field(:city)) %>
<%= optional_field(@person, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
<%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>

<% optional_field(@person, 'schooling') do %>

    <%= _('Schooling') %>

      <%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %>
      <%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %>

<% end %>

<%= optional_field(@person, 'formation', select_area(_('Formation'), 'profile_data', 'formation', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_formation_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.formation) %> >
  <%= optional_field(@person, 'custom_formation', f.text_field(:custom_formation)) %>

<%= observe_field 'profile_data_formation', :function =>'toggle_text_field("profile_data_formation", "profile_data_custom_formation_span")' %>

<%= optional_field(@person, 'area_of_study', select_area(_('Area of study'), 'profile_data', 'area_of_study', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_area_of_study_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.area_of_study) %> >
  <%= optional_field(@person, 'custom_area_of_study', f.text_field(:custom_area_of_study)) %>

<%= observe_field 'profile_data_area_of_study', :function =>'toggle_text_field("profile_data_area_of_study", "profile_data_custom_area_of_study_span")' %>

<%= optional_field(@person, 'professional_activity', f.text_field(:professional_activity)) %>
<%= optional_field(@person, 'organization', f.text_field(:organization)) %>
<%= optional_field(@person, 'organization_website', f.text_field(:organization_website)) %>

<% @person ||= @profile %>

<%= required labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>

<% optional_field(@person, 'nickname') do %>
  <%= f.text_field(:nickname, :maxlength => 16, :size => 30) %>

    <%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %>

<% end %>

<%= optional_field(@person, 'contact_information', f.text_field(:contact_information)) %>
<%= optional_field(@person, 'contact_phone', labelled_form_field(_('Home phone'), text_field(:profile_data, :contact_phone))) %>
<%= optional_field(@person, 'cell_phone', f.text_field(:cell_phone)) %>
<%= optional_field(@person, 'comercial_phone', f.text_field(:comercial_phone)) %>
<%= optional_field(@person, 'sex', f.radio_group(:profile_data, :sex, [ ['male',_('Male')], ['female',_('Female')] ])) %>
<%= optional_field(@person, 'birth_date', labelled_form_field(_('Birth date'), '
' + pick_date(:profile_data, :birth_date, {:start_year => (Date.today.year - 100), :end_year => (Date.today.year - 10)}) + '
')) %>
<%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address))) %>
<%= optional_field(@person, 'zip_code', labelled_form_field(_('ZIP code'), text_field(:profile_data, :zip_code))) %>
<%= optional_field(@person, 'city', f.text_field(:city)) %>
<%= optional_field(@person, 'state', f.text_field(:state)) %>
<%= optional_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %>
<%= optional_field(@person, 'nationality', f.text_field(:nationality)) %>

<% optional_field(@person, 'schooling') do %>

    <%= _('Schooling') %>

      <%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %>
      <%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %>

<% end %>

<%= optional_field(@person, 'formation', select_area(_('Formation'), 'profile_data', 'formation', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_formation_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.formation) %> >
  <%= optional_field(@person, 'custom_formation', f.text_field(:custom_formation)) %>

<%= observe_field 'profile_data_formation', :function =>'toggle_text_field("profile_data_formation", "profile_data_custom_formation_span")' %>

<%= optional_field(@person, 'area_of_study', select_area(_('Area of study'), 'profile_data', 'area_of_study', {:class => 'type-select-full-line'})) %>

<span id='profile_data_custom_area_of_study_span' <%= "style='display:none'" if ! ['Others', nil].include?(@person.area_of_study) %> >
  <%= optional_field(@person, 'custom_area_of_study', f.text_field(:custom_area_of_study)) %>

<%= observe_field 'profile_data_area_of_study', :function =>'toggle_text_field("profile_data_area_of_study", "profile_data_custom_area_of_study_span")' %>

<%= optional_field(@person, 'professional_activity', f.text_field(:professional_activity)) %>
<%= optional_field(@person, 'organization', f.text_field(:organization)) %>
<%= optional_field(@person, 'organization_website', f.text_field(:organization_website)) %>