decebals / wicket-dashboard

Simple web dashboard using Apache Wicket
53 stars 23 forks source link

RTL support #23

Closed solomax closed 9 years ago

solomax commented 9 years ago

One of our users claims RTL is not supported by Dashboard :( I'm planning to create additional CSS file with "override" RTL rules and add it in case RTL-language is selected I can contribute it back to your project

Are you interested in it?

solomax commented 9 years ago

currently the additional "rtl" CSS is very simple:

.column { float: right !important; } .dragbox-toggle { float: right !important; } .dragbox-title { float: right !important; } .dragbox-actions { float: left !important; }

malaki12003 commented 9 years ago

I've recently incorporated the Dashboard into Appfuse (wicket version) and completely adapted in Persian. I mean I built a wicket Jalai calendar, full rtl support along with Persian translation. I also added a web chat component for my user by candy and openfire which all are RTL compatible. you can find my work at sarmayeh360.com (a site for auto analyzing stock market by AI)

decebals commented 9 years ago

Sure. I am interested. I don't have experience with rtl but I will try to help.

@malaki12003 Can you give us more information about your "rtl" approach?

solomax commented 9 years ago

Here is the code I'm currently using: https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java

renderHead method

decebals commented 9 years ago

I will try to implement rtl support in this mode:

What do you think? Makes sense?

solomax commented 9 years ago

I have implemented it same way :)

decebals commented 9 years ago

Thanks solomax. I see now that your approach is per session and my approach is per application.

decebals commented 9 years ago

@solomax Do you see an inconvenient in my implementation (per application)? Is it ok for you?

solomax commented 9 years ago

Our users has own language, so I need per session approach :)

malaki12003 commented 9 years ago

@solomax, as you said rtl approach is not big deal, Regardless I am not so expert in CSS, I created 3 css files: the first for rtl, the second for ltr and the last for common. I set a Locale variable in session that lets me to select which css (rtl or ltr) should be import in my template page. I used firebug as a amazing debug tool to find right css selectors and attributes in a try&error approach. I just utilized following attributes: float, direction, and text-align. Keep in mind you should changed direction of everything as they are looking in front of a mirror. Calendars & Dates are a bit challenging. for rtl language you can store all date in Gregorian form, and only convert it into suitable form in presentation layer.

solomax commented 9 years ago

As you can see from the CSS upper here, I created 1 additional CSS file (which need to be included AFTER main one) this CSS overwrites necessary CSS properties

decebals commented 9 years ago

I committed some code that try to resolve this issue. I will update wicket-7 branch. You can use RTL support per application or per session. Per application: DashboardSettings.setRtl(true) Per session: DashboardPanel.setRtlModel(IModel) - you must push the rtl flag in DashboardPanel

decebals commented 9 years ago

@solomax Can you test the new feature? I updated wicket-7 branch because I know that you use wicket-7 in openmeetings

solomax commented 9 years ago

I just have checked it works as expected!

could you please change setRtlModel(IModel) to "return this" for chaining? When do you plan to release this?

decebals commented 9 years ago

I committed the modification on github. If you think that everything is ok I could do a release today.

solomax commented 9 years ago

Thanks a lot! Will wait for release, then will test one more time

malaki12003 commented 9 years ago

I wish you continues this way so that the dashboard can support Unicode numbers in addition different Calendar systems.

decebals commented 9 years ago

I just released a new version. Please wait some time for propagation on Maven Central Repository.

malaki12003 commented 9 years ago

@decebals why don't u setup a live demo. Take a look at "openshif" as a free cloud hosting for java. It is so easy and I am sure it can be so useful.

solomax commented 9 years ago

0.12.0 is available 0.12.0+wicket-7 is not :( hopefully will be available tonight

decebals commented 9 years ago

@solomax Sorry. I forgot to promote the new version in sonatype but I resolved the situation.

solomax commented 9 years ago

somehow http://repo1.maven.org/maven2/ro/fortsoft/wicket/dashboard/wicket-dashboard-core/0.12.0%2bwicket-7/ link is broken I need to go to ApacheCon will check again later :(

decebals commented 9 years ago

I see that you have a presentation "Set Up And Use Apache Openmeetings In 30 Minutes" at ApacheCon. Good luck. For me it is the first time when I have this kind of problem. Maybe I must create a ticket to sonatype.

solomax commented 9 years ago

Thanks a lot :)

solomax commented 9 years ago

I was able to download wicket-7 artifact Everything seems to work as expected Thanks a lot!