As Django Admin, Typus is designed for a single activity:
Trusted users editing structured content.
Once installed and configured you can login at http://application.tld/admin/
Note: Typus doesn't try to be all the things to all the people.
You can view the available tasks running
rake typus
rake typus:dependencies
This task will install for you:
- Gem
paginator
paperclip
File uploadacts_as_list
acts_as_tree
rake typus:assets
rake typus:configure
script/generate typus_migration
rake db:migrate
rake typus:seed email='[email protected]' RAILS_ENV=production
Start your application and go to http://application.tld/admin/
You can overwriting the following settings:
Typus::Configuration.options[:app_name] = "Your app name"
Typus::Configuration.options[:app_description] = "App Details"
Typus::Configuration.options[:per_page] = "20"
Typus::Configuration.options[:form_rows] = "20"
Typus::Configuration.options[:form_columns] = "20"
Typus::Configuration.options[:color] = "20"
Typus::Configuration.options[:app_logo] = "url/to/application/logo"
Typus::Configuration.options[:app_logo_height] = "400px"
Typus::Configuration.options[:app_logo_width] = "400px"
Place this settings in a initializer at config/initializers/typus.rb
.
If the configuration file is broken you'll see a +typus.yml+ text on the admin interface.
fields:
list: name, created_at, category_id, status
form: name, body, created_at, status
relationship: name, category_id
NOTE: Upload files only works if you follow Paperclip naming conventions.
relationships:
has_and_belongs_to_many: users
has_many: projects
filters: status, author_id, created_at
Adding minus (-) sign before the attribute will make the order DESC.
order_by: -attribute1, attribute2
search: attribute1, attribute2
actions:
list: notify_all
form: notify
These actions will only be available on the context +list+ and +form+ of Typus.
You'll have to create controllers that inherit from TypusController
class Typus::NewslettersController < TypusController
##
# Action to deliver emails ...
def deliver
...
redirect_to :back
end
end
For feedback you can use the flash method.
flash[:notice]
just some feedback.flash[:error]
when there's something wront.flash[:success]
when the action successfully finished.
To group modules into an application use application
.
application: CMS
Each module has submodules grouped using module
.
module: Article
Example: (E-Commerce Application)
Product:
application: ECommerce
Client:
application: ECommerce
Category:
module: Product
Option Type:
module: Product
Example: (Blog)
Post:
application: Blog
Category:
application: Blog
Tag:
module: Post
You can add your custom views to match your application requirements. Views you can customize.
index.html.erb
edit.html.erb
Example:
You need a custom view on the Articles listing. Under app/view/typus/articles
add the file index.html.erb
and Typus default listing will be overrided.
You can customize the interface by placing on views/typus
the following files.
_dashboard_sidebar.html.erb
_dashboard_top.html.erb
_dashboard_bottom.html.erb
MODEL/_index_top.html.erb
MODEL/_index_bottom.html.erb
MODEL/_new_top.html.erb
MODEL/_new_bottom.html.erb
MODEL/_new_bottom.html.erb
MODEL/_new_sidebar.html.erb
MODEL/_edit_top.html.erb
MODEL/_edit_bottom.html.erb
MODEL/_edit_bottom.html.erb
MODEL/_edit_sidebar.html.erb
- Isaac Feliu - http://railslab.net/
- Jaime Iniesta - http://railes.net/
- supercoco9, sd and hydrus (sort_by)
- Laia Gargallo - http://azotacalles.net/
- Xavier Noria (fxn) - http://www.hashref.com/
- Sergio Espeja - http://github.com/spejman/
You can contact me at [email protected]
BROWSE SOURCE on GitHub: http://github.com/fesplugas/typus
Copyright (c) 2007-2008 Francesc Esplugas Marti, released under the MIT license