Skip to content

Commit

Permalink
Added inbuild help guide to application. Uses Markdown syntax. Files …
Browse files Browse the repository at this point in the history
…stored under /lib/help
  • Loading branch information
glenv committed Jan 19, 2014
1 parent 7db5ab8 commit 7717464
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/controllers/help_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class HelpController < ApplicationController
before_filter :login_required # User must be logged in first
def show
@help = File.open(File.join(Rails.root, 'lib', 'help', "#{params[:page_id]}.md"), 'r') { |f| f.read }
@sidebar = File.open(File.join(Rails.root, 'lib', 'help', 'sidebar.md'), 'r') { |f| f.read }
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true)
render :html => markdown.render(File.join(Rails.root, 'lib', 'help', "#{params[:page_id]}.md"))
end


end
6 changes: 6 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def menu_button(link_name = nil, link_action = nil, icon_class = nil, button_cla
"<a href='#{link_action}' class='#{button_class}'><i class='#{icon_class}'></i> #{link_name}</a>".html_safe

end
# Help Icon Linkhelper
def help_button(help_page = nil)

"<a href='/help/#{help_page}', target='_blank'><i class='icon-question-sign'></i></a>".html_safe

end

# Used to show Employees Overview
def employees_work_overview(status_id, employee_number = nil)
Expand Down
12 changes: 12 additions & 0 deletions app/views/help/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="span10">
<div class="offset2 span8">

<%= markdown(@help) %>


</div>

<div class="span2">
<%= markdown(@sidebar) %>
</div>
</div>
1 change: 0 additions & 1 deletion app/views/layouts/_header.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<% if not logged_in? %>
<div class="page-header"><%= image_tag("logo.png",:height => '64') %><small><%= Setting::business_slogan %></small></div>
<hr>
<% end %>
1 change: 1 addition & 0 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</style>
<h1 class="offset3"><%= t "user.t_new_user" %></h1>
<div class="span12">
<%= help_button('user/create_new') %>
<%= simple_form_for @user, :html => { :class => "form-horizontal"} do |f| %>
<div class="span5 well">
<h4 class="offset4"><%= t("global.required") %></h4>
Expand Down
1 change: 1 addition & 0 deletions app/views/users/register.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</style>
<h1 class="offset3"><%= (t "user.t_new_user") %></h1>
<div class="span10">
<%= help_button('user/create_new') %>
<%= simple_form_for @user, :html => { :class => "form-horizontal"} do |f| %>
<div class="span5 well">
<h4 class="offset4"><%= t("global.required") %></h4>
Expand Down
1 change: 1 addition & 0 deletions app/views/work_orders/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="row-fluid">
<div class="span10">
<%= help_button('home') %>
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#new" data-toggle="tab"><%= t "workorder.tab_menu_new" %>&nbsp;<% if @new_work_orders.count > 0 %><span class="badge badge-important"><%= @new_work_orders.count %></span><% end %></a></li>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
match 'work_order/:id/assign' => 'work_orders#assign', :as => :assign
match 'settings/edit' => 'settings#edit', :as => :edit

match 'help/:page_id' => 'help#show'

# Ensure these are last in this list and before the root route
# resources :pages, only: [:index, :new, :create]
# resources :pages, path: "", except: [:index, :new, :create]
Expand Down
3 changes: 3 additions & 0 deletions lib/help/home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Home

This is a home page.
9 changes: 9 additions & 0 deletions lib/help/sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#### Table of contents

**Users Menu**

* [Create New User](/help/users_create_new)

* [Employees](/help/users_employees)?

* [Clients](/help/users_clients)?
30 changes: 30 additions & 0 deletions lib/help/users_create_new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Create a New User

To create a New user, You simply fill in all the relevant information for the new user.

Ensure that you select the correct permission for the new user.

Here you can select if the new user:

* **Is a Client/Customer? => Options Yes or No**

*This will limit this users permissions to only sections that the user has permission too.
These are define under the `Business Settings/Roles` section where you can assign permission to the role selected.*

* **Is the User an Employee? => Options Yes or No.**

*If the user is an employee, this allows for an addition level of security.*

* **Can this user be assigned Work Orders? => Options Yes or No.**

*Not all users will be able to be assigned work orders. For example, an accountant or receptionist may never be assigned a work order.
This removes this user from the list of users who can be assigned to work orders.*

* **Role => Defaults are Super User, Technician, Client**

*Here you can assign the particular role to this user. By default all new users who sign up through the frontend registration section
automatically are assigned a client role. You can also add a customer role by going to `Business Settings/Roles`
(you need to be a super user to create/edit roles and there permissions.)*



0 comments on commit 7717464

Please sign in to comment.