#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 , 13 years ago
Keywords: | bitesized added |
---|---|
Milestone: | → next-minor-0.12.x |
comment:2 by , 12 years ago
Milestone: | next-minor-0.12.x → next-dev-1.1.x |
---|
comment:3 by , 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 , 12 years ago
Cc: | added |
---|
comment:5 by , 12 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:6 by , 11 years ago
Milestone: | next-dev-1.1.x → 1.1.3 |
---|
comment:7 by , 11 years ago
Cc: | removed |
---|---|
Milestone: | 1.1.3 → 1.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.
comment:8 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:9 by , 11 years ago
Release Notes: | modified (diff) |
---|
comment:10 by , 11 years ago
Milestone: | 1.0.3 → 1.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: 12 12 py:if="alist.can_create" method="get" action="${alist.attach_href}" id="attachfile"> 13 13 <div> 14 14 <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'))}" /> 16 18 </div> 17 19 </form>
PatchWelcome.