Browse code

Allow replacing GitList's title by another defined in config.ini

Cyriaque Skrapits authored on06/30/2014 15:28:17
Showing4 changed files
... ...
@@ -15,6 +15,7 @@ repositories[] = '/home/git/repositories/' ; Path to your repositories
15 15
 debug = false
16 16
 cache = true
17 17
 theme = "default"
18
+title = ""
18 19
 
19 20
 ; If you need to specify custom filetypes for certain extensions, do this here
20 21
 [filetypes]
... ...
@@ -33,6 +33,7 @@ class Application extends SilexApplication
33 33
         $this['debug'] = $config->get('app', 'debug');
34 34
         $this['date.format'] = $config->get('date', 'format') ? $config->get('date', 'format') : 'd/m/Y H:i:s';
35 35
         $this['theme'] = $config->get('app', 'theme') ? $config->get('app', 'theme') : 'default';
36
+        $this['title'] = $config->get('app', 'title') ? $config->get('app', 'title') : 'GitList';
36 37
         $this['filetypes'] = $config->getSection('filetypes');
37 38
         $this['binary_filetypes'] = $config->getSection('binary_filetypes');
38 39
         $this['cache.archives'] = $this->getCachePath() . 'archives';
... ...
@@ -2,7 +2,7 @@
2 2
 <html lang="en">
3 3
     <head>
4 4
         <meta charset="UTF-8" />
5
-        <title>{% block title %}Welcome!{% endblock %}</title>
5
+        <title>{{ app.title }}{% if app.title %} - {% endif %}{% block title %}Welcome!{% endblock %}</title>
6 6
         <link rel="stylesheet" type="text/css" href="{{ app.request.basepath }}/themes/{{ app.theme }}/css/style.css">
7 7
         <link rel="shortcut icon" type="image/png" href="{{ app.request.basepath }}/themes/{{ app.theme }}/img/favicon.png" />
8 8
         <!--[if lt IE 9]>
... ...
@@ -6,7 +6,7 @@
6 6
                 <span class="icon-bar"></span>
7 7
                 <span class="icon-bar"></span>
8 8
             </a>
9
-            <a class="brand" href="{{ path('homepage') }}">GitList</a>
9
+            <a class="brand" href="{{ path('homepage') }}">{{ app.title }}</a>
10 10
             <div class="nav-collapse">
11 11
                 <ul class="nav pull-right">
12 12
                     <li><a href="http://gitlist.org/">About</a></li>