source: trunk/www/my_base/user/reset_filters.jsp @ 5900

Last change on this file since 5900 was 5900, checked in by Nicklas Nordborg, 11 years ago

References #1655: GUI improvements

  • Added a CacheControlFilter which can be configured to disable caching for certain file types. This is very useful in a development environment, but not recommended in production.
  • Redesigned buttons with rounded corners.


  • Use more modern css rules for buttons and button groups. Got rid of "align" attribute that is deprecated in html.


  • Place buttons in popup dialogs using coordinates

relative to the bottom of the dialog so that they follow along if the dialog is resized. Only the popups in the "BASE" menu has been fixed so far.

Due to changes in css files, some other layout is now really "ugly", but this will be fixed later...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.6 KB
Line 
1<%-- $Id: reset_filters.jsp 5900 2011-12-07 13:43:15Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
5  Copyright (C) 2007 Johan Enell, Nicklas Nordborg, Martin Svensson
6
7  This file is part of BASE - BioArray Software Environment.
8  Available at http://base.thep.lu.se/
9
10  BASE is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 3
13  of the License, or (at your option) any later version.
14
15  BASE is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with BASE. If not, see <http://www.gnu.org/licenses/>.
22  ------------------------------------------------------------------
23
24--%>
25<%@ page pageEncoding="UTF-8" session="false"
26  import="net.sf.basedb.core.SessionControl"
27  import="net.sf.basedb.core.Item"
28  import="net.sf.basedb.core.ItemContext"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.User"
31  import="net.sf.basedb.clients.web.Base"
32  import="net.sf.basedb.clients.web.util.HTML"
33  import="net.sf.basedb.util.Values"
34  import="net.sf.basedb.util.ToStringComparator"
35  import="net.sf.basedb.util.NestedIterator"
36  import="java.util.Iterator"
37  import="java.util.List"
38  import="java.util.Set"
39  import="java.util.TreeSet"
40  import="java.util.HashSet"
41  import="java.util.Arrays"
42%>
43<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
44<%
45final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
46final String ID = sc.getId();
47final float scale = Base.getScale(sc);
48final String activePage = request.getParameter("page");
49final DbControl dc = sc.newDbControl();
50try
51{
52  final User user = User.getById(dc, sc.getLoggedInUserId());
53  final List<ItemContext> inMemory = sc.getAllCurrentContexts(true, false);
54  final List<ItemContext> inDatabase = sc.getAllCurrentContexts(false, true);
55  final Set<Item> items = new TreeSet<Item>(new ToStringComparator<Item>(false));
56  final Set<Item> dbOnly = new HashSet<Item>();
57  Iterator<ItemContext> it = new NestedIterator(inMemory, inDatabase);
58  for (ItemContext ctx : inMemory)
59  {
60    if (ctx.getNumPropertyFilters() > 0 || ctx.getSortProperty() != null)
61    {
62      items.add(ctx.getItemType());
63    }
64  }
65  for (ItemContext ctx : inDatabase)
66  {
67    if (ctx.getNumPropertyFilters() > 0 || ctx.getSortProperty() != null)
68    {
69      if (items.add(ctx.getItemType())) dbOnly.add(ctx.getItemType());
70    }
71  }
72  %>
73  <base:page type="popup" title="<%="Reset list settings for "+HTML.encodeTags(user.getName())%>">
74  <base:head>
75    <script language="JavaScript">
76    function resetFilters()
77    {
78      var frm = document.forms['preferences'];
79      frm.submit();
80    }
81    function itemTypeOnChange()
82    {
83      var frm = document.forms['preferences'];
84      var dbOnly = frm.item_type[frm.item_type.selectedIndex].text.indexOf('*') >= 0;
85      frm.database.checked = dbOnly;
86    }
87    </script>
88  </base:head>
89  <base:body>
90  <p>
91
92  <form action="submit_user.jsp?ID=<%=ID%>" method="post" name="preferences" 
93    onsubmit="return false;">
94  <input type=hidden name="cmd" value="ResetFilters">
95
96  <h3 class="docked">Reset list settings for <%=HTML.encodeTags(user.getName())%> 
97    <base:help helpid="userpreferences.resetfilters" /></h3>
98  <div class="boxed">
99
100    <table class="form" cellspacing=0>
101    <tr>
102      <td class="prompt">Which list?</td>
103      <td>
104        <select name="item_type" onchange="itemTypeOnChange()">
105          <option value="">- all -
106          <%
107          for (Item item : items)
108          {
109            %>
110            <option value="<%=item.name()%>"><%=dbOnly.contains(item) ? "* " : "" %><%=item%>
111            <%
112          }
113          %>
114        </select><br>
115        * = This setting is only in the database
116      </td>
117    </tr>
118    <tr>
119      <td class="prompt">Location</td>
120      <td>
121      <input type="checkbox" name="memory" id="memory" value="1" checked disabled>In-memory<br>
122      <input type="checkbox" name="database" id="database" value="1"><label for="database">In-database</label>
123      </td>
124    </tr>
125    </table>
126    <p>
127    Use this functionality if you are experiencing problems when listing
128    items on a list page. Try first with only the 'In-memory' option selected.
129    If that doesn't help, try the 'In-database' option.
130  </div>
131  </form>
132 
133    <base:buttongroup subclass="dialogbuttons">
134      <base:button onclick="resetFilters();" title="Ok" />
135      <base:button onclick="window.close();" title="Cancel" />
136    </base:buttongroup>
137  </base:body>
138  </base:page>
139  <%
140}
141finally
142{
143  if (dc != null) dc.close();
144}
145%>
Note: See TracBrowser for help on using the repository browser.