Changeset 8473 for mauRepo/MolesManager


Ignore:
Timestamp:
20/07/12 12:28:05 (7 years ago)
Author:
gparton
Message:

Updated search page to give something a little more meaningful in the results. Now has the title field as a link to the appropriate object with the description below.

Location:
mauRepo/MolesManager/trunk/src/MolesManager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/MolesManager/settings.py

    r8433 r8473  
    11# Django settings for MolesManager project. 
    22import os 
     3 
    34 
    45def decodeRelativePath(relPath): 
  • mauRepo/MolesManager/trunk/src/MolesManager/static/templates/cedaSearchResults.html

    r8296 r8473  
    2828            <thead> 
    2929                <tr> 
    30                     <th>Location</th> 
    31                     <th>Id</th> 
    32                     <th>Author</th> 
     30                    <th>Title</th> 
    3331                </tr> 
    3432            </thead> 
    3533        <tbody>   
    36         {% for location, id, auth  in searchResults %} 
     34        {% for location, description, title  in searchResults %} 
    3735                <tr bgcolor="white"> 
    38                         <td>{{ location }}</td> 
    39                         <td><a href="{{ location }}">{{ id }}</a></td> 
    40                         <td>{{ auth }}</td> 
     36                        <td><a href="{{ location }}">{{ title }}</a></td> 
     37                </tr> 
     38                <tr bgcolor=#66CCFF> 
     39                        <td>{{ description }}</td> 
    4140                </tr>    
    4241        {% endfor %} 
  • mauRepo/MolesManager/trunk/src/MolesManager/views/cedaSearch.py

    r8445 r8473  
    2323        @return: the first Observation or None  
    2424        ''' 
    25     obsevations = request.moles3EPB.extractObservationByTitleKeywords(keywords)  
     25    observations = request.moles3EPB.extractObservationByTitleKeywords(keywords)  
    2626    titles = [] 
    2727    ids = [] 
    2828    list_list = [] 
    2929    baseCov = "http://" + request.get_host() + "/cov/" 
    30     for o in obsevations: 
     30    for o in observations: 
    3131        a = "".join([baseCov, str(o.id)]) 
    3232        try: 
    33             responsibleAuthors = request.moles3EPB.observationAuthor(o) 
    34             if responsibleAuthors is not None: 
    35                 list_list.append((a, o.description, _appendAuthors(responsibleAuthors))) 
     33            if o.identifier[0].code is not None: 
     34                list_list.append((a, o.identifier[0].code, o.description)) 
    3635        except Exception as e: 
    3736            print e 
Note: See TracChangeset for help on using the changeset viewer.