igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

Date/Time styling broken in form #38

Closed bbenezech closed 8 years ago

bbenezech commented 8 years ago

This seems useless https://github.com/igorkasyanchuk/rails_db/blob/9bc0e4f3334d3ce5ab790dbe94de2fd1d2ba47e4/app/views/rails_db/tables/_edit.html.erb#L11-L18

should be replaced with

<%= form.input name, label: name %>

It doesn't work on timestamps (created_at/updated_at on PG), and SimpleForm gives you datetime, date, time classes.

All the style needed is:

rails_db/app/assets/stylesheets/rails_db/forms.css.scss

select.datetime select.date select.time  {
  margin-right: 25px; /* to account for drop-down icon */
  width: auto;
}

display: inline does not seem needed as well.

I won't submit a PR because I'm terrible at CSS and do not want to take any responsability :D

Otherwise some padding on inline checkboxes looks needed too.

igorkasyanchuk commented 8 years ago

@bbenezech do you have a screenshot with issue? if everything is OK, few lines of CSS code is not a problem, I just wanted to wrap datetime fields in separate div

bbenezech commented 8 years ago

css-date-bug2

bbenezech commented 8 years ago

Wrapping datetime fields doesn't look needed.