Extra +/- buttons on input-many (hobo 2.0.0 pre3)

68 views
Skip to first unread message

Bob Sleys

unread,
Oct 8, 2012, 1:38:06 PM10/8/12
to hobo...@googlegroups.com
See the attached screen shot.  Note the extra +/- buttons and the text No Records to Display by the Machines label.  Obviousness there is a record to display since it's right there in the screenshot.  Note I didn't just added that record but just opened the edit form.  Below is the dryml code I'm using for this form.  I could very well have caused the problem in my code.

<extend tag="form" for="Gym">
  <old-form merge>
    <field-list: replace>
      <field-list columns="2" fields="name, phone, email, address"/>
      <field-list columns="1" fields="notes"/>
      <hr/>
      <div class="row columns">
        <div class="span12">
          <single-field-list fields="machines">
            <machines-view:>
              <input-many>
                <field-list size="8" columns="1" fields="machine_model, serial_number, notes">
                  <machine_model-view:>
                    <select-one text-method="manufacturer_model"/>
                  </machine_model-view:>
                </field-list>
              </input-many>
            </machines-view:>
          </single-field-list>
        </div>
      </div>
    </field-list:>
  </old-form>
</extend>

Bob
Screenshot from 2012-10-08 13:16:24.png

Bryan Larsen

unread,
Oct 8, 2012, 2:53:32 PM10/8/12
to hobo...@googlegroups.com
I'm willing to bet that's a problem with hobo_bootstrap: Does the
extraneous "No records to display" and add/remove buttons have a
"hidden" class or something similar? If so, we need to add a CSS
rule of display:none to that class in the hobo_bootstrap css.

Bryan
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/HFXhQmwktiMJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

Bob Sleys

unread,
Oct 8, 2012, 3:17:00 PM10/8/12
to hobo...@googlegroups.com
Here is the html for that section. So yes there is a hidden class on the li.

<li class="input-many-li empty  hidden" id="machine_model_parts_-1_empty">
  <!-- HACK way to signal an empty collection to the controller -->
    <input class="empty-input" id="machine_model_parts" name="machine_model[parts]" type="hidden" value="" disabled="disabled">
       <div class="empty-message">          No records to display
       </div>
       <div class="buttons">
          <button class="hidden remove-item" id="machine_model_parts_-1_remove">-</button>
          <button class="add-item" id="machine_model_parts_-1_add">+</button>
       </div>
</li>

I added the following to my front.scss and that fixed it.  Though it might be a bit heavy handed.

.hidden{
  display:none;
}

Thanks

Bob

Ignacio Huerta

unread,
Oct 8, 2012, 3:43:44 PM10/8/12
to hobo...@googlegroups.com, Bob Sleys
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Bryan is right: it was a problem with hobo_bootstrap. In bootstrap
there's a "hide" class instead of "hidden", but it adding "hidden" to
hobo_bootstrap makes perfect sense to me (it's probably used a lot in
Hobo).

I just added your piece of CSS to hobo_bootstrap_main.scss and pushed
the change to Github. If you are using the git repository in your
Gemfile, you should not need the change to front.scss any more.

Regards,
Ignacio

El 08/10/12 21:17, Bob Sleys escribi�:
> <https://groups.google.com/d/msg/hobousers/-/HFXhQmwktiMJ>.
>> To post to this group, send email to hobo...@googlegroups.com
> <javascript:>.
>> To unsubscribe from this group, send email to
>> hobousers+...@googlegroups.com <javascript:>. For more options,
> <http://groups.google.com/group/hobousers?hl=en>.
>
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit
> https://groups.google.com/d/msg/hobousers/-/A9_gWoppUJgJ. To post
> to this group, send email to hobo...@googlegroups.com. To
> unsubscribe from this group, send email to
> hobousers+...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBzLPAACgkQBPlUJ6RHaORXDgCfV4QbmPqIh6PMqchpKEyVRwkQ
pT4AoJSg+iPGekN0e7JZLWdeUmV4ZCUd
=wj47
-----END PGP SIGNATURE-----

