Global navigation moves to side menu.

This commit is contained in:
takezoe
2014-05-05 22:05:41 +09:00
parent cf047a8cee
commit 6a7fc55572
35 changed files with 1704 additions and 1290 deletions

View File

@@ -2,6 +2,7 @@
<!-- Created with Inkscape (http://www.inkscape.org/) --> <!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg <svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#" xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@@ -16,7 +17,16 @@
inkscape:version="0.48.4 r9939" inkscape:version="0.48.4 r9939"
sodipodi:docname="icons.svg"> sodipodi:docname="icons.svg">
<defs <defs
id="defs4" /> id="defs4">
<linearGradient
id="linearGradient4044"
osb:paint="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop4046" />
</linearGradient>
</defs>
<sodipodi:namedview <sodipodi:namedview
id="base" id="base"
pagecolor="#ffffff" pagecolor="#ffffff"
@@ -24,15 +34,15 @@
borderopacity="1.0" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="1.4" inkscape:zoom="0.9899495"
inkscape:cx="450.21999" inkscape:cx="827.57339"
inkscape:cy="97.51519" inkscape:cy="496.04311"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1-9" inkscape:current-layer="layer1-9"
showgrid="false" showgrid="false"
inkscape:window-width="1366" inkscape:window-width="1366"
inkscape:window-height="706" inkscape:window-height="715"
inkscape:window-x="1912" inkscape:window-x="-8"
inkscape:window-y="-8" inkscape:window-y="-8"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:snap-global="false" inkscape:snap-global="false"
@@ -978,6 +988,268 @@
id="path4310" id="path4310"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscc" /> sodipodi:nodetypes="ccscc" />
<path
id="path2991-7-1-4"
transform="translate(668.66057,1115.0272)"
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
sodipodi:ry="104.28571"
sodipodi:rx="104.28571"
sodipodi:cy="290.93362"
sodipodi:cx="255.71428"
style="fill:#b3b3b3;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:type="arc" />
<path
id="path2993-4-5-8"
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
sodipodi:ry="104.28571"
sodipodi:rx="104.28571"
sodipodi:cy="290.93362"
sodipodi:cx="255.71428"
style="fill:#ffffff;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:type="arc"
transform="matrix(0.83611704,0,0,0.83611704,711.41194,1163.4493)" />
<rect
id="rect2995-0-2-8"
y="1378.4849"
x="916.58545"
height="99.396141"
width="20.706863"
style="fill:#b3b3b3;stroke:none;stroke-width:0.93666755999999995" />
<path
style="fill:#ffffff;stroke:#ffffff;stroke-width:2.92446065;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none"
d="m 884.0251,1366.2678 -64.6851,-36.2114 10.70013,55.9569 53.98497,-19.7455 z"
id="rect4046-3-4"
inkscape:connector-curvature="0" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:1.98877633;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none"
d="m 873.36878,1359.3959 -43.65605,-24.4345 6.99871,38.1562 36.65734,-13.7217 z"
id="rect4046-5"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#b3b3b3;stroke-width:13.63542366;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none"
d="m 1162.2186,1316.0972 c -0.2525,22.2049 -0.505,44.4098 -0.7575,66.6147 3.3299,0.032 6.6599,0.063 9.9898,0.095 -2.3515,2.3672 -4.703,4.7345 -7.0544,7.1018 31.3741,31.374 62.7482,62.7482 94.1223,94.1223 23.3412,-23.3412 46.6824,-46.6824 70.0236,-70.0236 -31.3741,-31.3899 -62.7483,-62.7798 -94.1224,-94.1697 -2.6197,2.6356 -5.2395,5.2711 -7.8593,7.9067 0.032,-3.6298 0.063,-7.2596 0.095,-10.8894 -21.4789,-0.2525 -42.9579,-0.505 -64.4368,-0.7575 z"
id="rect3075-11"
inkscape:connector-curvature="0" />
<rect
id="rect2995-0-2-8-6"
y="899.99463"
x="-1417.3273"
height="99.396141"
width="20.706863"
style="fill:#b3b3b3;stroke:none;stroke-width:0.93666755999999995"
transform="matrix(0,-1,1,0,0,0)" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:10.37699986;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 1172.5522,1326.6744 c -0.1922,16.8985 -0.3844,33.7973 -0.5765,50.6959 2.5342,0.024 5.0684,0.047 7.6026,0.072 -1.7896,1.8014 -3.5792,3.6031 -5.3686,5.4047 23.8766,23.8766 47.7533,47.7533 71.63,71.6301 17.7636,-17.7634 35.5269,-35.5268 53.2902,-53.2902 -23.8766,-23.8888 -47.7534,-47.7775 -71.6302,-71.6662 -1.9936,2.0058 -3.9873,4.0114 -5.9811,6.0172 0.024,-2.7624 0.047,-5.5247 0.072,-8.2872 -16.3463,-0.1921 -32.6925,-0.3843 -49.0386,-0.5764 z"
id="rect3075-11-7"
inkscape:connector-curvature="0" />
<path
sodipodi:type="arc"
style="fill:#ffffff;stroke:#b3b3b3;stroke-width:6.57334423;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none"
id="path3100-2"
sodipodi:cx="700"
sodipodi:cy="812.36218"
sodipodi:rx="10"
sodipodi:ry="10"
d="m 710,812.36218 c 0,5.52285 -4.47715,10 -10,10 -5.52285,0 -10,-4.47715 -10,-10 0,-5.52284 4.47715,-10 10,-10 5.52285,0 10,4.47716 10,10 z"
transform="matrix(1.2362333,-1.2362333,1.2362333,1.2362333,-667.98357,1217.7251)" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#b3b3b3;stroke-width:10.80681515;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect4114"
width="45.086407"
height="62.401226"
x="-133.16023"
y="1850.2394"
transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)" />
<path
id="path2991-7-6"
transform="translate(1090.5728,-207.2632)"
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
sodipodi:ry="104.28571"
sodipodi:rx="104.28571"
sodipodi:cy="290.93362"
sodipodi:cx="255.71428"
style="fill:#a0a0a0;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
sodipodi:type="arc" />
<path
id="path2993-4-8"
d="m 359.99999,290.93362 c 0,57.59541 -46.6903,104.28572 -104.28571,104.28572 -57.59541,0 -104.28571,-46.69031 -104.28571,-104.28572 0,-57.5954 46.6903,-104.28571 104.28571,-104.28571 57.59541,0 104.28571,46.69031 104.28571,104.28571 z"
sodipodi:ry="104.28571"
sodipodi:rx="104.28571"
sodipodi:cy="290.93362"
sodipodi:cx="255.71428"
style="fill:#ffffff;fill-rule:evenodd;stroke:#808080;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
sodipodi:type="arc"
transform="matrix(0.83611704,0,0,0.83611704,1133.3242,-158.84107)" />
<rect
id="rect2995-0-8"
y="10.829478"
x="1332.5247"
height="99.221687"
width="29.189819"
style="fill:#a0a0a0;stroke:#ffffff;stroke-width:1.11112404000000000;fill-opacity:1" />
<rect
id="rect2997-9-2"
y="129.62337"
x="1332.7828"
height="26.258072"
width="29.724136"
style="fill:#a0a0a0;stroke:#ffffff;stroke-width:0.57680577000000000;fill-opacity:1" />
<g
id="g4284-1"
transform="translate(670.07237,-816.24186)"
style="stroke:#a0a0a0;stroke-opacity:1">
<path
sodipodi:nodetypes="czcczcc"
inkscape:connector-curvature="0"
id="rect4201-26"
d="m 568.37427,1080.8464 c 0,0 55.60005,-9.5933 75.06243,-8.6574 19.46238,0.9359 40.43273,8.6574 40.43273,8.6574 l 0,141.4674 c 0,0 -20.97035,-7.7215 -40.43273,-8.6574 -19.46238,-0.9359 -75.06243,8.6574 -75.06243,8.6574 z"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:14.36538028999999900;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1" />
<rect
y="1108.1473"
x="597.4068"
height="5.4857273"
width="55.265846"
id="rect4203-0"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
y="1142.7776"
x="598.48895"
height="5.4857273"
width="55.26585"
id="rect4203-2-4"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
y="1176.1093"
x="598.48895"
height="5.4857273"
width="55.26585"
id="rect4203-2-3-9"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="czc"
inkscape:connector-curvature="0"
id="path4245-4"
d="m 563.55369,1233.6274 c 0,0 59.11965,-16.1473 81.00954,-14.7566 21.8899,1.3907 46.29117,14.7566 46.29117,14.7566"
style="fill:#b3b3b3;stroke:#a0a0a0;stroke-width:19.63722609999999900;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<g
transform="matrix(-1.0032405,0,0,1,1329.8708,99.560238)"
id="g4277-6"
style="stroke:#a0a0a0;stroke-opacity:1">
<path
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:14.36538124000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
d="m 519.67634,980.83663 c 0,0 55.60005,-9.5933 75.06243,-8.6574 19.46238,0.9359 40.43272,8.6574 40.43272,8.6574 l 0,141.46737 c 0,0 -20.97034,-7.7215 -40.43272,-8.6574 -19.46238,-0.9359 -75.06243,8.6574 -75.06243,8.6574 z"
id="rect4201-2-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="czcczcc" />
<rect
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4203-21-3"
width="55.26585"
height="5.4857273"
x="548.70886"
y="1008.1376" />
<rect
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4203-2-6-6"
width="55.26585"
height="5.4857273"
x="549.79102"
y="1042.7678" />
<rect
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:11.82844734000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4203-2-3-8-2"
width="55.26585"
height="5.4857273"
x="549.79102"
y="1076.0995" />
<path
style="fill:#b3b3b3;stroke:#a0a0a0;stroke-width:19.63722609999999900;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 514.85576,1133.6176 c 0,0 59.11965,-16.1473 81.00954,-14.7566 21.8899,1.3907 46.29116,14.7566 46.29116,14.7566"
id="path4245-5-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="czc" />
</g>
</g>
<path
inkscape:connector-curvature="0"
id="path3850-1-1"
d="m 1409.5992,670.87038 0,-128.57724 c 0,0 1.8599,-15.30681 -16.7384,-15.30681 -18.5984,0 -51.1454,0 -51.1454,0"
style="fill:none;stroke:#a0a0a0;stroke-width:22.72570610000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
y="547.80316"
x="1294.749"
height="104.27072"
width="3.2554622"
id="rect3818-4-7"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:22.72570610000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
transform="matrix(1.0049237,0,0,0.61497516,944.16607,536.33294)"
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
sodipodi:ry="35.140915"
sodipodi:rx="21.718279"
sodipodi:cy="230.89374"
sodipodi:cx="351.02802"
id="path3795-4-8-4"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:type="arc" />
<path
transform="matrix(1.0049237,0,0,0.61497516,942.63054,386.00935)"
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
sodipodi:ry="35.140915"
sodipodi:rx="21.718279"
sodipodi:cy="230.89374"
sodipodi:cx="351.02802"
id="path3795-8-0"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:type="arc" />
<path
transform="matrix(1.0049237,0,0,0.61497516,1056.9547,536.43446)"
d="m 372.74629,230.89374 a 21.718279,35.140915 0 1 1 -43.43655,0 21.718279,35.140915 0 1 1 43.43655,0 z"
sodipodi:ry="35.140915"
sodipodi:rx="21.718279"
sodipodi:cy="230.89374"
sodipodi:cx="351.02802"
id="path3795-4-0-2-9"
style="fill:#ffffff;stroke:#a0a0a0;stroke-width:12.04511166000000000;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:type="arc" />
<path
inkscape:connector-curvature="0"
id="path3852-4-4"
d="m 1369.3146,490.2451 0,70.69144 -45.5889,-32.13462 z"
style="fill:#a0a0a0;stroke:#a0a0a0;stroke-width:0.83335358000000004px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" />
<rect
style="fill:#a0a0a0;fill-opacity:1;stroke:#a0a0a0;stroke-width:10.82955647;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3953"
width="15.304287"
height="97.947441"
x="1474.2273"
y="-367.14282"
transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)" />
<rect
style="fill:#a0a0a0;fill-opacity:1;stroke:#a0a0a0;stroke-width:10.82955647;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3953-8"
width="15.304287"
height="97.947441"
x="-281.45197"
y="-1573.058"
transform="matrix(-0.70710678,0.70710678,-0.70710678,-0.70710678,0,0)" />
<rect
style="fill:#a0a0a0;fill-opacity:1;stroke:#a0a0a0;stroke-width:10.82955647;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3953-82"
width="15.304287"
height="97.947441"
x="-412.46057"
y="-1617.4926"
transform="matrix(-0.70710678,0.70710678,-0.70710678,-0.70710678,0,0)" />
<rect
style="fill:#a0a0a0;fill-opacity:1;stroke:#a0a0a0;stroke-width:10.82955647;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3953-82-4"
width="15.304287"
height="97.947441"
x="-1617.2937"
y="306.0546"
transform="matrix(-0.70710678,-0.70710678,0.70710678,-0.70710678,0,0)" />
</g> </g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1,60 +1,162 @@
@(active: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) @(active: String, repository: service.RepositoryService.RepositoryInfo, id: Option[String] = None)(body: Html)(implicit context: app.Context)
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@if(repository.commitCount > 0){ <div class="container">
<div class="pull-right"> @if(repository.commitCount > 0){
<div class="input-prepend"> <div class="pull-right">
<a href="@path/@repository.owner/@repository.name/fork" class="btn" style="margin-bottom: 10px;">Fork</a> <div class="input-prepend">
<span class="add-on count"><a href="@url(repository)/network/members">@repository.forkedCount</a></span> <a href="@path/@repository.owner/@repository.name/fork" class="btn" style="margin-bottom: 10px;">Fork</a>
<span class="add-on count"><a href="@url(repository)/network/members">@repository.forkedCount</a></span>
</div>
</div> </div>
}
<div class="head">
@helper.html.repositoryicon(repository, true)
<a href="@url(repository.owner)">@repository.owner</a> / <a href="@url(repository)" class="strong">@repository.name</a>
@defining(repository.repository){ x =>
@if(repository.repository.originRepositoryName.isDefined){
<div class="forked">
forked from <a href="@path/@x.parentUserName/@x.parentRepositoryName">@x.parentUserName/@x.parentRepositoryName</a>
</div>
}
}
</div> </div>
</div>
<hr style="margin-bottom: 20px;"/>
<style type="text/css">
ul.sidemenu {
margin-left: 0px;
} }
<div class="head">
@helper.html.repositoryicon(repository, true) ul.sidemenu li.active {
<a href="@url(repository.owner)">@repository.owner</a> / <a href="@url(repository)" class="strong">@repository.name</a> border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
@defining(repository.repository){ x => border-right: 4px solid #bb4444;
@if(repository.repository.originRepositoryName.isDefined){ border-left: 1px solid white;
<div class="forked"> }
forked from <a href="@path/@x.parentUserName/@x.parentRepositoryName">@x.parentUserName/@x.parentRepositoryName</a>
ul.sidemenu div.gradient {
width: 5px;
height: 35px;
background: linear-gradient(to right, #eee, #fff);
margin-right: 4px;
}
ul.sidemenu div.margin {
width: 5px;
height: 35px;
margin-right: 4px;
}
ul.sidemenu li {
line-height: 35px;
height: 35px;
border-left: 1px solid #eee;
margin-left:0px;
list-style-type: none;
}
ul.sidemenu li.separator {
border-top: 1px solid #eee;
height: 1px;
}
</style>
<div class="container body">
<div style="width: 170px;" class="pull-right">
<ul class="sidemenu">
<li style="height: 12px"><div class="gradient pull-left" style="height: 12px"></div></li>
<li class="active">
<div class="margin pull-left"></div><a href="@url(repository)"><img src="@assets/common/images/menu-code.png"> Code</a>
</li>
<li>
<div class="gradient pull-left"></div><a href="@url(repository)/issues"><img src="@assets/common/images/menu-issues.png"> Issues</a>
@if(repository.issueCount > 0){
<div class="pull-right"><span class="label">@repository.issueCount</span></div>
}
</li>
<li>
<div class="gradient pull-left"></div><a href="@url(repository)/pulls"><img src="@assets/common/images/menu-pulls.png"> Pull Requests</a>
@if(repository.pullCount > 0){
<div class="pull-right"><span class="label">@repository.pullCount</span></div>
}
</li>
<li>
<div class="gradient pull-left"></div><a href="@url(repository)/wiki"><img src="@assets/common/images/menu-wiki.png"> Wiki</a>
</li>
<li class="separator"></li>
<li>
<div class="gradient pull-left"></div>Settings
</li>
</ul>
<div class="small">
<strong>HTTP</strong> <span class="mute">clone URL</span>
</div>
@helper.html.copy("repository-url-copy", repository.httpUrl){
@*
@if(settings.ssh && loginAccount.isDefined){
<div class="btn-group add-on" data-toggle="buttons-radio" style="padding: 0px; border-width: 0px;">
<button type="button" class="btn active" id="repository-url-http">HTTP</button><button type="button" class="btn" id="repository-url-ssh">SSH</button>
</div>
} else {
<span class="add-on">HTTP</span>
}
*@
<input type="text" value="@repository.httpUrl" id="repository-url" readonly>
}
@if(settings.ssh && loginAccount.isDefined){
<div class="small">
You can clone <a href="#">HTTP</a> or <a href="#">SSH</a>.
</div> </div>
} }
} <div>
</div> @*
@repository.repository.description.map { description => <a href="@{url(repository)}/archive/@{encodeRefName(id)}.zip" class="btn"><i class="icon-download-alt"></i>Download ZIP</a>
<p>@description</p> *@
} <a href="#" class="btn btn-small" style="width: 147px;"><i class="icon-download-alt"></i>Download ZIP</a>
<table class="global-nav box-header"> </div>
<tr> </div>
<th class="box-header@if(active=="code"){ active}"> <div style="margin-right: 180px;">
<a href="@url(repository)">Code</a> @repository.repository.description.map { description =>
</th> <p class="muted">@description</p>
<th class="box-header@if(active=="issues"){ active}">
<a href="@url(repository)/issues">Issues</a>
@if(repository.issueCount > 0){
<span class="badge">@repository.issueCount</span>
}
</th>
<th class="box-header@if(active=="pulls"){ active}">
<a href="@url(repository)/pulls">Pull Requests</a>
@if(repository.pullCount > 0){
<span class="badge">@repository.pullCount</span>
}
</th>
<th class="box-header@if(active=="wiki"){ active}">
<a href="@url(repository)/wiki">Wiki</a>
</th>
<th class="box-header@if(active=="network"){ active}">
<a href="@url(repository)/network/members">Network</a>
</th>
@if(loginAccount.isDefined && (loginAccount.get.isAdmin || repository.managers.contains(loginAccount.get.userName))){
<th class="box-header@if(active=="settings"){ active}">
<a href="@url(repository)/settings">Settings</a>
</th>
} }
</tr> <style type="text/css">
</table> a.header-link {
color: #888;
}
a.header-link strong {
color: black;
}
a.header-link:hover {
color: #0088cc;
text-decoration: none;
}
</style>
<div style="border: 1px solid silver; padding: 4px; margin-bottom: 10px;">
<table style="width: 100%;">
<tr>
<td style="width: 33%; text-align: center;">
<a href="@url(repository)/commits/@encodeRefName(id.getOrElse(""))" class="header-link">
<img src="@assets/common/images/header-commits.png"/> <strong>@repository.commitCount</strong> commits
</a>
</td>
<td style="width: 33%; text-align: center;">
<a href="@url(repository)/branches" class="header-link" class="header-link">
<img src="@assets/common/images/header-branches.png"/> <strong>@repository.branchList.length</strong> branches
</a>
</td>
<td style="width: 33%; text-align: center;">
<a href="@url(repository)/tags" class="header-link" class="header-link">
<img src="@assets/common/images/header-tags.png"/> <strong>@repository.tags.length</strong> releases
</a>
</td>
</tr>
</table>
</div>
@body
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('table.global-nav th.box-header').click(function(){ $('table.global-nav th.box-header').click(function(){

View File

@@ -1,5 +1,5 @@
@(id: String, value: String, prepend: Boolean = false)(html: Html) @(id: String, value: String)(html: Html)
<div class="input-append@if(prepend){ input-prepend}"> <div class="input-append">
@html @html
<span id="@id" class="add-on btn" data-clipboard-text="@value" data-placement="bottom" title="copy to clipboard"><i class="icon-check"></i></span> <span id="@id" class="add-on btn" data-clipboard-text="@value" data-placement="bottom" title="copy to clipboard"><i class="icon-check"></i></span>
</div> </div>

View File

@@ -6,85 +6,86 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"New Issue - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"New Issue - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("issues", repository) @html.header("issues", repository){
@tab("", repository) @tab("", repository)
<form action="@url(repository)/issues/new" method="POST" validate="true"> <form action="@url(repository)/issues/new" method="POST" validate="true">
<div class="row-fluid"> <div class="row-fluid">
<div class="span9"> <div class="span9">
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div> <div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
<div class="box issue-box"> <div class="box issue-box">
<div class="box-content"> <div class="box-content">
<span id="error-title" class="error"></span> <span id="error-title" class="error"></span>
<input type="text" name="title" value="" placeholder="Title" style="width: 600px;"/> <input type="text" name="title" value="" placeholder="Title" style="width: 600px;"/>
<div> <div>
<span id="label-assigned">No one is assigned</span> <span id="label-assigned">No one is assigned</span>
@if(hasWritePermission){
<input type="hidden" name="assignedUserName" value=""/>
@helper.html.dropdown() {
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
@collaborators.map { collaborator =>
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-while"></i>@avatar(collaborator, 20) @collaborator</a></li>
}
}
}
<div class="pull-right">
<span id="label-milestone">No milestone</span>
@if(hasWritePermission){ @if(hasWritePermission){
<input type="hidden" name="milestoneId" value=""/> <input type="hidden" name="assignedUserName" value=""/>
@helper.html.dropdown() { @helper.html.dropdown() {
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li> <li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
@milestones.filter(_.closedDate.isEmpty).map { milestone => @collaborators.map { collaborator =>
<li> <li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-while"></i>@avatar(collaborator, 20) @collaborator</a></li>
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
<i class="icon-while"></i> @milestone.title
<div class="small" style="padding-left: 20px;">
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
</div>
</a>
</li>
} }
} }
} }
<div class="pull-right">
<span id="label-milestone">No milestone</span>
@if(hasWritePermission){
<input type="hidden" name="milestoneId" value=""/>
@helper.html.dropdown() {
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li>
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
<li>
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
<i class="icon-while"></i> @milestone.title
<div class="small" style="padding-left: 20px;">
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
</div>
</a>
</li>
}
}
}
</div>
</div>
<hr>
@helper.html.preview(repository, "", false, true, "width: 600px; height: 200px; max-height: 250px;", elastic = true)
</div>
</div>
<div class="pull-right">
<input type="submit" class="btn btn-success" value="Submit new issue"/>
</div>
</div>
<div class="span3">
@if(hasWritePermission){
<span class="strong">Add Labels</span>
<div>
<div id="label-list">
<ul class="label-list nav nav-pills nav-stacked">
@labels.map { label =>
<li>
<a href="javascript:void(0);" class="toggle-label" data-label="@label.labelName" data-bgcolor="@label.color" data-fgcolor="@label.fontColor">
<span style="background-color: #@label.color;" class="label-color">&nbsp;&nbsp;</span>
@label.labelName
</a>
</li>
}
</ul>
<input type="hidden" name="labelNames" value=""/>
</div> </div>
</div> </div>
<hr> }
@helper.html.preview(repository, "", false, true, "width: 600px; height: 200px; max-height: 250px;", elastic = true)
</div>
</div>
<div class="pull-right">
<input type="submit" class="btn btn-success" value="Submit new issue"/>
</div> </div>
</div> </div>
<div class="span3"> </form>
@if(hasWritePermission){ }
<span class="strong">Add Labels</span>
<div>
<div id="label-list">
<ul class="label-list nav nav-pills nav-stacked">
@labels.map { label =>
<li>
<a href="javascript:void(0);" class="toggle-label" data-label="@label.labelName" data-bgcolor="@label.color" data-fgcolor="@label.fontColor">
<span style="background-color: #@label.color;" class="label-color">&nbsp;&nbsp;</span>
@label.labelName
</a>
</li>
}
</ul>
<input type="hidden" name="labelNames" value=""/>
</div>
</div>
}
</div>
</div>
</form>
} }
<script> <script>
$(function(){ $(function(){

View File

@@ -9,31 +9,32 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${issue.title} - Issue #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"${issue.title} - Issue #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("issues", repository) @html.header("issues", repository){
@tab("issues", repository) @tab("issues", repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="pull-left"><a href="@url(repository)/issues"><i class="icon-arrow-left"></i> Back to issue list</a></li> <li class="pull-left"><a href="@url(repository)/issues"><i class="icon-arrow-left"></i> Back to issue list</a></li>
<li class="pull-right">Issue #@issue.issueId</li> <li class="pull-right">Issue #@issue.issueId</li>
</ul> </ul>
<div class="row-fluid"> <div class="row-fluid">
<div class="span10"> <div class="span10">
@issuedetail(issue, comments, collaborators, milestones, hasWritePermission, repository) @issuedetail(issue, comments, collaborators, milestones, hasWritePermission, repository)
@commentlist(issue, comments, hasWritePermission, repository) @commentlist(issue, comments, hasWritePermission, repository)
@commentform(issue, hasWritePermission, repository) @commentform(issue, hasWritePermission, repository)
</div> </div>
<div class="span2"> <div class="span2">
@if(issue.closed) { @if(issue.closed) {
<span class="label label-important issue-status">Closed</span> <span class="label label-important issue-status">Closed</span>
} else { } else {
<span class="label label-success issue-status">Open</span> <span class="label label-success issue-status">Open</span>
} }
<div class="small" style="text-align: center;"> <div class="small" style="text-align: center;">
@defining(comments.filter( _.action.contains("comment") ).size){ count => @defining(comments.filter( _.action.contains("comment") ).size){ count =>
<span class="strong">@count</span> @plural(count, "comment") <span class="strong">@count</span> @plural(count, "comment")
} }
</div>
<hr/>
@issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository)
</div> </div>
<hr/>
@issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository)
</div> </div>
</div> }
} }

View File

@@ -16,129 +16,130 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Issues - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"Issues - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("issues", repository) @html.header("issues", repository){
@tab("issues", repository) @tab("issues", repository)
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li@if(filter == "all"){ class="active"}> <li@if(filter == "all"){ class="active"}>
<a href="@url(repository)/issues@condition.toURL"> <a href="@url(repository)/issues@condition.toURL">
<span class="count-right">@allCount</span> <span class="count-right">@allCount</span>
Everyone's Issues Everyone's Issues
</a> </a>
</li> </li>
@if(loginAccount.isDefined){ @if(loginAccount.isDefined){
<li@if(filter == "assigned"){ class="active"}> <li@if(filter == "assigned"){ class="active"}>
<a href="@url(repository)/issues/assigned/@loginAccount.map(_.userName)@condition.toURL"> <a href="@url(repository)/issues/assigned/@loginAccount.map(_.userName)@condition.toURL">
<span class="count-right">@assignedCount</span> <span class="count-right">@assignedCount</span>
Assigned to you Assigned to you
</a> </a>
</li> </li>
<li@if(filter == "created_by"){ class="active"}> <li@if(filter == "created_by"){ class="active"}>
<a href="@url(repository)/issues/created_by/@loginAccount.map(_.userName)@condition.toURL"> <a href="@url(repository)/issues/created_by/@loginAccount.map(_.userName)@condition.toURL">
<span class="count-right">@createdByCount</span> <span class="count-right">@createdByCount</span>
Created by you Created by you
</a> </a>
</li> </li>
} }
</ul> </ul>
<hr/> <hr/>
@if(condition.milestoneId.isEmpty){ @if(condition.milestoneId.isEmpty){
<span class="muted small">No milestone selected</span> <span class="muted small">No milestone selected</span>
} else {
@if(condition.milestoneId.get.isEmpty){
<span class="muted small">Issues with no milestone</span>
} else { } else {
<span class="muted small">Milestone:</span> @milestones.find(_.milestoneId == condition.milestoneId.get.get).map(_.title) @if(condition.milestoneId.get.isEmpty){
} <span class="muted small">Issues with no milestone</span>
}
@helper.html.dropdown() {
@if(condition.milestoneId.isDefined){
<li>
<a href="@condition.copy(milestoneId = None).toURL">
<i class="icon-remove-circle"></i> Clear milestone filter
</a>
</li>
}
<li>
<a href="@condition.copy(milestoneId = Some(None)).toURL">
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
</a>
</li>
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
<li>
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
<div class="small" style="padding-left: 20px;">
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
</div>
</a>
</li>
}
}
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
@milestones.find(_.milestoneId == condition.milestoneId.get.get).map { milestone =>
<div style="margin-top: 4px;">
@_root_.issues.milestones.html.progress(openCount + closedCount, closedCount, false)
</div>
<span class="muted small">@openCount open issues</span>
@if(milestone.closedDate.isDefined){
@milestone.closedDate.map { closedDate =>
<span class="small">Closed in @date(closedDate)</span>
}
} else { } else {
@milestone.dueDate.map { dueDate => <span class="muted small">Milestone:</span> @milestones.find(_.milestoneId == condition.milestoneId.get.get).map(_.title)
@if(isPast(dueDate)){ }
<img src="@assets/common/images/alert.png"/><span class="small milestone-alert">Due in @date(dueDate)</span> }
} else { @helper.html.dropdown() {
<span class="small">Due in @date(dueDate)</span> @if(condition.milestoneId.isDefined){
<li>
<a href="@condition.copy(milestoneId = None).toURL">
<i class="icon-remove-circle"></i> Clear milestone filter
</a>
</li>
}
<li>
<a href="@condition.copy(milestoneId = Some(None)).toURL">
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
</a>
</li>
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
<li>
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
<div class="small" style="padding-left: 20px;">
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
</div>
</a>
</li>
}
}
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
@milestones.find(_.milestoneId == condition.milestoneId.get.get).map { milestone =>
<div style="margin-top: 4px;">
@_root_.issues.milestones.html.progress(openCount + closedCount, closedCount, false)
</div>
<span class="muted small">@openCount open issues</span>
@if(milestone.closedDate.isDefined){
@milestone.closedDate.map { closedDate =>
<span class="small">Closed in @date(closedDate)</span>
}
} else {
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert.png"/><span class="small milestone-alert">Due in @date(dueDate)</span>
} else {
<span class="small">Due in @date(dueDate)</span>
}
} }
} }
} }
} }
}
<hr/>
<span class="strong">Labels</span>
<div>
<div id="label-list">
<ul class="label-list nav nav-pills nav-stacked">
@labels.map { label =>
<li>
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL"
@if(condition.labels.contains(label.labelName)){style="background-color: #@label.color; color: #@label.fontColor;"}>
<span class="count-right">@labelCounts.getOrElse(label.labelName, 0)</span>
<span style="background-color: #@label.color;" class="label-color">&nbsp;&nbsp;</span>
@label.labelName
</a>
</li>
}
</ul>
</div>
</div>
@if(hasWritePermission){
<hr/> <hr/>
<input type="button" class="btn btn-block" id="manageLabel" data-toggle="button" value="Manage Labels"/> <span class="strong">Labels</span>
<br/> <div>
<span class="strong">New label</span> <div id="label-list">
@_root_.issues.labels.html.edit(None, repository) <ul class="label-list nav nav-pills nav-stacked">
} @labels.map { label =>
<li>
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL"
@if(condition.labels.contains(label.labelName)){style="background-color: #@label.color; color: #@label.fontColor;"}>
<span class="count-right">@labelCounts.getOrElse(label.labelName, 0)</span>
<span style="background-color: #@label.color;" class="label-color">&nbsp;&nbsp;</span>
@label.labelName
</a>
</li>
}
</ul>
</div>
</div>
@if(hasWritePermission){
<hr/>
<input type="button" class="btn btn-block" id="manageLabel" data-toggle="button" value="Manage Labels"/>
<br/>
<span class="strong">New label</span>
@_root_.issues.labels.html.edit(None, repository)
}
</div>
@***** show issue list *****@
@listparts(issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission)
</div> </div>
@***** show issue list *****@ @if(hasWritePermission){
@listparts(issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission) <form id="batcheditForm" method="POST">
</div> <input type="hidden" name="value"/>
@if(hasWritePermission){ <input type="hidden" name="checked"/>
<form id="batcheditForm" method="POST"> </form>
<input type="hidden" name="value"/> }
<input type="hidden" name="checked"/>
</form>
} }
} }
@if(hasWritePermission){ @if(hasWritePermission){

View File

@@ -2,38 +2,39 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Milestones - ${repository.owner}/${repository.name}"){ @html.main(s"Milestones - ${repository.owner}/${repository.name}"){
@html.header("milestones", repository) @html.header("milestones", repository){
@issues.html.tab("milestones", repository) @issues.html.tab("milestones", repository)
<form method="POST" action="@url(repository)/issues/milestones/@if(milestone.isEmpty){new}else{@milestone.get.milestoneId/edit}" validate="true"> <form method="POST" action="@url(repository)/issues/milestones/@if(milestone.isEmpty){new}else{@milestone.get.milestoneId/edit}" validate="true">
<fieldset> <fieldset>
<label for="title"><string>Title</string></label> <label for="title"><string>Title</string></label>
<input type="text" id="title" name="title" style="width: 400px;" value="@milestone.map(_.title)"/> <input type="text" id="title" name="title" style="width: 400px;" value="@milestone.map(_.title)"/>
<span id="error-title" class="error"></span> <span id="error-title" class="error"></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label for="description" class="strong">Description</label> <label for="description" class="strong">Description</label>
<textarea id="description" name="description" style="width: 500px; height: 150px;">@milestone.map(_.description)</textarea> <textarea id="description" name="description" style="width: 500px; height: 150px;">@milestone.map(_.description)</textarea>
<span id="error-description" class="error"></span> <span id="error-description" class="error"></span>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label for="dueDate" class="strong">Due Date</label> <label for="dueDate" class="strong">Due Date</label>
@helper.html.datepicker("dueDate", milestone.flatMap(_.dueDate)) @helper.html.datepicker("dueDate", milestone.flatMap(_.dueDate))
<span id="error-dueDate" class="error"></span> <span id="error-dueDate" class="error"></span>
</fieldset> </fieldset>
<hr> <hr>
<div class="pull-right"> <div class="pull-right">
@if(milestone.isEmpty){ @if(milestone.isEmpty){
<input type="submit" class="btn" value="Create milestone"/> <input type="submit" class="btn" value="Create milestone"/>
} else {
@if(milestone.get.closedDate.isDefined){
<input type="button" class="btn" value="Open" id="open"
onclick="location.href='@url(repository)/issues/milestones/@milestone.get.milestoneId/close';"/>
} else { } else {
<input type="button" class="btn" value="Close" id="close" @if(milestone.get.closedDate.isDefined){
onclick="location.href='@url(repository)/issues/milestones/@milestone.get.milestoneId/open';"/> <input type="button" class="btn" value="Open" id="open"
onclick="location.href='@url(repository)/issues/milestones/@milestone.get.milestoneId/close';"/>
} else {
<input type="button" class="btn" value="Close" id="close"
onclick="location.href='@url(repository)/issues/milestones/@milestone.get.milestoneId/open';"/>
}
<input type="submit" class="btn" value="Update milestone"/>
} }
<input type="submit" class="btn" value="Update milestone"/> </div>
} </form>
</div> }
</form>
} }

