class HelpController < ApplicationController

def index

  @help_title = "#{SITE_TITLE} Help Pages"
  @help_text = "The #{SITE_TITLE} provides an inventory of resources available to the community.<br><br>
It is hosted by <a href = #{SITE_PARENT_URL}>#{SITE_PARENT_ORG}</a>.  
To access these help pages, there are question marks, \"?\" <br>
throughout the site that will show an explanation of the different functions" 
  @see_also = ['resources', 'search', 'accounts' ]      

end

  def method_missing( op, *method_params )
    case op

    when :resources
      @help_title = "#{SITE_TITLE} Resources"
      @help_text = "The #{SITE_TITLE} catalogs resources for Physics Based Simulation in Life Sciences, including software, data, and web-accessible services.  The content on the site is contributed and maintained by external authors of the resources."
      @see_also = ['new_resource', 'resource_types' ]      
      @link = ['List all resources', 'resource', 'list']      

    when :resource_types
      @help_title = "#{SITE_TITLE} Resource Types"
      @help_text = "The #{SITE_TITLE} uses a single, simple categorization of resources.  Each resource can be in one of the following types: <blockquote>
<li>Software: Algorithm or Reusable Library</li>
<li>Software: Simulation Application</li>
<li>Software: Platform, Development Environment</li>
<li>Software: Support Tool</li>
<li>Web / Online Resource</li>
<li>Database or Data Source</li>
</blockquote>
"
      @see_also = ['new_resource','resources' ]      
      @link = ['List all resources', 'resource', 'list']      
      

    when :search, :Search
      @help_title = "Search Help"
      @help_text = "The Search tab shows the interface to search the #{SITE_TITLE}.  Enter keywords or parts of words to search through all the text fields for different entries."
      @see_also = ['search', 'limit_search' ]

    when :limit_search
      @help_title = "Limiting Searches"
      @help_text = "Search allows you to limit the results returned to specific categories.  When you select the checkbox for a limit, resources will be shown that match the selected criteria.  This is not complete yet - FIX"
      @see_also = ['search' ]

    when :site_admin
      @help_title = "Site Admin Page"
      @help_text = "The Site Admin Page provides functions to administer the whole site, including deleting resources and users, and managing flags."
      @see_also = ['user_admin']

    when :admin_promote
      @help_title = "Authorization Setting"
      @help_text = "Promote to Site Admin gives this user the authorization to control all aspects of the site."
      @see_also = ['user_admin']


    when :user_admin
      @help_title = "User Administration Page"
      @help_text = "When a person is logged in, a new tab appears showing te User Adminisrtation Page  This page provides functions to manage your user information, including changing your name, email and password."
      @see_also = ['new_user', 'forgotten_password', 'accounts', 'my_user_data']
      @link = ['Go to the User Administration Page', 'admin', 'index']      

    when :new_user
      @help_title = "Create New User"
      @help_text = "Anyone can create an account on the #{SITE_TITLE}.  The process involves filling seelcting a unique login handle, your name, email and an initial password.  An email is then sent to activate the account."
      @see_also = ['forgotten_password', 'accounts', 'my_user_data']
      @link = ['Create a new user', 'account', 'signup']      

    when :new_resource
      @help_title = "Adding New Resources to #{SITE_TITLE}"
      @help_text = "The #{SITE_TITLE} is moderated.  All entries are approved before being posted.  Each person with an account can suggest a new resource for addition to the #{SITE_TITLE}."
      @link = ['Suggest a new resource', 'resource', 'new']      
      
      

    when :manage_resources
      @help_title = "Managing Your Resource Entry"
      @help_text = "Each user can edit or delete Entries in the #{SITE_TITLE}.  When a user is logged in, the Admin tab lists those resources assigned to that user, and allows them to edit or delete the entry."
      @see_also = ['user_admin', 'new_user', 'forgotten_password', 'my_user_data']

      
      

    when :login_handle
      @help_title = "Login Handle"
      @help_text = "This is the Username for the system.  Use it to log in."
      @see_also = ['new_user', 'forgotten_password', 'my_user_data']

    when :password
      @help_title = "Password"
      @help_text = "This is the Password for the system.  Use it to log in.  If you forget your password, you can enter your email and we will send you a new one."
      @see_also = ['new_user', 'forgotten_password', 'my_user_data']


    when :accounts
      @help_title = "#{SITE_TITLE} Accounts"
      @help_text = "Anyone can have an account on the #{SITE_TITLE}.  Having an account will allow you to suggest a resource for us to publish, and will allow you to keep your resource information up to date.  Logged in users can also post comments on other resources.  The login page allows you to create a new account."
      @see_also = ['new_user', 'forgotten_password', 'my_user_data']

    when :forgotten_password
      @help_title = "Forgotten Password"
      @help_text = "If you have forgotten your password, it will need to be reset.  The login page has a link to send an email with a new password."
      @see_also = ['accounts', 'my_user_data']
      @link = ['Reset your password', 'account', 'reminder']

    when :my_user_data
      @help_title = "My User Data"
      @help_text = "Each user of the sysem has a login handle, a full name, and email, anda  password.  The Admin tab at teh top appears when a user is logged in, and has links to allow the user to update their personal data."
      @see_also = ['new_user', 'forgotten_password', 'accounts' ]
      @link = ['Reset your password', 'account', 'reminder']
      @link = ['Update your user data', 'account', 'update']      

    when :delete_entry
      @help_title = "Delete Entry"
      @help_text = "This function on the Site Admin Page will delete a resource after a confirmation."

    when :delete_user
      @help_title = "Delete User"
      @help_text = "This function on the Site Admin Page will delete a user after a confirmation."           

    when :flags
      @help_title = "Flags"
      @help_text = "FIX"
      @see_also = ['flag_comments']

    when :flag_comments
      @help_title = "Flag Comments"
      @help_text = "FIX"
      @see_also = ['flags']
      

    when :pending_flags
      @help_title = "Flags"
      @help_text = "#{SITE_TITLE} maintains flags that are submitted from the general user base.  If a person is logged in, then the flag includes a link to their name and account, but flags can also be submitted anonymously.  A flag indicate someone thinks an entry should be updated or removed.  The Site Admin page lists the flags currently registered for te site admin to address."           

      # add more help here
   
    else
      @help_title = "No Help Available"
      @help_text = "Sorry, I don't have help available for " + op.to_s           
    end    
        
    render :action => 'index'
  end

end
