Edgewall Software

TracDev/Proposals/ThemePlugins: theming.2.patch

File theming.2.patch, 28.4 KB (added by Armin Ronacher, 5 years ago)

added missing file

  • setup.py

     
    8585        trac.web.auth = trac.web.auth 
    8686        trac.wiki.macros = trac.wiki.macros 
    8787        trac.wiki.web_ui = trac.wiki.web_ui 
     88        trac.themes = trac.web.theming 
    8889    """, 
    8990) 
  • trac/htdocs/css/admin.css

     
    1 #content.admin h1 { float: left; } 
     1#x-trac #content.admin h1 { float: left; } 
    22 
    3 #tabs { background: #f7f7f0; border: 1px solid black; 
    4   border-color: #ccc #666 #666 #ccc; clear: left; 
     3#x-trac #tabs { border: 1px solid black; clear: left; 
    54  margin: 1em 0 2em; padding: .5em 0 0; float: left; width: 12em; 
    65} 
    7 #tabs ul { list-style: none; margin: 0 0 .5em; padding: 0; } 
    8 #tabs li { color: #999; font-size: 90%; font-weight: bold; margin: 0; 
     6#x-trac #tabs ul { list-style: none; margin: 0 0 .5em; padding: 0; } 
     7#x-trac #tabs li { font-size: 90%; font-weight: bold; margin: 0; 
    98  padding: 0.1em 5px; 
    109} 
    11 #tabs li li { color: #000; font-size: 110%; font-weight: normal; 
     10#x-trac #tabs li li { font-size: 110%; font-weight: normal; 
    1211  margin: 0 -3px; padding: 1px 0 1px 10px; 
    1312} 
    14 #tabs li li.active { background: #ddc; border: 1px solid; 
    15   border-color: #ccc #000 #666 #ccc; padding: 0 0 0 9px; 
    16 } 
    17 #tabs :link, #tabs :visited { border: none; display: block } 
    18 #tabs :link:hover, #tabs :visited:hover { background: transparent; 
    19   color: #000; 
    20 } 
     13#x-trac #tabs li li.active { border: 1px solid black; padding: 0 0 0 9px; } 
     14#x-trac #tabs :link, #x-trac #tabs :visited { border: none; display: block } 
     15#x-trac #tabs :link:hover, #x-trac #tabs :visited:hover { background: transparent; } 
    2116 
    22 #tabcontent { padding: 0.4em 2em; margin-left: 12em; min-height: 300px; } 
    23 #tabcontent h2 { color: #333; margin-top: 0; } 
    24 p.help { color: #666; font-size: 90%; margin: 1em .5em .5em; } 
     17#x-trac #tabcontent { padding: 0.4em 2em; margin-left: 12em; min-height: 300px; } 
     18#x-trac #tabcontent h2 { margin-top: 0; } 
     19#x-trac p.help { font-size: 90%; margin: 1em .5em .5em; } 
    2520 
    26 #enumlist tbody td { vertical-align: middle; } 
     21#x-trac #enumlist tbody td { vertical-align: middle; } 
    2722 
    28 form.addnew { clear: right; float: right; margin: -2em 0 4em; width: 33% } 
    29 form.mod { margin-top: 1em; } 
    30 form.mod .field { margin: .5em 0; } 
    31 form .field em { color: #888; font-size: smaller } 
    32 form .field .disabled em { color: #d7d7d7 } 
     23#x-trac form.addnew { clear: right; float: right; margin: -2em 0 4em; width: 33% } 
     24#x-trac form.mod { margin-top: 1em; } 
     25#x-trac form.mod .field { margin: .5em 0; } 
     26#x-trac form .field em { color: font-size: smaller } 
    3327 
    34 table.listing { clear: none; width: 64% } 
    35 table.listing .sel, table.listing .default { text-align: center; width: 1% } 
     28#x-trac table.listing { clear: none; width: 64% } 
     29#x-trac table.listing .sel, #x-trac table.listing .default { text-align: center; width: 1% } 
    3630 
    3731/* Plugins panel */ 
    38 form#addplug { width: 35% } 
    39 .plugin { background: #f7f7f7; border: 1px solid #d7d7d7; margin: 0 0 2em; 
     32#x-trac form#addplug { width: 35% } 
     33#x-trac .plugin { border: 1px solid black; margin: 0 0 2em; 
    4034  padding: 2px .5em; text-align: left; width: 60%; 
    4135} 
    42 .plugin h3 { background: url(../expanded.png) 0 50% no-repeat; 
     36#x-trac .plugin h3 { background-position: 0 50%; background-repeat: no-repeat; 
    4337  margin: .5em 0 0; padding-left: 16px; 
    4438} 
    45 .collapsed h3 { background-image: url(../collapsed.png); } 
    46 .plugin .buttons { margin-top: 0; text-align: right } 
    47 .plugin .uninstall { margin-top: -2em; padding: 0 } 
    48 .plugin .summary, .plugin .info { color: #999; font-size: 80%; 
    49   padding-left: 16px; 
    50 } 
    51 .plugin .summary { margin: -.5em 0 .5em } 
    52 .plugin .info { margin: 1em 0 .5em; } 
    53 .plugin .info dt { float: left; width: 7em; } 
    54 .plugin .info dd { padding: 0; margin: 0; } 
    55 .plugin .listing { width: 100% } 
    56 .collapsed .info, .collapsed .listing, .collapsed .update { display: none } 
    57 .plugin .listing td { background: #fff } 
    58 .plugin .listing .name p { color: #999; font-size: 80%; margin: 0 } 
     39#x-trac .plugin .buttons { margin-top: 0; text-align: right } 
     40#x-trac .plugin .uninstall { margin-top: -2em; padding: 0 } 
     41#x-trac .plugin .summary, 
     42#x-trac .plugin .info { font-size: 80%; padding-left: 16px; } 
     43#x-trac .plugin .summary { margin: -.5em 0 .5em } 
     44#x-trac .plugin .info { margin: 1em 0 .5em; } 
     45#x-trac .plugin .info dt { float: left; width: 7em; } 
     46#x-trac .plugin .info dd { padding: 0; margin: 0; } 
     47#x-trac .plugin .listing { width: 100% } 
     48#x-trac .collapsed .info, #x-trac .collapsed .listing, #x-trac .collapsed .update { display: none } 
     49#x-trac .plugin .listing .name p { font-size: 80%; margin: 0 } 
    5950 
    6051/* Perm Panel */ 
    61 #permlist div { width: 13em; float: left; } 
    62 fieldset tr.field th { text-align: right; } 
     52#x-trac #permlist div { width: 13em; float: left; } 
     53#x-trac fieldset tr.field th { text-align: right; } 
  • trac/htdocs/css/about.css

     
    11/* About page */ 
    2 #content.about p.copyright { color: #999; font-size: 90%; } 
    3 #content.about h2 { margin-top: 2em; } 
    4 #content.about table { margin-top: 0; width: auto; } 
    5 #content.about table th, #content.about table td { font-size: 90%; } 
     2#x-trac #content.about p.copyright { font-size: 90%; } 
     3#x-trac #content.about h2 { margin-top: 2em; } 
     4#x-trac #content.about table { margin-top: 0; width: auto; } 
     5#x-trac #content.about table th, #content.about table td { font-size: 90%; } 
    66 
    7 #content.about th { background: #f7f7f0; font-weight: bold; text-align: right; 
     7#x-trac #content.about th { 
     8  font-weight: bold; 
     9  text-align: right; 
    810  vertical-align: top; 
    911} 
    1012 
    11 #content.about #config th { text-align: left; } 
    12 #content.about #config th.section { text-align: right; } 
    13 #content.about #config th, #content.about #config td { border: 1px solid #ddd; 
    14   padding: 3px; 
    15 } 
    16 #content.about #config td.value { font-family: monospace; } 
    17 #content.about #config tr.modified td.value { font-weight: bold; } 
    18 #content.about #config td.doc { padding: 3px 1em; } 
     13#x-trac #content.about #config th { text-align: left; } 
     14#x-trac #content.about #config th.section { text-align: right; } 
     15#x-trac #content.about #config th, 
     16#x-trac #content.about #config td { padding: 3px; } 
     17#x-trac #content.about #config td.value { font-family: monospace; } 
     18#x-trac #content.about #config tr.modified td.value { font-weight: bold; } 
     19#x-trac #content.about #config td.doc { padding: 3px 1em; } 
  • trac/htdocs/css/tracstyle.css

     
     1/** 
     2 * Colors / Backgrounds for the default design 
     3 * 
     4 * XXX: skiped css files in the alphabetical list 
     5 *  - browser.css 
     6 *  - changeset.css 
     7 *  - code.css 
     8 *  - diff.css 
     9 */ 
     10 
     11/* about page */ 
     12#x-trac #content.about p.copyright { color: #999; } 
     13#x-trac #content.about th { background: #f7f7f0; } 
     14#x-trac #content.about #config td { border: 1px solid #ddd; } 
     15 
     16/* admin page */ 
     17#x-trac #content.admin #tabs { 
     18  background: #f7f7f0; 
     19  border-color: #ccc #666 #666 #ccc; 
     20} 
     21#x-trac #content.admin #tabs li { color: #999; } 
     22#x-trac #content.admin #tabs li li { color: #000; } 
     23#x-trac #content.admin #tabs li li.active { 
     24  color: #444; 
     25  border-color: #ccc #000 #666 #ccc; 
     26} 
     27#x-trac #content.admin #tabs :link:hover, 
     28#x-trac #content.admin #tabs :visited:hover { color: #000; } 
     29#x-trac #content.admin #tabcontent h2 { color: #333; } 
     30#x-trac #content.admin p.help { color: #666; } 
     31#x-trac #content.admin form .field em { color: #888; } 
     32#x-trac #content.admin form .field .disabled em { color: #d7d7d7 } 
     33 
     34#x-trac #content.admin .plugin { 
     35  background: #f7f7f7; border: 1px solid #d7d7d7; 
     36} 
     37#x-trac #content.admin .plugin h3 { background-image: url(../expanded.png); } 
     38#x-trac #content.admin .collapsed h3 { background-image: url(../collapsed.png); } 
     39#x-trac #content.admin .plugin .summary, 
     40#x-trac #content.admin .plugin .info { color: #999; } 
     41#x-trac #content.admin .plugin .listing td { background: #fff } 
     42#x-trac #content.admin .plugin .listing .name p { color: #999; } 
     43 
     44/* prefs */ 
     45#x-trac #content.prefs #tabs li { 
     46  background: #e6e6e6; 
     47  border-color: #ccc #666 #ccc #ccc; 
     48  color: #666; 
     49} 
     50#x-trac #content.prefs #tabs :link, 
     51#x-trac #content.prefs #tabs :visited { 
     52  border: none; color: #999; 
     53} 
     54#x-trac #content.prefs #tabs :link:hover, 
     55#x-trac #content.prefs #tabs :visited:hover { 
     56  background: transparent; 
     57} 
     58#x-trac #content.prefs #tabs li.active { 
     59  background: #fff; 
     60  border-bottom: 1px solid #fff; 
     61} 
     62#x-trac #content.prefs #tabcontent { 
     63  background: url(../vgradient.png) 0 1px repeat-x; 
     64  border-top: 1px solid #ccc; 
     65} 
     66 
     67/* report */ 
     68#x-trac #content.report h1 .numrows, 
     69#x-trac #content.report h2 .numrows { color: #999 } 
     70#x-trac #content.report h2 { color: #d7d7d7; background: #f7f7f7; } 
     71#x-trac #content.report .tickets .fullrow .meta { color: #999; } 
     72#x-trac #content.report .tickets tbody tr:hover { background: #eed; color: #000 } 
     73#x-trac #content.report .tickets tbody tr.fullrow td, 
     74#x-trac #content.report .tickets tbody td.fullrow { 
     75 color: #333; 
     76 background: transparent; 
     77} 
  • trac/htdocs/css/report.css

     
    11@import url(code.css); 
    22 
    3 h1 .numrows, h2 .numrows { 
     3#x-trac h1 .numrows, #x-trac h2 .numrows { 
    44 margin-left: 1em; 
    5  color: #999;  
    65 font-size: 65%;  
    76 font-weight: normal;  
    87} 
    9 h2 { 
    10  background: #f7f7f7; 
    11  border-bottom: 1px solid #d7d7d7; 
     8#x-trac h2 { 
    129 margin: 2em 0 0; 
    1310 padding: 0 .33em; 
    1411} 
    15 #report-descr { margin: 0 2em; font-size: 90% } 
    16 #report-notfound { margin: 2em; font-size: 110% } 
    17 #content.report .field { margin: 1em 0; } 
    18 #content.report .field label { padding-bottom: .3em; } 
     12#x-trac #report-descr { margin: 0 2em; font-size: 90% } 
     13#x-trac #report-notfound { margin: 2em; font-size: 110% } 
     14#x-trac #content.report .field { margin: 1em 0; } 
     15#x-trac #content.report .field label { padding-bottom: .3em; } 
    1916 
    20 #query { clear: right } 
    21 #query fieldset, #query fieldset input, #query fieldset select { font-size: 11px } 
    22 #query fieldset { margin-top: 1em } 
    23 #query .option, #query .option input, #query .option select { font-size: 11px } 
    24 #query .option { float: left; line-height: 2em; margin: .9em 2.5em 0 .5em; padding: 0 0 .1em } 
    25 #query .buttons { float: right; margin-top: .5em } 
    26 #query .buttons input { margin: .5em } 
    27 #query hr { clear: both; margin: 0; visibility: hidden } 
     17#x-trac #query { clear: right } 
     18#x-trac #query fieldset, #x-trac #query fieldset input, #x-trac #query fieldset select { font-size: 11px } 
     19#x-trac #query fieldset { margin-top: 1em } 
     20#x-trac #query .option, #x-trac #query .option input, #x-trac #query .option select { font-size: 11px } 
     21#x-trac #query .option { float: left; line-height: 2em; margin: .9em 2.5em 0 .5em; padding: 0 0 .1em } 
     22#x-trac #query .buttons { float: right; margin-top: .5em } 
     23#x-trac #query .buttons input { margin: .5em } 
     24#x-trac #query hr { clear: both; margin: 0; visibility: hidden } 
    2825 
    29 #filters table { width: 100% } 
    30 #filters tr { height: 2em } 
    31 #filters th, #filters td { padding: 0 .2em; vertical-align: middle } 
    32 #filters th { font-size: 11px; text-align: right; white-space: nowrap; } 
    33 #filters td label { font-size: 11px } 
    34 #filters td.mode { text-align: right } 
    35 #filters td.filter { width: 100% } 
    36 #filters td.filter label { padding-right: 1em } 
    37 #filters td.actions { text-align: right; white-space: nowrap } 
     26#x-trac #filters table { width: 100% } 
     27#x-trac #filters tr { height: 2em } 
     28#x-trac #filters th, #x-trac #filters td { padding: 0 .2em; vertical-align: middle } 
     29#x-trac #filters th { font-size: 11px; text-align: right; white-space: nowrap; } 
     30#x-trac #filters td label { font-size: 11px } 
     31#x-trac #filters td.mode { text-align: right } 
     32#x-trac #filters td.filter { width: 100% } 
     33#x-trac #filters td.filter label { padding-right: 1em } 
     34#x-trac #filters td.actions { text-align: right; white-space: nowrap } 
    3835 
    3936/* Styles for the report list and the report results table 
    4037   (extends the styles for "table.listing") */ 
    41 .reports td.title { width: 100% } 
    42 .reports tbody td :link, .reports tbody td :visited, 
    43 .tickets tbody td :link, .tickets tbody td :visited { display: block } 
    44 .tickets { border-bottom: none } 
    45 .tickets thead th { text-transform: capitalize; white-space: nowrap; } 
    46 .tickets tbody td, .reports tbody td { padding: .1em .5em !important } 
    47 .tickets tbody td a, .reports tbody td a { border-bottom: none } 
    48 .tickets tbody td.id :link, .tickets tbody td.id :visited { 
     38#x-trac .reports td.title { width: 100% } 
     39#x-trac .reports tbody td :link, #x-trac .reports tbody td :visited, 
     40#x-trac .tickets tbody td :link, .#x-trac .tickets tbody td :visited { display: block } 
     41#x-trac .tickets { border-bottom: none } 
     42#x-trac .tickets thead th { text-transform: capitalize; white-space: nowrap; } 
     43#x-trac .tickets tbody td, #x-trac .reports tbody td { padding: .1em .5em !important } 
     44#x-trac .tickets tbody td a, #x-trac .reports tbody td a { border-bottom: none } 
     45#x-trac .tickets tbody td.id :link, #x-trac .tickets tbody td.id :visited { 
    4946 font-weight: bold; 
    5047} 
    51 .tickets tbody tr:hover { background: #eed; color: #000 } 
    52 .tickets tr.color1-odd  { background: #fdc; border-color: #e88; color: #a22 } 
    53 .tickets tr.color1-even { background: #fed; border-color: #e99; color: #a22 } 
    54 .tickets tr.color2-odd  { background: #ffb; border-color: #eea; color: #880 } 
    55 .tickets tr.color2-even { background: #ffd; border-color: #dd8; color: #880 } 
    56 .tickets tr.color3-odd  { background: #fbfbfb; border-color: #ddd; color: #444 } 
    57 .tickets tr.color3-even { background: #f6f6f6; border-color: #ccc; color: #333 } 
    58 .tickets tr.color4-odd { background: #e7ffff; border-color: #cee; color: #099 } 
    59 .tickets tr.color4-even { background: #dff; border-color: #bee; color: #099 } 
    60 .tickets tr.color5-odd { background: #e7eeff; border-color: #cde; color: #469 } 
    61 .tickets tr.color5-even { background: #dde7ff; border-color: #cde; color: #469 } 
    62 .tickets tr.color6-odd  { background: #f0f0f0; border-color: #ddd; color: #888 } 
    63 .tickets tr.color6-even { background: #f7f7f7; border-color: #ddd; color: #888 } 
    64 .tickets tr.color6-odd a, .color6-even a { color: #b66 } 
    65 .tickets tbody tr.fullrow td, .tickets tbody td.fullrow { 
     48#x-trac .tickets tr.color1-odd  { background: #fdc; border-color: #e88; color: #a22 } 
     49#x-trac .tickets tr.color1-even { background: #fed; border-color: #e99; color: #a22 } 
     50#x-trac .tickets tr.color2-odd  { background: #ffb; border-color: #eea; color: #880 } 
     51#x-trac .tickets tr.color2-even { background: #ffd; border-color: #dd8; color: #880 } 
     52#x-trac .tickets tr.color3-odd  { background: #fbfbfb; border-color: #ddd; color: #444 } 
     53#x-trac .tickets tr.color3-even { background: #f6f6f6; border-color: #ccc; color: #333 } 
     54#x-trac .tickets tr.color4-odd { background: #e7ffff; border-color: #cee; color: #099 } 
     55#x-trac .tickets tr.color4-even { background: #dff; border-color: #bee; color: #099 } 
     56#x-trac .tickets tr.color5-odd { background: #e7eeff; border-color: #cde; color: #469 } 
     57#x-trac .tickets tr.color5-even { background: #dde7ff; border-color: #cde; color: #469 } 
     58#x-trac .tickets tr.color6-odd  { background: #f0f0f0; border-color: #ddd; color: #888 } 
     59#x-trac .tickets tr.color6-even { background: #f7f7f7; border-color: #ddd; color: #888 } 
     60#x-trac .tickets tr.color6-odd a, #x-trac .color6-even a { color: #b66 } 
     61#x-trac .tickets tbody tr.fullrow td, #x-trac .tickets tbody td.fullrow { 
    6662 border: none; 
    67  color: #333; 
    68  background: transparent; 
    6963 padding: 0 1em 2em 2em !important; 
    7064 font-size: 85%; 
    7165} 
    72 .tickets tbody tr.fullrow:hover { background: transparent !important } 
    73 .tickets .fullrow :link, .tickets .fullrow :visited { display: inline } 
    74 .tickets .fullrow .meta { color: #999; margin-bottom: -.5em; margin-left: -1em } 
    75 .tickets .fullrow hr { display: none } 
     66#x-trac .tickets tbody tr.fullrow:hover { background: transparent !important } 
     67#x-trac .tickets .fullrow :link, #x-trac .tickets .fullrow :visited { display: inline } 
     68#x-trac .tickets .fullrow .meta { margin-bottom: -.5em; margin-left: -1em } 
     69#x-trac .tickets .fullrow hr { display: none } 
    7670 
    7771/* Query results table */ 
    78 table.tickets tbody tr.added td { font-weight: bold } 
    79 table.tickets tbody tr.changed td { font-style: italic } 
    80 table.tickets tbody tr.removed td { color: #999 } 
    81 table.tickets tbody tr.prio1 { background: #fdc; border-color: #e88 } 
    82 table.tickets tbody tr.even.prio1 { background: #fed; border-color: #e99 } 
    83 table.tickets tbody tr.prio2 { background: #ffb; border-color: #eea } 
    84 table.tickets tbody tr.even.prio2 { background: #ffd; border-color: #dd8 } 
    85 table.tickets tbody tr.prio3  { background: #fbfbfb; border-color: #ddd } 
    86 table.tickets tbody tr.even.prio3 { background: #f6f6f6; border-color: #ccc } 
    87 table.tickets tbody tr.prio4 { background: #e7ffff; border-color: #cee } 
    88 table.tickets tbody tr.even.prio4 { background: #dff; border-color: #bee } 
    89 table.tickets tbody tr.prio5 { background: #e7eeff; border-color: #cde } 
    90 table.tickets tbody tr.even.prio5 { background: #dde7ff } 
    91 table.tickets tbody tr.prio6 { background: #f0f0f0; border-color: #ddd } 
    92 table.tickets tbody tr.even.prio6 { background: #f7f7f7 } 
     72#x-trac table.tickets tbody tr.added td { font-weight: bold } 
     73#x-trac table.tickets tbody tr.changed td { font-style: italic } 
     74#x-trac table.tickets tbody tr.removed td { color: #999 } 
     75#x-trac table.tickets tbody tr.prio1 { background: #fdc; border-color: #e88 } 
     76#x-trac table.tickets tbody tr.even.prio1 { background: #fed; border-color: #e99 } 
     77#x-trac table.tickets tbody tr.prio2 { background: #ffb; border-color: #eea } 
     78#x-trac table.tickets tbody tr.even.prio2 { background: #ffd; border-color: #dd8 } 
     79#x-trac table.tickets tbody tr.prio3  { background: #fbfbfb; border-color: #ddd } 
     80#x-trac table.tickets tbody tr.even.prio3 { background: #f6f6f6; border-color: #ccc } 
     81#x-trac table.tickets tbody tr.prio4 { background: #e7ffff; border-color: #cee } 
     82#x-trac table.tickets tbody tr.even.prio4 { background: #dff; border-color: #bee } 
     83#x-trac table.tickets tbody tr.prio5 { background: #e7eeff; border-color: #cde } 
     84#x-trac table.tickets tbody tr.even.prio5 { background: #dde7ff } 
     85#x-trac table.tickets tbody tr.prio6 { background: #f0f0f0; border-color: #ddd } 
     86#x-trac table.tickets tbody tr.even.prio6 { background: #f7f7f7 } 
  • trac/htdocs/css/prefs.css

     
    1 #content.prefs #tabs { list-style: none; margin: 2em 1em 0; padding: 1px; } 
    2 #content.prefs #tabs li { background: #e6e6e6; border: 1px solid; 
    3   border-color: #ccc #666 #ccc #ccc; color: #666; position: relative; 
     1#x-trac #content.prefs #tabs { list-style: none; margin: 2em 1em 0; padding: 1px; } 
     2#x-trac #content.prefs #tabs li { border: 1px solid black; 
    43  bottom: -1px; float: left; font-size: 90%; margin: 0 .5em; 
    5   padding: .2em 1em .3em; 
     4  padding: .2em 1em .3em; position: relative; 
    65} 
    7 #content.prefs #tabs :link, #content.prefs #tabs :visited { 
    8   border: none; color: #999; 
     6#x-trac #content.prefs #tabs :link:hover, #x-trac #content.prefs #tabs :visited:hover { 
     7  background: transparent; 
    98} 
    10 #content.prefs #tabs :link:hover, #content.prefs #tabs :visited:hover { 
    11   background: transparent; color: #333; 
    12 } 
    13 #content.prefs #tabs li.active { background: #fff; 
    14   border-bottom: 1px solid #fff; 
    15 } 
    16 #content.prefs #tabs #tab_advanced { float: right; } 
    17 #content.prefs #tabcontent { background: url(../vgradient.png) 0 1px repeat-x; 
    18   border-top: 1px solid #ccc; clear: left; padding: 20px 5px; 
    19 } 
    20 * html #content.prefs #tabcontent { padding-top: 0; } 
     9#x-trac #content.prefs #tabs #tab_advanced { float: right; } 
     10#x-trac #content.prefs #tabcontent { clear: left; padding: 20px 5px; } 
    2111 
    22 #content.prefs div.field { margin-bottom: 1em; } 
    23 #content.prefs tr.field th { text-align: right; vertical-align: middle; 
     12#x-trac #content.prefs div.field { margin-bottom: 1em; } 
     13#x-trac #content.prefs tr.field th { text-align: right; vertical-align: middle; 
    2414  white-space: nowrap; 
    2515} 
  • trac/templates/layout.html

     
    3636  </div> 
    3737 
    3838  <body py:match="body"> 
    39     <div id="banner"> 
    40       <div id="header" py:choose=""> 
    41         <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link}"><img 
    42           src="${chrome.logo.src}" alt="${chrome.logo.alt}" /></a> 
    43         <h1 py:otherwise=""><a href="${chrome.logo.link}">${project.name}</a></h1> 
    44       </div> 
    45       <form py:if="'SEARCH_VIEW' in perm" id="search" 
    46             action="${href.search()}" method="get"><div> 
    47         <label for="proj-search">Search:</label> 
    48         <input type="text" id="proj-search" name="q" size="18" accesskey="f" value="" /> 
    49         <input type="submit" value="Search" /> 
    50         <input type="hidden" name="wiki" value="on" /> 
    51         <input type="hidden" name="changeset" value="on" /> 
    52         <input type="hidden" name="ticket" value="on" /> 
    53       </div></form> 
    54       ${navigation('metanav')} 
    55     </div> 
     39     
     40    <form py:if="'SEARCH_VIEW' in perm" id="search" 
     41          action="${href.search()}" method="get"><div> 
     42      <label for="proj-search">Search:</label> 
     43      <input type="text" id="proj-search" name="q" size="18" accesskey="f" value="" /> 
     44      <input type="submit" value="Search" /> 
     45      <input type="hidden" name="wiki" value="on" /> 
     46      <input type="hidden" name="changeset" value="on" /> 
     47      <input type="hidden" name="ticket" value="on" /> 
     48    </div></form> 
     49     
     50    ${navigation('metanav')} 
    5651    ${navigation('mainnav')} 
    5752 
    5853    <div id="main"> 
     
    6560      </script> 
    6661      <script py:for="script in chrome.late_scripts" 
    6762              type="${script.type}" src="${script.href}"></script> 
     63    </div> 
    6864 
    69       <div id="altlinks" py:if="'alternate' in chrome.links"> 
    70         <h3>Download in other formats:</h3> 
    71         <ul> 
    72           <li py:for="idx, link in enumerate(chrome.links.alternate)" 
    73               class="${first_last(idx, chrome.links.alternate)}"> 
    74             <a rel="nofollow" href="${link.href}" class="${link['class']}" 
    75                py:content="link.title" /> 
    76           </li> 
    77         </ul> 
    78       </div> 
     65    <div id="altlinks" py:if="'alternate' in chrome.links"> 
     66      <h3>Download in other formats:</h3> 
     67      <ul> 
     68        <li py:for="idx, link in enumerate(chrome.links.alternate)" 
     69            class="${first_last(idx, chrome.links.alternate)}"> 
     70          <a rel="nofollow" href="${link.href}" class="${link['class']}" 
     71             py:content="link.title" /> 
     72        </li> 
     73      </ul> 
    7974    </div> 
    8075 
    8176    <div id="footer"><hr/> 
     
    9085    </div> 
    9186  </body> 
    9287 
    93   <xi:include href="site.html"><xi:fallback /></xi:include> 
     88  <xi:include href="${trac.theme.get_theme_site_template()}"><xi:fallback /></xi:include> 
    9489 
    9590</html> 
  • trac/templates/trac_site.html

     
     1<html xmlns="http://www.w3.org/1999/xhtml" 
     2      xmlns:py="http://genshi.edgewall.org/" 
     3      xmlns:xi="http://www.w3.org/2001/XInclude" py:strip=""> 
     4  <head py:match="head"> 
     5    ${select('*')} 
     6    <link rel="stylesheet" href="${trac.theme.get_chrome_url('css/tracstyle.css')}" /> 
     7  </head> 
     8  <body py:match="body"> 
     9    <div id="x-trac"> 
     10      <div id="banner"> 
     11        <div id="header" py:choose=""> 
     12          <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link}"><img 
     13            src="${chrome.logo.src}" alt="${chrome.logo.alt}" /></a> 
     14          <h1 py:otherwise=""><a href="${chrome.logo.link}">${project.name}</a></h1> 
     15        </div> 
     16        ${select('form[@id="search"]')} 
     17        ${select('div[@id="metanav"]')} 
     18      </div> 
     19      ${select('div[@id="mainnav"]')} 
     20 
     21      <div id="main"> 
     22        ${select('div[@id="main"]/*')} 
     23        ${select('div[@id="altlinks"]')} 
     24      </div> 
     25 
     26      ${select('div[@id="footer"]')} 
     27    </div> 
     28  </body> 
     29</html> 
  • trac/web/theming.py

     
     1# -*- coding: utf-8 -*- 
     2# 
     3# Copyright (C) 2004-2006 Edgewall Software 
     4# Copyright (C) 2007 Armin Ronacher <armin.ronacher@active-4.com> 
     5# All rights reserved. 
     6# 
     7# This software is licensed as described in the file COPYING, which 
     8# you should have received as part of this distribution. The terms 
     9# are also available at http://trac.edgewall.org/wiki/TracLicense. 
     10# 
     11# This software consists of voluntary contributions made by many 
     12# individuals. For the exact contribution history, see the revision 
     13# history and logs, available at http://trac.edgewall.org/log/. 
     14# 
     15# Author: Daniel Lundin <daniel@edgewall.com> 
     16#         Christopher Lenz <cmlenz@gmx.de> 
     17 
     18from trac.core import Interface, Component, implements 
     19 
     20 
     21class IThemeProvider(Interface): 
     22    """ 
     23    The interface for all theme providers. Pretty basic, 
     24    just provides the most important things 
     25    """ 
     26 
     27    def get_theme_htdocs_name(): 
     28        """ 
     29        Return the name of the htdocs folder. Every theme 
     30        can implement the `ITemplateProvider` in order to 
     31        get it's own theme folder, however there are two 
     32        special ones: 
     33 
     34        - `common`      the trac htdocs folder 
     35        - `site`        the htdocs folder in the trac instance 
     36        """ 
     37 
     38    def get_theme_site_template(): 
     39        """ 
     40        Return the name of the theme site template that is 
     41        used. The site template places the interface 
     42        elements and overrides them. 
     43        """ 
     44 
     45 
     46class CustomTheme(Component): 
     47    implements(IThemeProvider) 
     48 
     49    # IThemeProvider 
     50    def get_theme_htdocs_id(self): 
     51        return 'site' 
     52 
     53    def get_theme_site_template(self): 
     54        return 'site.html' 
     55 
     56 
     57class TracTheme(Component): 
     58    implements(IThemeProvider) 
     59 
     60    # IThemeProvider 
     61    def get_theme_htdocs_id(self): 
     62        return 'common' 
     63 
     64    def get_theme_site_template(self): 
     65        return 'trac_site.html' 
     66 
     67 
     68class ThemeController(object): 
     69    """ 
     70    Class passed to the templates in order to help the 
     71    designer. 
     72    """ 
     73 
     74    def __init__(self, req, theme): 
     75        self.req = req 
     76        self.theme = theme 
     77 
     78    def get_chrome_url(self, *files): 
     79        return self.req.href.chrome(self.theme.get_theme_htdocs_id(), *files) 
     80 
     81    def get_theme_site_template(self): 
     82        return self.theme.get_theme_site_template() 
  • trac/web/chrome.py

     
    4343from trac.web.href import Href 
    4444from trac.wiki import IWikiSyntaxProvider 
    4545from trac.wiki.formatter import format_to_html, format_to_oneliner 
     46from trac.web.theming import ThemeController, IThemeProvider 
    4647 
    4748 
    4849def add_link(req, rel, href, title=None, mimetype=None, classname=None): 
     
    165166         
    166167        (''since 0.11'')""") 
    167168 
     169    theme = ExtensionOption('trac', 'theme', 
     170                            IThemeProvider, 'TracTheme', 
     171        """Name of the theme trac should use.""") 
     172 
    168173    auto_reload = Option('trac', 'auto_reload', False, 
    169174        """Automatically reload template files after modification.""") 
    170175 
     
    253258            try: 
    254259                fileobj.write("""<html xmlns="http://www.w3.org/1999/xhtml" 
    255260      xmlns:py="http://genshi.edgewall.org/" py:strip=""> 
    256   <!-- Custom match templates go here --> 
     261  <!-- Custom match templates go here 
     262       If you modify this template you have to set `trac.theme` to 
     263       `CustomTheme` in your trac.ini --> 
    257264</html>""") 
    258265            finally: 
    259266                fileobj.close() 
     
    363370            add_link(fakereq, 'icon', src, mimetype=mimetype) 
    364371            add_link(fakereq, 'shortcut icon', src, mimetype=mimetype) 
    365372 
     373 
    366374        # Logo image 
    367375        chrome['logo'] = self.get_logo_data(req.href) 
    368376 
     
    460468            'version': VERSION, 
    461469            'homepage': 'http://trac.edgewall.org/', # FIXME: use setup data 
    462470            'systeminfo': self.env.systeminfo, 
     471            'theme': ThemeController(req, self.theme) 
    463472        } 
    464473        d['project'] = { 
    465474            'name': self.env.project_name,