Skip to content

The Unified and Autonomous Development Platform

Update readme panel

steve72c601ad82cc
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css b/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css
index 90ca662e73..d5daf9fb68 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/assets/css/page.css
@@ -393,7 +393,7 @@ table.files td.file-icon { width: 18px; padding-right: 2px; padding-left: 15px;
table.table-blob { width: 100%; }
.blob-body { width: 100%; overflow: auto; overflow-x: auto; overflow-y: hidden; border-top: 1px solid #bbb; }
-.table-blob td { vertical-align: top; line-height: 18px; font-size: 12px; font-family: Consolas, "Liberation Mono", Courier, monospace; }
+.table-blob td { vertical-align: top; line-height: 18px; font-size: 12px; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace; }
.table-blob td.blob-lineno { width: 1%; padding: 0; border-right: 1px solid #ddd; padding: 9px 0;}
.blob-lineno span { display: block; color: #999; text-align: right; line-height: 18px; padding: 0 5px 0 15px; cursor: pointer; }
.blob-lineno span.active { background: #08F; color: white; }
@@ -405,16 +405,20 @@ table.table-blob { width: 100%; }
.code-highlight code {
background: white; border-radius: 0; padding: 0; margin: 0; border: none;
white-space: pre; word-break: normal; word-wrap: normal;
- font-family: Consolas, "Liberation Mono", Courier, monospace; font-size: 12px; line-height: 18px;
+ font-size: 12px; line-height: 18px;
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;
}
.code-highlight pre {
overflow: auto; overflow-x: auto; overflow-y: hidden;
}
-.code-highlight .ace_editor { height: 400px; }
.blob-meta > span > .icon { padding: 3px; background: white; border: 1px solid #ccc; border-right-color: #e5e5e5; border-bottom-color: #e5e5e5; border-radius: 3px;}
+.readme { border: 1px solid #ddd; margin: 18px 0; border-radius: 4px; }
+.readme > .head { padding: 8px 15px; border-radius: 4px 4px 0 0; background: #e5e5e5; border-bottom: 1px solid #ddd; font-size: 16px; font-weight: bold; }
+.readme > .body { padding: 15px; }
+
/**
* GATE KEEPER SETTING PAGE
*/
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.html
index d7b3bf6cea..7349e43bc9 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.html
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.html
@@ -1,8 +1,11 @@
<html xmlns:wicket>
<wicket:panel>
<div class="readme">
- <h3>Readme here</h3>
- <div wicket:id="readme"></div>
+ <div class="head">
+ <i class="icon icon-readme"></i>
+ <span wicket:id="name"></span>
+ </div>
+ <div class="body" wicket:id="readme"></div>
</div>
</wicket:panel>
</html>
\ No newline at end of file
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.java
index 730be7e451..da9809d7a6 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.java
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/component/ReadmePanel.java
@@ -4,6 +4,8 @@ import java.util.List;
import java.util.Set;
import org.apache.tika.mime.MimeType;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
@@ -47,6 +49,21 @@ public class ReadmePanel extends AbstractSourcePagePanel {
protected void onConfigure() {
super.onConfigure();
+ this.setVisibilityAllowed(getReadmeNode() != null);
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+
+ add(new Label("name", new AbstractReadOnlyModel<String>() {
+
+ @Override
+ public String getObject() {
+ return getReadmeNode().getName();
+ }
+ }));
+
add(new WikiTextPanel("readme", new LoadableDetachableModel<String>() {
@Override
@@ -72,14 +89,6 @@ public class ReadmePanel extends AbstractSourcePagePanel {
}
}));
-
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
-
- this.setVisibilityAllowed(getReadmeNode() != null);
}
static Set<String> README_FILES = ImmutableSet.of(
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.html b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.html
index c3e936e518..e156f41315 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.html
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/project/source/tree/SourceTreePanel.html
@@ -23,7 +23,7 @@
</div>
</div>
</div>
- <table class="table table-condense files">
+ <table class="table table-condense files table-striped">
<wicket:enclosure>
<tr>
<td class="file-icon"><i class="icon icon-back"></i></td>