Bob Sleys

unread,
Oct 8, 2012, 4:29:00 PM10/8/12
to hobo...@googlegroups.com
Thanks for the quick fix.

A few other minor issues I've noticed.

Footers added via the footer tag in an extended page tag (example below) are sometimes outside the container bootstrap-content div tag and sometimes inside of it. IE it's outside the div on index, edit, new pages but inside on show pages.

<extend tag="page">
<old-page merge >
   <footer:><hr/>
    Copyright  <%= Time.now.year %>
      <a href="&admin_users_url" if="&current_user.administrator?">
        <br/>
        <t key="hobo.admin.subsite_name">Admin</t>
      </a>
    </footer:>
</old-page>
</extend>

The action buttons/text in the table for index pages are missing the links are there if you carefully move the mouse over the proper spots just there is nothing there to see.

Bob

Bob Sleys

unread,
Oct 9, 2012, 1:03:16 PM10/9/12
to hobo...@googlegroups.com
Could the problem with the missing icons have to do with the css looking for the image the icons come from at 
/img/glyphicons-halflings.png

Perhaps I'm missing some import or include for the compass stuff?

Bob

Bob Sleys

unread,
Oct 9, 2012, 4:30:22 PM10/9/12
to hobo...@googlegroups.com
Another thing I just found on these action buttons.  If the user has permission to update but not delete the record the delete button doesn't get removed.  Since the popup confirmation is in javascript it still works but of course since the user can't remove the record they get the permission denied page if they click ok.

Bob

Bryan Larsen

unread,
Oct 10, 2012, 3:37:53 AM10/10/12
to hobo...@googlegroups.com
Which delete button are you referring to? The '-' button in the
input-many or the more standard delete-button elsewhere?

Bryan
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/-m_utMIe-k8J.

Bob Sleys

unread,
Oct 10, 2012, 9:17:08 AM10/10/12
to hobo...@googlegroups.com
Sorry I was refering to the edit/delete action buttons in the table on index page.  They ones I referring to can be seen in the first image at http://cookbook.hobocentral.net/api_plugins/hobo_bootstrap the edit and delete buttons in the actions column.

The first issue I noticed is the button images arn't showing up for me. The buttons are there, ie I can click in the right spot to activate them it's just I don't see the actual images.

The second is if a user has update but not delete both buttons are still there.  The delete button will fail after the popup message so just a little confusing, but not a security issue.

On last thing it would be nice if the popup dialog for the delete button refereed to the record being deleted somehow.  Perhaps just included the name field in the message.  The would help the user know they clicked on the right row to be deleted.

Bob

Bryan Larsen

unread,
Oct 10, 2012, 10:24:35 AM10/10/12
to hobo...@googlegroups.com
On Wed, Oct 10, 2012 at 9:17 AM, Bob Sleys <bsl...@gmail.com> wrote:
> Sorry I was refering to the edit/delete action buttons in the table on index
> page. They ones I referring to can be seen in the first image at
> http://cookbook.hobocentral.net/api_plugins/hobo_bootstrap the edit and
> delete buttons in the actions column.
>
> The first issue I noticed is the button images arn't showing up for me. The
> buttons are there, ie I can click in the right spot to activate them it's
> just I don't see the actual images.

Have you tried updating hobo_bootstrap? I know that Ignacio has
recently fixed one issue related to icons.

>
> The second is if a user has update but not delete both buttons are still
> there. The delete button will fail after the popup message so just a little
> confusing, but not a security issue.

OK, please raise an issue on hobo_bootstrap.

>
> On last thing it would be nice if the popup dialog for the delete button
> refereed to the record being deleted somehow. Perhaps just included the
> name field in the message. The would help the user know they clicked on the
> right row to be deleted.

Raise an issue for this on hobo itself. It would also have to be
fixed in bootstrap, but it's best to do it in Hobo first and then
propagate it.

Bryan

Bob Sleys

unread,
Oct 10, 2012, 11:11:36 AM10/10/12
to hobo...@googlegroups.com
Ok added the issue to github, hope that is where you wanted them

As for updating the gems from github I'm getting the following error.

Bundler could not find compatible versions for gem "will_paginate":
  In Gemfile:
    hobo_bootstrap (>= 0) ruby depends on
      will_paginate (>= 3.0.3) ruby

    hobo (>= 0) ruby depends on
      will_paginate (3.0.3.hobo)

Looks like we have a version catch 22 going on.  Note my gem file has the following

gem "hobo", :git => "git://github.com/Hobo/hobo.git", :branch => "master"
gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git", :branch => "master"
gem "hobo_bootstrap", :git => "git://github.com/Hobo/hobo_bootstrap.git", :branch => "master"

Bryan Larsen

unread,
Oct 10, 2012, 11:18:58 AM10/10/12
to hobo...@googlegroups.com
I just pushed a fix for that to hobo/will_paginate. It's not
complete, but it should get you and Arve running for now.

Bryan
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/lhgYTdTPQC0J.

Bob Sleys

unread,
Oct 10, 2012, 1:13:28 PM10/10/12
to hobo...@googlegroups.com
Thanks that did indeed fix it.  I posted the trace you wanted in another thread

Oh and yes the update to git did fix the issue with the images not showing, the issues I opened on github are still valid however but not critical.

Ignacio Huerta

unread,
Oct 12, 2012, 4:54:23 AM10/12/12
to hobo...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Bob,

I made a change to the glyphicons URL a few days ago:
https://github.com/Hobo/hobo_bootstrap/commit/af1fd1f075bbeab45a66718f0b629f9662ed2429

Could you check if the latest code is still having problems with URLs?

Regards,
Ignacio

El 09/10/12 19:03, Bob Sleys escribi�:
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit
> https://groups.google.com/d/msg/hobousers/-/4qt_7aalidEJ. To post
> to this group, send email to hobo...@googlegroups.com. To
> unsubscribe from this group, send email to
> hobousers+...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB32r8ACgkQBPlUJ6RHaORSWQCeM02URQNRT0eCkppHoHd48xiS
KJoAnjZP4roFEPY/l4Z+RyluLHUaosej
=2UxK
-----END PGP SIGNATURE-----

Ignacio Huerta

unread,
Oct 12, 2012, 4:56:31 AM10/12/12
to hobo...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mmm, that looks like a bug. I just created an issue about this:
https://github.com/Hobo/hobo_bootstrap/issues/11

Regards,
Ignacio

El 08/10/12 22:29, Bob Sleys escribi�:
>
> Footers added via the footer tag in an extended page tag (example
> below) are sometimes outside the container bootstrap-content div
> tag and sometimes inside of it. IE it's outside the div on index,
> edit, new pages but inside on show pages.
>
> <extend tag="page"> <old-page merge > <footer:><hr/> Copyright <%=
> Time.now.year %> <a href="&admin_users_url"
> if="&current_user.administrator?"> <br/> <t
> key="hobo.admin.subsite_name">Admin</t> </a> </footer:>
> </old-page> </extend>
>
> The action buttons/text in the table for index pages are missing
> the links are there if you carefully move the mouse over the proper
> spots just there is nothing there to see.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB32z8ACgkQBPlUJ6RHaORc5gCdEp56r2usrEY0cmO4Mf7YOu3B
Q18AoMhbS6/e1hMGq8X24XHJjT1KqBwh
=vcS5
-----END PGP SIGNATURE-----

Ignacio Huerta

unread,
Oct 12, 2012, 4:57:51 AM10/12/12
to hobo...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oh, I'm really late with my emails.

Bryan already answered and the bug is in hobo_bootstrap already :).

Regards,
Ignacio

El 10/10/12 16:24, Bryan Larsen escribi�:
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB3248ACgkQBPlUJ6RHaOSbgACgsLw2i9jptAtJot7iyX4KpNad
kQMAoID/rsjkQ8JeX6ISuL376vccO6eU
=NQk7
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages