Changeset 5116 for MILK


Ignore:
Timestamp:
18/03/09 17:06:26 (10 years ago)
Author:
cbyrom
Message:

Improve MILK configuration file, to simplify switching on/off the
browse/discovery/editor modes + improve look and feel - according
to mode of operation (inc. add new logos) + remove some obsolete
functionality + hide functions not relevant to the selected mode of
operation.

Location:
MILK/trunk/milk_server/milk_server
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r5111 r5116  
    4545        self.globals.icons_R=cf.get('RELATED','icon') 
    4646        self.globals.icons_key=cf.get('layout','key') 
    47         debugMode = cf.get('DEFAULT','debug') or False 
    48         if debugMode and debugMode.lower == 'true': 
    49             debugMode = True 
    50         self.globals.debugModeOn = debugMode 
     47        self.globals.debugModeOn = \ 
     48            self.__getTrueFalseValue(cf.get('DEFAULT','debug'))  
    5149         
    52         editModeOn = cf.get('ATOM_EDITOR','enabled') or False 
    53         if editModeOn and editModeOn.lower == 'true': 
    54             editModeOn = True 
    55         self.globals.atomEditorEnabled = editModeOn  
     50        self.globals.atomEditorEnabled = \ 
     51            self.__getTrueFalseValue(cf.get('MILK_SERVER','editorOn'))  
     52 
     53        self.globals.browseEnabled = \ 
     54            self.__getTrueFalseValue(cf.get('MILK_SERVER','browseOn'))  
     55 
     56        self.globals.discoveryEnabled = \ 
     57            self.__getTrueFalseValue(cf.get('MILK_SERVER','discoveryOn'))  
    5658 
    5759        self.globals.wmcClientURL = cf.get('WMC_CLIENT','url') 
     
    163165        self.__setUpHelpText(g) 
    164166 
     167    def __getTrueFalseValue(self, val): 
     168        ''' 
     169        Check for config values that could be true/false in a consistent manner 
     170        @param val: value read from config object 
     171        @return True, if val is some form of 'true' 
     172        ''' 
     173        if val and val.lower() == 'true': 
     174            return True 
     175        return False 
    165176 
    166177    def __setUpHelpText(self, g): 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/atomeditorcontroller.py

    r5111 r5116  
    2828        ''' 
    2929        # check the editor is enabled first 
    30         if g.atomEditorEnabled != 'True': 
     30        if not g.atomEditorEnabled: 
    3131            logging.info("Editor not enabled - cannot edit atoms - redirect to 'view' mode") 
    3232            return h.redirect_to(h.url_for('discovery')) 
  • MILK/trunk/milk_server/milk_server/public/layout/style/ndg2.css

    r4727 r5116  
    6161 * !WARNING: the background image needs setting to match any proxy configuration. 
    6262 */ 
    63  
    64 #header { 
     63#editorheader { 
    6564 height: 100px; 
    6665 background: #fff; 
     
    6867 border: solid #333333; 
    6968 border-width: 0 0 2px 0; 
    70  background-image:url(/layout/icons/header_image.jpg);background-position:right;background-repeat:repeat-x;} 
     69 background-image:url(/layout/icons/header_image.jpg);background-position:right;background-repeat:repeat-x; 
     70} 
     71 
     72#browseheader { 
     73background:#BFE2F9 url(/layout/icons/bannerBackground_1300_120_browse_1.png) no-repeat scroll right center; 
     74border-color:#333333; 
     75border-style:solid; 
     76border-width:0pt 0pt 2px; 
     77height:100px; 
     78padding:0pt; 
     79} 
    7180 
    7281#logo{ 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/atom_editor.html

    r5111 r5116  
    5757                            <h3>  $c.title </h3> 
    5858                                ${Markup(h.form(h.url_for(controller='atom_editor/editatom', action='edit', uri=c.atom.ndgURI)))} 
    59                                         <input py:if="not c.saveLink and g.atomEditorEnabled == 'True'" name="Edit" type="submit" value="Edit" /> 
     59                                        <input py:if="not c.saveLink and g.atomEditorEnabled" name="Edit" type="submit" value="Edit" /> 
    6060                                ${Markup(h.end_form())} 
    6161                                ${Markup(h.form(h.url_for(controller='atom_editor/editatom', action='delete', uri=c.atom.ndgURI)))} 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/layout.html

    r4999 r5116  
    2929 
    3030      <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    31           <span py:with="panelTab = select('panelTab/text()')" py:strip=""> 
    32             <py:if test="panelTab"> 
    33               <div py:replace="PageTabs(panelTab)"/> 
    34             </py:if> 
    35           </span> 
    36       <div py:replace="searchOneLine()"/> 
    37  
     31      <div py:if="g.discoveryEnabled"> 
     32                  <span py:with="panelTab = select('panelTab/text()')" py:strip=""> 
     33                    <py:if test="panelTab"> 
     34                      <div py:replace="PageTabs(panelTab)"/> 
     35                    </py:if> 
     36                  </span> 
     37              <div py:replace="searchOneLine()"/> 
     38          </div> 
    3839      <div id="content"> 
    3940                <table py:if="g.atomEditorEnabled and c.title != ATOM_HOME_TITLE" class="homeHelpBar"> 
  • MILK/trunk/milk_server/milk_server/templates/browse/advanced.kid

    r4487 r5116  
    3636    <body onload="initOLMapBox()"> 
    3737    <div id="entirepage"> 
    38         <div py:replace="header1(0)"/> 
     38        <div py:replace="header()"/> 
    3939        <div py:replace="PageTabs('Search')"/> 
    4040        <div class="outer"> 
  • MILK/trunk/milk_server/milk_server/templates/ndgPage.html

    r4984 r5116  
    1313        <link media="all, screen" href="$g.server/layout/style/ndg2.css" type="text/css" rel="stylesheet"/> 
    1414    </head> 
    15  
    16     <div py:def="header1(searchBox)"> 
    17         <div id="header"/> 
    18         <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    19     </div> 
    2015     
    2116    <div py:def="header()"> 
    22         <div id="header"/> 
     17        <div py:if="g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled" id="browseheader"/> 
     18        <div py:if="not (g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled)" id="editorheader"/> 
    2319        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    2420    </div> 
     
    116112                </td> 
    117113                <td width="40%" align="center"> 
    118                     <div py:if="not g.standalone" id="loginStatus"> 
    119                         <!--! now we choose one of the next two (logged in or not) --> 
    120                         <div py:if="'ndgSec' in session"><table><tbody><tr><td>  
    121                         User [${session['ndgSec']['u']}] logged in at  
    122                         ${session['ndgSec']['org']} with roles  
    123                         [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td> 
    124                         &nbsp;<span py:replace="logOut()"/></td></tr></tbody></table></div> 
    125                         <div py:if="'ndgSec' not in session">Further services may be available if you can 
    126                             <span py:replace="logIn()"/></div> 
    127                     </div> 
    128114                </td> 
    129115                <td align="right"><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td> 
  • MILK/trunk/milk_server/milk_server/templates/ndgPage.kid

    r4472 r5116  
    1313        <link media="all, screen" href="$g.server/layout/style/ndg2.css" type="text/css" rel="stylesheet"/> 
    1414    </head> 
    15  
    16     <div py:def="header1(searchBox)"> 
    17         <div id="header"/> 
    18         <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    19     </div> 
    2015     
    2116    <div py:def="header()"> 
    22         <div id="header"/> 
     17        <div py:if="g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled" id="browseheader"/> 
     18        <div py:if="not (g.browseEnabled and not g.discoveryEnabled and not g.atomEditorEnabled)" id="editorheader"/> 
    2319        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    2420    </div> 
Note: See TracChangeset for help on using the changeset viewer.