From 373ec23bbc7d5fbe952bd802102927e8a0eb9c7b Mon Sep 17 00:00:00 2001
From: Luc Didry
Date: Thu, 20 Feb 2014 11:40:31 +0100
Subject: [PATCH] Add possibility to display a message on all LUTIm pages
---
README.md | 9 +++++++++
lutim.conf.template | 1 +
templates/layouts/default.html.ep | 5 +++++
3 files changed, 15 insertions(+)
diff --git a/README.md b/README.md
index a03ab6a..a06f9a1 100644
--- a/README.md
+++ b/README.md
@@ -55,6 +55,7 @@ vi lutim.conf
* https: 1 if you want to provide secure images URLs (default is 0) ;
* stats\_day\_num: when you generate statistics with `script/lutim cron stats`, you will have stats for the last `stats_day_num` days (default is 365) ;
* keep\_ip\_during: when you delete IP addresses of image's senders with `script/lutim cron cleanbdd`, the IP addresses of images older than `keep_ip_during` days will be deleted (default is 365) ;
+* broadcast\_message: put some string (not HTML) here and this message will be displayed on all LUTIm pages (not in JSON responses)
##Usage
```
@@ -125,6 +126,14 @@ If the files directory go under quota, the `stop-upload` file is deleted. If you
carton exec script/lutim cron watch
```
+##Broadcast message
+Set a string in the `broadcast_message` option of `lutim.conf` and reload the server with:
+```shell
+carton exec hypnotoad script/lutim
+```
+
+It may take a few reload before the message is displayed.
+
##Shutter integration
See where Shutter () keeps its plugins on your computer.
On my computer, it's in `/usr/share/shutter/resources/system/upload_plugins/upload`.
diff --git a/lutim.conf.template b/lutim.conf.template
index 772bd3f..495d6ac 100644
--- a/lutim.conf.template
+++ b/lutim.conf.template
@@ -20,4 +20,5 @@
#keep_ip_during => 365, # optional, number of days, after that delay, the IP addresses of image creators will be deleted (used with script/lutim cron cleanbdd)
#max_total_size => 10*1024*1024*1024, # optional, maximum total size of the files directory (used with script/lutim cron watch)
#policy_when_full => 'warn', # optional, policy when files directory is over max_total_size. Valid values are 'warn', 'stop-upload' and 'delete'. See README.
+ #broadcast_message => 'Maintenance', #optional, the broadcast_message is displayed on all pages of LUTIm (but no in json response)
};
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 026546f..ffac184 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -60,6 +60,11 @@
+% if (defined($config->{broadcast_message})) {
+
+ <%= $config->{broadcast_message} %>
+
+% }
% if (defined(stash('stop_upload'))) {
<%= stash('stop_upload') %>