[CMF-checkins] CVS: CMF/CMFStaging/skins/tidy - custom.css.dtml:1.1 main_template.pt:1.1 standard_html.pt:1.1 standard_html_footer.py:1.1 standard_html_header.py:1.1

Shane Hathaway shane@cvs.zope.org
Fri, 24 May 2002 15:12:06 -0400


Update of /cvs-repository/CMF/CMFStaging/skins/tidy
In directory cvs.zope.org:/tmp/cvs-serv16405/skins/tidy

Added Files:
	custom.css.dtml main_template.pt standard_html.pt 
	standard_html_footer.py standard_html_header.py 
Log Message:
Added the "tidy" skin, which looks better than the standard and provides
some JavaScript that helps locking.


=== Added File CMF/CMFStaging/skins/tidy/custom.css.dtml ===
.topbar {  color: #000000; background-color: #ffffff}
.topbar a:link {  color: #3366cc}
.topbar a:visited {  color: #cc66cc}
.userbar {  background-color: #EEEEEE}
.topbar h1 {  font-size: 16pt; font-weight: normal; text-indent: 5pt; font-style: normal}
.userbar h1 {  font-weight: bold; font-size: 10pt}
.actionsbox {  }
table.actionsbox {  background-color: #EEEEEE; border: 1px #999999 solid}
.actionsbox th {  font-weight: bold; background-color: #3366CC; text-align: left; color: #FFFFFF}
.actionsbox tr td.division { border-color: #3366CC black black; line-height: 18pt; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
.mainhead {  }
.mainhead th {  font-size: 12pt; font-weight: bold; color: #FFFFFF; background-color: #3366CC; text-align: left}
.contents {  }
.contents th { font-size: 12pt; font-weight: bold; color: #FFFFFF; background-color: #3366CC; text-align: left }
.artifacts {  }
.wiki {  }
.wiki th {  color: #FFFFFF; background-color: #3366CC}
.wiki font {  font-size: 12pt}
body {  font-family: Arial, Helvetica, sans-serif; font-size: 9pt}
table {  font-size: 9pt; border: 1px #999999 solid; width: 100%; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px}
.wikiheader {  }
.wikiheader font { font-size: 12pt }
.wikiheader th {  font-weight: bold; color: #FFFFFF; background-color: #3366CC}
.wikiheader th a:link {  color: #CCCCCC}
.noborder {  border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
table.noborder { font-size: 9pt; border: 0px #999999 none; width: 100%; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px }
table.artifacts {  border-style: none}
tr.oddrow { background-color: #EEE; }
.page_title { font-size: 12pt; font-weight: bold }


=== Added File CMF/CMFStaging/skins/tidy/main_template.pt ===
<html metal:define-macro="master"
      tal:define="utool nocall:here/portal_url;
                  mtool here/portal_membership;
                  atool here/portal_actions;
                  wtool here/portal_workflow;
                  portal_object utool/getPortalObject;
                  portal_title portal_object/Title;
                  object_title here/Title;
                  page_title page_title | template/title;
                  portal_url here/portal_url;
                  member mtool/getAuthenticatedMember;
                  isAnon mtool/isAnonymousUser;
                  actions python: atool.listFilteredActionsFor( here );
                  user_actions actions/user;
                  object_actions actions/object;
                  workflow_actions actions/workflow;
                  folder_actions actions/folder;
                  global_actions actions/global;
                  wf_state python:wtool.getInfoFor(here,'review_state','');
                 ">

<head>
 <title>
  <tal:block condition="page_title"
             replace="string:$page_title: ">view: </tal:block>
  <tal:block replace="object_title">The title</tal:block>
 </title>
 <link rel="stylesheet" href="custom.css" type="text/css"
       tal:attributes="href here/custom.css/absolute_url">

<script type="text/javascript" tal:define="locktool here/LockTool|nothing;
  editable python: (not locktool or (locktool.locked(here)
                    and not locktool.isLockedOut(here)));
  js_editable python: editable and 'true' or 'false'"
  tal:content="string:var editable = ${js_editable};">
var editable = true;
</script>


<script type="text/javascript"><!--

var changed = false;

function before_leave() {
  if (changed) {
    if (confirm("Discard changes?"))
      return true;
    else
      return false;
  }
  else
    return true;
}

function user_changed() {
  changed = true;
}

function setup_safety() {
  for (i = 0; i < document.links.length; i++) {
    link = document.links[i];
    if (!link.onclick) {
      link.onclick = before_leave;
    }
  }

  for (i = 0; i < document.forms.length; i++) {
    var f = document.forms[i];
    if (f.className == 'modify_object') {
      elements = f.elements;
      for (j = 0; j < elements.length; j++) {
        element = elements[j];
        if (element.className == 'non_modify') continue;
        if (!editable) {
          if (element.tagName == 'TEXTAREA' || (
               element.tagName == 'INPUT' && (
                element.type == 'text' || element.type == 'hidden')))
            element.readOnly = true;
          else
            element.disabled = true;
        } else {
          if (!element.onchange)
            element.onchange = user_changed;
        }
      }
    }
  }
}

// --></script>


  <metal:block define-slot="head"></metal:block>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div metal:define-macro="top_bar">

<!-- Top bar -->

 <table class="topbar" width="100%" cellspacing="0" border="0">
  <tr>
  <form action="search" method="GET" name="search"
        tal:attributes="action string:${portal_url}/search">
   <td width="1%">
    <a href="."
       tal:attributes="href portal_url"><img
    src="logo.png" tal:replace="structure here/logo.png"></a>
   </td>
   <td>
    <h1 tal:content="string:${portal_title}">Site Title</h1>
   </td>
   <td align="right">
    <a href="."
       tal:attributes="href portal_url">home</a>&nbsp;
    <a href="search_form"
       tal:attributes="href string:${portal_url}/search_form">search</a> 

    <input name="SearchableText" size="16">
    <input border="0" type="image" name="go" value="go"
           src="go.gif" align="middle" width="20"
           height="20" tal:attributes="src string:go.gif"> &nbsp;
   </td>
  </form>
  </tr>
 </table>
 <!-- end topbar -->
</div>


<div metal:define-macro="user_menu_bar"
     tal:define="uname python: isAnon and 'Guest' or member.getUserName()">

<!-- user_menu_bar -->

 <table class="userbar" width="100%" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td width="30%" tal:content="uname">Guest</td>
    <td width="40%" align="center" class="page_title">
      <span tal:condition="page_title" 
            tal:replace="string:$page_title: ">view: </span>
      <em tal:content="object_title">Object</em>
    </td>
    <td width="30%" align="right">
 <a href="HelpSys" onclick="window.open('HelpSys','help','width=600,height=500,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes'); return false;">Help!</a>&nbsp;|&nbsp;
      <span tal:repeat="action user_actions">
       <a href="" tal:attributes="href action/url"
          tal:content="action/name">Login</a><span
    tal:condition="not: repeat/action/end">&nbsp;|&nbsp;</span>
      </span>
      <span tal:condition="nothing"><a href="join_form">Join</a></span>
    </td>
   </tr>
 </table>

 <!-- end user_menu_bar -->
</div>

<br>

<!-- Desktop -->
 <table class="noborder" align="center" width="95%" border="0" cellpadding="4" cellspacing="0">
 <tr>
 <td valign="top" width="20%">
  
  <!-- actions box -->
        <table class="actionsbox" width="100%"
               cellpadding="4" cellspacing="0"
               metal:define-macro="actions_box">

          <!-- object ID -->
          <tr tal:define="getIcon python:hasattr(here, 'getIcon') and here.getIcon();
                    icon python:getIcon or getattr(here, 'icon', '');
                    typ python:getattr(here, 'Type', '');
                    objID python:here.truncID( here.getId(), size=15 )"> 
            <th> <img src="icon" align="left" title="Type"
                      alt="[X]" height="16" width="16"
                      tal:condition="icon"
                      tal:attributes="src string:${portal_url}/${icon};
                          alt typ; " />
            </th><th width="90%"><span
    tal:replace="structure objID">ID</span> 
            </th>
          </tr>

          <!-- workflow actions -->
          <tr class="ContextActionsRow"
              tal:condition="workflow_actions"> 
            <td>
            </td>
            <td class="ActionLink"> <span class="ObjectStatus"> Status: <span
    tal:replace="wf_state">Private</span><br>
              </span> <span tal:repeat="action workflow_actions"> <a
    href="content_submit_form"
    tal:attributes="href action/url"
    tal:content="action/name">Submit</a><br>
              </span> </td>
          </tr>

          <!-- object actions -->
          <tr tal:repeat="action object_actions">
            <td>
              <!--img tal:define="icon python: here.getActionIcon(
                   action['id'], action.get('action', ''))"
                   tal:condition="icon"
                   tal:replace="structure icon/tag" / -->
            </td>
            <td>
              <a href="" tal:attributes="href action/url"
                 tal:content="action/name">View</a><br>
            </td>
          </tr>
          
          <!-- folder actions -->
          <tr tal:condition="folder_actions"> 
            <td class="division">
              &nbsp;
            </td>
            <td class="division"> <span
    tal:repeat="action folder_actions"> 
              <a href="../folder_contents"
                 tal:attributes="href action/url"
                 tal:content="action/name">Folder contents</a><br>
              </span> </td>
          </tr>

          <!-- global actions -->
          <tr tal:condition="global_actions"> 
            <td class="division">
              &nbsp;
            </td>
            <td class="division"> <span
    tal:repeat="action global_actions"> 
              <a href="undo_form"
                 tal:attributes="href action/url"
                 tal:content="action/name">Undo</a><br>
              </span> </td>
          </tr>
          <tr tal:condition="global_actions">
            <td colspan="2" class="division"
                tal:condition="request/portal_status_message|nothing"
                tal:content="request/portal_status_message"> Status message.</td>
          </tr>
        </table>
  <!-- end actions_box -->

  <div tal:define="blocks actions/block|nothing"
       tal:condition="blocks">
    <div tal:repeat="block blocks"
         tal:replace="structure python: getattr(here, block['action'])()">
      Action box extension block
    </div>
  </div>

 </td>

<!-- Gutter -->

 <td width="2%">
 <br>
 </td>

<!-- End Gutter -->

<td width="78%" valign="top"> 
<div metal:define-slot="header"></div>

<!-- Main Body -->

<div metal:define-slot="main">

</div>

<!-- end Main Body -->

<script type="text/javascript"><!--
  setup_safety();
// --></script>

</td>
</tr>
</table>

</body>
</html>


=== Added File CMF/CMFStaging/skins/tidy/standard_html.pt ===
<html metal:use-macro="here/main_template/macros/master">
  <div metal:fill-slot="main" tal:omit-tag=""><!--split here--></div>
</html>


=== Added File CMF/CMFStaging/skins/tidy/standard_html_footer.py ===
parts = context.standard_html().split('<!--split here-->', 1)
if len(parts) > 1:
    return parts[1]
else:
    return ""



=== Added File CMF/CMFStaging/skins/tidy/standard_html_header.py ===
return context.standard_html().split('<!--split here-->', 1)[0]