View File

@@ -5,95 +5,96 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Milestones - ${repository.owner}/${repository.name}"){ @html.main(s"Milestones - ${repository.owner}/${repository.name}"){
@html.header("issues", repository) @html.header("issues", repository){
@issues.html.tab("milestones", repository) @issues.html.tab("milestones", repository)
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li@if(state == "open"){ class="active"}> <li@if(state == "open"){ class="active"}>
<a href="?state=open"> <a href="?state=open">
<span class="count-right">@milestones.filter(_._1.closedDate.isEmpty).size</span> <span class="count-right">@milestones.filter(_._1.closedDate.isEmpty).size</span>
Open Milestones Open Milestones
</a> </a>
</li> </li>
<li@if(state == "closed"){ class="active"}> <li@if(state == "closed"){ class="active"}>
<a href="?state=closed"> <a href="?state=closed">
<span class="count-right">@milestones.filter(_._1.closedDate.isDefined).size</span> <span class="count-right">@milestones.filter(_._1.closedDate.isDefined).size</span>
Closed Milestones Closed Milestones
</a> </a>
</li> </li>
</ul> </ul>
@if(hasWritePermission){ @if(hasWritePermission){
<hr> <hr>
<a href="@url(repository)/issues/milestones/new" class="btn btn-block">Create a new milestone</a> <a href="@url(repository)/issues/milestones/new" class="btn btn-block">Create a new milestone</a>
}
</div>
<div class="span9">
<table class="table table-bordered table-hover">
@defining(milestones.filter { case (milestone, _, _) =>
milestone.closedDate.map(_ => state == "closed").getOrElse(state == "open")
}){ milestones =>
@milestones.map { case (milestone, openCount, closedCount) =>
<tr>
<td>
<div class="milestone row-fluid">
<div class="span4">
<a href="@url(repository)/issues?milestone=@milestone.milestoneId&state=open" class="milestone-title">@milestone.title</a><br>
@if(milestone.closedDate.isDefined){
<span class="muted">Closed @datetime(milestone.closedDate.get)</span>
} else {
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert.png"/><span class="muted milestone-alert">Due in @date(dueDate)</span>
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
}
</div>
<div class="span8">
<div class="milestone-menu">
<div class="pull-right">
@if(hasWritePermission){
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/edit">Edit
@if(milestone.closedDate.isDefined){
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/open">Open</a>
} else {
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/close">Close</a>
}
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/delete" class="delete">Delete</a>
}
<a href="@url(repository)/issues?milestone=@milestone.milestoneId&state=open">Browse issues</a>
</div>
<span class="muted">@closedCount closed - @openCount open</span>
</div>
@progress(openCount + closedCount, closedCount, true)
</div>
</div>
@if(milestone.description.isDefined){
<div class="milestone-description">
@markdown(milestone.description.get, repository, false, false)
</div>
}
</td>
</tr>
}
@if(milestones.isEmpty){
<tr>
<td style="padding: 20px; background-color: #eee; text-align: center;">
No milestones to show.
@if(hasWritePermission){
<a href="@url(repository)/issues/milestones/new">Create a new milestone.</a>
}
</td>
</tr>
}
} }
</table> </div>
<div class="span9">
<table class="table table-bordered table-hover">
@defining(milestones.filter { case (milestone, _, _) =>
milestone.closedDate.map(_ => state == "closed").getOrElse(state == "open")
}){ milestones =>
@milestones.map { case (milestone, openCount, closedCount) =>
<tr>
<td>
<div class="milestone row-fluid">
<div class="span4">
<a href="@url(repository)/issues?milestone=@milestone.milestoneId&state=open" class="milestone-title">@milestone.title</a><br>
@if(milestone.closedDate.isDefined){
<span class="muted">Closed @datetime(milestone.closedDate.get)</span>
} else {
@milestone.dueDate.map { dueDate =>
@if(isPast(dueDate)){
<img src="@assets/common/images/alert.png"/><span class="muted milestone-alert">Due in @date(dueDate)</span>
} else {
<span class="muted">Due in @date(dueDate)</span>
}
}.getOrElse {
<span class="muted">No due date</span>
}
}
</div>
<div class="span8">
<div class="milestone-menu">
<div class="pull-right">
@if(hasWritePermission){
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/edit">Edit
@if(milestone.closedDate.isDefined){
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/open">Open</a>
} else {
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/close">Close</a>
}
<a href="@url(repository)/issues/milestones/@milestone.milestoneId/delete" class="delete">Delete</a>
}
<a href="@url(repository)/issues?milestone=@milestone.milestoneId&state=open">Browse issues</a>
</div>
<span class="muted">@closedCount closed - @openCount open</span>
</div>
@progress(openCount + closedCount, closedCount, true)
</div>
</div>
@if(milestone.description.isDefined){
<div class="milestone-description">
@markdown(milestone.description.get, repository, false, false)
</div>
}
</td>
</tr>
}
@if(milestones.isEmpty){
<tr>
<td style="padding: 20px; background-color: #eee; text-align: center;">
No milestones to show.
@if(hasWritePermission){
<a href="@url(repository)/issues/milestones/new">Create a new milestone.</a>
}
</td>
</tr>
}
}
</table>
</div>
</div> </div>
</div> }
} }
<script> <script>
$(function(){ $(function(){

View File

@@ -72,9 +72,7 @@
</div> </div>
</form> </form>
</div> </div>
<div class="container body"> @body
@body
</div>
<script> <script>
$(function(){ $(function(){
$('#search').submit(function(){ $('#search').submit(function(){

View File

@@ -12,77 +12,78 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Pull Requests - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"Pull Requests - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("pulls", repository) @html.header("pulls", repository){
<div class="pullreq-info"> <div class="pullreq-info">
<div id="compare-info"> <div id="compare-info">
<a href="#" id="edit-compare-condition" class="btn btn-mini pull-right">Edit</a> <a href="#" id="edit-compare-condition" class="btn btn-mini pull-right">Edit</a>
<span class="label label-info monospace">@originRepository.owner:@originId</span> ... <span class="label label-info monospace">@forkedRepository.owner:@forkedId</span> <span class="label label-info monospace">@originRepository.owner:@originId</span> ... <span class="label label-info monospace">@forkedRepository.owner:@forkedId</span>
</div>
<div id="compare-edit" style="display: none;">
<a href="#" id="cancel-condition-editing" class="pull-right"><i class="icon-remove-circle"></i></a>
@helper.html.dropdown(originRepository.owner + "/" + originRepository.name, "base fork") {
@members.map { case (owner, name) =>
<li><a href="#" class="origin-owner" data-owner="@owner" data-name="@name">@helper.html.checkicon(owner == originRepository.owner) @owner/@name</a></li>
}
}
@helper.html.dropdown(originId, "base") {
@originRepository.branchList.map { branch =>
<li><a href="#" class="origin-branch" data-branch="@encodeRefName(branch)">@helper.html.checkicon(branch == originId) @branch</a></li>
}
}
...
@helper.html.dropdown(forkedRepository.owner + "/" + forkedRepository.name, "head fork") {
@members.map { case (owner, name) =>
<li><a href="#" class="forked-owner" data-owner="@owner" data-name="@name">@helper.html.checkicon(owner == forkedRepository.owner) @owner/@name</a></li>
}
}
@helper.html.dropdown(forkedId, "compare") {
@forkedRepository.branchList.map { branch =>
<li><a href="#" class="forked-branch" data-branch="@encodeRefName(branch)">@helper.html.checkicon(branch == forkedId) @branch</a></li>
}
}
</div>
</div> </div>
<div id="compare-edit" style="display: none;"> @if(commits.nonEmpty && hasWritePermission){
<a href="#" id="cancel-condition-editing" class="pull-right"><i class="icon-remove-circle"></i></a> <div style="margin-bottom: 10px;" id="create-pull-request">
@helper.html.dropdown(originRepository.owner + "/" + originRepository.name, "base fork") { <a href="#" class="btn" id="show-form">Click to create a pull request for this comparison</a>
@members.map { case (owner, name) => </div>
<li><a href="#" class="origin-owner" data-owner="@owner" data-name="@name">@helper.html.checkicon(owner == originRepository.owner) @owner/@name</a></li> <div id="pull-request-form" class="box" style="display: none;">
} <div class="box-content">
} <form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
@helper.html.dropdown(originId, "base") { <div style="width: 260px; position: absolute; margin-left: 635px;">
@originRepository.branchList.map { branch => <div class="check-conflict" style="display: none;">
<li><a href="#" class="origin-branch" data-branch="@encodeRefName(branch)">@helper.html.checkicon(branch == originId) @branch</a></li> <img src="@assets/common/images/indicator.gif"/> Checking...
} </div>
}
...
@helper.html.dropdown(forkedRepository.owner + "/" + forkedRepository.name, "head fork") {
@members.map { case (owner, name) =>
<li><a href="#" class="forked-owner" data-owner="@owner" data-name="@name">@helper.html.checkicon(owner == forkedRepository.owner) @owner/@name</a></li>
}
}
@helper.html.dropdown(forkedId, "compare") {
@forkedRepository.branchList.map { branch =>
<li><a href="#" class="forked-branch" data-branch="@encodeRefName(branch)">@helper.html.checkicon(branch == forkedId) @branch</a></li>
}
}
</div>
</div>
@if(commits.nonEmpty && hasWritePermission){
<div style="margin-bottom: 10px;" id="create-pull-request">
<a href="#" class="btn" id="show-form">Click to create a pull request for this comparison</a>
</div>
<div id="pull-request-form" class="box" style="display: none;">
<div class="box-content">
<form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
<div style="width: 260px; position: absolute; margin-left: 635px;">
<div class="check-conflict" style="display: none;">
<img src="@assets/common/images/indicator.gif"/> Checking...
</div> </div>
</div> <div style="width: 620px; border-right: 1px solid #d4d4d4;">
<div style="width: 620px; border-right: 1px solid #d4d4d4;"> <span class="error" id="error-title"></span>
<span class="error" id="error-title"></span> <input type="text" name="title" style="width: 600px" placeholder="Title"/>
<input type="text" name="title" style="width: 600px" placeholder="Title"/> @helper.html.preview(repository, "", false, true, "width: 600px; height: 200px;")
@helper.html.preview(repository, "", false, true, "width: 600px; height: 200px;") <input type="hidden" name="targetUserName" value="@originRepository.owner"/>
<input type="hidden" name="targetUserName" value="@originRepository.owner"/> <input type="hidden" name="targetBranch" value="@originId"/>
<input type="hidden" name="targetBranch" value="@originId"/> <input type="hidden" name="requestUserName" value="@forkedRepository.owner"/>
<input type="hidden" name="requestUserName" value="@forkedRepository.owner"/> <input type="hidden" name="requestRepositoryName" value="@forkedRepository.name"/>
<input type="hidden" name="requestRepositoryName" value="@forkedRepository.name"/> <input type="hidden" name="requestBranch" value="@forkedId"/>
<input type="hidden" name="requestBranch" value="@forkedId"/> <input type="hidden" name="commitIdFrom" value="@sourceId"/>
<input type="hidden" name="commitIdFrom" value="@sourceId"/> <input type="hidden" name="commitIdTo" value="@commitId"/>
<input type="hidden" name="commitIdTo" value="@commitId"/> </div>
</div> </form>
</form> </div>
</div> </div>
</div> }
} @if(commits.isEmpty){
@if(commits.isEmpty){ <table class="table table-bordered table-hover table-issues">
<table class="table table-bordered table-hover table-issues"> <tr>
<tr> <td style="padding: 20px; background-color: #eee; text-align: center;">
<td style="padding: 20px; background-color: #eee; text-align: center;"> <h4>There isn't anything to compare.</h4>
<h4>There isn't anything to compare.</h4> <span class="strong">@originRepository.owner:@originId</span> and <span class="strong">@forkedRepository.owner:@forkedId</span> are identical.
<span class="strong">@originRepository.owner:@originId</span> and <span class="strong">@forkedRepository.owner:@forkedId</span> are identical. </td>
</td> </tr>
</tr> </table>
</table> } else {
} else { @pulls.html.commits(commits, repository)
@pulls.html.commits(commits, repository) @helper.html.diff(diffs, repository, Some(commitId), Some(sourceId), true)
@helper.html.diff(diffs, repository, Some(commitId), Some(sourceId), true) }
} }
} }
<script> <script>

View File

@@ -11,40 +11,41 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Pull Requests - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"Pull Requests - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("pulls", repository) @html.header("pulls", repository){
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li@if(filter.isEmpty){ class="active"}> <li@if(filter.isEmpty){ class="active"}>
<a href="@url(repository)/pulls"> <a href="@url(repository)/pulls">
<span class="count-right">@allCount</span> <span class="count-right">@allCount</span>
All Requests All Requests
</a> </a>
</li> </li>
@if(loginAccount.isDefined){ @if(loginAccount.isDefined){
<li@if(filter.map(_ == loginAccount.get.userName).getOrElse(false)){ class="active"}> <li@if(filter.map(_ == loginAccount.get.userName).getOrElse(false)){ class="active"}>
<a href="@url(repository)/pulls/@loginAccount.map(_.userName)"> <a href="@url(repository)/pulls/@loginAccount.map(_.userName)">
<span class="count-right">@counts.find(_.userName == loginAccount.get.userName).map(_.count).getOrElse(0)</span> <span class="count-right">@counts.find(_.userName == loginAccount.get.userName).map(_.count).getOrElse(0)</span>
Yours Yours
</a> </a>
</li> </li>
}
</ul>
<hr>
<ul class="nav nav-pills nav-stacked small">
@counts.map { user =>
@if(loginAccount.isEmpty || loginAccount.get.userName != user.userName){
<li@if(filter.map(_ == user.userName).getOrElse(false)){ class="active"}>
<a href="@url(repository)/pulls/@user.userName">
<span class="count-right">@user.count</span>
@user.userName
</a>
</li>
}
} }
</ul> </ul>
<hr> </div>
<ul class="nav nav-pills nav-stacked small"> @listparts(issues, page, openCount, closedCount, condition, Some(repository), hasWritePermission)
@counts.map { user =>
@if(loginAccount.isEmpty || loginAccount.get.userName != user.userName){
<li@if(filter.map(_ == user.userName).getOrElse(false)){ class="active"}>
<a href="@url(repository)/pulls/@user.userName">
<span class="count-right">@user.count</span>
@user.userName
</a>
</li>
}
}
</ul>
</div> </div>
@listparts(issues, page, openCount, closedCount, condition, Some(repository), hasWritePermission) }
</div>
} }

View File

@@ -12,42 +12,43 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${issue.title} - Pull Request #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"${issue.title} - Pull Request #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("pulls", repository) @html.header("pulls", repository){
@defining(dayByDayCommits.flatten){ commits => @defining(dayByDayCommits.flatten){ commits =>
<div class="pullreq-info"> <div class="pullreq-info">
@if(issue.closed) { @if(issue.closed) {
@comments.find(_.action == "merge").map{ comment => @comments.find(_.action == "merge").map{ comment =>
<span class="label label-info">Merged</span> <span class="label label-info">Merged</span>
@user(comment.commentedUserName, styleClass="username strong") merged @commits.size @plural(commits.size, "commit") @user(comment.commentedUserName, styleClass="username strong") merged @commits.size @plural(commits.size, "commit")
into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code> into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code>
at @datetime(comment.registeredDate) at @datetime(comment.registeredDate)
}.getOrElse { }.getOrElse {
<span class="label label-important">Closed</span> <span class="label label-important">Closed</span>
@user(issue.openedUserName, styleClass="username strong") wants to merge @commits.size @plural(commits.size, "commit")
into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code>
}
} else {
<span class="label label-success">Open</span>
@user(issue.openedUserName, styleClass="username strong") wants to merge @commits.size @plural(commits.size, "commit") @user(issue.openedUserName, styleClass="username strong") wants to merge @commits.size @plural(commits.size, "commit")
into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code> into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code>
} }
} else {
<span class="label label-success">Open</span>
@user(issue.openedUserName, styleClass="username strong") wants to merge @commits.size @plural(commits.size, "commit")
into <code>@pullreq.userName:@pullreq.branch</code> from <code>@pullreq.requestUserName:@pullreq.requestBranch</code>
}
</div>
<ul class="nav nav-tabs" id="pullreq-tab">
<li class="active"><a href="#discussion">Discussion</a></li>
<li><a href="#commits">Commits <span class="badge">@commits.size</span></a></li>
<li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="discussion">
@pulls.html.discussion(issue, pullreq, comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository)
</div> </div>
<div class="tab-pane" id="commits"> <ul class="nav nav-tabs" id="pullreq-tab">
@pulls.html.commits(dayByDayCommits, repository) <li class="active"><a href="#discussion">Discussion</a></li>
<li><a href="#commits">Commits <span class="badge">@commits.size</span></a></li>
<li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="discussion">
@pulls.html.discussion(issue, pullreq, comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository)
</div>
<div class="tab-pane" id="commits">
@pulls.html.commits(dayByDayCommits, repository)
</div>
<div class="tab-pane" id="files">
@helper.html.diff(diffs, repository, Some(commits.head.id), Some(commits.last.id), true)
</div>
</div> </div>
<div class="tab-pane" id="files"> }
@helper.html.diff(diffs, repository, Some(commits.head.id), Some(commits.last.id), true)
</div>
</div>
} }
} }
<script> <script>

View File

@@ -7,63 +7,64 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(branch, repository, "files") @tab(branch, repository, "files")
<div class="head"> <div class="head">
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) => @pathList.zipWithIndex.map { case (section, i) =>
@if(i == pathList.length - 1){ @if(i == pathList.length - 1){
@section @section
} else { } else {
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
}
} }
} </div>
</div>
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th style="font-weight: normal;"> <th style="font-weight: normal;">
<div class="pull-left"> <div class="pull-left">
@avatar(latestCommit, 20) @avatar(latestCommit, 20)
@user(latestCommit.committer, latestCommit.mailAddress, "username strong") @user(latestCommit.committer, latestCommit.mailAddress, "username strong")
<span class="muted">@datetime(latestCommit.time)</span> <span class="muted">@datetime(latestCommit.time)</span>
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a> <a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
</div> </div>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
@if(hasWritePermission && content.viewType == "text"){ @if(hasWritePermission && content.viewType == "text"){
<a class="btn" href="@url(repository)/edit/@encodeRefName(branch)/@pathList.mkString("/")">Edit</a> <a class="btn" href="@url(repository)/edit/@encodeRefName(branch)/@pathList.mkString("/")">Edit</a>
} }
<a class="btn" href="?raw=true">Raw</a> <a class="btn" href="?raw=true">Raw</a>
<a class="btn" href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")">History</a> <a class="btn" href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")">History</a>
@if(hasWritePermission){ @if(hasWritePermission){
<a class="btn btn-danger" href="@url(repository)/remove/@encodeRefName(branch)/@pathList.mkString("/")">Delete</a> <a class="btn btn-danger" href="@url(repository)/remove/@encodeRefName(branch)/@pathList.mkString("/")">Delete</a>
} }
</div> </div>
</th> </th>
</tr> </tr>
<tr> <tr>
<td> <td>
@if(content.viewType == "text"){ @if(content.viewType == "text"){
@defining(pathList.reverse.head) { file => @defining(pathList.reverse.head) { file =>
@if(renderableSuffixes.find(suffix => file.toLowerCase.endsWith(suffix))) { @if(renderableSuffixes.find(suffix => file.toLowerCase.endsWith(suffix))) {
@renderMarkup(pathList, content.content.get, branch, repository, false, false) @renderMarkup(pathList, content.content.get, branch, repository, false, false)
} else { } else {
<pre class="prettyprint linenums blob">@content.content.get</pre> <pre class="prettyprint linenums blob">@content.content.get</pre>
}
} }
} }
} @if(content.viewType == "image"){
@if(content.viewType == "image"){ <img src="?raw=true"/>
<img src="?raw=true"/> }
} @if(content.viewType == "large" || content.viewType == "binary"){
@if(content.viewType == "large" || content.viewType == "binary"){ <div style="text-align: center">
<div style="text-align: center"> <a href="?raw=true">View Raw</a><br>
<a href="?raw=true">View Raw</a><br> (Sorry about that, but we can't show files that are this big right now)
(Sorry about that, but we can't show files that are this big right now) </div>
</div> }
} </td>
</td> </tr>
</tr> </table>
</table> }
} }
<script src="@assets/common/js/jquery.ba-hashchange.js"></script> <script src="@assets/common/js/jquery.ba-hashchange.js"></script>
<script> <script>

