TracDev/Proposals/ThemePlugins: theming.2.patch
| File theming.2.patch, 28.4 KB (added by Armin Ronacher, 20 months ago) |
|---|
-
setup.py
85 85 trac.web.auth = trac.web.auth 86 86 trac.wiki.macros = trac.wiki.macros 87 87 trac.wiki.web_ui = trac.wiki.web_ui 88 trac.themes = trac.web.theming 88 89 """, 89 90 ) -
trac/htdocs/css/admin.css
1 # content.admin h1 { float: left; }1 #x-trac #content.admin h1 { float: left; } 2 2 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; 5 4 margin: 1em 0 2em; padding: .5em 0 0; float: left; width: 12em; 6 5 } 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; 9 8 padding: 0.1em 5px; 10 9 } 11 # tabs li li { color: #000;font-size: 110%; font-weight: normal;10 #x-trac #tabs li li { font-size: 110%; font-weight: normal; 12 11 margin: 0 -3px; padding: 1px 0 1px 10px; 13 12 } 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; } 21 16 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; } 25 20 26 # enumlist tbody td { vertical-align: middle; }21 #x-trac #enumlist tbody td { vertical-align: middle; } 27 22 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 } 33 27 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% } 36 30 37 31 /* 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; 40 34 padding: 2px .5em; text-align: left; width: 60%; 41 35 } 42 .plugin h3 { background: url(../expanded.png) 0 50%no-repeat;36 #x-trac .plugin h3 { background-position: 0 50%; background-repeat: no-repeat; 43 37 margin: .5em 0 0; padding-left: 16px; 44 38 } 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 } 59 50 60 51 /* 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
1 1 /* 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%; } 6 6 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; 8 10 vertical-align: top; 9 11 } 10 12 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
1 1 @import url(code.css); 2 2 3 h1 .numrows,h2 .numrows {3 #x-trac h1 .numrows, #x-trac h2 .numrows { 4 4 margin-left: 1em; 5 color: #999;6 5 font-size: 65%; 7 6 font-weight: normal; 8 7 } 9 h2 { 10 background: #f7f7f7; 11 border-bottom: 1px solid #d7d7d7; 8 #x-trac h2 { 12 9 margin: 2em 0 0; 13 10 padding: 0 .33em; 14 11 } 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; } 19 16 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 } 28 25 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 } 38 35 39 36 /* Styles for the report list and the report results table 40 37 (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 { 49 46 font-weight: bold; 50 47 } 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 { 66 62 border: none; 67 color: #333;68 background: transparent;69 63 padding: 0 1em 2em 2em !important; 70 64 font-size: 85%; 71 65 } 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 } 76 70 77 71 /* 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; 4 3 bottom: -1px; float: left; font-size: 90%; margin: 0 .5em; 5 padding: .2em 1em .3em; 4 padding: .2em 1em .3em; position: relative; 6 5 } 7 # content.prefs #tabs :link, #content.prefs #tabs :visited{8 b order: none; color: #999;6 #x-trac #content.prefs #tabs :link:hover, #x-trac #content.prefs #tabs :visited:hover { 7 background: transparent; 9 8 } 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; } 21 11 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; 24 14 white-space: nowrap; 25 15 } -
trac/templates/layout.html
36 36 </div> 37 37 38 38 <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')} 56 51 ${navigation('mainnav')} 57 52 58 53 <div id="main"> … … 65 60 </script> 66 61 <script py:for="script in chrome.late_scripts" 67 62 type="${script.type}" src="${script.href}"></script> 63 </div> 68 64 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> 79 74 </div> 80 75 81 76 <div id="footer"><hr/> … … 90 85 </div> 91 86 </body> 92 87 93 <xi:include href=" site.html"><xi:fallback /></xi:include>88 <xi:include href="${trac.theme.get_theme_site_template()}"><xi:fallback /></xi:include> 94 89 95 90 </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 18 from trac.core import Interface, Component, implements 19 20 21 class 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 46 class 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 57 class 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 68 class 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
43 43 from trac.web.href import Href 44 44 from trac.wiki import IWikiSyntaxProvider 45 45 from trac.wiki.formatter import format_to_html, format_to_oneliner 46 from trac.web.theming import ThemeController, IThemeProvider 46 47 47 48 48 49 def add_link(req, rel, href, title=None, mimetype=None, classname=None): … … 165 166 166 167 (''since 0.11'')""") 167 168 169 theme = ExtensionOption('trac', 'theme', 170 IThemeProvider, 'TracTheme', 171 """Name of the theme trac should use.""") 172 168 173 auto_reload = Option('trac', 'auto_reload', False, 169 174 """Automatically reload template files after modification.""") 170 175 … … 253 258 try: 254 259 fileobj.write("""<html xmlns="http://www.w3.org/1999/xhtml" 255 260 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 --> 257 264 </html>""") 258 265 finally: 259 266 fileobj.close() … … 363 370 add_link(fakereq, 'icon', src, mimetype=mimetype) 364 371 add_link(fakereq, 'shortcut icon', src, mimetype=mimetype) 365 372 373 366 374 # Logo image 367 375 chrome['logo'] = self.get_logo_data(req.href) 368 376 … … 460 468 'version': VERSION, 461 469 'homepage': 'http://trac.edgewall.org/', # FIXME: use setup data 462 470 'systeminfo': self.env.systeminfo, 471 'theme': ThemeController(req, self.theme) 463 472 } 464 473 d['project'] = { 465 474 'name': self.env.project_name,
