Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Title: Schedules are not in a responsive table » Office Hours are not in a responsive table
StatusFileSize
new252.24 KB

The schedule form is not correctly displayed on a small screen.

Can you adapt the table for the responsive ?

johnv’s picture

Issue tags: +php-novice

A volunteer is greatly appreciated.

janez zibelnik’s picture

StatusFileSize
new549 bytes

The following patch makes the parent div scrollable on overflow-x.

zenimagine’s picture

StatusFileSize
new173.81 KB

Thank you. I applied the patch but it does not work. The schedule form remains illegible on mobile

janez zibelnik’s picture

Status: Active » Needs review
StatusFileSize
new2.45 KB

Providing a new patch.

zenimagine’s picture

StatusFileSize
new209.99 KB

I applied the patch but the display and user experience on mobile is not good

vdenis’s picture

The following patch fixes help text so that it doesn't go out of the container as can you see on #7 image.

zenimagine’s picture

#8 Thank you, it works.

Can you put the minutes and the hours on a line?

At home, the help text is beyond the block.

vdenis’s picture

StatusFileSize
new2.93 KB

@zenimagine I've applied requested changes so that now hours and minutes are in one line when you editing the node.

Please take a look.

zenimagine’s picture

StatusFileSize
new175.03 KB

Thank you, I tested the patch and it does not work for me. I use the Bootstrap theme on my site and the display is very bad.

vdenis’s picture

Status: Needs review » Needs work
vdenis’s picture

StatusFileSize
new5.32 KB

Providing new patch. @zenimagine, can you please test again?

vdenis’s picture

Status: Needs work » Needs review
zenimagine’s picture

StatusFileSize
new352.95 KB

The responsive does not work

johnv’s picture

Title: Office Hours are not in a responsive table » Make Office Hours Widget a responsive table
Component: User interface » Code - widget
Status: Needs review » Needs work

I guess this only applies to the widget, not the formatter.
there is some code replicated 4 times, that could be encapsulated into a function.

scottsawyer’s picture

I have been thinking about this, and I wonder if it might be better solved by replacing the table markup entirely?

My initial thoughts would be to do something like this: ( sort of abbreviated, but a lot of markup, sorry )

<div class="office-hours-row">
  <div class="office-hours-column">
    <div class="office-hours-label">Sunday</div>
  </div>
  <div class="office-hours-column column-start-hours">
    <div class="office-hours-inputs">
      <select name="field[0][starthours][hours]"></select>
      <select name="field[0][starthours][minutes]"></select>
      <select name="field[0][starthours][ampm]"></select>
    </div>
  <div class="office-hours-column column-end-hours">
    <div class="office-hours-inputs">
      <select name="field[0][endhours][hours]"></select>
      <select name="field[0][endhours][minutes]"></select>
      <select name="field[0][endhours][ampm]"></select>
    </div>
  </div>
  <div class="office-hours-column column-comment">
    <div class="office-hours-inputs">
      <input type="text">
    </div>
  </div>
  <div class="office-hours-column column-operations">
    <div class="office-hours-inputs">
      <a>Add time slot</a>
      <a>Copy ___ day</a>
    </div>
  </div>
</div>
div.office-hours-row { // each row
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

div.office-hours-column { // each column
  display: flex;
  flex: 1 1 auto; // or something
  flex-direction: row;
  flex-wrap: wrap;
}

My CSS probably needs some work ( also, maybe grid is a better solution than flexbox ), but the general idea would be the columns would simply start wrapping as the screen gets smaller. I think the CSS would be way simpler than the CSS + JS implementation in the patch, plus, it wouldn't depend on arbitrary breakpoints that may have nothing to do with what the site builder / themer wants.

zenimagine’s picture

it would be nice if the next update is finally in responsive design.

Currently this module is not usable on smartphone.

zenimagine’s picture

StatusFileSize
new221.98 KB

This problem should be addressed first

zenimagine’s picture

Issue tags: -

@scottsawyer In which templates should you put this code ?

scottsawyer’s picture

Honestly, I did not even look at the templates, I just looked at the rendered markup and thought about how I might improve it.

zenimagine’s picture

@scottsawyer would you have screenshot of the code rendering? on pc and smartphone

scottsawyer’s picture

I just did this in my browser's dev tools. Needs some work. This is a custom admin theme.

Desktop

Mobile

zenimagine’s picture

it looks good, but you have to remove the panels

zenimagine’s picture

StatusFileSize
new126.07 KB

Hi guys, there is an urgent need to deal with this problem.

The template to display the schedules in the form is disastrous. We really have to deal with the problem of responsive design. The schedules are unusable on the desktop when there are error messages and it is even worse on mobile.

matija5’s picture

Office hour week table in form can be made responsive with a little css.

/*
 * CSS override for Table on Form
 */
table#edit-field-office-hours-value tr td div[id*="-starthours"],
table#edit-field-office-hours-value tr td div[id*="-endhours"],
table#edit-field-office-hours-value tr td div[class*="-comment"] {
  display: grid;
}
table#edit-field-office-hours-value input,
table#edit-field-office-hours-value select {
  width: 100%;
}
table#edit-field-office-hours-value a {
  display: block;
  white-space: normal;
  margin-bottom: 10px;
}

@media only screen and (max-width: 780px) {
  table#edit-field-office-hours-value {
    display: grid;
  }
  table#edit-field-office-hours-value thead {
    display: none;
  }
  table#edit-field-office-hours-value tbody {
    display: grid;
  }
  table#edit-field-office-hours-value tr {
    display: contents;
  }
  table#edit-field-office-hours-value tr td {
    padding: 0;
    margin-top: 0.75em;
    margin-bottom: 0.75em;
  }
  table#edit-field-office-hours-value tr td div[id*="-starthours"],
  table#edit-field-office-hours-value tr td div[id*="-endhours"],
  table#edit-field-office-hours-value tr td div[class*="-comment"]{
    display: grid;
  }
  table#edit-field-office-hours-value tr td div[id*="-starthours"]:before,
  table#edit-field-office-hours-value tr td div[id*="-endhours"]:before,
  table#edit-field-office-hours-value tr td div[class*="-comment"]:before {
    display: inline-block;
    width: 70px;
  }
  table#edit-field-office-hours-value tr td div[id*="-starthours"]:before {
    content: 'From';
  }
  table#edit-field-office-hours-value tr td div[id*="-endhours"]:before {
    content: 'To';
  }
  table#edit-field-office-hours-value tr td div[class*="-comment"]:before {
    content: 'Comment';
  }
}

But I think new widget should be created and make it responsive.

matija5’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB

Responsive table form with grid css. Tested with Seven and Claro theme.

zenimagine’s picture

StatusFileSize
new216.05 KB

With the Bootstrap theme on mobile the form is unusable. All of my users must use a desktop computer if they want to create a store or group. Even on a tablet, the picture looks like nothing. This problem should be dealt with as a priority.

zenimagine’s picture

Status: Needs review » Needs work
johnv’s picture

Please be aware that #3102097: Make Widget Help text responsive was committed, doing half the trick.

johnv’s picture

Category: Bug report » Feature request
Status: Needs work » Closed (outdated)

Given the current state of the Widget (with many UX fixes from other issues), I guess this ticket can be closed.
Please reopen if you feel otherwise.