Loomio

Restructure UI code.

JH Jonne Haß Public Seen by 45

I think we don't need to vote if we should do it, so this discussion is about how doing it. To make things easier we should keep the current design where possible for now and do design improvements when this is done. I'll list some possible requirements/alternatives to what we currently use/tasks:

HTML/Templates

  • Get rid of unused templates
  • Get rid of app/views/shared/ if still in use move them to better fitting places
  • Make clear rules on what to render on the server and what to render on the client side, get rid of handlebars and server side templates doing the same job.
  • Refactor the code to get rid of "styling HTML", like 99% of <br>s, potential <b> tags and whatever
  • Use semantically rich tags, like using <em> for something important, not because it looks cool.
  • Decide on either ERB or HAML, don't use both.
  • Use all the (semantic) power HTML5 provides.
  • Stop using casing as design element, that just localizes terribly as there are scripts which have no casing.

CSS

  • Make Layout responsive
  • Get rid of fixed sizes where possible (I'm looking at you, px)
  • Develop a clear and clean structure. Like for example one CSS file for each GET route + meaningful common usages Group the common usages by categories, i.e. forms.
  • Port every SASS code to SCSS, see #3796 [DONE]
  • Get rid of all :css/`` blocks in templates
  • Port everything from Blueprint to Bootstrap, see#4466

JS

  • Get rid of multiple libraries essentially doing the same where possible, i.e. the autocomplete ones.
  • Move everything to Backbone if possible.
  • Replace hacked libs with vanilla ones doing it right in the first place. If not found try to externalize the hack into another file. If not possible make it damn clear inside the library where the change it and why it was done with big fat comments, to ease the life of the updater.
  • Update all dependencies, replace them with gems if available (maybe even create some?)

While at the frontend code, the locale files too contain many unused keys and semi duplicates. A lot of the template code was moved around so I guess about the half of the keys is accessed using the full path, unable to take advantage of the dot syntax. Maybe we should develop a struture there that's independent from the template structure?

I'll keep this list updated with the ongoing discussion, so ensure you'll rescan it once in a while ;)

G

goob
Agree
Fri 30 Nov 2012 11:21PM

Sounds like a good idea from what you say, although it means I won't be able to help with style sheets as I don't know SCSS (not that that will be much of a loss to you).

TS

Tom Scott
Agree
Fri 7 Dec 2012 5:04PM

I believe a run of sass-convert is all we need to convert our CSS to the SCSS syntax, however we will need to run some acceptance tests to figure out if the auto convert broke anything...

T

tortoise
Agree
Sun 9 Dec 2012 11:11PM

Making it easy for new/green devs is always good idea.

TS

Tom Scott Mon 10 Dec 2012 4:56PM

This is pretty much unanimously YES so let's make an issue. :)

https://github.com/diaspora/diaspora/issues/3796

I'd also like to put it out there to anyone on the contributors team to definitely review the pull request that will be made for this issue, as there might be/will be problems with CSS after an automatic conversion such as this.

F

Flaburgan Mon 24 Jun 2013 8:22AM

Decide on either ERB or HAML, don't use both.

I'm absolutely not in the Ruby world so I don't know if HAML is the most used language, but I don't like it at all and I think that, like me, many persons know HTML but not HAML. Keep a HTML syntax could unlock the number of contribution in the front end part. We can say the same about sass which is not better than scss (as far as I know) but does not allow people who simply know css to participate.

So I'm for scss (this was already voted) but also ERB, what do you guys think?

The issue for scss is on github, the work was partially done, maybe we could ask with DiasporaHQ if someone wants to continue working on it?

F

Flaburgan Thu 4 Jul 2013 8:53AM

I'd be happy to work on the refactor of the UI part, but I don't love the HAML syntax. I know, tastes are different, but I really think that a lot of people are like me: they know HTML and would love to make some quick fix, but when they see that the views are written with a language they don't know, they just give up. For me, it's a blocking point for newcomers. What do you think?

ST

Sean Tilley Mon 8 Jul 2013 5:15PM

I wouldn't mind getting rid of the HAML and just using good old-fashioned erb, honestly.

JH

Jonne Haß Mon 8 Jul 2013 6:25PM

Before we consider that we should first clean up all unused HAML templates. There should be quite a lot of these by now.

F

Flaburgan Tue 9 Jul 2013 8:20AM

I am working on refactoring the frontend stuff. I started with the left bar side menu, because the fixed widths break design in french. I think I'll finish having a nice plain HTML code today. Should I convert it to ERB or HAML after that?

(please, please say ERB :p)

R

Ryuno-Ki Fri 21 Feb 2014 10:57PM

Thank you, @seantilleycommunit, for allowing me writing here :-)

@flaburgan Don't confuse HAML with YAML ;-)

I've worked for a small company using RoR. They were moving from HAML to Slim and I took the chance to learn HAML :-)

I'd say, I'm pretty familar with it, although there are certain circumstances, where it becomes pretty difficult to write clean HAML markup …

I was going to review the view files soonly anyway :-)

Load More