feat(panel): working on panel help text and unifying panel links, panel errors, and panel help into a single panel feature, #4079 , #6847

This commit is contained in:
Torkel Ödegaard 2016-12-16 13:06:04 +01:00
parent ac9ae52cea
commit 62f3b16671
8 changed files with 50 additions and 43 deletions

View File

@ -10,7 +10,7 @@
</a>
</div>
<div class="modal-content" ng-bind-html="html">
<div class="modal-content markdown-html" ng-bind-html="html">
</div>
</div>

View File

@ -263,7 +263,9 @@ export class PanelCtrl {
var linkSrv = this.$injector.get('linkSrv');
var templateSrv = this.$injector.get('templateSrv');
var interpolatedMarkdown = templateSrv.replace(markdown, this.panel.scopedVars);
var html = new Remarkable().render(interpolatedMarkdown);
var html = '<div class="markdown-html">';
html += new Remarkable().render(interpolatedMarkdown);
if (this.panel.links && this.panel.links.length > 0) {
html += '<ul>';
@ -274,7 +276,7 @@ export class PanelCtrl {
html += '</ul>';
}
return html;
return html + '</div>';
}
openInfo() {

View File

@ -31,7 +31,7 @@
<div class="page-body">
<div class="tab-content page-content-with-sidebar" ng-if="ctrl.tabs[ctrl.tabIndex] === 'Readme'">
<div ng-bind-html="ctrl.readmeHtml" class="plugin-markdown-readme">
<div ng-bind-html="ctrl.readmeHtml" class="markdown-html">
</div>
</div>

View File

@ -1,2 +1,2 @@
<p class="panel-text-content" ng-bind-html="ctrl.content" ng-show="ctrl.content">
<p class="markdown-html panel-text-content" ng-bind-html="ctrl.content" ng-show="ctrl.content">
</p>

View File

@ -290,3 +290,42 @@ a.external-link {
.pointer {
cursor: pointer;
}
.markdown-html {
img {
max-width: 100%;
}
ul {
padding-left: $spacer*1.5;
margin-bottom: $spacer;
}
table {
td, th {
padding: $spacer*.5 $spacer;
}
th {
font-weight: normal;
background: $table-bg-accent;
}
}
table, th, td {
border: 1px solid $table-border;
border-collapse: collapse;
}
a {
text-decoration: underline;
color: $external-link-color;
&:hover {
color: lighten($external-link-color, 10%);
}
}
p:last-child {
margin-bottom: 0;
}
}

View File

@ -29,12 +29,11 @@ $easing: cubic-bezier(0, 0, 0.265, 1.00);
}
.drop-help {
ul {
padding-left: $spacer;
}
a {
text-decoration: underline;
color: $white;
&:hover {
color: darken($white, 10%);
}
}
}

View File

@ -1,8 +1 @@
.panel-text-content {
ul {
margin: 0 0 $spacer $spacer * 1.5;
}
li {line-height: 2;}
a { color: $external-link-color; }
}

View File

@ -37,32 +37,6 @@
overflow: hidden;
}
.plugin-markdown-readme {
img {
max-width: 100%;
}
ul {
padding-left: $spacer*1.5;
margin-bottom: $spacer*2;
}
table {
td, th {
padding: $spacer*.5 $spacer;
}
th {
font-weight: normal;
background: $table-bg-accent;
}
}
table, th, td {
border: 1px solid $table-border;
border-collapse: collapse;
}
}
.get-more-plugins-link {
color: $text-muted;
font-size: $font-size-sm;