Mailinglist Archive: yast-devel (128 mails)

< Previous Next >
[yast-devel] Webyast - How to show details in flash object
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 22 Feb 2010 11:30:58 +0100
  • Message-id: <201002221130.58645.jreidinger@xxxxxxx>
Hi,
we sometime need to show details in flash message. Especially in error.
Definition of details is that it should be something which can be hide/show.
Question is how to do it.
I see two ways:
1) special mark which separate message from details. This mark is then replaced
by code we want.
example:
flash[:error] = "You don't have enough permissions to run this module. Contact
administrator if you need it. ===DETAILS=== User #{user} doesn't have
permission #{permission}."

advantage:
- easy to use
- you can easy switch way how details is generated
- unified way of details

disadvantage:
- not common in rails world and don't know where to document it

2) allow html elements in flash message. And details write to flash message
(maybe some helper for it is possible)
example: flash[:error] = "You don't have enough permissions to run this module.
Contact administrator if you need it. " + details("User #{user} doesn't have
permission #{permission}.")

advantage:
- easy to use (again :)
- you can easy switch way how details is generated

disadvantage:
- allows all elements in flash message
- allows different personal "improvements" which could lead to inconsistent
flash messages


Any other ideas how to solve it? Which solution do you prefer?

I personally prefer solution 2) which is cleaner for me. So if there is no
complains or better ideas I use it.

Josef
--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, parts of webyast
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >