Another cache header fix

This commit is contained in:
Torkel Ödegaard
2015-03-24 17:16:13 +01:00
parent a5c3855233
commit 7919d79347
4 changed files with 30 additions and 2 deletions
+2 -2
View File
@@ -66,12 +66,12 @@ func newMacaron() *macaron.Macaron {
func mapStatic(m *macaron.Macaron, dir string, prefix string) {
headers := func(c *macaron.Context) {
c.Resp.Header().Set("Cache-Control", "public max-age: 3600")
c.Resp.Header().Set("Cache-Control", "public, max-age: 3600")
}
if setting.Env == setting.DEV {
headers = func(c *macaron.Context) {
c.Resp.Header().Set("Cache-Control", "max-age: 0")
c.Resp.Header().Set("Cache-Control", "max-age: 0, must-revalidate")
}
}
+8
View File
@@ -168,4 +168,12 @@ function (angular, app, _, config) {
};
});
module.directive('panelGhostPanel', function() {
return function(scope, element) {
var dropZoneSpan = 12 - scope.dashboard.rowSpan(scope.row);
element.find('.panel-container').css('height', scope.row.height);
element[0].style.width = ((dropZoneSpan / 1.2) * 10) + '%';
};
});
});
+8
View File
@@ -86,6 +86,14 @@
<panel-loader type="panel.type" class="panel-margin"></panel-loader>
</div>
<div panel-ghost-panel class="panel ghost-panel panel-margin">
<div class="panel-container">
<div style="text-align: center">
<h2>Add panel</h2>
</div>
</div>
</div>
<div panel-drop-zone class="panel panel-drop-zone"
ui-on-drop="onDrop($data, row)"
data-drop="true">
+12
View File
@@ -169,6 +169,18 @@
}
}
.ghost-panel {
&:hover {
.panel-container {
visibility: visible;
}
}
.panel-container {
visibility: hidden;
border: 1px solid @grayDark;
}
}
.panel-time-info {
font-weight: bold;
float: right;