Changeset 1548 for trunk


Ignore:
Timestamp:
Feb 22, 2011, 3:45:25 PM (9 years ago)
Author:
robert@…
Message:

Preparation for using a simple wizard: some changes in tag libraries in order to make them more generic

Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy

    r1527 r1548  
    110110        def matchvalue = (attrs['fuzzymatching']=="true") ? attrs['matchvalue'] : ""
    111111        def selected = (attrs['selected']) ? attrs['selected'] : ""
     112                def fuzzyTreshold = attrs[ 'treshold' ] && attrs[ 'treshold' ].toString().isNumber() ? Float.valueOf( attrs[ 'treshold' ] ) : 0.1;
    112113
    113114        def domainfields = mc.entityclass.giveDomainFields().findAll { it.type == mc.templatefieldtype }
     
    125126                /*(mc.identifier) ? out << createPropertySelect(attrs['name'], prefcolumn, matchvalue, mc.index) :
    126127                        out << createPropertySelect(attrs['name'], templatefields, matchvalue, mc.index)*/
    127          out << createPropertySelect(attrs['name'], templatefields, matchvalue, selected, mc.index)
     128               
     129         out << createPropertySelect(attrs['name'], templatefields, matchvalue, selected, mc.index, fuzzyTreshold)
    128130        }
    129131
     
    137139         * @return HTML select object
    138140         */
    139         def createPropertySelect(String name, options, matchvalue, selected, Integer columnIndex) {
     141        def createPropertySelect(String name, options, matchvalue, selected, Integer columnIndex, float fuzzyTreshold = 0.1f) {
    140142                // Determine which field in the options list matches the best with the matchvalue
    141                 def mostsimilar = (matchvalue) ? ImporterService.mostSimilar(matchvalue, options) : ""
    142 
     143                def mostsimilar = (matchvalue) ? ImporterService.mostSimilar(matchvalue, options, fuzzyTreshold) : ""
     144               
    143145                def res = "<select style=\"font-size:10px\" id=\"${name}.index.${columnIndex}\" name=\"${name}.index.${columnIndex}\">"
    144146
     
    150152                        // mostsimilar string passed as argument or selected value passed?
    151153            res += (mostsimilar.toString().toLowerCase() == f.name.toLowerCase() || selected.toLowerCase() == f.name.toLowerCase() ) ?
    152                                 " selected>" :
     154                                " selected='selected'>" :
    153155                                ">"
    154156           
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r1545 r1548  
    186186
    187187        def _publicationAddButton = { attrs, body ->
    188 
     188               
     189                if( attrs.get( 'noForm', false ) ) {
     190                        // Only show the add button. The dialog that is created with this method otherwise,
     191                        // should be created somewhere outside the form.
     192                } else {
     193                        out << publicationDialog( attrs, body );
     194                }
     195       
     196                out << '<input type="button" onClick="openPublicationDialog(\'' + attrs.name + '\' );" value="Add Publication">';
     197        }
     198       
     199        // Show the add publications dialog
     200        def publicationDialog = { attrs, body ->
    189201                // Output the dialog for the publications
    190202                out << '<div id="' + attrs.name + '_dialog">';
     
    195207                out << '  createPublicationDialog( "' + attrs.name + '" );'
    196208                out << '</script>';
    197 
    198                 out << '<input type="button" onClick="openPublicationDialog(\'' + attrs.name + '\' );" value="Add Publication">';
    199         }
     209        }
     210       
    200211
    201212        def ContactSelectElement = { attrs, body ->
     
    421432
    422433        def _userAddButton = { attrs, body ->
    423 
     434                if( attrs.get( 'noForm', false ) ) {
     435                        // Only show the add button. The dialog that is created with this method otherwise,
     436                        // should be created somewhere outside the form.
     437                } else {
     438                        out << userDialog( attrs, body );
     439                }
     440
     441                out << '<input type="button" onClick="openUserDialog(\'' + attrs.name + '\' );" value="Add User">';
     442        }
     443       
     444        def userDialog = { attrs, body ->
    424445                // Output the dialog for the publications
    425446                out << '<div id="' + attrs.name + '_dialog">';
     
    430451                out << '  createUserDialog( "' + attrs.name + '" );'
    431452                out << '</script>';
    432 
    433                 out << '<input type="button" onClick="openUserDialog(\'' + attrs.name + '\' );" value="Add User">';
    434453        }
    435454
  • trunk/grails-app/views/advancedQuery/assayresults.gsp

    r1526 r1548  
    55        <title>Query results</title>
    66        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     7        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    78        <g:javascript src="advancedQueryResults.js" />
    89</head>
  • trunk/grails-app/views/advancedQuery/index.gsp

    r1526 r1548  
    55        <title>Query database</title>
    66        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     7        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    78        <g:javascript src="advancedQuery.js" />
    89        <script type="text/javascript">
  • trunk/grails-app/views/advancedQuery/list.gsp

    r1526 r1548  
    66        <title>Previous queries</title>
    77        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     8        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    89        <g:javascript src="advancedQueryResults.js" />
    910        <script type="text/javascript">
  • trunk/grails-app/views/advancedQuery/results.gsp

    r1526 r1548  
    55        <title>Query results</title>
    66        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     7        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    78        <g:javascript src="advancedQueryResults.js" />
    89</head>
  • trunk/grails-app/views/advancedQuery/sampleresults.gsp

    r1526 r1548  
    55        <title>Query results</title>
    66        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     7        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    78        <g:javascript src="advancedQueryResults.js" />
    89</head>
  • trunk/grails-app/views/advancedQuery/studyresults.gsp

    r1526 r1548  
    55        <title>Query results</title>
    66        <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/>
     7        <link rel="stylesheet" href="<g:resource dir="css" file="buttons.css" />" type="text/css"/>
    78        <g:javascript src="advancedQueryResults.js" />
    89</head>
  • trunk/web-app/css/advancedQuery.css

    r1526 r1548  
    3535        -khtml-opacity: 0.3;
    3636}
    37        
    38 /** Options buttons **/
    39 .options { margin-top: 8px; }
    40 .options.multiple { float: left; width: 300px; }
    41 
    42 .options a {
    43         font-size: 10px;
    44         font-weight: bold;
    45         margin-right: 10px;
    46         padding-top: 2px;
    47         padding-bottom: 2px;
    48         line-height: 20px;
    49         padding-left: 28px;     
    50 }
    51 
    52 #content .options a.disabled { color: #aaa; cursor: default; }
    53 
    54 .options a.performAction {
    55         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/brick_go.png) 5px 50% no-repeat;
    56 }
    57 .options a.excel {
    58         background-image: url(../plugins/famfamfam-1.0.1/images/icons/page_excel.png);
    59 }
    60 .options a.searchIn {
    61         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/arrow_branch.png) 5px 50% no-repeat;
    62 }
    63 .options a.search {
    64         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/arrow_undo.png) 5px 50% no-repeat;
    65 }
    66 .options a.discard {
    67         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/basket_remove.png) 5px 50% no-repeat;
    68 }
    69 .options a.listPrevious {
    70         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/basket.png) 5px 50% no-repeat;
    71 }
    72 .options a.combine {
    73         background: transparent url(../plugins/famfamfam-1.0.1/images/icons/arrow_join.png) 5px 50% no-repeat;
    74 }
  • trunk/web-app/css/default_style.css

    r1494 r1548  
    7575        font-size: 1.2em;
    7676        background: url(../images/default_style/topnav/topnav_bg.gif) repeat-x;
    77         z-index: 1005; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
     77        z-index: 995; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
    7878}
    7979
     
    8383        padding: 0 15px 0 0;
    8484        position: relative; /*--Declare X and Y axis base--*/
    85         z-index: 1004; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
     85        z-index: 994; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
    8686}
    8787
     
    132132        -webkit-border-bottom-right-radius: 5px;
    133133        border: 1px solid #111;
    134         z-index: 1001; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
     134        z-index: 991; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
    135135}
    136136
     
    143143        width: 170px;
    144144        position:relative;
    145         z-index: 1000; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
     145        z-index: 990; /** Important: keeps submenu's on top of other elements in IE7. See http://www.shawnpreisz.com/css/z-index-internet-explorer-7-ie7#comment-547 */
    146146}
    147147
  • trunk/web-app/js/advancedQueryResults.js

    r1524 r1548  
    55       
    66        var oTable = paginatedTable.dataTable();
    7         var inputs = $('input', oTable.fnGetNodes())
     7        var inputs = $('input[type=checkbox]', oTable.fnGetNodes())
    88       
    99        // If any of the inputs is checked, uncheck all. Otherwise, check all
     
    3131       
    3232        var oTable = paginatedTable.dataTable();
    33         var inputs = $('input', oTable.fnGetNodes())
     33        var inputs = $('input[type=checkbox]', oTable.fnGetNodes())
    3434       
    3535        // Is none checked, are all checked or are some checked
     
    4343        checkAll.attr( 'checked', numChecked > 0 );
    4444       
    45         if( numChecked > 0 && numChecked < inputs.length - 1 ) {
     45        if( numChecked > 0 && numChecked < inputs.length ) {
    4646                checkAll.addClass( 'transparent' );
    4747        } else {
Note: See TracChangeset for help on using the changeset viewer.