source: trunk/www/admin/server/broadcast.jsp @ 5902

Last change on this file since 5902 was 5902, checked in by Nicklas Nordborg, 10 years ago

References #1655: GUI improvements

  • Make sure content on dialog can be placed so that it fills the free space between the title and buttons.


  • The 'Logout' dialog is easy and provides the simple case where everything is centered in the remaining space. Should also work when resizing the dialog.


  • The 'Reset filters' and 'Broadcast message' dialogs need a bit more work. The look ok now, but there are some minor things to fix yet.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.0 KB
Line 
1<%-- $Id: broadcast.jsp 5902 2011-12-08 14:01:38Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2008 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 3
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with BASE. If not, see <http://www.gnu.org/licenses/>.
20  ------------------------------------------------------------------
21
22  @author Nicklas
23--%>
24<%@ page pageEncoding="UTF-8" session="false"
25  import="net.sf.basedb.core.SessionControl"
26  import="net.sf.basedb.core.DbControl"
27  import="net.sf.basedb.core.Client"
28  import="net.sf.basedb.core.User"
29  import="net.sf.basedb.core.ClientDefaultSetting"
30  import="net.sf.basedb.core.Permission"
31  import="net.sf.basedb.clients.web.util.HTML"
32  import="net.sf.basedb.util.Values"
33  import="net.sf.basedb.clients.web.Base"
34%>
35<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
36
37<%
38final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
39final String ID = sc.getId();
40final float scale = Base.getScale(sc);
41final DbControl dc = sc.newDbControl();
42
43try
44{
45  final Client server = Client.getById(dc, sc.getClientId());
46  final boolean writePermission = server.hasPermission(Permission.WRITE);
47 
48  String title = (String)application.getAttribute("broadcast.title");
49  String message = (String)application.getAttribute("broadcast.message");
50  Boolean denyLogin = (Boolean)application.getAttribute("broadcast.deny-login");
51  %>
52  <base:page type="popup" title="Broadcast message">
53  <base:head>
54  <script language="JavaScript">
55  // Submit the form
56  function saveSettings()
57  {
58    var frm = document.forms["broadcast"];
59    frm.submit();
60  }
61  function clearMessage()
62  {
63    var frm = document.forms["broadcast"];
64    frm.denyLogin.checked = false;
65    frm.title.value = '';
66    frm.message.value = '';
67  }
68  function init()
69  {
70    var frm = document.forms["broadcast"];
71    frm.title.focus();   
72  }
73  </script>
74
75  </base:head>
76  <base:body onload="init()">
77    <h1>Broadcast message <base:help helpid="broadcast.message"/></h1>
78    <form name="broadcast" action="submit_server.jsp" method="post" onsubmit="return false;">
79    <input type="hidden" name="ID" value="<%=ID%>">
80    <input type="hidden" name="cmd" value="SetBroadcastMessage">
81 
82    <div class="content">
83    <%
84    if (!writePermission)
85    {
86      %>
87      <table class="fullcc"><tr><td>
88      <div class="error">You do not have permission to broadcast messages to users.</div>
89      </td></tr></table>
90      <%
91    }
92    else
93    {
94      %>
95      <table class="fullform smaller">
96      <tr>
97        <th>Title</td>
98        <td>
99          <input class="text" style="width: 98%;"
100            type="text" name="title" value="<%=HTML.encodeTags(title)%>" maxlength="255">
101        </td>
102        <td></td>
103      </tr>
104      <tr>
105        <th>Disable login</td>
106        <td>
107          <input type="checkbox" name="denyLogin" <%=Boolean.TRUE.equals(denyLogin) ? "checked": ""%> value="1">
108        </td>
109        <td></td>
110      </tr>
111      <t>
112        <th>Message</td>
113        <td>
114          <textarea class="text" style="width: 98%;" rows="15" name="message" wrap="virtual"><%=HTML.encodeTags(message)%></textarea>
115        </td>
116        <td style="width: 20px;">
117          <a href="javascript:Main.zoom('Message', 'broadcast', 'message')" title="Edit in larger window"><base:icon image="zoom.gif" /></a>
118        </td>
119      </tr>
120      </table>
121      <%
122    }
123    %>
124    </div>
125
126    </form>
127    <base:buttongroup subclass="dialogbuttons">
128      <base:button onclick="clearMessage()" image="remove.png" title="Clear message" />
129      <base:button onclick="saveSettings();" title="Ok" visible="<%=writePermission%>"/>
130      <base:button onclick="window.close();" title="Cancel" />
131    </base:buttongroup>
132  </base:body>
133  </base:page>
134  <%
135}
136finally
137{
138  if (dc != null) dc.close();
139}
140%>
141
Note: See TracBrowser for help on using the repository browser.