Changeset 17125


Ignore:
Timestamp:
02/17/12 09:29:11 (2 years ago)
Author:
trs22
Message:

Additional CSS/JS tweaks for homepages.

Location:
agSciencesCollege/agCommon/branches/3.0.1
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • agSciencesCollege/agCommon/branches/3.0.1/__init__.py

    r17124 r17125  
    200200        function () { 
    201201            homepageImage = jq("body.template-document_homepage_view #homepageimage"); 
    202             if (homepageImage) 
     202            breadcrumbs = jq("body.template-document_homepage_view #portal-breadcrumbs"); 
     203            if (homepageImage.length) 
    203204            { 
    204205                var backgrounds = "%s".split(";"); 
     
    216217                    } 
    217218                ); 
    218                  
     219 
     220                if (backgrounds.length && breadcrumbs.length) 
     221                { 
     222                    breadcrumbs.addClass("homepage"); 
     223                } 
     224 
    219225                %s 
    220226                 
     
    247253                var backgroundHeights = "%(heights)s".split(";"); 
    248254                var randomnumber = Math.floor(Math.random()*backgrounds.length) ; 
    249          
    250                 var homepageImage = jq('<div id="panorama-homepage-image"><!-- --></div>'); 
    251                                  
    252                 homepageImage.insertBefore(portalColumns); 
    253                  
    254                 homepageImage.css("backgroundImage", "url(" + backgrounds[randomnumber] + ")"); 
    255                 homepageImage.css("backgroundPosition", backgroundAlignments[randomnumber] + " top"); 
    256                 homepageImage.css("paddingTop", backgroundHeights[randomnumber] + 'px'); 
    257          
    258                 if (breadcrumbs.length) 
     255 
     256                if (backgrounds.length)  
    259257                { 
    260                     breadcrumbs.detach(); 
    261                     breadcrumbs.insertBefore(homepageImage); 
    262                 } 
    263                 else 
    264                 { 
    265                     homepageImage.addClass("nobreadcrumbs"); 
     258                    var homepageImage = jq('<div id="panorama-homepage-image"><!-- --></div>'); 
     259                                     
     260                    homepageImage.insertBefore(portalColumns); 
     261                     
     262                    homepageImage.css("backgroundImage", "url(" + backgrounds[randomnumber] + ")"); 
     263                    homepageImage.css("backgroundPosition", backgroundAlignments[randomnumber] + " top"); 
     264                    homepageImage.css("paddingTop", backgroundHeights[randomnumber] + 'px'); 
     265             
     266                    if (breadcrumbs.length) 
     267                    { 
     268                        breadcrumbs.detach(); 
     269                        breadcrumbs.insertBefore(homepageImage); 
     270                        breadcrumbs.addClass("homepage"); 
     271                    } 
     272                    else 
     273                    { 
     274                        homepageImage.addClass("nobreadcrumbs"); 
     275                    } 
    266276                } 
    267277            } 
     
    277287     
    278288        return """ 
    279         var homepageImage = jq('#image-header');         
    280  
    281         var backgrounds = "%(backgrounds)s".split(";"); 
    282         var backgroundAlignments = "%(alignments)s".split(";"); 
    283         var backgroundHeights = "%(heights)s".split(";"); 
    284         var randomnumber = Math.floor(Math.random()*backgrounds.length) ; 
    285          
    286         homepageImage.css("backgroundImage", "url(" + backgrounds[randomnumber] + ")"); 
    287         homepageImage.css("backgroundPosition", backgroundAlignments[randomnumber] + " top"); 
    288         homepageImage.css("paddingTop", backgroundHeights[randomnumber] + 'px'); 
    289  
     289    jq(document).ready( 
     290        function () { 
     291            var homepageImage = jq('#image-header');         
     292     
     293            var backgrounds = "%(backgrounds)s".split(";"); 
     294            var backgroundAlignments = "%(alignments)s".split(";"); 
     295            var backgroundHeights = "%(heights)s".split(";"); 
     296            var randomnumber = Math.floor(Math.random()*backgrounds.length) ; 
     297             
     298            homepageImage.css("backgroundImage", "url(" + backgrounds[randomnumber] + ")"); 
     299            homepageImage.css("backgroundPosition", backgroundAlignments[randomnumber] + " top"); 
     300            homepageImage.css("paddingTop", backgroundHeights[randomnumber] + 'px'); 
     301             
     302            breadcrumbs = jq("#portal-breadcrumbs"); 
     303 
     304            if (backgrounds.length && breadcrumbs.length) 
     305            { 
     306                breadcrumbs.addClass("homepage"); 
     307            } 
     308        } 
     309    ); 
    290310    
    291311    """ % {'backgrounds' :  ";".join(backgrounds), 'alignments' : ";".join(backgroundAlignments), 'heights' : ";".join(backgroundHeights)} 
  • agSciencesCollege/agCommon/branches/3.0.1/browser/templates/centercolumn.pt

    r17123 r17125  
    1 <div id="centercolumn" class="agCommonPortlet" tal:condition="view/isHomePage" 
     1<div id="centercolumn" class="agCommonPortlet" tal:condition="python: view.isHomePage and not view.isLayout(views=['portlet_homepage_view'])" 
    22     tal:define="plone_view context/@@plone; 
    33                 hsr python:plone_view.have_portlets('agcommon.rightcolumn', view);" 
  • agSciencesCollege/agCommon/branches/3.0.1/browser/templates/document_subsite_view.pt

    r17123 r17125  
    1414            </style> 
    1515 
    16             <!-- Subsite JavaScript --> 
     16            <!-- Subsite CSS --> 
    1717            <style type="text/css" media="all" 
    1818                    tal:content="string:@import url($portal_url/subsite.css);"> 
     
    2020         
    2121        </metal:css> 
    22  
     22         
    2323        <metal:title fill-slot="content-title" tal:condition="not:view/hasDescriptionOrText"> 
    2424         
  • agSciencesCollege/agCommon/branches/3.0.1/browser/templates/homepageimage.pt

    r13675 r17125  
    1 <div id="homepageimage" tal:condition="view/isHomePage" tal:attributes="class python: (view.hide_breadcrumbs or not view.anonymous) and 'nobreadcrumbs' or ''"> 
     1<div id="homepageimage" tal:condition="python: view.isLayout(views=['document_homepage_view'])" tal:attributes="class python: (view.hide_breadcrumbs or not view.anonymous) and 'nobreadcrumbs' or ''"> 
    22 
    33        <tal:homePageOverlay tal:condition="python: view.homepage_h1 or view.homepage_h2"> 
  • agSciencesCollege/agCommon/branches/3.0.1/browser/templates/leadimage-header.pt

    r17105 r17125  
    66                        class string:leadimage ${div_class}"> 
    77    <!-- --> 
     8        <script type="text/javascript"> 
     9            jq(document).ready( 
     10                function () { 
     11                    breadcrumbs = jq("#portal-breadcrumbs").addClass("homepage"); 
     12                } 
     13            ); 
     14        </script> 
    815    </div> 
    916     
     
    1522             tal:attributes="class div_class"> 
    1623            <!-- --> 
     24            <!-- Subsite JavaScript --> 
     25            <script type="text/javascript"  
     26                    src="background-images/getSubsiteHomepageImage.js"></script> 
     27 
    1728        </div> 
    18         <script type="text/javascript" src="background-images/getSubsiteHomepageImage.js"></script> 
     29 
    1930    </tal:multipleImages> 
    2031</tal:breadcrumbs> 
  • agSciencesCollege/agCommon/branches/3.0.1/browser/templates/rightcolumn.pt

    r17123 r17125  
    1 <div id="rightcolumn" class="agCommonPortlet" tal:condition="view/isHomePage"> 
     1<div id="rightcolumn" class="agCommonPortlet" tal:condition="python: view.isLayout(views=['document_homepage_view'])"> 
    22 
    33        <tal:block replace="structure provider:agcommon.rightcolumn" /> 
  • agSciencesCollege/agCommon/branches/3.0.1/skins/agcommon_styles/common-homepage.css.dtml

    r17124 r17125  
    88/* ============= Breadcrumbs ================ */ 
    99 
    10 #portal-breadcrumbs { 
     10#portal-breadcrumbs.homepage { 
    1111        background-color: &dtml-breadcrumbBackgroundColor;; 
    1212        color: &dtml-breadcrumbTextColor;; 
     
    2020} 
    2121 
    22 #portal-breadcrumbs .breadcrumbSeparator { 
     22#portal-breadcrumbs.homepage .breadcrumbSeparator { 
    2323        color: &dtml-breadcrumbSeparatorColor;; 
    2424} 
    2525 
    26 #portal-breadcrumbs a { 
     26#portal-breadcrumbs.homepage a { 
    2727        color: &dtml-breadcrumbLinkColor;; 
    2828} 
    2929 
    30 #portal-column-content.sr #portal-breadcrumbs { 
     30#portal-column-content.sr #portal-breadcrumbs.homepage { 
    3131    margin: 0; 
    3232} 
  • agSciencesCollege/agCommon/branches/3.0.1/skins/agcommon_styles/extension.css.dtml

    r17124 r17125  
    4444body.section-front-page #portlets-above .portlet { 
    4545    min-height: 32em; 
    46     font-size: 0.84375em; 
    4746} 
    4847 
     
    5554} 
    5655 
    57 body.section-front-page #content #homepage-text { 
    58     margin: 0; 
    59     padding: 0; 
    60 } 
    61  
    6256body.section-front-page #content #homepage-text p.documentDescription { 
    6357    font-size: 1.25em; 
    64     margin: 0 0 0.25em 0; 
    65 } 
    66  
    67 body.section-front-page #content, 
    68 body.section-front-page #portal-column-content.sr #content { 
    69     padding: 0.8125em 1.25em 0 1.25em !important; 
     58    margin: 0.75em 0 0.25em 0; 
    7059} 
    7160 
  • agSciencesCollege/agCommon/branches/3.0.1/skins/agcommon_styles/panorama_homepage.css.dtml

    r17124 r17125  
    4444} 
    4545 
    46 #portal-breadcrumbs { 
     46#portal-breadcrumbs.homepage { 
    4747    margin: 0; 
    4848    padding-top: 0; 
  • agSciencesCollege/agCommon/branches/3.0.1/skins/agcommon_styles/portlet_homepage.css.dtml

    r16817 r17125  
    77 
    88 
    9 /* For Extension front page */ 
     9#content { 
     10    padding: 0 1.25em 0 !important 
     11} 
     12 
     13#portal-column-content .documentEditable { 
     14    margin: 0.875em 0; 
     15} 
     16 
     17#portal-column-content .documentEditable #content { 
     18    margin: 0 1em !important; 
     19} 
     20 
     21#content #homepage-text { 
     22    margin: 0 !important; 
     23    padding: 0 !important; 
     24} 
    1025 
    1126#portlets-above { 
    1227    display: block; 
     28    font-size: 0.84375em; 
    1329} 
    1430 
  • agSciencesCollege/agCommon/branches/3.0.1/skins/agcommon_templates/main_template.pt

    r17043 r17125  
    130130                <div metal:define-macro="content" 
    131131                     tal:define="show_border context/@@plone/showEditableBorder" 
    132                      tal:attributes="class python:show_border and 'documentEditable' or ''"> 
     132                     tal:attributes="class python:show_border and 'documentEditable' or ''" 
     133                     tal:omit-tag="not:show_border"> 
    133134 
    134135                    <div id="edit-bar" 
Note: See TracChangeset for help on using the changeset viewer.