mirror of https://github.com/apache/archiva.git
table layout for file list
ignore nbactions.xml for rat git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1378091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
401a3397cb
commit
899348f4d1
|
@ -277,6 +277,7 @@
|
||||||
<exclude>src/test/resources/archiva-mime-types.txt</exclude>
|
<exclude>src/test/resources/archiva-mime-types.txt</exclude>
|
||||||
<exclude>src/test/resources/artifact.jar.sha1</exclude>
|
<exclude>src/test/resources/artifact.jar.sha1</exclude>
|
||||||
<exclude>src/test/resources/maven-metadata.xml</exclude>
|
<exclude>src/test/resources/maven-metadata.xml</exclude>
|
||||||
|
<exclude>nbactions.xml</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -94,12 +94,14 @@ public class IndexWriter
|
||||||
relative.append("../");
|
relative.append("../");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.println( ".file{list-style-image:url(" + relative.toString() + "images/package-x-generic.png);}" );
|
writer.println( ".file{background:url(" + relative.toString() + "images/package-x-generic.png) no-repeat scroll 0 0 transparent;}" );
|
||||||
writer.println( ".folder{list-style-image:url(" + relative.toString() + "images/folder.png);}" );
|
writer.println( ".folder{background:url(" + relative.toString() + "images/folder.png) no-repeat scroll 0 0 transparent;}" );
|
||||||
writer.println( "a{color: #0088CC;text-decoration: none;}" );
|
writer.println( "a{color:#0088CC;text-decoration: none;padding-left:20px;}" );
|
||||||
writer.println( ".collection li:nth-child(odd){background-color:#fafafa;}" );
|
writer.println( ".collection tr:nth-child(odd){background-color:#fafafa;}" );
|
||||||
writer.println( ".size{position:absolute;left:500px;color:#cc8800;}" );
|
writer.println( "tr td:nth-child(2){width:150px;color:#cc8800;text-align:right;}" );
|
||||||
writer.println( ".date{position:absolute;left:600px;color:#0000cc;}" );
|
writer.println( "tr td:nth-child(3){width:150px;color:#0000cc;text-align:center;}" );
|
||||||
|
writer.println( "th td:nth-child(2){width:150px;}" );
|
||||||
|
writer.println( "th td:nth-child(3){width:150px;}" );
|
||||||
writer.println( "</style>" );
|
writer.println( "</style>" );
|
||||||
writer.println( "</head>" );
|
writer.println( "</head>" );
|
||||||
writer.println( "<body>" );
|
writer.println( "<body>" );
|
||||||
|
@ -115,16 +117,17 @@ public class IndexWriter
|
||||||
parentName = StringUtils.replace( parentName, "\\", "/" );
|
parentName = StringUtils.replace( parentName, "\\", "/" );
|
||||||
|
|
||||||
writer.println( "<ul>" );
|
writer.println( "<ul>" );
|
||||||
writer.println( "<li class=\"folder\"><a href=\"../\">" + parentName + "</a> <i><small>(Parent)</small></i></li>" );
|
writer.println( "<li><a class=\"folder\" href=\"../\">" + parentName + "</a> <i><small>(Parent)</small></i></li>" );
|
||||||
writer.println( "</ul>" );
|
writer.println( "</ul>" );
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.println( "<ul class=\"collection\">" );
|
writer.println( "<table class=\"collection\">" );
|
||||||
|
writer.println( "<tr><th>Name</th><th>Size (Bytes)</th><th>Last Modified</th></tr>" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeDocumentEnd( PrintWriter writer )
|
private void writeDocumentEnd( PrintWriter writer )
|
||||||
{
|
{
|
||||||
writer.println( "</ul>" );
|
writer.println( "</table>" );
|
||||||
writer.println( "</body>" );
|
writer.println( "</body>" );
|
||||||
writer.println( "</html>" );
|
writer.println( "</html>" );
|
||||||
}
|
}
|
||||||
|
@ -197,21 +200,15 @@ public class IndexWriter
|
||||||
return dateFormatter.format( aDate );
|
return dateFormatter.format( aDate );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String fileSizeFormat( long fileSize )
|
|
||||||
{
|
|
||||||
DecimalFormat format =new DecimalFormat( "###,##0.000" );
|
|
||||||
return format.format( (double) fileSize / 1024 ) + " KB";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeHyperlink( PrintWriter writer, String resourceName, long lastModified, long fileSize, boolean directory )
|
private void writeHyperlink( PrintWriter writer, String resourceName, long lastModified, long fileSize, boolean directory )
|
||||||
{
|
{
|
||||||
if ( directory )
|
if ( directory )
|
||||||
{
|
{
|
||||||
writer.println( "<li class=\"folder\"><a href=\"" + resourceName + "/\">" + resourceName + "</a></li>" );
|
writer.println( "<tr><td><a class=\"folder\" href=\"" + resourceName + "/\">" + resourceName + "</a></td><td> </td><td> </td></tr>" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writer.println( "<li class=\"file\"><a href=\"" + resourceName + "\">" + resourceName + "<span class=\"size\">" + fileSizeFormat( fileSize ) + "</span><span class=\"date\">" + fileDateFormat( lastModified ) + "</span></a></li>" );
|
writer.println( "<tr><td><a class=\"file\" href=\"" + resourceName + "\">" + resourceName + "</a></td><td class=\"size\">" + fileSize + " </td><td class=\"date\">" + fileDateFormat( lastModified ) + "</td></tr>" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue