ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Issues - Hide the File upload section (Feature #149)


Added by Eric Davis at 2011-02-06 01:54 am. Updated at 2011-02-20 05:36 pm.


Status:Closed Start date:2011-02-06
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:User interface
Target version:1.1.0 — Bell
Remote issue URL: Affected version:

Description

I have heard from a lot of people that having the file upload section visible on the issue form is distracting. It is easy to click Choose File instead of Submit on accident.

I propose hiding the file upload section behind a display:none. This should be hidden on the page load using JavaScript so the form is still shown to non-JavaScript users.

Thoughts?


No_file_upload_field.png (11.1 kB) Felix Schäfer, 2011-02-08 08:13 am

Top_border_-_collapsed.png (12.3 kB) Felix Schäfer, 2011-02-09 02:04 pm

Top_border_-_open.png (17.2 kB) Felix Schäfer, 2011-02-09 02:05 pm

All_borders_-_collapsed.png (11.6 kB) Felix Schäfer, 2011-02-09 02:05 pm

All_borders_-_open.png (16.9 kB) Felix Schäfer, 2011-02-09 02:05 pm


Associated revisions

Revision 8a863a4f
Added by Felix Schäfer at 2011-02-09 09:33 pm

Attachment fields in a collapsed fieldset #149

Puts the attachment fields in a collapsed fieldset on issue update.

History

Updated by Muntek Singh at 2011-02-06 04:04 am

Agreed, I've made this mistake myself.

Updated by Matthew Connerton at 2011-02-06 12:23 pm

What would be the mechanism to show/hide the file form? Is this just for issue updates or both creation and updates?

This can be filed under ux/ui changes, but I would like to see the Submit / Preview buttons designed with maybe a larger noticeable style, maybe floated right?

Updated by Felix Schäfer at 2011-02-06 12:40 pm

Matthew Connerton wrote:

What would be the mechanism to show/hide the file form? Is this just for issue updates or both creation and updates?

I'd say an easy change would be to have a js hide the whole thing save the "add a file" link, and make the "add a file" first try to show that part or add an additional file upload field if it's shown already.

Updated by Eric Davis at 2011-02-08 01:31 am

Matthew:

Felix described almost exactly what I was thinking. Just a simple toggle. Eventually I think it should be for everyplace file uploads are allowed so there is a common user interface across the entire system.

Could you open a new issue for the Submit / Preview buttons? I have some ideas but don't want to take over this discussion.

Updated by Matthew Connerton at 2011-02-08 01:36 am

I agree, sounds good.

As far as the submit / preview buttons, with this early in the fork, should those discussions go into issues for now or under the UX_Overhaul wiki page? I'm fine to do either.

Updated by Felix Schäfer at 2011-02-08 07:30 am

Eric Davis wrote:

Felix described almost exactly what I was thinking. Just a simple toggle. Eventually I think it should be for everyplace file uploads are allowed so there is a common user interface across the entire system.

I think they're all generated from the same helper. I'll give it a shot.

  • Assignee set to Felix Schäfer

Updated by Felix Schäfer at 2011-02-08 08:13 am

Ok, a first try looks like that:

 1diff --git a/app/views/attachments/_form.rhtml b/app/views/attachments/_form.rhtml
 2index 6d387d1..fc31a26 100644
 3--- a/app/views/attachments/_form.rhtml
 4+++ b/app/views/attachments/_form.rhtml
 5@@ -2,7 +2,8 @@
 6 <%= file_field_tag 'attachments[1][file]', :size => 30, :id => nil  -%><label class="inline"><span id="attachment_description_label_content"><%= l(:label_optional_description) %>
 7 </label>
 8 </span>
 9+<%= javascript_tag("$('attachments_fields').hide();") %>
10 <br />
11-<small><%= link_to l(:label_add_another_file), '#', :onclick => 'addFileField(); return false;' %>
12+<small><%= link_to l(:label_add_another_file), '#', :onclick => 'if ($(\'attachments_fields\').visible()) {addFileField();} else {$(\'attachments_fields\').show();}; return false
13 (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
14 </small>

That looks a little weird though because of the big empty space between "files" and the link:

So it would need a tad more work to make the link say "add a file" instead of "add another file" the first time it is shown, and the link must get a little nearer the "files" title, or we could just drop it. Matthew, could you give the little cosmetic improvement idea a spin?

  • File No_file_upload_field.png added

Updated by Matthew Connerton at 2011-02-08 12:03 pm

Hey Felix, you referring to the submit / preview cosmetic improvements?

Updated by Eric Davis at 2011-02-08 10:34 pm

Matthew Connerton wrote:

... issues for now or under the UX_Overhaul wiki page? I'm fine to do either.

Actually I think forums are best for discussions, especially about UI work because there might be a lot of ideas. Then the Wiki could be used to document the final ideas and issues for the actual work.

Felix:

Actually looking at the HTML, I think the Files section should be outside of the "Notes" fieldset completely since uploads are added to the issue and not the note. Then we can make "Files" be the legend and use the same toggles as on the issues list filters. (toggleFieldset(this)) Thoughts?

Updated by Felix Schäfer at 2011-02-08 11:27 pm

Eric Davis wrote:

Actually looking at the HTML, I think the Files section should be outside of the "Notes" fieldset completely since uploads are added to the issue and not the note. Then we can make "Files" be the legend and use the same toggles as on the issues list filters. (toggleFieldset(this)) Thoughts?

That probably works too, and would keep the change to the issues edit for the moment. I'll try it out tomorrow.

Updated by Felix Schäfer at 2011-02-09 02:04 pm

New try:

 1diff --git a/app/views/issues/_edit.rhtml b/app/views/issues/_edit.rhtml
 2index ec36b14..b6e5f0b 100644
 3--- a/app/views/issues/_edit.rhtml
 4+++ b/app/views/issues/_edit.rhtml
 5@@ -36,8 +36,12 @@
 6     <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
 7     <%= wikitoolbar_for 'notes' %>
 8     <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
 9+    </fieldset>
10
11-    <p><%=l(:label_attachment_plural)%><br /><%= render :partial => 'attachments/form' %></p>
12+    <fieldset id="attachments" class="collapsible collapsed"><legend onclick="toggleFieldset(this);"><%=l(:label_attachment_plural)%></legend>
13+      <div style="display: none;">
14+      <%= render :partial => 'attachments/form' %>
15+      </div>
16     </fieldset>
17     </div>
18     

That puts the file upload things in a collapsed fieldset, it looks a little weird though because it only has a top border. I've also tried re-adding the missing borders, but that looks weird when it's collapsed, I'd prefer it with all borders than just the top one though.

The 4 screenshots are: only top border collapsed and open, all borders collapsed and open:

  • File Top_border_-_collapsed.png added

Updated by Felix Schäfer at 2011-02-09 02:05 pm

  • File All_borders_-_open.png added
  • File Top_border_-_open.png added
  • File All_borders_-_collapsed.png added

Updated by Eric Davis at 2011-02-09 08:10 pm

Felix:

I think it's better than the current one and better than your previous version. I wonder if you could use some CSS to hide the border when it's collapsed so it's just "> Files".

Updated by Felix Schäfer at 2011-02-09 08:40 pm

Eric: Works with CSS, just wobbles a bit because it doesn't have a left border when collapsed and a 1px one when open. The pull request is here: https://github.com/chiliproject/chiliproject/pull/2

  • Status changed from Open to Ready for review

Updated by Felix Schäfer at 2011-02-15 01:36 pm

Ok, I've asked a few people, and none saw the wobbling by themselves. Anything against merging this?

Updated by Eric Davis at 2011-02-15 11:46 pm

Felix:

Let me test it this week and I'll get back to you. My wife was the one who noticed it so I'll volunteer her to test it ;)

Updated by Eric Davis at 2011-02-20 03:28 am

Felix:

This looks good, I didn't see the wobbling myself. I did reset the font-size on the legend to 1em though, the .collapsible class turned it down to 0.9em. Feel free to merge when you are ready.

https://github.com/edavis10/chiliproject/tree/ticket/master/149-hide-file-upload-section

  • Target version set to 1.1.0 — Bell

Updated by Felix Schäfer at 2011-02-20 05:36 pm

Eric Davis wrote:

I did reset the font-size on the legend to 1em though, the .collapsible class turned it down to 0.9em. Feel free to merge when you are ready.

Missed that one, thanks. Merged and committed in 887a10ac6001551facf142520456301bfdcbc286

  • Status changed from Ready for review to Closed

Also available in: Atom PDF