View File

@@ -4,38 +4,39 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(repository.repository.defaultBranch, repository, "branches", true) @tab(repository.repository.defaultBranch, repository, "branches", true)
<h1>Branches</h1> <h1>Branches</h1>
<table class="table table-bordered"> <table class="table table-bordered">
<tr>
<th width="40%">Branch</th>
<th width="20%">Last update</th>
<th width="20%">Compare</th>
<th width="20%">Download</th>
</tr>
@branchInfo.map { case (branchName, latestUpdateDate) =>
<tr> <tr>
<td> <th width="40%">Branch</th>
<a href="@url(repository)/tree/@encodeRefName(branchName)">@branchName</a> <th width="20%">Last update</th>
@if(hasWritePermission && repository.repository.defaultBranch != branchName){ <th width="20%">Compare</th>
<a href="@url(repository)/delete/@encodeRefName(branchName)" class="btn btn-danger btn-mini pull-right delete-branch" data-name="@branchName">Delete branch</a> <th width="20%">Download</th>
}
</td>
<td>
@datetime(latestUpdateDate)
</td>
<td>
@if(repository.repository.defaultBranch == branchName){
Base branch
} else {
<a href="@url(repository)/compare/@{encodeRefName(repository.repository.defaultBranch)}...@{encodeRefName(branchName)}">to @{repository.repository.defaultBranch}</a>
}
</td>
<td><a href="@url(repository)/archive/@{encodeRefName(branchName)}.zip">ZIP</a></td>
</tr> </tr>
} @branchInfo.map { case (branchName, latestUpdateDate) =>
</table> <tr>
<td>
<a href="@url(repository)/tree/@encodeRefName(branchName)">@branchName</a>
@if(hasWritePermission && repository.repository.defaultBranch != branchName){
<a href="@url(repository)/delete/@encodeRefName(branchName)" class="btn btn-danger btn-mini pull-right delete-branch" data-name="@branchName">Delete branch</a>
}
</td>
<td>
@datetime(latestUpdateDate)
</td>
<td>
@if(repository.repository.defaultBranch == branchName){
Base branch
} else {
<a href="@url(repository)/compare/@{encodeRefName(repository.repository.defaultBranch)}...@{encodeRefName(branchName)}">to @{repository.repository.defaultBranch}</a>
}
</td>
<td><a href="@url(repository)/archive/@{encodeRefName(branchName)}.zip">ZIP</a></td>
</tr>
}
</table>
}
} }
<script> <script>
$(function(){ $(function(){

View File

@@ -9,68 +9,69 @@
@import view.helpers._ @import view.helpers._
@import util.Implicits._ @import util.Implicits._
@html.main(commit.shortMessage, Some(repository)){ @html.main(commit.shortMessage, Some(repository)){
@html.header("code", repository) @html.header("code", repository){
@tab(commitId, repository, "commits") @tab(commitId, repository, "commits")
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th> <th>
<div class="pull-right align-right"> <div class="pull-right align-right">
<a href="@url(repository)/tree/@commit.id" class="btn btn-small">Browse code</a> <a href="@url(repository)/tree/@commit.id" class="btn btn-small">Browse code</a>
</div>
<div class="commit-log">@link(commit.summary, repository)</div>
@if(commit.description.isDefined){
<pre class="commit-description">@link(commit.description.get, repository)</pre>
}
<div class="small" style="font-weight: normal;">
@if(branches.nonEmpty){
<span class="muted">
<img src="@assets/common/images/branch.png"/>
@branches.zipWithIndex.map { case (branch, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)" class="branch" id="branch-@i">@branch</a>
}
</span>
}
@if(tags.nonEmpty){
<span class="muted">
<img src="@assets/common/images/tag.png"/>
@tags.zipWithIndex.map { case (tag, i) =>
<a href="@url(repository)/tree/@tag" class="tag" id="tag-@i">@tag</a>
}
</span>
}
</div>
</th>
</tr>
<tr>
<td>
@avatar(commit, 20)
@user(commit.committer, commit.mailAddress, "username strong")
<span class="muted">@datetime(commit.time)</span>
<div class="pull-right monospace small" style="text-align: right;">
<div>
@if(commit.parents.size == 0){
<span class="muted">0 parent</span>
}
@if(commit.parents.size == 1){
<span class="muted">1 parent</span>
<a href="@url(repository)/commit/@commit.parents(0)" class="commit-id">@commit.parents(0).substring(0, 7)</a>
}
<span class="muted">commit</span> @commit.id
</div> </div>
@if(commit.parents.size > 1){ <div class="commit-log">@link(commit.summary, repository)</div>
<div> @if(commit.description.isDefined){
<span class="muted">@commit.parents.size parents <pre class="commit-description">@link(commit.description.get, repository)</pre>
@commit.parents.map { parent =>
<a href="@url(repository)/commit/@parent" class="commit-id">@parent.substring(0, 7)</a>
}.mkHtml(" + ")
</span>
</div>
} }
</div> <div class="small" style="font-weight: normal;">
</td> @if(branches.nonEmpty){
</tr> <span class="muted">
</table> <img src="@assets/common/images/branch.png"/>
@helper.html.diff(diffs, repository, Some(commit.id), oldCommitId, true) @branches.zipWithIndex.map { case (branch, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)" class="branch" id="branch-@i">@branch</a>
}
</span>
}
@if(tags.nonEmpty){
<span class="muted">
<img src="@assets/common/images/tag.png"/>
@tags.zipWithIndex.map { case (tag, i) =>
<a href="@url(repository)/tree/@tag" class="tag" id="tag-@i">@tag</a>
}
</span>
}
</div>
</th>
</tr>
<tr>
<td>
@avatar(commit, 20)
@user(commit.committer, commit.mailAddress, "username strong")
<span class="muted">@datetime(commit.time)</span>
<div class="pull-right monospace small" style="text-align: right;">
<div>
@if(commit.parents.size == 0){
<span class="muted">0 parent</span>
}
@if(commit.parents.size == 1){
<span class="muted">1 parent</span>
<a href="@url(repository)/commit/@commit.parents(0)" class="commit-id">@commit.parents(0).substring(0, 7)</a>
}
<span class="muted">commit</span> @commit.id
</div>
@if(commit.parents.size > 1){
<div>
<span class="muted">@commit.parents.size parents
@commit.parents.map { parent =>
<a href="@url(repository)/commit/@parent" class="commit-id">@parent.substring(0, 7)</a>
}.mkHtml(" + ")
</span>
</div>
}
</div>
</td>
</tr>
</table>
@helper.html.diff(diffs, repository, Some(commit.id), oldCommitId, true)
}
} }
<script> <script>
$(function(){ $(function(){

View File

@@ -7,60 +7,61 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(branch, repository, if(pathList.isEmpty) "commits" else "files") @tab(branch, repository, if(pathList.isEmpty) "commits" else "files")
<div class="head"> <div class="head">
@if(pathList.isEmpty){ @if(pathList.isEmpty){
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / Commit History <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / Commit History
} }
@if(pathList.nonEmpty){ @if(pathList.nonEmpty){
<span class="muted">History for</span> <span class="muted">History for</span>
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) => @pathList.zipWithIndex.map { case (section, i) =>
@if(i == pathList.length - 1){ @if(i == pathList.length - 1){
@section @section
} else { } else {
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
}
} }
} }
} </div>
</div> @commits.map { day =>
@commits.map { day => <table class="table table-bordered">
<table class="table table-bordered"> <tr>
<tr> <th>@date(day.head.time)</th>
<th>@date(day.head.time)</th> </tr>
</tr> @day.map { commit =>
@day.map { commit => <tr>
<tr> <td>
<td> <div class="pull-right align-right">
<div class="pull-right align-right"> <a href="@url(repository)/commit/@commit.id" class="btn btn-small monospace">@commit.id.substring(0, 10)</a><br>
<a href="@url(repository)/commit/@commit.id" class="btn btn-small monospace">@commit.id.substring(0, 10)</a><br> <a href="@url(repository)/tree/@commit.id" class="small">Browse code</a>
<a href="@url(repository)/tree/@commit.id" class="small">Browse code</a> </div>
</div> <div>
<div> <div class="commit-avatar-image">@avatar(commit, 40)</div>
<div class="commit-avatar-image">@avatar(commit, 40)</div> <div class="commit-message-box">
<div class="commit-message-box"> <a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a>
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a> @if(commit.description.isDefined){
@if(commit.description.isDefined){ <a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a> }
} <br>
<br> @if(commit.description.isDefined){
@if(commit.description.isDefined){ <pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre> }
} <div class="small">
<div class="small"> @user(commit.committer, commit.mailAddress, "username")
@user(commit.committer, commit.mailAddress, "username") <span class="muted">@datetime(commit.time)</span>
<span class="muted">@datetime(commit.time)</span> </div>
</div> </div>
</div> </div>
</div> </td>
</td> </tr>
</tr> }
} </table>
</table> }
<div class="btn-group">
<button class="btn" onclick="location.href='?page=@{page - 1}'"@if(page <= 1){ disabled="true"}>&lt; Newer</button>
<button class="btn" onclick="location.href='?page=@{page + 1}'"@if(!hasNext){ disabled="true"}>Older &gt;</button>
</div>
} }
<div class="btn-group">
<button class="btn" onclick="location.href='?page=@{page - 1}'"@if(page <= 1){ disabled="true"}>&lt; Newer</button>
<button class="btn" onclick="location.href='?page=@{page + 1}'"@if(!hasNext){ disabled="true"}>Older &gt;</button>
</div>
} }

View File

@@ -6,50 +6,51 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Deleting ${path} at ${fileName} - ${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"Deleting ${path} at ${fileName} - ${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(branch, repository, "files") @tab(branch, repository, "files")
<form method="POST" action="@url(repository)/remove" validate="true"> <form method="POST" action="@url(repository)/remove" validate="true">
<div class="head"> <div class="head">
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) => @pathList.zipWithIndex.map { case (section, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
} }
@fileName
<input type="hidden" name="fileName" id="fileName" value="@fileName"/>
<input type="hidden" name="branch" id="branch" value="@branch"/>
<input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
</div>
<table class="table table-bordered">
<th style="font-weight: normal;" class="box-header">
@fileName @fileName
<div class="pull-right align-right"> <input type="hidden" name="fileName" id="fileName" value="@fileName"/>
<a href="@url(repository)/blob/@branch/@{(pathList ::: List(fileName)).mkString("/")}" class="btn btn-small">View</a> <input type="hidden" name="branch" id="branch" value="@branch"/>
</div> <input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
</th> </div>
<tr> <table class="table table-bordered">
<td> <th style="font-weight: normal;" class="box-header">
<div id="diffText"></div> @fileName
<textarea id="newText" style="display: none;"></textarea> <div class="pull-right align-right">
<textarea id="oldText" style="display: none;">@content.content</textarea> <a href="@url(repository)/blob/@branch/@{(pathList ::: List(fileName)).mkString("/")}" class="btn btn-small">View</a>
</td> </div>
</tr> </th>
</table> <tr>
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div> <td>
<div class="box issue-comment-box"> <div id="diffText"></div>
<div class="box-content"> <textarea id="newText" style="display: none;"></textarea>
<div> <textarea id="oldText" style="display: none;">@content.content</textarea>
<strong>Commit changes</strong> </td>
</div> </tr>
<div> </table>
<input type="text" name="message" style="width: 98%;"/> <div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
</div> <div class="box issue-comment-box">
<div style="text-align: right;"> <div class="box-content">
<a href="@url(repository)/blob/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-danger">Cancel</a> <div>
<input type="submit" id="commit" class="btn btn-success" value="Commit changes"/> <strong>Commit changes</strong>
</div>
<div>
<input type="text" name="message" style="width: 98%;"/>
</div>
<div style="text-align: right;">
<a href="@url(repository)/blob/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-danger">Cancel</a>
<input type="submit" id="commit" class="btn btn-success" value="Commit changes"/>
</div>
</div> </div>
</div> </div>
</div> </form>
</form> }
} }
<script type="text/javascript" src="@assets/jsdifflib/difflib.js"></script> <script type="text/javascript" src="@assets/jsdifflib/difflib.js"></script>
<script type="text/javascript" src="@assets/jsdifflib/diffview.js"></script> <script type="text/javascript" src="@assets/jsdifflib/diffview.js"></script>

View File

@@ -6,62 +6,63 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(if(fileName.isEmpty) "New File" else s"Editing ${path} at ${fileName} - ${repository.owner}/${repository.name}", Some(repository)) { @html.main(if(fileName.isEmpty) "New File" else s"Editing ${path} at ${fileName} - ${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(branch, repository, "files") @tab(branch, repository, "files")
<form method="POST" action="@url(repository)/@if(fileName.isEmpty){create}else{update}" validate="true"> <form method="POST" action="@url(repository)/@if(fileName.isEmpty){create}else{update}" validate="true">
<span class="error" id="error-newFileName"></span> <span class="error" id="error-newFileName"></span>
<div class="head"> <div class="head">
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) => @pathList.zipWithIndex.map { case (section, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
} }
<input type="text" name="newFileName" id="newFileName" placeholder="Name your file..." value="@fileName"/> <input type="text" name="newFileName" id="newFileName" placeholder="Name your file..." value="@fileName"/>
<input type="hidden" name="oldFileName" id="oldFileName" value="@fileName"/> <input type="hidden" name="oldFileName" id="oldFileName" value="@fileName"/>
<input type="hidden" name="branch" id="branch" value="@branch"/> <input type="hidden" name="branch" id="branch" value="@branch"/>
<input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/> <input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
</div> </div>
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th> <th>
<div class="pull-right"> <div class="pull-right">
<select id="wrap" class="input-medium" style="margin-bottom: 0px;"> <select id="wrap" class="input-medium" style="margin-bottom: 0px;">
<optgroup label="Line Wrap Mode"> <optgroup label="Line Wrap Mode">
<option value="false">No wrap</option> <option value="false">No wrap</option>
<option value="true">Soft wrap</option> <option value="true">Soft wrap</option>
</optgroup> </optgroup>
</select> </select>
</div>
</th>
</tr>
<tr>
<td>
<div id="editor" style="width: 100%; height: 600px;"></div>
</td>
</tr>
</table>
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
<div class="box issue-comment-box">
<div class="box-content">
<div>
<strong>Commit changes</strong>
</div>
<div>
<input type="text" name="message" style="width: 98%;"/>
</div>
<div style="text-align: right;">
@if(fileName.isEmpty){
<a href="@url(repository)/tree/@encodeRefName(branch)/@{pathList.mkString("/")}" class="btn btn-danger">Cancel</a>
} else {
<a href="@url(repository)/blob/@encodeRefName(branch)/@{(pathList ++ Seq(fileName.get)).mkString("/")}" class="btn btn-danger">Cancel</a>
}
<input type="submit" id="commit" class="btn btn-success" value="Commit changes" disabled="true"/>
<input type="hidden" id="charset" name="charset" value="@content.charset"/>
<input type="hidden" id="content" name="content" value=""/>
<input type="hidden" id="initial" value="@content.content"/>
</div> </div>
</th>
</tr>
<tr>
<td>
<div id="editor" style="width: 100%; height: 600px;"></div>
</td>
</tr>
</table>
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
<div class="box issue-comment-box">
<div class="box-content">
<div>
<strong>Commit changes</strong>
</div>
<div>
<input type="text" name="message" style="width: 98%;"/>
</div>
<div style="text-align: right;">
@if(fileName.isEmpty){
<a href="@url(repository)/tree/@encodeRefName(branch)/@{pathList.mkString("/")}" class="btn btn-danger">Cancel</a>
} else {
<a href="@url(repository)/blob/@encodeRefName(branch)/@{(pathList ++ Seq(fileName.get)).mkString("/")}" class="btn btn-danger">Cancel</a>
}
<input type="submit" id="commit" class="btn btn-success" value="Commit changes" disabled="true"/>
<input type="hidden" id="charset" name="charset" value="@content.charset"/>
<input type="hidden" id="content" name="content" value=""/>
<input type="hidden" id="initial" value="@content.content"/>
</div> </div>
</div> </div>
</div> </form>
</form> }
} }
<script src="@assets/ace/ace.js" type="text/javascript" charset="utf-8"></script> <script src="@assets/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script> <script>

