From 6fe8d713f5e9560b853c72def307ca384c1420c7 Mon Sep 17 00:00:00 2001
From: Francesc Esplugas
Date: Mon, 5 Sep 2011 07:52:14 +0200
Subject: [PATCH] Moved /admin/user_guide to usage in user_guide.
---
CHANGELOG | 6 +-
app/controllers/admin/base_controller.rb | 2 -
app/views/admin/base/user_guide.html.erb | 87 -------------------
app/views/admin/dashboard/_sidebar.html.erb | 4 +-
config/routes.rb | 2 -
doc/user_guide/source/index.rst | 1 +
doc/user_guide/source/usage.rst | 59 +++++++++++++
.../controllers/admin/base_controller_test.rb | 14 +--
.../views/admin/dashboard/_sidebar.html.erb | 15 +++-
9 files changed, 82 insertions(+), 108 deletions(-)
delete mode 100644 app/views/admin/base/user_guide.html.erb
create mode 100644 doc/user_guide/source/usage.rst
diff --git a/CHANGELOG b/CHANGELOG
index 4949f17ff..27a7a88b1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
= 3.2.0 (unreleased)
-= 3.1.0 (unreleased)
+= 3.1.1 (unreleased)
+
+ * [CHANGED] Removed user guide. Docs can now be found at http://docs.typuscmf.com/
+
+= 3.1.0
* [NEW] Filter with scopes.
diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb
index 8bf8f3da4..8e3bf80a5 100644
--- a/app/controllers/admin/base_controller.rb
+++ b/app/controllers/admin/base_controller.rb
@@ -9,8 +9,6 @@ class Admin::BaseController < ActionController::Base
helper_method :admin_user
helper_method :current_role
- def user_guide; end
-
protected
def reload_config_and_roles
diff --git a/app/views/admin/base/user_guide.html.erb b/app/views/admin/base/user_guide.html.erb
deleted file mode 100644
index ceb477e8e..000000000
--- a/app/views/admin/base/user_guide.html.erb
+++ /dev/null
@@ -1,87 +0,0 @@
-<%
- rails = "http://rubyonrails.org/"
- typus = "http://core.typuscmf.com/"
-%>
-
-<% content_for :main_grid do %>
-
-
- Introduction
-
- This website is powered by <%= link_to "Ruby on Rails", rails %> and
- <%= link_to "Typus", typus %>.
-
- With <%= link_to "Typus", typus %>, also known as the application backend
- or admin interface, you'll be able to update your application contents and
- perform the most common operations for the site maintenance.
-
- You can get more information at <%= link_to typus, typus %>.
-
-
-
- Basic Actions
-
- Create Entries
-
- To create a new entry:
-
-
- - Click on entries tab.
- - Click "Add New" sub tab.
- - Start filling in the blanks.
- - When you are ready, click "Save Entry".
-
-
- Editing & Updating Entries
-
- To edit entries:
-
-
- - Click on entries tab.
- - You'll see a list of entries, if you have already create some.
- - Click on "Edit".
- - Edit the entry.
- - When you are ready, click "Update Entry".
-
-
- Removing Entries
-
- To remove entries:
-
-
- - Click on entries tab.
- - You'll see a list of entries, if you have already create some.
- - Click on "Trash".
- - Click "Ok" on the dialog to confirm you want to remove the entry.
-
-
- Removing entries will be only available if you have permissions to do so.
-
-
-
- Registered Users
-
- Registered users can do a variety of different things on a Typus
- driven site. The various elements available to the user are determined by their
- user level.
-
- When :session
authentication is enabled Typus
- will enable a a default role which will allow registered users perform all kind
- of operations on entries: create, read, update and destroy.
-
- It's usually recommended having an extra role which some restrictions.
-<% end %>
-
-
-
User Guide
-
-
- - <%= link_to "Introduction", "#introduction" %>
- - <%= link_to "Basics", "#basics" %>
- - <%= link_to "Registered Users", "#registered-users" %>
-
-
-
-
- <%= yield :main_grid %>
-
diff --git a/app/views/admin/dashboard/_sidebar.html.erb b/app/views/admin/dashboard/_sidebar.html.erb
index 808e47e96..9e256fa2f 100644
--- a/app/views/admin/dashboard/_sidebar.html.erb
+++ b/app/views/admin/dashboard/_sidebar.html.erb
@@ -2,11 +2,11 @@
<%
mailing_list = link_to('mailing list', 'http://groups.google.com/group/typus')
- user_guide = link_to('user guide', admin_user_guide_path)
+ user_guide = link_to('user guide', 'http://docs.typuscmf.com/')
%>
If you need help don't hesitate in joining the <%= mailing_list %> or use
-the provided <%= user_guide %>.
+the <%= user_guide %>.
Replace this sidebar dropping a file named _sidebar.html.erb
on the app/views/admin/dashboard
folder.
diff --git a/config/routes.rb b/config/routes.rb
index 0a16213b7..0c71e8b25 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,8 +7,6 @@
match "dashboard" => "dashboard#index", :as => "dashboard_index"
match "dashboard/:application" => "dashboard#show", :as => "dashboard"
- match "user_guide" => "base#user_guide"
-
if Typus.authentication == :session
resource :session, :only => [:new, :create], :controller => :session do
get :destroy, :as => "destroy"
diff --git a/doc/user_guide/source/index.rst b/doc/user_guide/source/index.rst
index ed798f4d9..9429544c6 100644
--- a/doc/user_guide/source/index.rst
+++ b/doc/user_guide/source/index.rst
@@ -73,6 +73,7 @@ Misc
.. toctree::
:maxdepth: 1
+ usage
upgrade
credits
license
diff --git a/doc/user_guide/source/usage.rst b/doc/user_guide/source/usage.rst
new file mode 100644
index 000000000..6f86f30dc
--- /dev/null
+++ b/doc/user_guide/source/usage.rst
@@ -0,0 +1,59 @@
+Usage
+=====
+
+With **Typus**, also known as the control panel or admin interface, you'll be
+able to update your application contents and perform the most common operations
+for the site maintenance.
+
+
+Basic Actions
+-------------
+
+Create Entries
+^^^^^^^^^^^^^^
+
+To create a new entry:
+
+* Click on entries tab.
+* Click "Add New" sub tab.
+* Start filling in the blanks.
+* When you are ready, click "Save Entry".
+
+Editing and Updating Entries
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To edit entries:
+
+* Click on entries tab.
+* You'll see a list of entries, if you have already create some.
+* Click on "Edit".
+* Edit the entry.
+* When you are ready, click "Save".
+
+Removing Entries
+^^^^^^^^^^^^^^^^
+
+To remove entries:
+
+* Click on entries tab.
+* You'll see a list of entries, if you have already create some.
+* Click on "Trash".
+* Click "Ok" on the dialog to confirm you want to remove the entry.
+
+.. note::
+
+ Removing entries will be only available if you have permissions to do so.
+
+
+Registered Users
+----------------
+
+Registered users can do a variety of different things on a **Typus** driven
+site. The various elements available to the user are determined by their user
+level.
+
+When ``:session`` authentication is enabled **Typus** will enable a a default
+role which will allow registered users perform all kind of operations on
+entries: create, read, update and destroy.
+
+It's usually recommended having an extra role which some restrictions.
diff --git a/test/app/controllers/admin/base_controller_test.rb b/test/app/controllers/admin/base_controller_test.rb
index 25d4ba63b..2877066d9 100644
--- a/test/app/controllers/admin/base_controller_test.rb
+++ b/test/app/controllers/admin/base_controller_test.rb
@@ -4,22 +4,14 @@
What's being tested here?
- - Access to user_guide.
+ - Nothing ...
=end
class Admin::BaseControllerTest < ActionController::TestCase
- test "user_guide is not displayed when user is not logged in" do
- get :user_guide
- assert_response :redirect
- assert_redirected_to new_admin_session_path
- end
-
- test "user_guide is displayed when user is logged in" do
- admin_sign_in
- get :user_guide
- assert_response :success
+ test "nothing" do
+ assert true
end
end
diff --git a/test/dummy/app/views/admin/dashboard/_sidebar.html.erb b/test/dummy/app/views/admin/dashboard/_sidebar.html.erb
index 61fa2fa5b..316fb0b5f 100644
--- a/test/dummy/app/views/admin/dashboard/_sidebar.html.erb
+++ b/test/dummy/app/views/admin/dashboard/_sidebar.html.erb
@@ -1,9 +1,18 @@
+<%
+ code = link_to('GitHub', 'https://github.com/typus/typus/tree/master/test/dummy')
+ typus = link_to('Typus', 'http://www.typuscmf.com/')
+ mailing_list = link_to('mailing list', 'http://groups.google.com/group/typus')
+ user_guide = link_to('user guide', 'http://docs.typuscmf.com/')
+%>
+
Welcome!
-This is the collection of models, organized by functionality, I use to test Typus.
+This is the collection of models, organized by functionality, I use to
+test <%= typus %>.
-Code for this application is available at GitHub.
+Code for this application is available at <%= code %>.
-If you need help don't hesitate in joining the <%= link_to 'mailing list', 'http://groups.google.com/group/typus' %> or use the <%= link_to "help", "/admin/user_guide" %>.
+If you need help don't hesitate in joining the <%= mailing_list %> or use
+the <%= user_guide %>.