|
From: Andres M. <amo...@ga...> - 2007-08-22 18:23:53
|
Hello everybody,
I have added three important new features to the media management system
(MMS):
1. Validation for existence of tables in the environment.rb file. Now it is
no longer necessary to comment and uncomment stuff when doing the db
migrations which was very annoying. If tables are not found, defaults are
assumed.
2. Added theme support. Hopefully this will allow for seamless collaboration
between THDL and NDLB. The idea is that each organization using the MMS can
use its own look and feel without needed to change core code. The code
related to look-and-feel has been isolated so that any new features added
will be incorporated automatically to everybody using the MMS and keeping
the integration with its own site.
Tenzin, when you do an svn update in the server you have to follow some
steps to get the appropriate theme. The steps are as follows:
- svn update
- rake db:migrate RAILS_ENV=production
- Log into the page and go to admin section with an administrator account.
- Under roles add all missing permissions to the administrator role.
- Under themes select 'e-Bhutan' and update.
- That's it!
3. Finally figured out a way to properly localize form fields. For this I
added to the globalize_complex_scripts library the following methods:
language_options, language_options_string, and fixed_language_options. All
of these take one optional argument.
The idea is that when using Rails' form helpers, so simply pass the method
language_options and it will add the appropriate tags to the generated code.
If you are not using the helpers but are coding directly in html (not
recommended but easier for pages with a fixed language like the introductory
page or help pages, use language_options_string. If a field has to accept
Dzongkha regardless of the language (such as the search fields for media or
the dictionary, or displaying "Dzongkha" in Dzongkha for language option)
use fixed_language options. If you need to send options to the form helper,
send them as arguments to the above methods and those options will be added.
See the dictionary search page to see how it looks.
Some examples.
A text field that can always accept Dzongkha will look like this:
<%= f.text_field :title, GlobalizeComplexScripts::fixed_language_options %>
A text field that accepts Dzongkha only when the language is set to
Dzongkha:
<%= f.text_field :title, GlobalizeComplexScripts::language_options %>
A submit button:
<%= submit_tag 'Browse'.te, GlobalizeComplexScripts::language_options %>
A submit button that requires the parameter "id" to be set to 'browse':
<%= submit_tag 'Browse'.te, GlobalizeComplexScripts::language_options({:id
=> 'browse'}) %>
The above examples are the usual case where all options are passed as one
argument to the helper. Be mindful that some helpers have the options
separated into options and html_options. You want to send the
language_options to the html_options, so if you are not sending any options
regarding the behavior of the object don't forget to send an empty hash
first. For instance, a select field will look like this:
<%= select(:dictionary_search, :language, @available_languages.collect {|l|
[l.title.t, l.id]} + [['All languages'.t, 0]], {},
GlobalizeComplexScripts::language_options) %>
See dictionary_searches/new for samples of this code in context.
Tenzin, please update the wiki with this new info.
Pema, is www.e-bhutan.net.bt still down?
For now the site is running here:
http://geotourism.mobi/ndlb/
This doesn't have any of the limitations that the development server had, so
there is no problem if you want to link to it, although the URL will soon
change to www.e-bhutan.net/ndlb .
Uden, how are you doing with the fixing of links from your last task?
Dechen, I updated the migrations for dictionary import. I am planning to
soon move the dictionary import into a rake task. Having it in the
migrations is a pain, since it takes so long (especially on a windows
machine). The results were better with Dzongkha collation in mysql. See
http://www.gaugeus.com/ramblings/2007/7/20/sorting-dzongkha-and-tibetan-unic
ode-in-mysql-through-a-custom-collation .
There are still some bugs with it, which would be great if you could fix
with Pema.
Sanjay, I have updated the Dzongkha entry page so that Dzongkha is rendered
properly (using the above mentioned language_options_string) and converting
all Dzongkha from Unicode characters to NCR. It would be great if you could
also translate in a similar fashion (i.e. separate file for Dzongkha with
_dz suffix) the help that pops up with the dictionary.
Take care,
Andres
|