View File

@@ -8,91 +8,94 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository, Some(branch)){
@tab(branch, repository, "files") @tab(branch, repository, "files")
<div class="head"> <div class="head">
<div class="pull-right"> @*
@defining(repository.commitCount){ commitCount => <div class="pull-right">
<a href="@url(repository)/commits/@encodeRefName(branch)">@if(commitCount > 10000){ 10000+ } else { @commitCount } @plural(commitCount, "commit")</a>&nbsp; @defining(repository.commitCount){ commitCount =>
<a href="@url(repository)/commits/@encodeRefName(branch)">@if(commitCount > 10000){ 10000+ } else { @commitCount } @plural(commitCount, "commit")</a>&nbsp;
}
</div>
*@
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
}
@if(hasWritePermission){
<a href="@url(repository)/new/@encodeRefName(branch)/@pathList.mkString("/")"><img src="@assets/common/images/newfile.png"/></a>
} }
</div> </div>
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <div class="box">
@pathList.zipWithIndex.map { case (section, i) => <table class="table table-file-list" style="border: 1px solid silver;">
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <tr>
} <th colspan="4" style="font-weight: normal;">
@if(hasWritePermission){ <a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a>
<a href="@url(repository)/new/@encodeRefName(branch)/@pathList.mkString("/")"><img src="@assets/common/images/newfile.png"/></a> @if(latestCommit.description.isDefined){
} <a href="javascript:void(0)" onclick="$('#description-@latestCommit.id').toggle();" class="omit">...</a>
</div> <pre id="description-@latestCommit.id" class="commit-description" style="display: none;">@link(latestCommit.description.get, repository)</pre>
<div class="box"> }
<table class="table table-file-list" style="border: 1px solid silver;"> </th>
<tr> </tr>
<th colspan="4" style="font-weight: normal;"> <tr>
<a href="@url(repository)/commit/@latestCommit.id" class="commit-message">@link(latestCommit.summary, repository)</a> <td colspan="4" class="latest-commit">
@if(latestCommit.description.isDefined){ <div>
<a href="javascript:void(0)" onclick="$('#description-@latestCommit.id').toggle();" class="omit">...</a> @avatar(latestCommit, 20)
<pre id="description-@latestCommit.id" class="commit-description" style="display: none;">@link(latestCommit.description.get, repository)</pre> @user(latestCommit.committer, latestCommit.mailAddress, "username strong")
} <span class="muted">@datetime(latestCommit.time)</span>
</th> <div class="pull-right align-right monospace">
</tr> <a href="@url(repository)/commit/@latestCommit.id" class="commit-id"><span class="muted">latest commit</span> @latestCommit.id.substring(0, 10)</a>
<tr> </div>
<td colspan="4" class="latest-commit">
<div>
@avatar(latestCommit, 20)
@user(latestCommit.committer, latestCommit.mailAddress, "username strong")
<span class="muted">@datetime(latestCommit.time)</span>
<div class="pull-right align-right monospace">
<a href="@url(repository)/commit/@latestCommit.id" class="commit-id"><span class="muted">latest commit</span> @latestCommit.id.substring(0, 10)</a>
</div> </div>
</div> </td>
</td> </tr>
</tr> @if(pathList.size > 0){
@if(pathList.size > 0){ <tr>
<tr> <td width="16"></td>
<td width="16"></td> <td><a href="@url(repository)@if(pathList.size > 1){/tree/@encodeRefName(branch)/@pathList.init.mkString("/")}">..</a></td>
<td><a href="@url(repository)@if(pathList.size > 1){/tree/@encodeRefName(branch)/@pathList.init.mkString("/")}">..</a></td> <td></td>
<td></td> <td></td>
<td></td> </tr>
</tr>
}
@files.map { file =>
<tr>
<td width="16">
@if(file.isDirectory){
@if(file.linkUrl.isDefined){
<img src="@assets/common/images/folder_link.png"/>
} else {
<img src="@assets/common/images/folder.png"/>
}
} else {
<img src="@assets/common/images/file.png"/>
} }
</td> @files.map { file =>
<td> <tr>
@if(file.isDirectory){ <td width="16">
@if(file.linkUrl.isDefined){ @if(file.isDirectory){
<a href="@file.linkUrl">@file.name</a> @if(file.linkUrl.isDefined){
<img src="@assets/common/images/folder_link.png"/>
} else {
<img src="@assets/common/images/folder.png"/>
}
} else { } else {
<a href="@url(repository)/tree@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a> <img src="@assets/common/images/file.png"/>
} }
} else { </td>
<a href="@url(repository)/blob@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a> <td>
@if(file.isDirectory){
@if(file.linkUrl.isDefined){
<a href="@file.linkUrl">@file.name</a>
} else {
<a href="@url(repository)/tree@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
}
} else {
<a href="@url(repository)/blob@{(encodeRefName(branch) :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
}
</td>
<td class="mute">
<a href="@url(repository)/commit/@file.commitId" class="commit-message">@link(file.message, repository)</a>
[@user(file.committer, file.mailAddress)]
</td>
<td style="text-align: right;">@datetime(file.time)</td>
</tr>
} }
</td> </table>
<td>@datetime(file.time)</td> </div>
<td>
<a href="@url(repository)/commit/@file.commitId" class="commit-message">@link(file.message, repository)</a> @readme.map { case(filePath, content) =>
[@user(file.committer, file.mailAddress)] <div id="readme" class="box">
</td> <div class="box-header">@filePath.reverse.head</div>
</tr> <div class="box-content markdown-body">@renderMarkup(filePath, content, branch, repository, false, false)</div>
} </div>
</table> }
</div>
@readme.map { case(filePath, content) =>
<div id="readme" class="box">
<div class="box-header">@filePath.reverse.head</div>
<div class="box-content markdown-body">@renderMarkup(filePath, content, branch, repository, false, false)</div>
</div>
} }
} }

View File

@@ -4,31 +4,32 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("network", repository) @html.header("network", repository){
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="@url(repository)/network/members">Members</a></li> <li class="active"><a href="@url(repository)/network/members">Members</a></li>
</ul> </ul>
<h3>Members of the @repository.name Network</h3> <h3>Members of the @repository.name Network</h3>
<div class="block">
@if(originRepository.isDefined){
@avatar(originRepository.get.owner, 20)
<span@if(repository.owner == originRepository.get.owner){ class="highlight"}>
<a href="@url(originRepository.get)">@originRepository.get.owner</a> / <a href="@path/@originRepository.get.owner/@originRepository.get.name">@originRepository.get.name</a>
</span>
} else {
@avatar(repository.repository.originUserName.get, 20)
<span class="highlight">
@repository.repository.originUserName / @repository.repository.originRepositoryName
</span>
}
(origin)
</div>
@members.map { case (owner, name) =>
<div class="block"> <div class="block">
@avatar(owner, 20) @if(originRepository.isDefined){
<span@if(repository.owner == owner){ class="highlight"}> @avatar(originRepository.get.owner, 20)
<a href="@url(owner)">@owner</a> / <a href="@path/@owner/@name">@name</a> <span@if(repository.owner == originRepository.get.owner){ class="highlight"}>
</span> <a href="@url(originRepository.get)">@originRepository.get.owner</a> / <a href="@path/@originRepository.get.owner/@originRepository.get.name">@originRepository.get.name</a>
</span>
} else {
@avatar(repository.repository.originUserName.get, 20)
<span class="highlight">
@repository.repository.originUserName / @repository.repository.originRepositoryName
</span>
}
(origin)
</div> </div>
@members.map { case (owner, name) =>
<div class="block">
@avatar(owner, 20)
<span@if(repository.owner == owner){ class="highlight"}>
<a href="@url(owner)">@owner</a> / <a href="@path/@owner/@name">@name</a>
</span>
</div>
}
} }
} }

View File

@@ -3,24 +3,25 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@if(!hasWritePermission){ @if(!hasWritePermission){
<h3>This is an empty repository</h3> <h3>This is an empty repository</h3>
} else { } else {
<h3 style="margin-top: 30px;">Create a new repository on the command line</h3> <h3 style="margin-top: 30px;">Create a new repository on the command line</h3>
<pre> <pre>
touch README.md touch README.md
git init git init
git add README.md git add README.md
git commit -m "first commit" git commit -m "first commit"
git remote add origin @repository.httpUrl git remote add origin @repository.httpUrl
git push -u origin master git push -u origin master
</pre> </pre>
<h3 style="margin-top: 30px;">Push an existing repository from the command line</h3> <h3 style="margin-top: 30px;">Push an existing repository from the command line</h3>
<pre> <pre>
git remote add origin @repository.httpUrl git remote add origin @repository.httpUrl
git push -u origin master git push -u origin master
</pre> </pre>
}
} }
} }

View File

