Posts Tagged ‘orange’

BaseApp Orange updated with basic pages and i18n support

Just a quick post to illustrate the changes I did to BaseApp Orange and how you can help shape it’s way.

BaseApp Orange is my attempt to create a base for future Rails projects which end up having similar constraints and features. This week I posted the code on github and I did some changes I thought I should comunicate.

Added SEO fields for Pages

I consider this one important. Basicaly, for each Page you create in the admin area, you can write the meta-keywords, meta-description and page slug for that page. When this page shows up in the frontend, that information will be part of it (unless they’re blank).

picture-4

You can also define this on a global scale for the app (in the config/config.yml file) and that way you can make your app more SEO friendly.

Basic i18n support

This is fairly new to me but I think I did some advances on this part. I defined two locales for the application, so there’s english and portuguese and i’ve got 2 yml files in config/locales/ with date formats, numbers, model names, attributes and much more.

picture-5

You can also use this yml file to store your own translations, like the below example:

picture-6

I also got a before_filter setup on the application.rb controller that sets the locale for each request:

before_filter :set_locale

def set_locale
locale = params[:locale] || 'pt'
I18n.locale = locale
end

And I got this working for Pages by defining my routes as this:

map.pages '/pages/:permalink/:locale', :controller=>"pages", :action=>"show", :defaults => { :locale => 'pt' }

This works fine even in the case you didn’t put the locale in the params.

picture-9

Now all I have to figure out is how to do the same for restful routes and translate the rest of the pages.

Any ideas?

BaseApp Orange

BaseApp Orange é um fork da aplicação BaseApp na tentativa de o tornar mais adequado à maioria dos nossos projectos futuros.

paginas

Ou seja, em vez de duplicar o mesmo trabalho, porque não criar uma base de trabalho com o essencial para futuros projectos?

Para isso, procurei melhorar o BaseApp com uma área de administração para Páginas (e sub-páginas até niveis infinitos), Línguas, Notícias, Utilizadores e conteúdos (ou snippets, pedaços de texto que podem querer editar no backoffice e pôr onde quiserem no frontend). A razão porque fiz isto é simples, os CMS’s actuais em Ruby on Rails como RadiantCMS não se adequavam ao que queria e maior parte dos projectos exigem desenvolvimento à medida.

O código está todo no GitHub e portanto quem quiser fazer melhoramentos, correcções, etc é pode fazer as alterações que quiser.
Principais diferenças do BaseApp Original

  • Traduzido para PT (incluindo i18n locale)
  • Páginas (e sub-páginas infinitas)
  • Notícias
  • Conteúdos
  • Campos para meta tags (descrição, keywords e permalink)
  • Tema para admin com (with famfamfam icons)

Plugins incluídos

  • Jrails para suporte JQuery (remover se preferir Prototype)
  • Bundle-fu em vez de  asset_packager
  • FckEditor para editar páginas com html
  • WillPaginate Gem
  • Paperclip para upload de ficheiros
  • Permalink-fu para gerar links permanentes
  • Acts as taggable

A fazer

  • Arrastar e largar com ordenação para a secção das páginas no admin
  • Suporte total i18n
  • Implementar páginas, snippets, notícias no frontend
  • Incluir Testes com RSPEC para os models

Mais screenshot na galeria do Flickr ou então faz download do projecto na respectiva página do GitHub.

English
Last week I started working on a fork from BaseApp in attempt to make it a more suitable backoffice and structure for my own projects. The main goal was to build a future base for my projects with support for Pages, Languages, News and User Management.

And so BaseApp Orange was evolved, the inspiration for the admin looks came from Apple and Wordpress. :)
Main diferences from BaseApp:

  • Pages (and infinite sub-pages) and expand/colapse rows in the admin
  • News
  • Multi-Language (not yet fully implemented)
  • Snippets
  • Fields for meta description, keywords, and permalink
  • Fully translated to portuguese (also included i18n locale)
  • Pretty admin theme (with famfamfam icons)

Other plugins included

  • Jrails for (jQuery support)
  • Bundle-fu instead of asset_packager
  • FckEditor to edit pages with image file upload support
  • WillPaginate Gem
  • Paperclip for uploading files
  • Permalink-fu for generating erm, permalinks?
  • Acts as taggable

TODO

  • Drag and drop sorting for pages in the admin area
  • Full i18n support with multi-languages
  • Frontend implementation of pages, snippets and languages
  • Add Rspec TESTS for all models and admin controllerse

Anyway, the whole project can be found at GitHub and you can see some more screenshots in my Flickr Gallery.

Feel free to change, update, alter, suggest new features, fork as you wish. Enjoy!

About

Reinventar is the home of Pedro Sousa, an entrepreneur and developer living in Lisbon, Portugal.

I co-founded Think Orange, created Book Worms and I'm also involved in the Ruby on Rails community and in the SHiFT organization.

I usually write here about design, web, technology, lifestyle and other random ideas.

Photos

new ambient lightsnew flipchartcowork lisboa entrancehole in the wall

Interesting

PROJECTS

Think Orange Book Worms SHiFT

Recommended Reading