Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive reports: 2 columns layouts now use Bootstrap CSS classes #7504

Merged
merged 2 commits into from Apr 17, 2015

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Mar 23, 2015

I have replaced the usage of CSS IDs #leftcolumn and #rightcolumn (used to create a 2 columns layout) with Bootstrap column classes.

Those 2 column layouts are now responsive and work on mobile (or any smaller screen).

To have an idea of the current problem, visit the current demo (e.g. http://demo.piwik.org/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#/module=VisitTime&action=index&idSite=1&period=day&date=yesterday) and try to resize the page: not responsive. With this PR the right column goes under the left column when the window width is too small.

@mnapoli mnapoli added the c: Design / UI For issues that impact Matomo's user interface or the design overall. label Mar 23, 2015
@mnapoli mnapoli added this to the Piwik 2.13.0 milestone Mar 23, 2015
@mnapoli
Copy link
Contributor Author

mnapoli commented Mar 23, 2015

The diff is pretty awful but the change is basically going from this:

<div id="leftcolumn">
    ...
</div>
<div id="rightcolumn">      
    ... 
</div>

(notice also that IDs were used which is not ideal because it's sometimes reused many times in the same page)

To this:

<div class="row">
    <div class="col-md-6">
        ...
    </div>
    <div class="col-md-6">
        ...
    </div>
</div>

To learn more about Bootstrap classes read the documentation here: http://getbootstrap.com/css/#grid-example-basic

Another cool thing is that we can now have more than 2 columns, create more advanced layouts (nested columns) and also choose the width at which columns must collapse.

@mnapoli mnapoli added the Needs Review PRs that need a code review label Mar 23, 2015
@mnapoli
Copy link
Contributor Author

mnapoli commented Mar 23, 2015

Here are some screenshots when the window is resized to something small (not the same Piwik so don't look in details it doesn't match it's normal).

Current behavior (not responsive)

capture d ecran 2015-03-23 a 14 18 07

New behavior (responsive)

screencapture-piwik-dev-index-php

That allows to use standard Bootstrap classes instead of custom Piwik ids + those layouts are now responsive and work on mobiles
@mnapoli mnapoli force-pushed the replace-columns-with-bootstrap branch from 2e7f54f to a8e1c99 Compare April 17, 2015 01:41
@mattab
Copy link
Member

mattab commented Apr 17, 2015

this has been an issue for a long time. Nice change!

@mnapoli
Copy link
Contributor Author

mnapoli commented Apr 17, 2015

software.twig updated in the PR

mattab pushed a commit that referenced this pull request Apr 17, 2015
Responsive reports: 2 columns layouts now use Bootstrap CSS classes
@mattab mattab merged commit a911352 into master Apr 17, 2015
@mattab
Copy link
Member

mattab commented Apr 17, 2015

nice, this is an improvement that will please many users

@diosmosis diosmosis deleted the replace-columns-with-bootstrap branch April 17, 2015 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Design / UI For issues that impact Matomo's user interface or the design overall. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants