Edgewall Software
Modify

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#10281 closed enhancement (fixed)

Attach file button label consistency

Reported by: Thijs Triemstra Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.2
Component: attachment Version: 0.12-stable
Severity: normal Keywords: bitesized
Cc: Branch:
Release Notes:

The attach file button reads Attach file when no attachments exist for the resource, and Attach another file when attachments exist for the resource.

API Changes:
Internal Changes:

Description

On a ticket page the label for the file attach button always reads 'Attach file'. On the attachments page that label always reads 'Attach another file'.

The issue with the 'Attach another file' label is the fact it's always showing, even when there are no attachments, although the label suggests a file was previously attached. A solution would be using the label 'Attach file' when there are 0 attachments, and 'Attach another file' when there are one or more attachments already.

This could also apply to the label on the ticket page.

Attachments (0)

Change History (12)

comment:1 by Remy Blank, 13 years ago

Keywords: bitesized added
Milestone: next-minor-0.12.x

comment:2 by Christian Boos, 12 years ago

Milestone: next-minor-0.12.xnext-dev-1.1.x

comment:3 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

I've implemented this behavior in 0e037825, such that every add attachment button reads Attach file in the case of no existing attachments, and Attach another file in the case of existing attachments. The implementation includes functional tests, extends test coverage to exercise milestone attachments and splits out part of TestTickets and TestWiki test cases, as recommended in the Todo.

In 7853b262, some refactoring of the tester class was done. In 63dd4df7, the submitted value was renamed to remove the now unnecessary whitespace.

My first attempt at the implementation can be seen in 4e11ff91, but I think the second attempt, described above, is better.

comment:4 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Cc: ryan.j.ollos@… added

comment:5 by Ryan J Ollos, 11 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:6 by Ryan J Ollos, 11 years ago

Milestone: next-dev-1.1.x1.1.3

comment:7 by Ryan J Ollos, 11 years ago

Cc: ryan.j.ollos@… removed
Milestone: 1.1.31.0.3
Release Notes: modified (diff)

Proposed changes can be found in log:rjollos.git:t10251. I may retarget this to 1.0.2 if the changes are ready to be committed in time for the release.

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:8 by Ryan J Ollos, 11 years ago

Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [12414] and merged to trunk in [12415] (and added a fix for a failing test case on the trunk).

comment:9 by Ryan J Ollos, 11 years ago

Release Notes: modified (diff)

comment:10 by Jun Omae, 11 years ago

Milestone: 1.0.31.0.2

The changes in attach_file_form.html would be simple like this.

  • trac/templates/attach_file_form.html

    diff --git a/trac/templates/attach_file_form.html b/trac/templates/attach_file_form.html
    index af7ecc2..a045944 100644
    a b Arguments:  
    1212      py:if="alist.can_create" method="get" action="${alist.attach_href}" id="attachfile">
    1313  <div>
    1414    <input type="hidden" name="action" value="new" />
    15     <input type="submit" id="attachfilebutton" value="${value_of('add_button_title') or (len(alist.attachments) and _('Attach another file')) or _('Attach file')}" />
     15    <input type="submit" id="attachfilebutton"
     16           value="${value_of('add_button_title') or
     17                    (_('Attach another file') if alist.attachments else _('Attach file'))}" />
    1618  </div>
    1719</form>

comment:11 by Ryan J Ollos, 11 years ago

Okay, I will commit your refactoring.

comment:12 by Ryan J Ollos, 11 years ago

Committed to 1.0-stable in [12419]; merged to trunk in [12420].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.