1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2014 Alexis Laferrière <alexis.laf@xymus.net>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # View logic of the Web interface Benitlux
23 # Template for the whole Benitlux page
24 class BenitluxDocument
28 var page_title
= "Benitlux Mailing List" is writable
31 fun header
: Template do return new BenitluxHeader
33 # Error or success message content, will be shown in a dismissable panel
34 var message_content
: nullable String = null is writable
36 # Error or success message level (success/danger/warning/info)
37 var message_level
: nullable String = null is writable
39 # Lines of the last email sent to subscribers
40 var sample_email_lines
: nullable Array[String] = null is writable
48 <meta charset="utf-8">
49 <meta http-equiv="X-UA-Compatible" content="IE=edge">
50 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
51 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
52 <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
61 <div class="container">
63 <div class="panel panel-default">
64 <div class="panel-body">
65 <p>Service de diffusion des changements au menu de l'excellente
66 <a href="http://www.brasseriebenelux.com/">Brasserie Bénélux</a>
67 sur la rue Sherbrooke. La liste est mise à jours tous les jours à 14h,
68 le courriel est envoyé au même moment.</p>
69 <form class="form-inline text-center" role="form" method="POST">
70 <div class="form-group">
71 <div class="input-group">
72 <div class="input-group-addon">@</div>
73 <input class="form-control" type="email" name="email" placeholder="Enter email">
76 <button type="submit" class="btn btn-default" name="sub">S'inscrire</button>
77 <button type="submit" class="btn btn-default" name="unsub">Se désinscrire</button>
83 var message_level
= message_level
84 var message_content
= message_content
85 if message_level
!= null and message_content
!= null then
87 <div class="alert alert-{{{message_level}}} alert-dismissible" role="alert">
88 <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
94 var sample_email_lines
= sample_email_lines
95 if sample_email_lines
!= null then
97 <div class="panel panel-default">
98 <div class="panel-heading">Dernier courriel envoyé</div>
99 <ul class="list-group">
100 <li class="list-group-item">
101 {{{sample_email_lines.join("</li><li class=\"list-group-item\">")}}}
114 # Template for the header of Benitlux (right after the opening of `<body>`)
121 <nav class="navbar navbar-default" role="navigation">
122 <div class="container-fluid">
123 <div class="navbar-header">
124 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
125 <span class="sr-only">Toggle navigation</span>
126 <span class="icon-bar"></span>
127 <span class="icon-bar"></span>
128 <span class="icon-bar"></span>
130 <a class="navbar-brand" href="http://xymus.net/">Xymus.net</a>
133 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
134 <ul class="nav navbar-nav">
135 <li><a href="http://pep8.xymus.net/">Pep/8 Analysis</a></li>
136 <li><a href="http://tnitter.xymus.net/">Tnitter</a></li>
137 <li class="active"><a href="http://benitlux.xymus.net/">Benitlux</a></li>