Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

#7803 closed enhancement (fixed)

Put attachment HTML code in own `div` tag

Reported by: martin@… Owned by: Christian Boos
Priority: low Milestone: 0.12
Component: attachment Version: none
Severity: minor Keywords: attachment div
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I wanted to change the look of the attachment sections on the wiki pages using CSS today. To my surprise I saw that the attachments are not put into an own div tag, but just placed after the wikipage searchable div using h3 and a ul list:

<h3>Attachments</h3>
<ul>
  ...
</ul>

instead it should look like this:

<div id="attachments">
  <h3>Attachments</h3>
  <ul>
    ...
  </ul>
</div>

While this is a minor thing it also shouldn't take much to change it in the source code.

Attachments (0)

Change History (7)

comment:1 by osimons, 16 years ago

Component: web frontendattachment
Milestone: 0.12
Owner: set to osimons

Makes sense, and same id as used for tickets. However, when looking at ticket page I see that the <H2> there is actually outside the div. Would be best if they both used same strategy.

I'll put it on my todo.

comment:2 by Christian Boos, 16 years ago

While you're at it, you could move the attachment snippets outside of macros.html and make it includable (related to #6374).

comment:3 by Remy Blank, 15 years ago

Simon, will you be able to do that for 0.12? If not, please move to a later milestone.

comment:4 by Christian Boos, 15 years ago

Milestone: 0.12next-major-0.1X

comment:5 by Remy Blank, 15 years ago

With the recent changes that made attachments collapsible, the list of attachments now actually is in a <div>, but the id="attachments" is still in the inner <div>. We could move the id to the outer <div> for 0.12?

comment:6 by Christian Boos, 15 years ago

Milestone: next-major-0.1X0.12
Owner: changed from osimons to Christian Boos
Status: newassigned

Like in:

  • trac/htdocs/css/trac.css

     
    413413.attachment #preview { margin-top: 1em }
    414414
    415415/* Styles for the list of attachments. */
    416 #attachments { border: 1px outset #996; padding: 1em }
     416#attachments > div { border: 1px outset #996; padding: 1em }
    417417#attachments .attachments { margin-left: 2em; padding: 0 }
    418418#attachments dt { display: list-item; list-style: square; }
    419419#attachments dd { font-style: italic; margin-left: 0; padding-left: 0; }
  • trac/templates/macros.html

     
    158158      </i18n:msg>
    159159    </py:def>
    160160    <py:if test="alist.attachments or alist.can_create">
    161       <div py:choose="">
     161      <div id="attachments" py:choose="">
    162162        <py:when test="compact and alist.attachments">
    163163          <h3 class="${foldable and 'foldable' or None}">Attachments</h3>
    164164          <ul>
     
    172172        </py:when>
    173173        <py:when test="not compact">
    174174          <h2 class="${foldable and 'foldable' or None}">Attachments</h2>
    175           <div py:if="alist.attachments or alist.can_create" id="attachments">
     175          <div py:if="alist.attachments or alist.can_create">
    176176            <dl py:if="alist.attachments" class="attachments">
    177177              <py:for each="attachment in alist.attachments">
    178178                <dt>${show_one_attachment(attachment)}</dt>

Seems to work.

comment:7 by Christian Boos, 15 years ago

Resolution: fixed
Status: assignedclosed

Change above applied in [8794].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.