@@ -2,6 +2,7 @@
hideBranchPulldown: Boolean = false)(implicit context: app.Context) hideBranchPulldown: Boolean = false)(implicit context: app.Context)
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@*
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@if(!hideBranchPulldown){ @if(!hideBranchPulldown){
<li> <li>
@@ -22,7 +23,7 @@
<li@if(active=="branches"){ class="active"}><a href="@url(repository)/branches">Branches@if(repository.branchList.length > 0){ <span class="badge">@repository.branchList.length</span>}</a></li> <li@if(active=="branches"){ class="active"}><a href="@url(repository)/branches">Branches@if(repository.branchList.length > 0){ <span class="badge">@repository.branchList.length</span>}</a></li>
<li@if(active=="tags" ){ class="active"}><a href="@url(repository)/tags">Tags@if(repository.tags.length > 0){ <span class="badge">@repository.tags.length</span>}</a></li> <li@if(active=="tags" ){ class="active"}><a href="@url(repository)/tags">Tags@if(repository.tags.length > 0){ <span class="badge">@repository.tags.length</span>}</a></li>
<li class="pull-right"> <li class="pull-right">
@helper.html.copy("repository-url-copy", repository.httpUrl, true){ @helper.html.copy("repository-url-copy", repository.httpUrl){
@if(settings.ssh && loginAccount.isDefined){ @if(settings.ssh && loginAccount.isDefined){
<div class="btn-group add-on" data-toggle="buttons-radio" style="padding: 0px; border-width: 0px;"> <div class="btn-group add-on" data-toggle="buttons-radio" style="padding: 0px; border-width: 0px;">
<button type="button" class="btn active" id="repository-url-http">HTTP</button><button type="button" class="btn" id="repository-url-ssh">SSH</button> <button type="button" class="btn active" id="repository-url-http">HTTP</button><button type="button" class="btn" id="repository-url-ssh">SSH</button>
@@ -39,6 +40,7 @@
</div> </div>
</li> </li>
</ul> </ul>
*@
@if(settings.ssh && loginAccount.isDefined){ @if(settings.ssh && loginAccount.isDefined){
<script> <script>
$(function(){ $(function(){

View File

@@ -2,23 +2,24 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) { @html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.header("code", repository) @html.header("code", repository){
@tab(repository.repository.defaultBranch, repository, "tags", true) @tab(repository.repository.defaultBranch, repository, "tags", true)
<h1>Tags</h1> <h1>Tags</h1>
<table class="table table-bordered"> <table class="table table-bordered">
<tr>
<th width="40%">Tag</th>
<th width="20%">Date</th>
<th width="20%">Commit</th>
<th width="20%">Download</th>
</tr>
@repository.tags.map { tag =>
<tr> <tr>
<td><a href="@url(repository)/tree/@encodeRefName(tag.name)">@tag.name</a></td> <th width="40%">Tag</th>
<td>@datetime(tag.time)</td> <th width="20%">Date</th>
<td class="monospace"><a href="@url(repository)/commit/@tag.id">@tag.id.substring(0, 10)</a></td> <th width="20%">Commit</th>
<td><a href="@url(repository)/archive/@{encodeRefName(tag.name)}.zip">ZIP</a></td> <th width="20%">Download</th>
</tr> </tr>
} @repository.tags.map { tag =>
</table> <tr>
<td><a href="@url(repository)/tree/@encodeRefName(tag.name)">@tag.name</a></td>
<td>@datetime(tag.time)</td>
<td class="monospace"><a href="@url(repository)/commit/@tag.id">@tag.id.substring(0, 10)</a></td>
<td><a href="@url(repository)/archive/@{encodeRefName(tag.name)}.zip">ZIP</a></td>
</tr>
}
</table>
}
} }

View File

@@ -2,36 +2,37 @@
repository: service.RepositoryService.RepositoryInfo)(body: Html)(implicit context: app.Context) repository: service.RepositoryService.RepositoryInfo)(body: Html)(implicit context: app.Context)
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.header("", repository) @html.header("", repository){
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<div class="box"> <div class="box">
<ul class="nav nav-tabs nav-stacked side-menu"> <ul class="nav nav-tabs nav-stacked side-menu">
<li@if(active=="code"){ class="active"}> <li@if(active=="code"){ class="active"}>
<a href="@url(repository)/search?q=@urlEncode(query)&type=code"> <a href="@url(repository)/search?q=@urlEncode(query)&type=code">
@if(fileCount != 0){ @if(fileCount != 0){
<span class="badge pull-right">@fileCount</span> <span class="badge pull-right">@fileCount</span>
} }
Code Code
</a> </a>
</li> </li>
<li@if(active=="issue"){ class="active"}> <li@if(active=="issue"){ class="active"}>
<a href="@url(repository)/search?q=@urlEncode(query)&type=issue"> <a href="@url(repository)/search?q=@urlEncode(query)&type=issue">
@if(issueCount != 0){ @if(issueCount != 0){
<span class="badge pull-right">@issueCount</span> <span class="badge pull-right">@issueCount</span>
} }
Issue Issue
</a> </a>
</li> </li>
</ul> </ul>
</div>
</div>
<div class="span9">
<form action="@url(repository)/search" method="GET">
<input type="text" name="q" value="@query" style="width: 80%; margin-bottom: 0px;"/>
<input type="submit" value="Search" class="btn" style="width: 15%;"/>
<input type="hidden" name="type" value="@active"/>
</form>
@body
</div> </div>
</div> </div>
<div class="span9"> }
<form action="@url(repository)/search" method="GET">
<input type="text" name="q" value="@query" style="width: 80%; margin-bottom: 0px;"/>
<input type="submit" value="Search" class="btn" style="width: 15%;"/>
<input type="hidden" name="type" value="@active"/>
</form>
@body
</div>
</div>

View File

@@ -4,31 +4,32 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main("Settings", Some(repository)){ @html.main("Settings", Some(repository)){
@html.header("settings", repository) @html.header("settings", repository){
@menu("collaborators", repository){ @menu("collaborators", repository){
<h3>Manage Collaborators</h3> <h3>Manage Collaborators</h3>
<ul class="collaborator"> <ul class="collaborator">
@collaborators.map { collaboratorName => @collaborators.map { collaboratorName =>
<li> <li>
<a href="@url(collaboratorName)">@collaboratorName</a> <a href="@url(collaboratorName)">@collaboratorName</a>
@if(!isGroupRepository){ @if(!isGroupRepository){
<a href="@url(repository)/settings/collaborators/remove?name=@collaboratorName" class="remove">(remove)</a> <a href="@url(repository)/settings/collaborators/remove?name=@collaboratorName" class="remove">(remove)</a>
} else { } else {
@if(repository.managers.contains(collaboratorName)){ @if(repository.managers.contains(collaboratorName)){
(Manager) (Manager)
}
} }
} </li>
</li> }
</ul>
@if(!isGroupRepository){
<form method="POST" action="@url(repository)/settings/collaborators/add" validate="true" autocomplete="off">
<div>
<span class="error" id="error-userName"></span>
</div>
@helper.html.account("userName", 300)
<input type="submit" class="btn" value="Add"/>
</form>
} }
</ul>
@if(!isGroupRepository){
<form method="POST" action="@url(repository)/settings/collaborators/add" validate="true" autocomplete="off">
<div>
<span class="error" id="error-userName"></span>
</div>
@helper.html.account("userName", 300)
<input type="submit" class="btn" value="Add"/>
</form>
} }
} }
} }

View File

@@ -2,37 +2,38 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main("Danger Zone", Some(repository)){ @html.main("Danger Zone", Some(repository)){
@html.header("settings", repository) @html.header("settings", repository){
@menu("danger", repository){ @menu("danger", repository){
<div class="box"> <div class="box">
<div class="box-header">Danger Zone</div> <div class="box-header">Danger Zone</div>
<div class="box-content"> <div class="box-content">
<form id="transfer-form" method="post" action="@url(repository)/settings/transfer" validate="true" autocomplete="off"> <form id="transfer-form" method="post" action="@url(repository)/settings/transfer" validate="true" autocomplete="off">
<fieldset> <fieldset>
<label class="strong">Transfer Ownership</label> <label class="strong">Transfer Ownership</label>
<div> <div>
Transfer this repo to another user or to group. Transfer this repo to another user or to group.
<div class="pull-right"> <div class="pull-right">
@helper.html.account("newOwner", 150) @helper.html.account("newOwner", 150)
<input type="submit" class="btn btn-danger" value="Transfer"/> <input type="submit" class="btn btn-danger" value="Transfer"/>
<div> <div>
<span id="error-newOwner" class="error"></span> <span id="error-newOwner" class="error"></span>
</div>
</div> </div>
</div> </div>
</div> </fieldset>
</fieldset> </form>
</form> <form id="delete-form" method="post" action="@url(repository)/settings/delete">
<form id="delete-form" method="post" action="@url(repository)/settings/delete"> <fieldset class="margin">
<fieldset class="margin"> <label class="strong">Delete repository</label>
<label class="strong">Delete repository</label> <div>
<div> Once you delete a repository, there is no going back.
Once you delete a repository, there is no going back. <input type="submit" class="btn btn-danger pull-right" value="Delete this repository"/>
<input type="submit" class="btn btn-danger pull-right" value="Delete this repository"/> </div>
</div> </fieldset>
</fieldset> </form>
</form> </div>
</div> </div>
</div> }
} }
} }
<script> <script>

View File

@@ -2,22 +2,23 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main("Settings", Some(repository)){ @html.main("Settings", Some(repository)){
@html.header("settings", repository) @html.header("settings", repository){
@menu("hooks", repository){ @menu("hooks", repository){
@helper.html.information(info) @helper.html.information(info)
<h3>WebHook URLs</h3> <h3>WebHook URLs</h3>
<ul> <ul>
@webHooks.map { webHook => @webHooks.map { webHook =>
<li>@webHook.url <a href="@url(repository)/settings/hooks/delete?url=@urlEncode(webHook.url)" class="remove">(remove)</a></li> <li>@webHook.url <a href="@url(repository)/settings/hooks/delete?url=@urlEncode(webHook.url)" class="remove">(remove)</a></li>
} }
</ul> </ul>
<form method="POST" action="@url(repository)/settings/hooks/add" validate="true"> <form method="POST" action="@url(repository)/settings/hooks/add" validate="true">
<div> <div>
<span class="error" id="error-url"></span> <span class="error" id="error-url"></span>
</div> </div>
<input type="text" name="url" id="url" style="width: 300px; margin-bottom: 0px;"/> <input type="text" name="url" id="url" style="width: 300px; margin-bottom: 0px;"/>
<input type="submit" class="btn" value="Add"/> <input type="submit" class="btn" value="Add"/>
<a href="@url(repository)/settings/hooks/test" class="btn">Test Hook</a> <a href="@url(repository)/settings/hooks/test" class="btn">Test Hook</a>
</form> </form>
}
} }
} }

View File

@@ -2,98 +2,99 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main("Settings", Some(repository)){ @html.main("Settings", Some(repository)){
@html.header("settings", repository) @html.header("settings", repository){
@menu("options", repository){ @menu("options", repository){
@helper.html.information(info) @helper.html.information(info)
<form id="form" method="post" action="@url(repository)/settings/options" validate="true"> <form id="form" method="post" action="@url(repository)/settings/options" validate="true">
<div class="box"> <div class="box">
<div class="box-header">Settings</div> <div class="box-header">Settings</div>
<div class="box-content"> <div class="box-content">
<fieldset> <fieldset>
<label for="repositoryName" class="strong">Repository Name:</label> <label for="repositoryName" class="strong">Repository Name:</label>
<input type="text" name="repositoryName" id="repositoryName" value="@repository.name"/> <input type="text" name="repositoryName" id="repositoryName" value="@repository.name"/>
<span id="error-repositoryName" class="error"></span> <span id="error-repositoryName" class="error"></span>
</fieldset> </fieldset>
<fieldset class="margin"> <fieldset class="margin">
<label for="description" class="strong">Description:</label> <label for="description" class="strong">Description:</label>
<input type="text" name="description" id="description" style="width: 600px;" value="@repository.repository.description"/> <input type="text" name="description" id="description" style="width: 600px;" value="@repository.repository.description"/>
</fieldset> </fieldset>
<fieldset class="margin"> <fieldset class="margin">
<label for="defaultBranch" class="strong">Default Branch:</label> <label for="defaultBranch" class="strong">Default Branch:</label>
<select name="defaultBranch" id="defaultBranch"@if(repository.branchList.isEmpty){ disabled}> <select name="defaultBranch" id="defaultBranch"@if(repository.branchList.isEmpty){ disabled}>
@if(repository.branchList.isEmpty){ @if(repository.branchList.isEmpty){
<option value="none" selected>No Branch</option> <option value="none" selected>No Branch</option>
} else { } else {
@repository.branchList.map { branch => @repository.branchList.map { branch =>
<option@if(branch==repository.repository.defaultBranch){ selected}>@branch</option> <option@if(branch==repository.repository.defaultBranch){ selected}>@branch</option>
}
} }
</select>
@if(repository.branchList.isEmpty){
<input type="hidden" name="defaultBranch" value="none"/>
} }
</select> <span class="error" id="error-defaultBranch"></span>
@if(repository.branchList.isEmpty){ </fieldset>
<input type="hidden" name="defaultBranch" value="none"/> <fieldset class="margin">
} <label class="radio">
<span class="error" id="error-defaultBranch"></span> <input type="radio" name="isPrivate" value="false"
</fieldset> @if(!repository.repository.isPrivate ){ checked }
<fieldset class="margin"> @if(repository.repository.parentUserName.isDefined){ disabled }
<label class="radio"> >
<input type="radio" name="isPrivate" value="false" <span class="strong">Public</span><br>
@if(!repository.repository.isPrivate ){ checked } <div>
@if(repository.repository.parentUserName.isDefined){ disabled } <span>All users and guests can read this repository.</span>
> </div>
<span class="strong">Public</span><br>
<div>
<span>All users and guests can read this repository.</span>
</div>
</label>
</fieldset>
<fieldset>
<label class="radio">
<input type="radio" name="isPrivate" value="true"
@if(repository.repository.isPrivate ){ checked }
@if(repository.repository.parentUserName.isDefined){ disabled }
>
<span class="strong">Private</span><br>
<div>
<span>Only collaborators can read this repository.</span>
</div>
</label>
</fieldset>
</div>
</div>
@*
<div class="box">
<div class="box-header">Features:</div>
<div class="box-content">
<dl>
<dt>
<label class="checkbox strong">
<input type="checkbox" name="wiki" id="wiki"/> Wiki
</label> </label>
</dt> </fieldset>
<dd> <fieldset>
Adds lightweight Wiki system to this repository. <label class="radio">
This is the simplest way to provide documentation or examples. <input type="radio" name="isPrivate" value="true"
Only collaborators can edit Wiki pages. @if(repository.repository.isPrivate ){ checked }
</dd> @if(repository.repository.parentUserName.isDefined){ disabled }
</dl> >
<hr> <span class="strong">Private</span><br>
<dl> <div>
<dt> <span>Only collaborators can read this repository.</span>
<label class="checkbox strong"> </div>
<input type="checkbox" name="issue" id="issue"/> Issue
</label> </label>
</dt> </fieldset>
<dd> </div>
Adds lightweight issue tracking integrated with this repository.
All users who have signed in and can access this repository can register an issue.
</dd>
</dl>
</div> </div>
</div> @*
*@ <div class="box">
<fieldset> <div class="box-header">Features:</div>
<input type="submit" class="btn btn-success" value="Apply changes"/> <div class="box-content">
</fieldset> <dl>
</form> <dt>
<label class="checkbox strong">
<input type="checkbox" name="wiki" id="wiki"/> Wiki
</label>
</dt>
<dd>
Adds lightweight Wiki system to this repository.
This is the simplest way to provide documentation or examples.
Only collaborators can edit Wiki pages.
</dd>
</dl>
<hr>
<dl>
<dt>
<label class="checkbox strong">
<input type="checkbox" name="issue" id="issue"/> Issue
</label>
</dt>
<dd>
Adds lightweight issue tracking integrated with this repository.
All users who have signed in and can access this repository can register an issue.
</dd>
</dl>
</div>
</div>
*@
<fieldset>
<input type="submit" class="btn btn-success" value="Apply changes"/>
</fieldset>
</form>
}
} }
} }

View File

@@ -10,31 +10,32 @@
@import org.eclipse.jgit.diff.DiffEntry.ChangeType @import org.eclipse.jgit.diff.DiffEntry.ChangeType
@html.main(s"Compare Revisions - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"Compare Revisions - ${repository.owner}/${repository.name}", Some(repository)){
@helper.html.information(info) @helper.html.information(info)
@html.header("wiki", repository) @html.header("wiki", repository){
@tab("history", repository) @tab("history", repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li> <li>
<h1 class="wiki-title"><span class="muted">Compare Revisions</span></h1> <h1 class="wiki-title"><span class="muted">Compare Revisions</span></h1>
</li> </li>
<li class="pull-right"> <li class="pull-right">
<div class="btn-group"> <div class="btn-group">
@if(pageName.isDefined){ @if(pageName.isDefined){
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a>
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Back to Page History</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Back to Page History</a>
} else { } else {
<a class="btn" href="@url(repository)/wiki/_history">Back to Wiki History</a> <a class="btn" href="@url(repository)/wiki/_history">Back to Wiki History</a>
} }
</div>
</li>
</ul>
@helper.html.diff(diffs, repository, None, None, false)
@if(hasWritePermission){
<div>
@if(pageName.isDefined){
<a href="@url(repository)/wiki/@urlEncode(pageName)/_revert/@from...@to" class="btn">Revert Changes</a>
} else {
<a href="@url(repository)/wiki/_revert/@from...@to" class="btn">Revert Changes</a>
}
</div> </div>
</li> }
</ul>
@helper.html.diff(diffs, repository, None, None, false)
@if(hasWritePermission){
<div>
@if(pageName.isDefined){
<a href="@url(repository)/wiki/@urlEncode(pageName)/_revert/@from...@to" class="btn">Revert Changes</a>
} else {
<a href="@url(repository)/wiki/_revert/@from...@to" class="btn">Revert Changes</a>
}
</div>
} }
} }

View File

@@ -4,31 +4,32 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${if(pageName.isEmpty) "New Page" else pageName} - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"${if(pageName.isEmpty) "New Page" else pageName} - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("wiki", repository) @html.header("wiki", repository){
@tab("", repository) @tab("", repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li> <li>
<h1 class="wiki-title"><span class="muted">Editing</span> @if(pageName.isEmpty){New Page} else {@pageName}</h1> <h1 class="wiki-title"><span class="muted">Editing</span> @if(pageName.isEmpty){New Page} else {@pageName}</h1>
</li> </li>
<li class="pull-right"> <li class="pull-right">
<div class="btn-group"> <div class="btn-group">
@if(page.isDefined){ @if(page.isDefined){
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a>
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_delete" id="delete">Delete Page</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_delete" id="delete">Delete Page</a>
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Page History</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Page History</a>
} }
</div> </div>
</li> </li>
</ul> </ul>
<form action="@url(repository)/wiki/@if(page.isEmpty){_new} else {_edit}" method="POST" validate="true"> <form action="@url(repository)/wiki/@if(page.isEmpty){_new} else {_edit}" method="POST" validate="true">
<span id="error-pageName" class="error"></span> <span id="error-pageName" class="error"></span>
<input type="text" name="pageName" value="@pageName" style="width: 900px; font-weight: bold;" placeholder="Input a page name."/> <input type="text" name="pageName" value="@pageName" style="width: 900px; font-weight: bold;" placeholder="Input a page name."/>
@helper.html.preview(repository, page.map(_.content).getOrElse(""), true, false, "width: 900px; height: 400px;", "") @helper.html.preview(repository, page.map(_.content).getOrElse(""), true, false, "width: 900px; height: 400px;", "")
<input type="text" name="message" value="" style="width: 900px;" placeholder="Write a small message here explaining this change. (Optional)"/> <input type="text" name="message" value="" style="width: 900px;" placeholder="Write a small message here explaining this change. (Optional)"/>
<input type="hidden" name="currentPageName" value="@pageName"/> <input type="hidden" name="currentPageName" value="@pageName"/>
<input type="hidden" name="id" value="@page.map(_.id)"/> <input type="hidden" name="id" value="@page.map(_.id)"/>
<input type="submit" value="Save" class="btn btn-success"> <input type="submit" value="Save" class="btn btn-success">
</form> </form>
}
} }
<script> <script>
$(function(){ $(function(){

View File

@@ -4,68 +4,69 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"History - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"History - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("wiki", repository) @html.header("wiki", repository){
@tab(if(pageName.isEmpty) "history" else "", repository) @tab(if(pageName.isEmpty) "history" else "", repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li> <li>
<h1 class="wiki-title"> <h1 class="wiki-title">
@if(pageName.isEmpty){ @if(pageName.isEmpty){
<span class="muted">History</span> <span class="muted">History</span>
} else { } else {
<span class="muted">History for</span> @pageName.get <span class="muted">History for</span> @pageName.get
}
</h1>
</li>
<li class="pull-right">
<div class="btn-group">
@if(pageName.isEmpty){
@if(loginAccount.isDefined){
<a class="btn" href="@url(repository)/wiki/_new">New Page</a>
} }
} else { </h1>
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a> </li>
@if(loginAccount.isDefined){ <li class="pull-right">
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_edit">Edit Page</a> <div class="btn-group">
@if(pageName.isEmpty){
@if(loginAccount.isDefined){
<a class="btn" href="@url(repository)/wiki/_new">New Page</a>
}
} else {
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)">View Page</a>
@if(loginAccount.isDefined){
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_edit">Edit Page</a>
}
} }
} </div>
</div> </li>
</li> </ul>
</ul> <table class="table table-bordered">
<table class="table table-bordered"> @commits.map { commit =>
@commits.map { commit => <tr>
<tr> <td width="0%"><input type="checkbox" name="commitId" value="@commit.id"></td>
<td width="0%"><input type="checkbox" name="commitId" value="@commit.id"></td> <td>@avatar(commit, 20)&nbsp;@user(commit.committer, commit.mailAddress)</td>
<td>@avatar(commit, 20)&nbsp;@user(commit.committer, commit.mailAddress)</td> <td width="80%">
<td width="80%"> <span class="muted">@datetime(commit.time):</span>&nbsp;@commit.shortMessage
<span class="muted">@datetime(commit.time):</span>&nbsp;@commit.shortMessage </td>
</td> </tr>
</tr>
}
</table>
<input type="button" id="compare" value="Compare Revisions" class="btn"/>
<input type="button" id="top" value="Back to Top" class="btn"/>
<script>
$(function(){
$('input[name=commitId]').click(function(){
return !($('input[name=commitId]:checked').length == 3);
});
$('#compare').click(function(){
var e = $('input[name=commitId]:checked');
if(e.length == 2){
@if(pageName.isEmpty){
location.href = '@url(repository)/wiki/_compare/' +
$(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value');
} else {
location.href = '@url(repository)/wiki/@urlEncode(pageName.get)/_compare/' +
$(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value');
}
} }
</table>
<input type="button" id="compare" value="Compare Revisions" class="btn"/>
<input type="button" id="top" value="Back to Top" class="btn"/>
<script>
$(function(){
$('input[name=commitId]').click(function(){
return !($('input[name=commitId]:checked').length == 3);
});
$('#compare').click(function(){
var e = $('input[name=commitId]:checked');
if(e.length == 2){
@if(pageName.isEmpty){
location.href = '@url(repository)/wiki/_compare/' +
$(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value');
} else {
location.href = '@url(repository)/wiki/@urlEncode(pageName.get)/_compare/' +
$(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value');
}
}
});
$('#top').click(function(){
$('html,body').animate({ scrollTop: 0 }, 'fast');
});
}); });
</script>
$('#top').click(function(){ }
$('html,body').animate({ scrollTop: 0 }, 'fast');
});
});
</script>
} }

View File

@@ -5,26 +5,27 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"${pageName} - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"${pageName} - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("wiki", repository) @html.header("wiki", repository){
@tab((if(pageName == "Home") "home" else ""), repository) @tab((if(pageName == "Home") "home" else ""), repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li> <li>
<h1 class="wiki-title">@pageName</h1> <h1 class="wiki-title">@pageName</h1>
</li> </li>
<li class="pull-right"> <li class="pull-right">
<div class="btn-group"> <div class="btn-group">
@if(hasWritePermission){ @if(hasWritePermission){
<a class="btn" href="@url(repository)/wiki/_new">New Page</a> <a class="btn" href="@url(repository)/wiki/_new">New Page</a>
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_edit">Edit Page</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_edit">Edit Page</a>
} }
<a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Page History</a> <a class="btn" href="@url(repository)/wiki/@urlEncode(pageName)/_history">Page History</a>
</div> </div>
</li> </li>
</ul> </ul>
<div class="markdown-body"> <div class="markdown-body">
@markdown(page.content, repository, true, false) @markdown(page.content, repository, true, false)
</div> </div>
<div class="small"> <div class="small">
<span class="muted">Last edited by @page.committer at @datetime(page.time)</span> <span class="muted">Last edited by @page.committer at @datetime(page.time)</span>
</div> </div>
}
} }

View File

@@ -4,24 +4,24 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@html.main(s"Pages - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"Pages - ${repository.owner}/${repository.name}", Some(repository)){
@html.header("wiki", repository) @html.header("wiki", repository){
@tab("pages", repository) @tab("pages", repository)
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li> <li>
<h1 class="wiki-title"><span class="muted">Pages</span></h1> <h1 class="wiki-title"><span class="muted">Pages</span></h1>
</li> </li>
<li class="pull-right"> <li class="pull-right">
<div class="btn-group"> <div class="btn-group">
@if(hasWritePermission){ @if(hasWritePermission){
<a class="btn" href="@url(repository)/wiki/_new">New Page</a> <a class="btn" href="@url(repository)/wiki/_new">New Page</a>
} }
</div> </div>
</li> </li>
</ul> </ul>
<ul> <ul>
@pages.map { page => @pages.map { page =>
<li><a href="@url(repository)/wiki/@urlEncode(page)">@page</a></li> <li><a href="@url(repository)/wiki/@urlEncode(page)">@page</a></li>
} }
</ul> </ul>
}
} }

View File

@@ -8,7 +8,7 @@
<li@if(active == "pages" ){ class="active"}><a href="@url(repository)/wiki/_pages">Pages</a></li> <li@if(active == "pages" ){ class="active"}><a href="@url(repository)/wiki/_pages">Pages</a></li>
<li@if(active == "history"){ class="active"}><a href="@url(repository)/wiki/_history">Wiki History</a></li> <li@if(active == "history"){ class="active"}><a href="@url(repository)/wiki/_history">Wiki History</a></li>
<li class="pull-right"> <li class="pull-right">
@helper.html.copy("repository-url-copy", httpUrl(repository), true){ @helper.html.copy("repository-url-copy", httpUrl(repository)){
@if(settings.ssh && loginAccount.isDefined){ @if(settings.ssh && loginAccount.isDefined){
<div class="btn-group add-on" data-toggle="buttons-radio" style="padding: 0px; border-width: 0px;"> <div class="btn-group add-on" data-toggle="buttons-radio" style="padding: 0px; border-width: 0px;">
<button type="button" class="btn active" id="repository-url-http">HTTP</button><button type="button" class="btn" id="repository-url-ssh">SSH</button> <button type="button" class="btn active" id="repository-url-http">HTTP</button><button type="button" class="btn" id="repository-url-ssh">SSH</button>

View File

@@ -3,6 +3,7 @@
/****************************************************************************/ /****************************************************************************/
body { body {
color: #333; color: #333;
line-height: 100%;
} }
li p { li p {
@@ -122,7 +123,7 @@ span.error {
} }
.small { .small {
font-size: 85%; font-size: 80%;
} }
.strong { .strong {
@@ -436,6 +437,7 @@ table.table-file-list td {
th, td, .table th, .table td { th, td, .table th, .table td {
padding-top: 4px; padding-top: 4px;
padding-bottom: 4px; padding-bottom: 4px;
line-height: 100%;
} }
div.commit-avatar-image { div.commit-avatar-image {
@@ -458,7 +460,16 @@ pre.commit-description {
#repository-url { #repository-url {
background-color: white; background-color: white;
cursor: default; cursor: default;
width: 300px; height: 16px;
width: 129px;
color: silver;
font-size: 9pt;
font-family: monospace;
}
#repository-url-copy {
height: 18px;
padding-top: 2px;
} }
ul#commit-file-list { ul#commit-file-list {