Ticket #7786: trac_7786-template-jinja-idiomatic.4.patch

File trac_7786-template-jinja-idiomatic.4.patch, 217.3 KB (added by timdumol, 11 years ago)

Adds missing div_wrap argument to template call at Cell.html()

  • deleted file sagenb/data/highlight/prettify.css

    diff -r 8afee2ec056a sagenb/data/highlight/prettify.css
    + -  
    1 /* Pretty printing styles. Used with prettify.js. */
    2 
    3 .str { color: #080; }
    4 .kwd { color: #008; }
    5 .com { color: #800; }
    6 .typ { color: #606; }
    7 .lit { color: #066; }
    8 .pun { color: #660; }
    9 .pln { color: #000; }
    10 .tag { color: #008; }
    11 .atn { color: #606; }
    12 .atv { color: #080; }
    13 .dec { color: #606; }
    14 pre.prettyprint { padding: 2px; border: 1px solid #888; }
    15 
    16 @media print {
    17   .str { color: #060; }
    18   .kwd { color: #006; font-weight: bold; }
    19   .com { color: #600; font-style: italic; }
    20   .typ { color: #404; font-weight: bold; }
    21   .lit { color: #044; }
    22   .pun { color: #440; }
    23   .pln { color: #000; }
    24   .tag { color: #006; font-weight: bold; }
    25   .atn { color: #404; }
    26   .atv { color: #060; }
    27 }
  • deleted file sagenb/data/sage/css/account_settings.css

    diff -r 8afee2ec056a sagenb/data/sage/css/account_settings.css
    + -  
    1 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; }
    2 
    3 *:focus { outline: 0; }
    4 
    5 body { line-height: 1em; color: black; background: #fff; }
    6 
    7 ol, ul { list-style: none; }
    8 
    9 /* tables still need 'cellspacing="0"' in the markup */
    10 table { border-collapse: separate; border-spacing: 0; vertical-align: middle; }
    11 
    12 caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; }
    13 
    14 q, blockquote { quotes: "" ""; }
    15 q:before, q:after, blockquote:before, blockquote:after { content: ""; }
    16 
    17 img a { border: none; }
    18 
    19 html { font-size: 100.1%; }
    20 
    21 body { font: 100%/1.4 Arial, Helvetica, sans-serif; }
    22 
    23 h1 { background: #DCDCDC; border-bottom: 1px solid #CCC; font-size: 2em; padding: 0 5px; }
    24 
    25 label { display: block; }
    26 
    27 #buttons { background: #DCDCDC; padding: 5px; }
    28 #buttons button { margin-right: 1em; }
    29 
    30 h2 { font-size: 1.5em; }
    31 
    32 .section { border-bottom: 1px solid #CCC; padding: 5px; }
    33 .section div { margin-bottom: 0.5em; }
    34 
    35 .error { color: red; }
    36 
    37 .updated { color: green; }
    38 
    39 input.c1 { width: 200px; }
  • sagenb/data/sage/css/main.css

    diff -r 8afee2ec056a sagenb/data/sage/css/main.css
    a b  
     1/* Warning: These .css files are automatically generated and will be overwritten */
     2/* when they are next generated. Please edit the SASS source located at */
     3/* <sagenb-spkg-root>/sass/src. */
    14thead { font-weight: bold; }
    25
    3 body { background-color: white; }
     6body { background-color: white; font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; }
    47body.worksheet-online { margin-bottom: 80%; }
    58
    69.hidden { display: none; }
     
    1619body div#banner #ping { float: left; }
    1720body div#banner div.version { float: left; clear: left; font-size: xx-small; text-indent: 13px; color: black; }
    1821
    19 #controls { float: right; width: 65%; }
    20 #controls ul { list-style: none; margin: 0; padding: 0; text-align: right; }
    21 #controls ul li { border-right: 1px solid #000; color: #112abb; display: inline; font-size: 14px; margin: 0; padding: 0 0.5em; }
    22 #controls ul li:last-child { border-right: 0; }
    23 #controls ul li.username { border: 0; color: #000; font-family: sans-serif; font-weight: bold; padding: 0; }
    24 #controls ul a { text-decoration: underline; white-space: nowrap; }
    25 #controls ul a:hover { cursor: pointer; }
     22#main-controls { float: right; width: 65%; }
     23#main-controls ul { list-style: none; margin: 0; padding: 0; text-align: right; }
     24#main-controls ul li { border-right: 1px solid #000; color: #112abb; display: inline; font-size: 14px; margin: 0; padding: 0 0.5em; }
     25#main-controls ul li:last-child { border-right: 0; }
     26#main-controls ul li.username { border: 0; color: #000; font-family: sans-serif; font-weight: bold; padding: 0; }
     27#main-controls ul a { text-decoration: underline; white-space: nowrap; }
     28#main-controls ul a:hover { cursor: pointer; }
    2629
    2730#top-bar { position: relative; padding: 10px 5px; border-bottom: 1px solid #c9d7f1; min-height: 40px; margin-bottom: 0.5em; overflow: hidden; display: inline-block; }
    2831#top-bar { display: block; }
     
    3134
    3235hr.usercontrol { clear: both; float: left; }
    3336
    34 div#usercontrols { overflow: hidden; display: inline-block; clear: both; border-bottom: 1px solid #c9d7f1; padding: 10px; }
    35 div#usercontrols { display: block; }
     37div#user-controls { overflow: hidden; display: inline-block; clear: both; border-bottom: 1px solid #c9d7f1; padding: 10px; }
     38div#user-controls { display: block; }
    3639div#worksheet-list-controls { padding: 10px; clear: both; overflow: hidden; display: inline-block; }
    3740div#worksheet-list-controls { display: block; }
    3841div#worksheet-list-controls div.action-buttons { float: left; }
     
    172175a.new_worksheet { font-family: arial, monospace; font-size: 12pt; text-align: right; color: #0000aa; }
    173176a.new_worksheet:hover { cursor: pointer; }
    174177
    175 div.worksheet_bottom_padding { height: 50%; }
    176 div.worksheet_top_padding { height: 5%; }
    177178div.worksheet_menu { top: 50px; }
    178179
    179180a.worksheet_title { text-decoration: none; font-size: 20px; font-family: arial; font-weight: bold; color: #000000; }
     
    212213span.control:hover a.cs, span.control a:hover.cs { color: black; border: 1px solid #333333; }
    213214
    214215/* *********** WORKSHEET ************************* */
    215 div.worksheet { background-color: white; border: 1px solid #aaa; }
     216div.worksheet { background-color: white; border: 1px solid #aaa; padding: .75em 0.2em; }
    216217div.banner { background-color: white; font-family: sans-serif; font-size: 18px; text-decoration: none; color: #1950c8; }
    217218div.banner a.banner { text-decoration: none; border: none; margin-top: 2px; }
    218219
     
    248249textarea.cell_input_active { background-color: white; border: 2px solid  #8888fe; font-family: monospace; font-size: 12pt; overflow: hidden; padding-bottom: 0px; padding-left: 5px; padding-right: 0px; padding-top: 3px; margin-top: 0px; margin-bottom: 0px; line-height: 1.2em; width: 97%; }
    249250
    250251div.cell_input_active { background-color: white; border: 2px solid  #8888fe; font-family: monospace; font-size: 12pt; padding-bottom: 0px; padding-left: 5px; padding-right: 0px; padding-top: 3px; margin-top: 0px; margin-bottom: 0px; line-height: 1.2em; width: 97%; z-index: -100; visibility: hidden; position: absolute; }
    251 div.cell_input_print { background-color: white; border: 1px solid  #a8a8a8; font-family: monospace; font-size: 12pt; padding-bottom: 1px; padding-left: 6px; padding-right: 1px; padding-top: 4px; margin-top: 0px; margin-bottom: 0px; line-height: 1.2em; width: 97%; }
     252div.cell_input_print { background-color: white; border: 1px solid  #a8a8a8; font-family: monospace; font-size: 12pt; padding-bottom: 1px; padding-left: 6px; padding-right: 1px; padding-top: 4px; margin-top: 0px; margin-bottom: 0px; line-height: 1.2em; width: 97%; whitespace: pre-wrap; }
    252253
    253254textarea.cell_input:hover { cursor: text; }
    254255
     
    304305.thin-right { position: absolute; top: auto; right: 0; width: 70%; }
    305306
    306307/* *********** User Home (Worksheet listing) ************************* */
    307 span.ratingmsg { color: #112abb; padding: 0.3em; font-size: 14px; }
    308 span.pubmsg { font-family: sans-serif; color: #112abb; padding: 0.3em; font-size: 12px; }
     308.ratingmsg { color: #112abb; padding: 0.3em; font-size: 14px; }
     309
     310.pubmsg { font-family: sans-serif; color: #112abb; padding: 0.3em; font-size: 12px; }
    309311
    310312#worksheet-list { clear: both; width: 100%; }
    311313#worksheet-list thead { background-color: #e8eef7; }
    312314#worksheet-list td.checkbox { padding: 4px; }
    313315
    314 a.usercontrol { color: #112abb; padding: 0.3em; font-size: 14px; text-decoration: underline; }
    315 a.usercontrol:hover { cursor: pointer; }
     316.controls a, .usercontrol { color: #112abb; font-size: 14px; text-decoration: underline; }
     317.controls a:hover, .usercontrol:hover { cursor: pointer; }
    316318
    317 span.usercontrol { color: #112abb; padding: 0.3em; font-size: 14px; }
     319.controls span { color: #112abb; padding: 0.3em; font-size: 14px; }
    318320
    319 a.boldusercontrol { color: #112abb; padding: 0.5em; font-weight: bold; font-size: 14px; }
     321.user-controls a, .boldusercontrol { color: #112abb; font-weight: bold; font-size: 14px; }
     322
     323.user-controls a, .controls a, .controls span { padding: 0.3em; }
     324
    320325a.control, a.control-select { background-color: #7799bb; font-family: sans-serif; color: #ffffff; padding-top: 0.25em; padding-bottom: 0.25em; padding-left: 0.5em; padding-right: 0.5em; font-size: 15px; font-weight: bold; text-decoration: none; }
    321326a.control:hover { cursor: pointer; }
    322327a.control-select { background-color: #4477aa; }
    323328a.control-select:hover { cursor: pointer; }
    324329
    325 span.sharebar { background-color: #4477aa; font-family: sans-serif; color: #ffffff; position: absolute; left: 0.5em; right: 0ex; padding-top: 0.5em; padding-bottom: 0.5em; padding-left: 2em; font-size: 18px; font-weight: bold; }
     330.sharebar { background-color: #4477aa; font-family: sans-serif; color: #ffffff; padding-top: 0.5em; padding-bottom: 0.5em; padding-left: 2em; font-size: 1.25em; font-weight: bold; }
    326331
    327332textarea.edit { font-family: courier, monospace; font-size: 10pt; border: 1px solid #8cacbb; color: black; background-color: white; padding: 3px; overflow: auto; margin-top: 0.5em; }
    328333
     
    347352
    348353div.ultrathinspace { border: 0; height: 0px; }
    349354
    350 span.lastedit { font-family: sans-serif; font-size: 10px; color: #717171; }
    351 span.revs { font-family: sans-serif; font-size: 12px; font-weight: bold; color: #333333; }
    352 span.users { font-family: sans-serif; font-size: 13px; color: #222222; }
     355.lastedit { font-family: sans-serif; font-size: 10px; color: #717171; }
     356
     357.revs { font-family: sans-serif; font-size: 12px; font-weight: bold; color: #333333; }
     358
     359.users { font-family: sans-serif; font-size: 13px; color: #222222; }
    353360
    354361a.share { font-family: sans-serif; font-size: 10px; color: #7777cc; }
    355362
     
    368375div.docidx { text-align: center; font-family: sans-serif; font-size: 16px; color: #222; font-weight: bold; }
    369376
    370377span.ping { display: none; }
    371 span.pingdown { font-family: sans-serif; font-size: 15px; font-weight: bold; color: white; background-color: #990000; }
     378span.pingdown { font-family: sans-serif; font-size: 15px; font-weight: bold; color: white; background-color: #990000; margin-left: 1em; }
    372379
    373 /* These have been scraped directly from pygment. */
     380#source-code-page .str { color: #080; }
     381#source-code-page .kwd { color: #008; }
     382#source-code-page .com { color: #800; }
     383#source-code-page .typ { color: #606; }
     384#source-code-page .lit { color: #066; }
     385#source-code-page .pun { color: #660; }
     386#source-code-page .pln { color: #000; }
     387#source-code-page .tag { color: #008; }
     388#source-code-page .atn { color: #606; }
     389#source-code-page .atv { color: #080; }
     390#source-code-page .dec { color: #606; }
     391
     392#source-code-page h1, #source-code-page h2 { text-align: center; }
     393#source-code-page .filename { font-family: monospace; }
     394#source-code-page code { display: block; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 1em; }
     395
     396#print-page h1 { text-align: center; }
     397
     398#guest-worksheet-page h1, #guest-worksheet-page h2 { text-align: center; }
     399#guest-worksheet-page ul.controls { margin: 0; padding: 0; border: 0; outline: 0; overflow: hidden; display: inline-block; }
     400#guest-worksheet-page ul.controls { display: block; }
     401#guest-worksheet-page ul.controls li { list-style-type: none; margin-left: 0px; white-space: nowrap; display: inline; float: left; padding-left: 0.5em; padding-right: 0.5em; }
     402#guest-worksheet-page ul.controls li.first { padding-left: 0px; }
     403#guest-worksheet-page ul.controls li.last { padding-right: 0px; }
     404
     405#before-publish-page form a { text-decoration: none; }
     406#before-publish-page form button { margin-left: 1em; margin-bottom: 0.5em; }
     407#before-publish-page form input { margin-left: 1em; }
     408
     409#after-publish-page input { margin-top: 1em; }
     410
     411#edit-page .sharebar span { margin-right: 2em; }
     412
     413.settings-page { line-height: 1.4; }
     414.settings-page h1 { font-size: 2em; padding: 0 5px; }
     415.settings-page label { display: block; }
     416.settings-page #buttons { padding: 5px; }
     417.settings-page #buttons button { margin-right: 1em; }
     418.settings-page #buttons a { text-decoration: none; }
     419.settings-page h2 { font-size: 1.5em; margin: 0 0 0.75em; }
     420.settings-page .section { border-bottom: 1px solid #CCC; padding: 5px; margin: 0.5em 0; }
     421.settings-page .section div { margin-bottom: 0.5em; }
     422.settings-page .error, .settings-page .error_found { color: red; }
     423.settings-page .error_found { font-size: 1.2em; }
     424.settings-page .updated { color: green; }
     425.settings-page input.c1 { width: 200px; }
     426
     427#settings-nav { margin: 0; padding: 0; border: 0; outline: 0; overflow: hidden; display: inline-block; }
     428#settings-nav { display: block; }
     429#settings-nav li { list-style-type: none; margin-left: 0px; white-space: nowrap; display: inline; float: left; padding-left: 0.5em; padding-right: 0.5em; }
     430#settings-nav li.first { padding-left: 0px; }
     431#settings-nav li.last { padding-right: 0px; }
     432#settings-nav li { border-right: 1px solid #ccc; }
     433#settings-nav li:last-child, #settings-nav li.last { border-right: none; }
     434
     435#user-management-page table { border-collapse: collapse; }
     436#user-management-page th, #user-management-page td { border: 1px solid #696969; padding: 0.25em; }
     437#user-management-page th { background: #CCC; }
     438#user-management-page a:link, #user-management-page a:visited { color: #112abb; }
     439
     440.accounts-page #wrapper { margin: 0 auto; max-width: 600px; }
     441.accounts-page h1, .accounts-page h2, .accounts-page h3, .accounts-page h4, .accounts-page h5 { font-weight: normal; }
     442.accounts-page h1 { border-bottom: 1px solid #696969; font-size: 2em; padding: 10px 0; }
     443.accounts-page h2 { font-weight: bold; }
     444.accounts-page h1, .accounts-page h2, .accounts-page p, .accounts-page li { margin-bottom: 10px; }
     445.accounts-page .entry { margin-bottom: 10px; border: 1px solid #999; padding: 3px; width: 200; }
     446.accounts-page li { border-bottom: 1px solid #CCC; }
     447.accounts-page .error { color: red; }
     448.accounts-page .error_found { color: red; font-size: 1.5em; }
     449.accounts-page button { margin-right: 1em; }
     450.accounts-page form label { display: block; }
     451.accounts-page form div { margin-bottom: 1em; }
     452.accounts-page form a { text-decoration: none; }
     453
     454#login-page h2 { font-size: 1.5em; margin-bottom: 0.375em; }
     455#login-page h1, #login-page h2, #login-page h3, #login-page h4, #login-page h5, #login-page h6 { line-height: 1em; }
     456#login-page p { margin-bottom: 1em; }
     457#login-page strong { font-weight: bold; }
     458#login-page #desc { float: left; margin-right: 400px; }
     459#login-page div { padding: 0.5em 1em; }
     460#login-page #sign-in-box { background-color: #efefff; float: left; margin-left: -400px; width: 350px; }
     461#login-page #sign-in-box form label { display: block; }
     462#login-page #sign-in-box a { font-size: 0.875em; }
     463
    374464.hll { background-color: #ffffcc; }
    375465
    376466.c { color: #408090; font-style: italic; }
     
    474564.vc, .vg, .vi { color: #bb60d5; }
    475565
    476566.il { color: #208050; }
    477 
    478 /* end stuff scraped from pygment */
  • deleted file sagenb/data/sage/css/master.css

    diff -r 8afee2ec056a sagenb/data/sage/css/master.css
    + -  
    1 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; }
    2 
    3 *:focus { outline: 0; }
    4 
    5 body { line-height: 1em; color: black; background: #fff; }
    6 
    7 ol, ul { list-style: none; }
    8 
    9 /* tables still need 'cellspacing="0"' in the markup */
    10 table { border-collapse: separate; border-spacing: 0; vertical-align: middle; }
    11 
    12 caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; }
    13 
    14 q, blockquote { quotes: "" ""; }
    15 q:before, q:after, blockquote:before, blockquote:after { content: ""; }
    16 
    17 img a { border: none; }
    18 
    19 html { font-size: 100.1%; }
    20 
    21 body { font: .9em/1.2em Arial, Helvetica, sans-serif; }
    22 
    23 div { padding: 0.5em 1em; }
    24 
    25 #desc { float: left; margin-right: 400px; }
    26 
    27 #sign-in-box { float: left; margin-left: -400px; width: 350px; background-color: #efefff; }
    28 #sign-in-box form label { display: block; }
    29 
    30 p { margin-bottom: 1em; }
    31 
    32 h1, h2, h3, h4, h5, h6 { line-height: 1em; }
    33 
    34 h2 { font-size: 1.5em; margin-bottom: 0.375em; }
    35 
    36 #banner { font-size: 1.2em; float: left; clear: both; margin-bottom: 0.25em; }
    37 #banner a.banner { text-decoration: none; border: none; margin-top: 2px; float: left; }
    38 #banner a.banner:visited { color: #1950c8; }
    39 #banner #ping { display: none; }
    40 #banner div.version { float: left; clear: left; font-size: xx-small; text-indent: 13px; color: black; }
    41 
    42 .section { border-bottom: 1px solid #CCC; padding: 5px; }
    43 .section > div { max-width: 350px; text-align: right; }
    44 
    45 input.c1 { width: 200px; }
    46 
    47 strong { font-weight: bold; }
  • deleted file sagenb/data/sage/css/registration.css

    diff -r 8afee2ec056a sagenb/data/sage/css/registration.css
    + -  
    1 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, table, caption, tbody, tfoot, thead, tr, th, td { border: 0; font-family: inherit; font-size: 100%; font-style: inherit; font-weight: inherit; margin: 0; outline: 0; padding: 0; text-decoration: none; vertical-align: baseline; }
    2 
    3 html { font-size: 100.1%; }
    4 
    5 body { font: 0.88em/1.4 Arial, Helvetica, sans-serif; }
    6 
    7 #wrapper { margin: 0 auto; max-width: 600px; }
    8 
    9 h1, h2, h3, h4, h5 { font-wieght: normal; }
    10 
    11 h1 { border-bottom: 1px solid #696969; font-size: 2em; padding: 10px 0; }
    12 
    13 h2 { font-weight: bold; }
    14 
    15 h1, h2, p, li { margin-bottom: 10px; }
    16 
    17 .entry { margin-bottom: 10px; border: 1px solid #999; padding: 3px; width: 200; }
    18 
    19 li { border-bottom: 1px solid #CCC; }
    20 
    21 .error { color: red; }
    22 
    23 .error_found { color: red; font-size: 1.5em; }
    24 
    25 button { margin-right: 1em; }
    26 
    27 form label { display: block; }
    28 form div { margin-bottom: 1em; }
  • sagenb/data/sage/css/test_report.css

    diff -r 8afee2ec056a sagenb/data/sage/css/test_report.css
    a b  
     1/* Warning: These .css files are automatically generated and will be overwritten */
     2/* when they are next generated. Please edit the SASS source located at */
     3/* <sagenb-spkg-root>/sass/src. Kindly refer to the readme for editing */
     4/* instructions at <sagenb-spkg-root>/sass */
    15body, table { background-color: #fff; color: #111; font-family: sans-serif; -moz-border-radius: 0.25em; -webkit-border-radius: 0.25em; }
    26
    37pre { margin: 0; padding: 0; padding-top: 0.25em; }
  • deleted file sagenb/data/sage/css/user_management.css

    diff -r 8afee2ec056a sagenb/data/sage/css/user_management.css
    + -  
    1 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; }
    2 
    3 *:focus { outline: 0; }
    4 
    5 body { line-height: 1em; color: black; background: #fff; }
    6 
    7 ol, ul { list-style: none; }
    8 
    9 /* tables still need 'cellspacing="0"' in the markup */
    10 table { border-collapse: separate; border-spacing: 0; vertical-align: middle; }
    11 
    12 caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; }
    13 
    14 q, blockquote { quotes: "" ""; }
    15 q:before, q:after, blockquote:before, blockquote:after { content: ""; }
    16 
    17 img a { border: none; }
    18 
    19 html { font-size: 100.1%; }
    20 
    21 body { font: .9em/1.2em Arial, Helvetica, sans-serif; }
    22 
    23 div { padding: 0.5em 1em; }
    24 
    25 #desc { float: left; margin-right: 400px; }
    26 
    27 #sign-in-box { float: left; margin-left: -400px; width: 350px; background-color: #efefff; }
    28 #sign-in-box form label { display: block; }
    29 
    30 p { margin-bottom: 1em; }
    31 
    32 h1, h2, h3, h4, h5, h6 { line-height: 1em; }
    33 
    34 h2 { font-size: 1.5em; margin-bottom: 0.375em; }
    35 
    36 #banner { font-size: 1.2em; float: left; clear: both; margin-bottom: 0.25em; }
    37 #banner a.banner { text-decoration: none; border: none; margin-top: 2px; float: left; }
    38 #banner a.banner:visited { color: #1950c8; }
    39 #banner #ping { display: none; }
    40 #banner div.version { float: left; clear: left; font-size: xx-small; text-indent: 13px; color: black; }
    41 
    42 .section { border-bottom: 1px solid #CCC; padding: 5px; }
    43 .section > div { max-width: 350px; text-align: right; }
    44 
    45 input.c1 { width: 200px; }
    46 
    47 strong { font-weight: bold; }
    48 
    49 body { margin: 10px; }
  • sagenb/data/sage/html/account_recovery.html

    diff -r 8afee2ec056a sagenb/data/sage/html/account_recovery.html
    a b  
    11{% extends "html/base.html" %}
    22
    33{% block title %}Account Recovery{% endblock %}
    4 {% block css %}registration{% endblock %}
     4{% block page_id %}account-recovery-page{% endblock %}
    55
    66{% block body %}
    77<div id="wrapper">
     
    1818        </div>
    1919</form>
    2020</div>
    21 
    22 
    2321{% endblock %}
  • deleted file sagenb/data/sage/html/account_settings.html

    diff -r 8afee2ec056a sagenb/data/sage/html/account_settings.html
    + -  
    1 {% extends "html/base.html" %}
    2 
    3 {% block title %}Account Settings{% endblock %}
    4 {% block css %}account_settings{% endblock %}
    5 {% block page_id %}account-settings-page{% endblock %}
    6 {% block body %}
    7 <h1>Account Settings</h1>
    8 <div class="section">{% if admin %}<a href="/users">Manage Users</a> | <a href="/notebooksettings">Notebook Settings</a> | {% endif %}<a href="/">My Worksheets</a> | <a href="/logout">Sign Out</a></div>
    9 
    10   <form method="post" action="/settings">
    11    
    12     <div class="section">
    13       <h2>Change Auto-Save Interval</h2>
    14       <div>
    15         Minutes:
    16         <select name="autosave">
    17         {% for i, selected in autosave_intervals %}
    18           <option{{ selected }}>{{ i }}</option>
    19         {% endfor %}
    20         </select>
    21       </div>
    22     </div>
    23     <div class="section">
    24       <h2>Change Password</h2>
    25       <div id="passwd">
    26           <div>
    27               <label for="old-pass">Old password</label>
    28               <input type="password" name="old-pass" />
    29           </div>
    30           <div>
    31               <label for="new-pass">New password</label>
    32               <input type="password" name="new-pass" />
    33           </div>
    34           <div>
    35               <label for="retype-pass">Retype new password</label>
    36               <input type="password" name="retype-pass" />
    37           </div>
    38       </div>
    39     </div>
    40 
    41     {% if true %}
    42         <div class="section">
    43           <h2>Change E-mail Address</h2>
    44    
    45           <div>
    46               <div>
    47                   <label>Current e-mail</label>
    48                   {{ email_address }} {{ email_confirmed }}
    49               </div>
    50               <div>
    51                   <label for="new-email">New e-mail</label>
    52                   <input type="text" name="new-email" class="c1" />
    53               </div>
    54           </div>
    55         </div>
    56         {% endif %}
    57     <div id="buttons">
    58     <button type="submit">Save</button>
    59     <a href="/"><button>Cancel</button></a>
    60     </div>
    61   </form>
    62 {% endblock %}
  • new file sagenb/data/sage/html/accounts/account_recovery.html

    diff -r 8afee2ec056a sagenb/data/sage/html/accounts/account_recovery.html
    - +  
     1{% extends "html/accounts/base.html" %}
     2
     3{% block title %}Account Recovery{% endblock %}
     4{% block page_id %}account-recovery-page{% endblock %}
     5
     6{% block body %}
     7<div id="wrapper">
     8    <h1>Account Recovery</h1>
     9    <p>A new password will be emailed to the email address connected to your account. However if you didn't confirm your email address you will be unable to recover your account.</p> 
     10
     11    <form method="GET" action="/forgotpass">
     12        <div>
     13            <label for="username">Username</label>
     14            <input type="text" name="username" size="15" />
     15        </div>
     16        <div>
     17            <button type="submit">Submit</button> <a href="/"><button >Cancel</button></a>
     18        </div>
     19</form>
     20</div>
     21{% endblock %}
  • new file sagenb/data/sage/html/accounts/base.html

    diff -r 8afee2ec056a sagenb/data/sage/html/accounts/base.html
    - +  
     1{% extends "html/base.html" %}
     2{% block body_classes %}accounts-page{% endblock %}
  • new file sagenb/data/sage/html/accounts/registration.html

    diff -r 8afee2ec056a sagenb/data/sage/html/accounts/registration.html
    - +  
     1{% extends "html/accounts/base.html" %}
     2
     3{% block title %}Sign up{% endblock %}
     4
     5{% block page_id %}registration-page{% endblock %}
     6
     7{% block body %}
     8<div id="wrapper">
     9    <h1>Sign up for a Sage Notebook account</h1>
     10    {% if error %}
     11    <h2 class="error_found">Error{{ error[1:] }}found</h2>
     12    {% endif %}
     13    <form method="POST" action="/register">
     14        <ol>
     15            <li>
     16                <h2>Create a username</h2>
     17                <p>Your username must start with a letter and be between 3 and 64
     18                characters long. You may only use letters, numbers, underscores, @,
     19                and dots.</p>
     20                <input type="text" name="username" value="{{ username }}" class="entry" tabindex="1" />
     21                {% if username_missing %}
     22                <p><span class="error">Error:</span> No username given</p>
     23                {% endif %}
     24                {% if username_taken %}
     25                <p><span class="error">Error:</span> Username already in use</p>
     26                {% endif %}
     27                {% if username_invalid %}
     28                <p><span class="error">Error:</span> Bad username</p>
     29                {% endif %}
     30            </li>
     31            <li>
     32                <h2>Create a good password</h2>
     33                <p>
     34                    Your password must be between 4 and 32 characters
     35                    long. Your password can not contain your username nor spaces.
     36                </p>
     37                <input type="password" name="password" class="entry" tabindex="2" />
     38                {% if password_missing %}
     39                <p><span class="error">Error:</span> No password given</p>
     40                {% endif %}
     41                {% if password_invalid %}
     42                <p><span class="error">Error:</span> Bad password</p>
     43                {% endif %}
     44            </li>
     45            <li><h2>Re-type your password</h2>
     46            <input type="password" name="retype_password" class="entry" tabindex="3" />
     47            {% if passwords_dont_match or retype_password_missing %}
     48            <p><span class="error">Error:</span> Passwords didn't match</p>
     49            {% endif %}
     50            </li>
     51            {% if email or email_missing or email_invaild %}
     52            <li>
     53                <h2>Enter your email address</h2>
     54                <p>
     55                    Your email address is required for account
     56                    confirmation and recovery. You will be emailed a confirmation link
     57                    right after you successfully sign up.
     58                </p>
     59                <input type="text" name="email" value="{{ email_address }}" class="entry" tabindex="4" />
     60                {% if email_missing %}
     61                <p><span class="error">Error:</span> No email address given</p>
     62                {% endif %}
     63                {% if email_invalid %}
     64                <p><span class="error">Error:</span> Invalid email address</p>
     65                {% endif %}
     66            </li>
     67            {% endif %}
     68            {% if challenge %}
     69            <li>
     70                <h2>Answer a challenge</h2>
     71                {{ challenge_html }}
     72                {% if challenge_missing %}
     73                <p><span class="error">Error:</span> No challenge response given</p>
     74                {% endif %}
     75                {% if challenge_invalid %}
     76                <p><span class="error">Error:</span> Invalid challenge response</p>
     77                {% endif %}
     78            </li>
     79            {% endif %}
     80        </ol>
     81        <button type="submit" tabindex="100" id="create-account-button">Create account</button>
     82        <a href="/"><button tabindex="101">Cancel</button></a>
     83    </form>
     84</div>
     85{% endblock %}
     86 No newline at end of file
  • deleted file sagenb/data/sage/html/admin_add_user.html

    diff -r 8afee2ec056a sagenb/data/sage/html/admin_add_user.html
    + -  
    1 <html>
    2 <head>
    3 <title>Add New User | {{ sitename }}</title>
    4 <style>
    5 /***** Global Settings *****/
    6 
    7 html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,table,caption,tbody,tfoot,thead,tr,th,td {
    8 border:0;
    9 font-family:inherit;
    10 font-size:100%;
    11 font-style:inherit;
    12 font-weight:inherit;
    13 margin:0;
    14 outline:0;
    15 padding:0;
    16 text-decoration:none;
    17 vertical-align:baseline
    18 }
    19 
    20 html {
    21 font-size:100.1%
    22 }
    23 
    24 body {
    25 font:0.88em/1.4 Arial, Helvetica, sans-serif;
    26 }
    27 
    28 #wrapper {
    29 margin:0 auto;
    30 max-width:600px
    31 }
    32 
    33 /***** Headings *****/
    34 
    35 h1,h2,h3,h4,h5 {
    36 font-wieght:normal
    37 }
    38 
    39 h1 {
    40 border-bottom:1px solid #696969;
    41 font-size:2em;
    42 padding:10px 0
    43 }
    44 
    45 h2 {
    46 font-weight:bold
    47 }
    48 
    49 h1, h2, p, li, .entry {
    50 margin-bottom:10px
    51 }
    52 
    53 .entry {
    54 border:1px solid #999;
    55 padding:3px;
    56 width:200
    57 }
    58 
    59 li {
    60 border-bottom:1px solid #CCC
    61 }
    62 
    63 .error, .error_found {
    64 color:red
    65 }
    66 
    67 .error_found {
    68 font-size:1.5em
    69 }
    70 
    71 .button {
    72 font-size:1.2em
    73 }
    74 </style>
    75 </head>
    76 <body>
    77 <div id="wrapper">
    78 <h1>Add New User</h1>
    79 {% if error %}
    80 <h2 class="error_found">Username Error</h2>
    81 {% endif %}
    82 <form method="POST" action="/adduser">
    83 <ol>
    84 <li><h2>Pick a username</h2>
    85 <p>The username must start with a letter and be between 4 and 32 characters long. It can only consist of letters, numbers, underscores, and one dot (.).</p>
    86 <input type="text" name="username" value="{{ username }}" class="entry" />
    87 {% if username_error %}
    88 {% if username_error == 'invalid' %}
    89 <p><span class="error">Error:</span> Invalid username</p>
    90 {% else %}
    91 <p><span class="error">Error:</span> Username taken</p>
    92 {% endif %}
    93 {% endif %}
    94 </li>
    95 </ol>
    96 <input type="submit" value="Create account" class="button" />
    97 <input type="button" value="Cancel" style="margin-left:10px" onClick="parent.location='/users'" class="button" />
    98 </form>
    99 </div>
    100 </body>
    101 </html>
    102  No newline at end of file
  • deleted file sagenb/data/sage/html/banner.html

    diff -r 8afee2ec056a sagenb/data/sage/html/banner.html
    + -  
    1 <div id="banner">
    2     <a class="banner" href="http://nb.sagemath.org/">
    3         <img align="top" src="/images/sagenb.png" alt="Sage" /><span>The Sage Notebook</span>
    4     </a>
    5         <span class="ping" id="ping">Searching for Sage server...</span>
    6     <div class="version">
    7         Version {{ sage_version }}
    8     </div>
    9 </div>
  • sagenb/data/sage/html/base.html

    diff -r 8afee2ec056a sagenb/data/sage/html/base.html
    a b  
     1{%- macro render_title -%}{% block title %}{% endblock %}{%- endmacro -%}
    12<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    23<html lang="en">
    34    <head>
    4         <title>{% block title %}{% endblock %}</title>
     5        <title>{{ render_title() }} -- Sage</title>
    56        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    67        {% block pre_main_css %}{% endblock %}
    7         <link type="text/css" rel="stylesheet" href="/css/{% block css %}master{% endblock %}.css" media="screen" />
     8        <link type="text/css" rel="stylesheet" href="/css/{% block css %}main{% endblock %}.css" />
    89        {% block more_css %}{% endblock %}
    9         <!-- jQuery - general-purpose functions -->
     10        {# jQuery and other universally used libraries #}
    1011        <script type="text/javascript" src="/javascript/jquery/jquery-1.3.2.min.js"></script>
    1112        {% block javascript %}
    12         <!-- Worksheet list functions -->
     13        {# Page-specific libraries #}
    1314        <script type="text/javascript" src="/javascript/sage/ws_list.js"></script>
    1415        {% endblock %}
     16        {# Behavior #}
     17        <script type="text/javascript" src="/javascript/sage/master.js"></script>
    1518    </head>
    16     <body {% block body_attrs %}{% endblock %} id="{% block page_id %}{% endblock %}">
    17         {% block body %}{% endblock %}
     19    <body id="{% block page_id %}{% endblock %}"
     20          class="{% block body_classes %}{% endblock %}">
     21        {% block body %}
     22        <div id="header">
     23            {% block header %}
     24            <div id="top-bar">
     25                <div id="banner">
     26                    <a class="banner" href="http://nb.sagemath.org/">
     27                        <img align="top" src="/images/sagenb.png" alt="Sage" /><span>The Sage Notebook</span>
     28                    </a>
     29                    <span class="ping" id="ping">Searching for Sage server...</span>
     30                    <div class="version">
     31                        Version {{ sage_version }}
     32                    </div>
     33                </div>
     34                {% block controls %}
     35                {% endblock %}
     36            </div>
     37            {% endblock %}
     38        </div>
     39        <div id="main">
     40            {% block main %}
     41
     42            {% endblock %}
     43        </div>
     44        {% endblock %}
    1845    </body>
    19 </html>
     46</html>
     47 No newline at end of file
  • new file sagenb/data/sage/html/base_authenticated.html

    diff -r 8afee2ec056a sagenb/data/sage/html/base_authenticated.html
    - +  
     1{% extends "html/base.html" %}
     2{% block controls %}
     3<div id="main-controls" class="controls">
     4    <ul>
     5        <li class="username">{{ username }}</li>
     6        {% if username == 'guest' %}
     7        <li><a title="Please log in to the Sage notebook" href="/">Log in</a></li>
     8        {% else %}
     9        <li><a id="toggle-link" title="Toggle the top bar" onClick="$('#worksheet-bar').toggle()">Toggle</a></li>
     10        <li><a title="Back to your personal worksheet list" href="/home/{{ username }}">Home</a></li>
     11        {% if pub %}
     12        <li><span>Published</span></li>
     13        {% else %}
     14        <li><a title="Browse the published worksheets" href="/pub">Published</a></li>
     15        <li><a title="View a log of recent computations" href="#" onClick="history_window()">Log</a></li>
     16        {% endif %}
     17        <li><a title="Change account settings including password" href="/settings">Settings</a></li>
     18        <li><a title="Documentation" href="#" onClick="help()">Help</a></li>
     19        <li><a title="Report a problem or submit a bug to improve Sage" href="#" onClick="bugreport()">Report a Problem</a></li>
     20        <li><a title="Log out of the Sage notebook" href="/logout">Sign out</a></li>
     21        {% endif %}
     22    </ul>
     23</div>
     24{% endblock %}
  • new file sagenb/data/sage/html/base_popup.html

    diff -r 8afee2ec056a sagenb/data/sage/html/base_popup.html
    - +  
     1{% extends "html/base.html" %}
     2
     3{% block body %}
     4{% endblock %}
  • deleted file sagenb/data/sage/html/command_history.html

    diff -r 8afee2ec056a sagenb/data/sage/html/command_history.html
    + -  
    1 
    2 {#
    3 INPUT:
    4     - history_text - a string containing the history text of the notebook
    5 #}
    6 <html>
    7     <head>
    8         <title>Command History</title>
    9         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    10     </head>
    11     <body>
    12         <pre>{{history_text}}</pre>
    13         <a name="bottom"></a>
    14         <script type="text/javascript"> window.location="#bottom"</script>
    15     </body>
    16 </html>
    17  No newline at end of file
  • sagenb/data/sage/html/docs.html

    diff -r 8afee2ec056a sagenb/data/sage/html/docs.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22
    33{% block title %}Sage Documentation{% endblock %}
    44
    5 {% block css %}main{% endblock %}
    6 
    75{% block javascript %}
    86<script type="text/javascript" src="/javascript/sage/ws_list.js"></script>
    97{% endblock%}
    108
    119{% block page_id %}docs-main-page{% endblock %}
    1210
    13 {% block body %}
    14 
    15 {% include "html/top_bar.html" %}
     11{% block main %}
    1612
    1713<div class="control-bar">
    1814    <ul class="controls">
  • sagenb/data/sage/html/error_message.html

    diff -r 8afee2ec056a sagenb/data/sage/html/error_message.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22
    33{% block title %}Error{% endblock %}
    44
    5 {% block body %}
    6 <br><a class="usercontrol" href="/">Home</a>
    7 <hr class="usercontrol">
    8 <br/><br/>
    9 {{ msg }}
    10 <br/><br/>
     5{% block main %}
     6<div>
     7    {{ msg }}
     8</div>
    119{% if cont %}
    12 <center><a class="boldusercontrol" href="{{ cont }}"><font size=+1>Continue</font></a></center>
     10<div>
     11    <a class="boldusercontrol" href="{{ cont }}">Continue</a>
     12</div>
    1313{% endif %}
    1414{% endblock %}
  • sagenb/data/sage/html/history.html

    diff -r 8afee2ec056a sagenb/data/sage/html/history.html
    a b  
    22
    33{% block title %}Sage: History for {{username}} {% endblock %}
    44
    5 {% block css %}main{% endblock %}
    6 
    75{% block javascript %}
    86<script type="text/javascript" src="/javascript/sage/ws_list.js"></script>
    97{% endblock %}
     
    1210
    1311{% block body %}
    1412
    15 {% include "html/top_bar.html" %}
    16 
    1713    <pre>{{ text | escape }}</pre>
    1814    <a title="Click here to turn the above into a Sage worksheet" href="/live_history">Create a new Sage worksheet version of the last 100 commands in the above log.</a>
    1915    <a name="bottom"></a>
  • deleted file sagenb/data/sage/html/list_top.html

    diff -r 8afee2ec056a sagenb/data/sage/html/list_top.html
    + -  
    1 {% include "html/top_bar.html" %}
    2 
    3 <div id="usercontrols">
    4     {% if pub is not defined or not pub %}
    5     <a class="boldusercontrol" href="/new_worksheet" target="_blank">New Worksheet</a>
    6     <a class="boldusercontrol" href="/upload">Upload</a>
    7     {% if not accounts %}
    8     <a class="boldusercontrol" href="/download_worksheets.zip">Download All Active</a>
    9     {% endif %}
    10     {% endif %}
    11 
    12     <div id='search-area'>
    13       <form action="." method="GET">
    14         <input type="hidden" value="{{ typ if not pub else 'pub' }}" name="typ" />
    15         <input id="search-worksheets" size="20" value="{{ search if search else "" }}" name="search" />
    16         <button class="add_new_worksheet_menu" id="search-worksheets-button" type="submit">Search Worksheets</button>
    17       </form>
    18     </div>
    19 </div>
  • sagenb/data/sage/html/login.html

    diff -r 8afee2ec056a sagenb/data/sage/html/login.html
    a b  
    22
    33{% block title %}Sign in{% endblock %}
    44
    5 {% block body %}
    6 {% include "html/banner.html" %}       
     5{% block page_id %}login-page{% endblock %}
    76
     7{% block main %}
    88{% if welcome %}
    99<h2>Congratulations {{ welcome }}! You can now sign into the Sage Notebook.</h2>
    1010{% endif %}
     
    6969            {% endif %}
    7070        </div>
    7171        <div>
    72             <input type="checkbox" name="remember" />Remember me
     72            <input type="checkbox" name="remember" /> Remember me
    7373        </div>
    7474        <div>
    7575            <button type="submit">Sign in</button>
    7676        </div>
    7777    </form>
     78    {% if accounts %}
    7879    <div>
    79         {% if accounts %}
    8080        <a href="/register" id="register-link"><strong>Sign up for a new Sage Notebook account</strong></a>
    81         {% endif %}
    8281    </div>
     82    {% endif %}
    8383    <div>
    8484        <a href="/pub"><strong>Browse published Sage worksheets<br>(no login required)</strong></a>
    8585    </div>
     86    {% if recovery %}
    8687    <div>
    87         {% if recovery %}
    8888        <a href="/forgotpass"><strong>Forgot password</strong></a>
    89         {% endif %}
    9089    </div>
     90    {% endif %}
    9191</div>
    9292{% endblock %}
    9393
  • sagenb/data/sage/html/notebook/afterpublish_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/afterpublish_window.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - url - a string containing the url of the published page
    8 - time - a string representing the time of publication
    9 - JSMATH - a boolean stating whether to include jsMath
    10 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    11 #}
     1{% extends "html/notebook/base_aux.html" %}
     2
     3{% block page_id %}after-publish-page{% endblock %}
    124
    135{% set checked = 'checked="true"' if worksheet.is_auto_publish() else '' %}
    146
    157{% block sharebar_title %}
    16 Worksheet is publicly viewable at <a href="{{ url }}" style="color:#FFF" target="_blank">{{ url }}</a>
    17 <br />
    18 Published on {{ time }}
    19 <br />
    20 <br />
    21 <input type="button" value="Re-publish worksheet" onClick="parent.location='?re'" />
    22 <input type="button" value="Stop publishing" style="margin-left:5px" onClick="parent.location='?stop'" />
    23 <br /><br />
     8<p>Worksheet is publicly viewable at <a href="{{ url }}" style="color:#FFF" target="_blank">{{ url }}</a></p>
     9<p>Published on {{ time }}</p>
     10<div>
     11    <a href=".?re"><button>Re-publish worksheet</button></a>
     12    <a onClick="parent.location+='?stop'"><button>Stop publishing</button></p></a>
     13</div>
    2414<input type="checkbox" name="auto" {{ checked }} onchange="parent.location='?auto'"/> <label for="auto">Automatically re-publish when changes are made</label>
    2515{% endblock %}
    2616{% set select = "publish" %}
  • new file sagenb/data/sage/html/notebook/base.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/base.html
    - +  
     1{% extends "html/base_authenticated.html" %}
     2{#
     3INPUT:
     4- notebook - an instance of Notebook
     5- worksheet - an instance of Worksheet
     6- username  - a string containing a username
     7- title - a string
     8- select    - a string containing the control that is selected
     9- backwards - a boolean
     10#}
     11
     12{% set system_names = worksheet.notebook().system_names() %}
     13{% block title %}{{ worksheet.name() }}{% endblock %}
     14
     15
     16{% block javascript %}
     17<!-- jQuery UI - interacts, widgets, drag-drop, etc. -->
     18<link rel="stylesheet" href="/javascript/jqueryui/css/sage/jquery-ui-1.7.2.custom.css" />
     19<script type="text/javascript" src="/javascript/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>
     20
     21<!-- jQuery plugins - color pickers, shift-click, AJAX forms, IE fixes -->
     22<link rel="stylesheet" href="/javascript/jquery/plugins/farbtastic/farbtastic.css" type="text/css" />
     23<script type="text/javascript" src="/javascript/jquery/plugins/farbtastic/farbtastic.min.js"></script>
     24<script type="text/javascript" src="/javascript/jquery/plugins/extendedclick/jquery.event.extendedclick.min.js"></script>
     25<script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
     26<script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
     27<link rel="stylesheet" href="/javascript/jquery/plugins/jpicker/css/jPicker-1.0.11.css" type="text/css" />
     28<script type="text/javascript" src="/javascript/jquery/plugins/jpicker/jpicker-1.0.11.min.js"></script>
     29<link rel="stylesheet" media="screen" type="text/css" href="/javascript/jquery/plugins/colorpicker/css/colorpicker.css" />
     30<script type="text/javascript" src="/javascript/jquery/plugins/colorpicker/js/colorpicker.min.js"></script>
     31
     32<script type="text/javascript" src="/javascript/sage/main.js"></script>
     33
     34{% if JSMATH %}
     35<!-- jsMath - typeset mathematics -->
     36<script type="text/javascript" src="/javascript/sage/jsmath.js"></script>
     37{% endif %}
     38
     39<!-- Sage3d - accelerated 3D graphics -->
     40<script type="text/javascript" src="/javascript/sage3d/sage3d.js"></script>
     41
     42<!-- Jmol - embedded 3D graphics -->
     43<script type="text/javascript" src="/java/jmol/appletweb/Jmol.js"></script>
     44<!-- This must stay in head -->
     45<script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script>
     46
     47{% if JEDITABLE_TINYMCE and not worksheet.docbrowser() and not worksheet.is_published() %}
     48<!-- TinyMCE and jEditable - in-place editing of text cells -->
     49<script type="text/javascript" src="/javascript/tiny_mce/tiny_mce.js"></script>
     50<script type="text/javascript" src="/javascript/jquery/plugins/jeditable/jquery.jeditable.mini.js" charset="utf-8"></script>
     51<script type="text/javascript" src="/javascript/sage/tinymce.js"></script>
     52{% endif %}
     53
     54<script type="text/javascript">user_name= "{{ username }}";</script>
     55{% if worksheet.filename() %}
     56<script  type="text/javascript">
     57    $(document).ready(function() {
     58    worksheet_filename="{{ worksheet.filename() }}";
     59    worksheet_name="{{ worksheet.name() }}";
     60    server_ping_while_alive();
     61    });
     62</script>
     63{% endif %}
     64
     65{% endblock %}
     66
     67{% block main %}
     68<div id="worksheet-bar">
     69    <div class="worksheet_title">
     70        <a id="worksheet_title" class="worksheet_title"
     71           onClick="rename_worksheet(); return false;"
     72           title="Click to rename this worksheet">
     73            {{ worksheet.name() }}
     74        </a>
     75        <div><span class="lastedit">{{ worksheet.html_time_last_edited() }}</span></div>
     76        {% if worksheet.warn_about_other_person_editing(username) and username != 'guest' and not worksheet.is_doc_worksheet() %}
     77        <span class="pingdown">(Someone else is viewing this worksheet)</span>
     78        {% endif %}
     79    </div>
     80    <div id="save-discard-buttons">
     81        {% if not worksheet.is_doc_worksheet() %}
     82        <button name="button_save" title="Save changes" onClick="save_worksheet();">Save</button><button title="Save changes and close window" onClick="save_worksheet_and_close();" name="button_save">Save & quit</button><button title="Discard changes to this worksheet" onClick="worksheet_discard();">Discard & quit</button>
     83        {% endif %}
     84    </div>
     85   
     86    <div id="worksheet-menu">
     87        <select class="worksheet"  onchange="go_option(this);" id="file-menu">
     88            <option title="Select a file related function" value=""  selected>File...</option>
     89            <option title="Load a new worksheet stored in a file" value="upload_worksheet_button();">Load worksheet from a file...</option>
     90            <option title="Create a new worksheet" value="new_worksheet();">New worksheet</option>
     91            <option title="Save this worksheet to an sws file" value="download_worksheet();">Save worksheet to a file...</option>
     92            <option title="Print this worksheet" value="print_worksheet();">Print</option>
     93            <option title="Rename this worksheet" value="rename_worksheet();">Rename worksheet</option>
     94            <option title="Copy this worksheet" value="copy_worksheet();">Copy worksheet</option>
     95            <option title="Move this worksheet to the trash" value="delete_worksheet('{{ worksheet.filename() }}');">Delete worksheet</option>
     96        </select>
     97
     98        <select class="worksheet"  onchange="go_option(this);"  id="action-menu">
     99            <option title="Select a worksheet function" value="" selected>Action...</option>
     100            <option title="Interrupt currently running calculations, if possible" value="interrupt();">Interrupt</option>
     101            <option title="Restart the worksheet process" value="restart_sage();">Restart worksheet</option>
     102            <option title="Quit the worksheet process" value="save_worksheet_and_close();">Save and quit worksheet</option>
     103            <option value="">---------------------------</option>
     104            <option title="Evaluate all input cells in the worksheet" value="evaluate_all();">Evaluate All</option>
     105            <option title="Hide all output" value="hide_all();">Hide All Output</option>
     106            <option title="Show all output" value="show_all();">Show All Output</option>
     107            <option title="Delete all output" value="delete_all_output();">Delete All Output</option>
     108            <option value="">---------------------------</option>
     109            <option title="Switch to single-cell mode" value="slide_mode();">One Cell Mode</option>
     110            <option title="Switch to multi-cell mode" value="cell_mode();">Multi Cell Mode</option>
     111        </select>
     112        <select class="worksheet" onchange="handle_data_menu(this);" id="data-menu">
     113            <option title="Select an attached file" value="" selected>Data...</option>
     114            <option title="Upload or create a data file in a wide range of formats" value="__upload_data_file__">Upload or create file...</option>
     115            <option value="">--------------------</option>
     116            {% for name in worksheet.attached_data_files()|sort %}
     117            <option value="datafile?name={{ name }}">{{ name }}</option>
     118            {% endfor %}
     119        </select>
     120
     121        {% if not worksheet.is_doc_worksheet() %}
     122        <select onchange="go_system_select(this, {{ worksheet.system_index() }});" class="worksheet" id="systems-menu">
     123            {% for system_name in worksheet.notebook().systems() %}
     124            <option title="Evaluate all input cells using {{ system_names[loop.index0] }}"
     125                    {{ "selected" if worksheet.system_index() == loop.index0 else "" }} value="{{ system_names[loop.index0] }}">
     126                {{ system_name }}
     127            </option>
     128            {% endfor %}
     129        </select>   
     130        <input type="checkbox" title="Enable/disable pretty_printing"
     131               onchange="pretty_print_check(this.checked);"
     132               class="worksheet" value="pretty_print" {{ "checked" if worksheet.pretty_print() else "" }} />&nbsp;Typeset
     133        {% endif %}
     134    </div>
     135    <div id="share-publish-buttons">
     136        {% if not worksheet.is_doc_worksheet() %}
     137        {% macro cls(x) %}
     138        {{ "control-select" if x == select else "control" }}
     139        {% endmacro %}
     140        {% macro backwards_text() %}{{ "../" if backwards else "" }}{% endmacro %}
     141        <a title="Print this worksheet" class="print-link" onClick="print_worksheet()"><img border=0 src="/images/icon_print.gif" alt="Print">Print</a>
     142        <a class="{{ cls('use') }}" title="Interactively use this worksheet" onClick="edit_worksheet();">Worksheet</a>       
     143        <a class="{{ cls('edit') }}" title="Edit text version of this worksheet" href="{{ backwards_text() }}edit">Edit</a>
     144        <a class="{{ cls('text') }}" title="View plain text version of this worksheet" href="{{ backwards_text() }}text">Text</a>
     145        <a class="{{ cls('undo') }}" title="View changes to this worksheet over time" href="{{ backwards_text() }}revisions">Undo</a>
     146        <a class="{{ cls('share') }}" title="Let others edit this worksheet" href="{{ backwards_text() }}share">Share</a>
     147        <a class="{{ cls('publish') }}" title="Make this worksheet publicly viewable" href="{{ backwards_text() }}publish">Publish</a>
     148        {% endif %}
     149    </div>
     150</div>
     151<div class="hidden" id="slide_controls">
     152    <div class="slideshow_control">
     153        <a class="slide_arrow" onClick="slide_next()">&gt;</a>
     154        <a class="slide_arrow" onClick="slide_last()">&gt;&gt;</a> <span class="vbar"></span>
     155        <a class="cell_mode" onClick="cell_mode()">Exit</a>
     156    </div>
     157    <div class="slideshow_progress" id="slideshow_progress" onClick="slide_next()">
     158        <div class="slideshow_progress_bar" id="slideshow_progress_bar">&nbsp;</div>
     159        <div class="slideshow_progress_text" id="slideshow_progress_text">&nbsp;</div>
     160    </div>
     161    <div class="slideshow_control">
     162        <a class="slide_arrow" onClick="slide_first()">&lt;&lt;</a>
     163        <a class="slide_arrow" onClick="slide_prev()">&lt;</a>
     164    </div>
     165</div>
     166{% block worksheet_main %}{% endblock %}
     167{% endblock %}
     168
  • new file sagenb/data/sage/html/notebook/base_aux.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/base_aux.html
    - +  
     1{% extends "html/notebook/base.html" %}
     2{# Base template for auxilliary pages (Edit, Text, etc.) #}
     3
     4{% block worksheet_main %}
     5{% block before_sharebar %}{% endblock %}
     6<div class="sharebar">{% block sharebar_title %}{% endblock %}</div>
     7{% block after_sharebar %}{% endblock %}
     8{% endblock %}
  • sagenb/data/sage/html/notebook/beforepublish_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/beforepublish_window.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    9 #}
     1{% extends "html/notebook/base_aux.html" %}
    102
     3{% block page_id %}before-publish-page{% endblock %}
    114{% block sharebar_title %}
    125<p>You can publish your worksheet to the Internet, where anyone will be able to access and view it online.</p>
    136
     
    1710
    1811<form method="get" action=".">
    1912    <input type="hidden" name="yes" value="" />
    20     <input type="submit" value="Yes" style="margin-left:10px" />
    21     <input type="button" value="No" style="margin-left:5px" onClick="parent.location='../'" />
    22     <br/>
    23     <br/>
    24     <input type="checkbox" name="auto" style="margin-left:13px" /> Automatically re-publish when changes are made
     13    <div>
     14        <button type="submit">Yes</button>
     15        <a href="../"><button>No</button></a>
     16    </div>
     17    <div>
     18        <input type="checkbox" name="auto" /> <label for="auto"> Automatically re-publish when changes are made</label>
     19    </div>
    2520</form>
    2621{% endblock %}
    2722{% set select = "publish" %}
  • new file sagenb/data/sage/html/notebook/cell.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/cell.html
    - +  
     1{#
     2INPUT:
     3
     4        - ``cell`` -- Cell instance
     5
     6        - ``wrap`` - an integer stating column position to wrap lines. Defaults to
     7          configuration if not given.
     8
     9        - ``div_wrap`` - a boolean stating whether to wrap ``div``.
     10
     11        - ``do_print`` - a boolean stating whether the HTML is for
     12        print or not.
     13#}
     14{% if do_print %}
     15    {% set wrap = 68 %}
     16    {% set div_wrap = 68 %}
     17{% endif %}
     18{% set cell_cls = "cell_evaluated" if cell.evaluated() or do_print else "cell_not_evaluated" %}
     19
     20{% if div_wrap %}
     21<div id="cell_outer_{{ cell.id() }}" class="cell_visible">
     22    <div id="cell_{{ cell.id() }}" class="{{ cell_cls }}">
     23{% endif %}
     24        {% if 'hideall' not in cell.percent_directives() %}
     25            {# input #}
     26            <div class="insert_new_cell" id="insert_new_cell_before{{ cell.id() }}">
     27            </div>
     28            <script type="text/javascript">
     29                $("#insert_new_cell_before{{ cell.id() }}").plainclick(function(e) {insert_new_cell_before({{ cell.id() }});});
     30                $("#insert_new_cell_before{{ cell.id() }}").shiftclick(function(e) {insert_new_text_cell_before({{ cell.id() }});});
     31            </script>
     32            {% if 'hide' in cell.percent_directives() %}
     33                {% set input_cls = 'cell_input_hide' %}
     34            {% else %}
     35                {% set input_cls = 'cell_input' %}
     36            {% endif %}
     37            {% if do_print %}
     38                <div class="cell_input_print">
     39                     {{ cell.input_text().rstrip()|escape + '&nbsp;' }}
     40                </div>
     41            {% else %}
     42                <textarea class="cell_input" rows="{{ max(1, number_of_rows(t.strip(), 80)) }}"
     43                          cols="80"
     44                          id="cell_input_{{ cell.id() }}"
     45                          {# TODO: Migrate these 'on' handlers to a .js file #}
     46                          onKeyPress="return input_keypress({{ cell.id() }}, event);"
     47                          onKeyDown="return input_keydown({{ cell.id() }},event);"
     48                          onKeyUp="return input_keyup({{ cell.id() }}, event);"
     49                          onBlur="cell_blur({{ cell.id() }}); return true;"
     50                          onFocus="cell_focused(this, {{ cell.id() }}); return true;">{{ cell.input_text().rstrip() }}</textarea>
     51                <a href="javascript:evaluate_cell({{ cell.id() }},0)"
     52                   class="eval_button"
     53                   id="eval_button{{ cell.id() }}"
     54                   alt="Click here or press shift-return to evaluate">
     55                    evaluate
     56                </a>
     57            {% endif %}
     58            {# end input #}
     59
     60            <div id='introspect_div_{{ cell.id() }}' class='introspection'></div>
     61        {% endif %}
     62
     63        {% if do_print and self.cell_output_type() == 'hidden' %}
     64        <pre>
     65        </pre>
     66        {% else %}
     67        {% set output_cls = 'cell_div_output_running' if cell.computing() else 'cell_div_output_' + cell.cell_output_type() %}
     68        <div class="cell_output_div">
     69            <table class="cell_output_box">
     70                <tr>
     71                    <td class="cell_number" id="cell_number_{{ cell.id() }}"
     72                        {{ '' if do_print else 'onClick="cycle_cell_output_type(%s);"'|format(cell.id()) }} >
     73                        {% for i in range(7) %}&nbsp;{% endfor %}
     74                    </td>
     75                    <td class="output_cell">
     76                        <div class="{{ output_cls }}" id="cell_div_output_{{ cell.id() }}">
     77                            <div class="cell_output_{{ "print_" if do_print else '' }}{{ cell.cell_output_type() }}"
     78                                id="cell_output_{{ cell.id() }}">
     79                                {% if cell.introspect() %}
     80                                    {{ cell.output_text(0, html=true) }}
     81                                {% else %}
     82                                    {{ cell.output_text(wrap, html=true) }}
     83                                {% endif %}
     84                            </div>
     85                            {% if not do_print %}
     86                                <div class="cell_output_{{ 'print_' if do_print else '' }}nowrap_{{ cell.cell_output_type() }}"
     87                                     id="cell_output_nowrap_{{ cell.id() }}">
     88                                    {{ cell.output_text(0, html=true) }}
     89                                </div>
     90                            {% endif %}
     91                                <div class="cell_output_html_{{ cell.cell_output_type() }}"
     92                                     id="cell_output_html_{{ cell.id() }}">
     93                                    {{ cell.output_html() }}
     94                                </div>
     95                        </div>
     96                    </td>
     97                </tr>
     98            </table>
     99        </div>
     100        {% endif %}
     101       
     102{% if div_wrap %}
     103    </div>
     104</div>
     105{% endif %}
  • deleted file sagenb/data/sage/html/notebook/debug_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/debug_window.html
    + -  
    1 
    2 <div class='debug_window'>
    3     <div class='debug_output'><pre id='debug_output'></pre></div>
    4     <textarea rows=5 id='debug_input' class='debug_input'
    5               onKeyPress='return debug_keypress(event);'
    6               onFocus='debug_focus();' onBlur='debug_blur();'></textarea>
    7 </div>
    8  No newline at end of file
  • sagenb/data/sage/html/notebook/doc_page.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/doc_page.html
    a b  
    1 {% extends "html/notebook/index.html" %}
     1{% extends "html/notebook/worksheet_page.html" %}
    22
    33{% block pre_main_css %}
    44<link type="text/css" rel="stylesheet" href="_static/default.css" media="screen" />
  • sagenb/data/sage/html/notebook/download_or_delete_datafile.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/download_or_delete_datafile.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
     1{% extends "html/notebook/base_aux.html" %}
    22{#
    33INPUT:
    44- worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    65- username - a string containing a username
    7 - active_worksheets - a list of the Worksheet instances that are active for username
    86- filename_ - the name of the file
    9 - path - the path to the file
    107- file_is_image - a boolean stating whether the file is an image
    118- file_is_text - a boolean stating whether the file is a text file
    129- text_file_content - a string containing the content of a text file
    13 - JSMATH - a boolean stating whether to include jsMath
    14 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    1510#}
    1611
     12{% set path = "/home/%s/data/%s"|format(worksheet.filename(), filename_) %}
     13
    1714{% block sharebar_title %}
    1815Data file: {{ filename_ }}
    1916{% endblock %}
     
    2118{% block after_sharebar %}
    2219<p>You may download <a href="{{ path }}">{{ filename_ }}</a> or create a linked copy to the worksheet <select onchange="go_option(this);" class="worksheet">
    2320<option selected>select worksheet</option>
    24 {% for worksheet in active_worksheets %}
     21{% for worksheet in notebook.active_worksheets_for(username) %}
    2522    <option value='link_datafile("{{ worksheet.filename() }}","{{ filename_ }}")'>{{ worksheet.name() }}</option>
    2623{% endfor %}
    2724</select> or <a href="/home/{{ worksheet.filename() }}/datafile?name={{ filename_ }}&action=delete">delete {{ filename_ }}.</a></p>
  • sagenb/data/sage/html/notebook/edit_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/edit_window.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - text - a string containing the text of the worksheet
    8 - n_lines - number of lines of the text of the worksheet
    9 - JSMATH - a boolean stating whether to include jsMath
    10 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    11 #}
     1{% extends "html/notebook/base_aux.html" %}
    122
    13 {% block sharebar_title %}
    14 Edit plain text &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Save Changes" name="button_save" id="button_save"> <input type="submit" value="Cancel" name="button_cancel">
    15 {% endblock %}
    16 {% set select = "edit" %}
     3{% block page_id %}edit-page{% endblock %}
    174
    185{% block before_sharebar %}
    196<form method="post" action="save" enctype="multipart/form-data">
    207{% endblock %}
     8   
     9{% block sharebar_title %}
     10    <span>Edit plain text</span>
     11    <button type="submit" name="button_save" id="button_save">Save Changes</button>
     12    <button type="submit" name="button_cancel">Cancel</button>
     13{% endblock %}
     14{% set select = "edit" %}
     15
    2116{% block after_sharebar %}
    2217<script type="text/javascript">
    2318    function save_worksheet() {
     
    2520    function save_worksheet_and_close() {
    2621    }
    2722</script>
    28     <textarea class="plaintextedit" id="cell_intext" name="textfield" rows="{{ n_lines }}">{{ text }}</textarea>
     23    <textarea class="plaintextedit" id="cell_intext" name="textfield" rows="{{ worksheet.edit_text().count("\n")+1 }}">{{ worksheet.edit_text()|escape }}</textarea>
    2924</form>
    3025{% endblock %}
  • deleted file sagenb/data/sage/html/notebook/guest_top_bar_and_worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/guest_top_bar_and_worksheet.html
    + -  
    1 
    2 {#
    3 INPUT:
    4 - original_worksheet - an instance of Worksheet
    5 - worksheet - an instance of Worksheet
    6 - notebook - an instance of Notebook which contains worksheet
    7 - worksheet_html - a string containing the html for the worksheet
    8 - username - a string containing a username
    9 #}
    10 {% if original_worksheet.is_collaborator(username) or original_worksheet.is_owner(username) %}
    11     {% set edit_text = "Edit this." %}
    12     {% set url       = "edit_published_page" %}
    13 {% elif notebook.user_is_guest(username) %}
    14     {% set edit_text = "Log in to edit a copy." %}
    15     {% set url       = "/" %}
    16 {% else %}
    17     {% set edit_text = "Edit a copy." %}
    18     {% set url       = "edit_published_page" %}
    19 {% endif %}
    20 
    21 {% set download_name = worksheet.download_name() %}
    22 
    23 <a class="usercontrol" href="{{ url }}">{{ edit_text }}</a>
    24 &nbsp;&nbsp;<a class="usercontrol" href="download/{{ download_name }}.sws">Download.</a>
    25 &nbsp;&nbsp;<span class="ratingmsg">
    26     {% if worksheet.rating() != -1 %}
    27         <a class="usercontrol" href="rating_info">
    28             This page is rated {{ "%.1f"|format(worksheet.rating()) }}.
    29         </a>
    30     {% endif %}
    31     {% if not notebook.user_is_guest(username)
    32         and not worksheet.is_publisher(username) %}
    33         &nbsp;&nbsp;
    34         <span class="usercontrol">
    35             {{ "Rerate" if worksheet.is_rater(username) else "Rate" }} it:
    36         </span>
    37         {% for i in range(5) %}
    38             <a class="usercontrol"
    39                onClick="rate_worksheet({{ i }})">
    40                 &nbsp;{{ i }}&nbsp;
    41             </a>
    42         {% endfor %}
    43             &nbsp;&nbsp; <input name="rating_comment" id="rating_comment"></input>
    44     {% endif %}
    45 </span>
    46 <span class="pubmsg">
    47     <a href="/pub/">Other published documents...</a>
    48 </span>
    49 <hr class="usercontrol" />
    50 <h1 align="center" class="title">{{ worksheet.name() }}</h1>
    51 <h2 align="center">{{ worksheet.html_time_since_last_edited() }}</h2>
    52 {{ worksheet_html }}
    53 <hr class="usercontrol" />
    54 {% for i in range(10) %}
    55 &nbsp;
    56 {% endfor %}
    57 
    58 
    59 
  • new file sagenb/data/sage/html/notebook/guest_worksheet_page.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/guest_worksheet_page.html
    - +  
     1{% extends "html/notebook/base.html" %}
     2{#
     3INPUT:
     4- worksheet - an instance of Worksheet
     5- notebook - an instance of Notebook which contains worksheet
     6- username - a string containing a username
     7#}
     8
     9{% block page_id %}guest-worksheet-page{% endblock %}
     10
     11{% set original_worksheet = worksheet.worksheet_that_was_published() %}
     12{% if original_worksheet.is_collaborator(username) or original_worksheet.is_owner(username) %}
     13    {% set edit_text = "Edit this." %}
     14    {% set url       = "edit_published_page" %}
     15{% elif notebook.user_is_guest(username) %}
     16    {% set edit_text = "Log in to edit a copy." %}
     17    {% set url       = "/" %}
     18{% else %}
     19    {% set edit_text = "Edit a copy." %}
     20    {% set url       = "edit_published_page" %}
     21{% endif %}
     22
     23{% set download_name = worksheet.download_name() %}
     24
     25{% block body %}
     26<ul class="controls">
     27    <li><a href="{{ url }}">{{ edit_text }}</a></li>
     28    <li><a href="download/{{ download_name }}.sws">Download.</a></li>
     29    {% if true or worksheet.rating() != -1 or
     30       not (notebook.user_is_guest(username) or worksheet.is_publisher(username)) %}
     31    <li>
     32        {% if true or worksheet.rating() != -1 %}
     33            <a class="usercontrol" href="rating_info">
     34                This page is rated {{ "%.1f"|format(worksheet.rating()) }}.
     35            </a>
     36        {% endif %}
     37        {% if true or not (notebook.user_is_guest(username) or worksheet.is_publisher(username)) %}
     38            <span>
     39                {{ "Rerate" if worksheet.is_rater(username) else "Rate" }} it:
     40            </span>
     41            {% for i in range(5) %}
     42                <a class="usercontrol"
     43                   onClick="rate_worksheet({{ i }})">{{ i }}</a>
     44            {% endfor %}
     45                &nbsp;&nbsp; <input name="rating_comment" id="rating_comment"></input>
     46        {% endif %}
     47    </li>
     48    {% endif %}
     49    <li><a href="/pub/">Other published documents...</a></li>
     50</ul>
     51<hr class="usercontrol" />
     52<h1 class="title">{{ worksheet.name() }}</h1>
     53<h2 class="lastedit">{{ worksheet.html_time_since_last_edited() }}</h2>
     54{{ worksheet.html(do_print=false, publish=true) }}
     55<hr class="usercontrol" />
     56{% for i in range(10) %}
     57&nbsp;
     58{% endfor %}
     59{% endblock %}
     60
     61
     62
  • deleted file sagenb/data/sage/html/notebook/head.tmpl

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/head.tmpl
    + -  
    1 {#
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - worksheet_filename - a string containing a worksheet's filename
    5 - username - a string containing a user's name
    6 - JSMATH - a boolean stating whether to include jsMath
    7 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    8   #}
    9 {% macro common_title(worksheet_filename, worksheet) %}
    10     {% if worksheet_filename %}
    11         {{ worksheet.name() }} (Sage)
    12     {% else %}
    13         Sage Notebook | Welcome
    14     {% endif %}
    15 {% endmacro %}
    16 
    17 {% macro common_javascript(worksheet, worksheet_filename, username, JSMATH, JEDITABLE_TINYMCE) %}
    18 <!-- jQuery UI - interacts, widgets, drag-drop, etc. -->
    19 <link rel="stylesheet" href="/javascript/jqueryui/css/sage/jquery-ui-1.7.2.custom.css" />
    20 <script type="text/javascript" src="/javascript/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>
    21 
    22 <!-- jQuery plugins - color pickers, shift-click, AJAX forms, IE fixes -->
    23 <link rel="stylesheet" href="/javascript/jquery/plugins/farbtastic/farbtastic.css" type="text/css" />
    24 <script type="text/javascript" src="/javascript/jquery/plugins/farbtastic/farbtastic.min.js"></script>
    25 <script type="text/javascript" src="/javascript/jquery/plugins/extendedclick/jquery.event.extendedclick.min.js"></script>
    26 <script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
    27 <script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
    28 <link rel="stylesheet" href="/javascript/jquery/plugins/jpicker/css/jPicker-1.0.11.css" type="text/css" />
    29 <script type="text/javascript" src="/javascript/jquery/plugins/jpicker/jpicker-1.0.11.min.js"></script>
    30 <link rel="stylesheet" media="screen" type="text/css" href="/javascript/jquery/plugins/colorpicker/css/colorpicker.css" />
    31 <script type="text/javascript" src="/javascript/jquery/plugins/colorpicker/js/colorpicker.min.js"></script>
    32 
    33 <script type="text/javascript" src="/javascript/sage/main.js"></script>
    34  
    35 {% if JSMATH %}
    36 <!-- jsMath - typeset mathematics -->
    37 <script type="text/javascript" src="/javascript/sage/jsmath.js"></script>
    38 {% endif %}
    39 
    40 <!-- Sage3d - accelerated 3D graphics -->
    41 <script type="text/javascript" src="/javascript/sage3d/sage3d.js"></script>
    42 
    43 <!-- Jmol - embedded 3D graphics -->
    44 <script type="text/javascript" src="/java/jmol/appletweb/Jmol.js"></script>
    45 <!-- This must stay in head -->
    46 <script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script>
    47 
    48 {% if JEDITABLE_TINYMCE and not worksheet.docbrowser() and not worksheet.is_published() %}
    49 <!-- TinyMCE and jEditable - in-place editing of text cells -->
    50 <script type="text/javascript" src="/javascript/tiny_mce/tiny_mce.js"></script>
    51 <script type="text/javascript" src="/javascript/jquery/plugins/jeditable/jquery.jeditable.mini.js" charset="utf-8"></script>
    52 <script type="text/javascript" src="/javascript/sage/tinymce.js"></script>
    53 {% endif %}
    54 
    55 <script type="text/javascript">user_name= "{{ username }}";</script>
    56 {% if worksheet_filename %}
    57 <script  type="text/javascript">
    58   worksheet_filename="{{ worksheet_filename }}";
    59   worksheet_name="{{ worksheet.name() }}";
    60   server_ping_while_alive();
    61 </script>
    62 {% endif %}
    63 
    64 {% endmacro %}
  • deleted file sagenb/data/sage/html/notebook/index.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/index.html
    + -  
    1 {% extends "html/base.html" %}
    2  {#
    3  INPUT:
    4  - worksheet - an instance of Worksheet
    5  - worksheet_filename - a string containing a worksheet's filename
    6  - notebook - an instance of Notebook which contains worksheet
    7  - username  - a string containing a username
    8  - show_debug - a boolean stating whether to show debug information
    9  - JSMATH - a boolean stating whether to include jsMath
    10  - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    11  - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    12  - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    13  - do_print - a boolean stating whether the file is for print mode
    14  - worksheet_html - a string containing the html for a worksheet
    15  - select    - a string containing the control that is selected
    16  - backwards - a boolean
    17  - warn - boolean stating whether to warn that another user is viewing
    18           the worksheet
    19 #}
    20 
    21 {% if not select %}
    22     {% set select = none %}
    23 {% endif %}
    24 
    25 {% if not backwards %}
    26     {% set backwards = false %}
    27 {% endif %}
    28    
    29 {% include "html/notebook/head.tmpl"%}
    30 
    31 {% block title %}
    32 {{ common_title(worksheet_filename, worksheet) }}
    33 {% endblock %}
    34    
    35 {% block css %}main{% endblock %}
    36 
    37 {% block javascript %}
    38 {{ common_javascript(worksheet, worksheet_filename, username, JSMATH, JEDITABLE_TINYMCE) }}
    39 {% endblock %}
    40 
    41 {# TODO: Hack until the template restructuring #}
    42 {% block body_attrs %}
    43 {% if worksheet.is_published() or notebook.user_is_guest(username) %}
    44         class="worksheet-online" onLoad="initialize_the_notebook();"
    45     {% else %}
    46         class="worksheet-online" onLoad="initialize_the_notebook();" id="user-worksheet-index"
    47 {% endif %}
    48 {% endblock %}
    49 
    50 
    51 {% block body %}
    52 {% if worksheet.is_published() or notebook.user_is_guest(username) %}
    53     {% set original_worksheet = worksheet.worksheet_that_was_published() %}
    54     {% include "html/notebook/guest_top_bar_and_worksheet.html" %}
    55 {% else %}
    56     {% include "html/notebook/top_bar_and_worksheet.html" %}
    57 {% endif %}
    58 {% if not worksheet %}
    59     </td></tr></table></span>
    60 {% endif %}
    61 {% if worksheet.is_only_viewer(username) %}
    62     <script type="text/javascript">worksheet_locked=true;</script>
    63 {% else %}
    64     <script type="text/javascript">worksheet_locked=false;</script>
    65 {% endif %}
    66 {% if worksheet.computing() %}
    67     <!-- Set the update checking back in motion. -->
    68     <script type="text/javascript">
    69         active_cell_list = {{ worksheet.queue_id_list() }};
    70         for(var i = 0; i < active_cell_list.length; i++) {
    71             cell_set_running(active_cell_list[i]);
    72         }
    73         start_update_check();
    74     </script>
    75 {% endif %}
    76 {% endblock %}
  • sagenb/data/sage/html/notebook/plain_text_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/plain_text_window.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - plain_text - a string containing the plain text version
    8 - JSMATH - a boolean stating whether to include jsMath
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 #}
     1{% extends "html/notebook/base_aux.html" %}
    112
    123{% block sharebar_title %}
    134View plain text
     
    167{% set select = "text" %}
    178
    189{% block after_sharebar %}
    19 <pre class="plaintext" id="cell_intext" name="textfield">{{ plain_text }}</pre>
     10<pre class="plaintext" id="cell_intext" name="textfield">{{ worksheet.plain_text(prompts=true, banner=false)|escape|trim }}</pre>
    2011{% endblock %}
  • deleted file sagenb/data/sage/html/notebook/plain_text_worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/plain_text_worksheet.html
    + -  
    1 
    2 {#
    3 INPUT:
    4      - worksheet_name - a string containing a worksheet's name
    5      - worksheet_plain_text - a string containing the plain text version of a worksheet
    6 #}
    7 <head>
    8     <title>Sage Worksheet: {{ worksheet_name }}</title>
    9     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    10 </head>
    11 <body>
    12     <h1><a href=".">Sage Worksheet: %s</a></h1>
    13     <pre>{{ worksheet_plain_text }}</pre>
    14 </body>
    15  No newline at end of file
  • new file sagenb/data/sage/html/notebook/print_worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/print_worksheet.html
    - +  
     1{% extends "html/notebook/base.html" %}
     2
     3{% block page_id %}print-page{% endblock %}
     4
     5{% block body %}
     6<h1>{{ worksheet.name() }}</h1>
     7{{ worksheet.html(do_print=true) }}
     8{% endblock %}
     9
     10 
     11 No newline at end of file
  • new file sagenb/data/sage/html/notebook/render_cell.tmpl

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/render_cell.tmpl
    - +  
     1{% macro render_cell(cell, wrap, div_wrap, do_print) %}
     2{#
     3INPUT:
     4        - ``wrap`` - an integer stating column position to wrap lines. Defaults to
     5          configuration if not given.
     6
     7        - ``div_wrap`` - a boolean stating whether to wrap ``div``.
     8
     9        - ``do_print`` - a boolean stating whether the HTML is for
     10        print or not.
     11#}
     12{% if do_print %}
     13    {% set wrap = 68 %}
     14    {% set div_wrap = 68 %}
     15{% endif %}
     16{% set cell_cls = "cell_evaluated" if cell.evaluated() or do_print else "cell_not_evaluated" %}
     17
     18{% if div_wrap %}
     19<div id="cell_outer_{{ cell.id() }}" class="cell_visible">
     20    <div id="cell_{{ cell.id() }}" class="{{ cell_cls }}">
     21{% endif %}
     22        {% if 'hideall' not in cell.percent_directives() %}
     23            {# input #}
     24            {% if 'hide' in cell.percent_directives() %}
     25                {% set input_cls = 'cell_input_hide' %}
     26            {% else %}
     27                {% set input_cls = 'cell_input' %}
     28            {% endif %}
     29            {% if do_print %}
     30                <div class="cell_input_print">
     31                     {{ cell.input_text().rstrip()|escape + '&nbsp;' }}
     32                </div>
     33            {% else %}
     34                <textarea class="cell_input" rows="{{ max(1, number_of_rows(t.strip(), 80)) }}"
     35                          cols="80"
     36                          id="cell_input_{{ cell.id() }}"
     37                          {# TODO: Migrate these 'on' handlers to a .js file #}
     38                          onKeyPress="return input_keypress({{ cell.id() }}, event);"
     39                          onKeyDown="return input_keydown({{ cell.id() }},event);"
     40                          onKeyUp="return input_keyup({{ cell.id() }}, event);"
     41                          onBlur="cell_blur({{ cell.id() }}); return true;"
     42                          onFocus="cell_focused(this, {{ cell.id() }}); return true;">{{ cell.input_text().rstrip() }}</textarea>
     43                <a href="javascript:evaluate_cell({{ cell.id() }},0)"
     44                   class="eval_button"
     45                   id="eval_button{{ cell.id() }}"
     46                   alt="Click here or press shift-return to evaluate">
     47                    evaluate
     48                </a>
     49            {% endif %}
     50            {# end input #}
     51
     52            <div id='introspect_div_{{ cell.id() }}' class='introspection'></div>
     53        {% endif %}
     54
     55        {% if do_print and self.cell_output_type() == 'hidden' %}
     56        <pre>
     57        </pre>
     58        {% else %}
     59        {% set output_cls = 'cell_div_output_running' if cell.computing() else 'cell_div_output_' + cell.cell_output_type() %}
     60        <div class="cell_output_div">
     61            <table class="cell_output_box">
     62                <tr>
     63                    <td class="cell_number" id="cell_number_{{ cell.id() }}"
     64                        {{ '' if do_print else 'onClick="cycle_cell_output_type(%s);"'|format(cell.id()) }} >
     65                        {% for i in range(7) %}&nbsp;{% endfor %}
     66                    </td>
     67                    <td class="output_cell">
     68                        <div class="{{ output_cls }}" id="cell_div_output_{{ cell.id() }}">
     69                            <div class="cell_output_{{ "print_" if do_print else '' }}{{ cell.cell_output_type() }}"
     70                                id="cell_output_{{ cell.id() }}">
     71                                {% if cell.introspect() %}
     72                                    {{ cell.output_text(0, html=true) }}
     73                                {% else %}
     74                                    {{ cell.output_text(wrap, html=true) }}
     75                                {% endif %}
     76                            </div>
     77                            {% if not do_print %}
     78                                <div class="cell_output_{{ 'print_' if do_print else '' }}nowrap_{{ cell.cell_output_type() }}"
     79                                     id="cell_output_nowrap_{{ cell.id() }}">
     80                                    {{ cell.output_text(0, html=true) }}
     81                                </div>
     82                            {% endif %}
     83                                <div class="cell_output_html_{{ cell.cell_output_type() }}"
     84                                     id="cell_output_html_{{ cell.id() }}">
     85                                    {{ cell.output_html() }}
     86                                </div>
     87                        </div>
     88                    </td>
     89                </tr>
     90            </table>
     91        </div>
     92        {% endif %}
     93       
     94{% if div_wrap %}
     95    </div>
     96</div>
     97{% endif %}
     98
     99{% endmacro %}
  • new file sagenb/data/sage/html/notebook/render_worksheet.tmpl

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/render_worksheet.tmpl
    - +  
     1{% include "html/notebook/render_cell.tmpl" %}
     2{% macro render_worksheet(worksheet, do_print, publish) %}
     3
     4{% set wrap = conf['word_wrap_cols'] %}
     5{% if not publish %}
     6    {% set publish = worksheet.is_published() %}
     7{% endif %}
     8
     9<div class="cell_input_active" id="cell_resizer"></div>
     10{% if not publish %}
     11<div class="worksheet_cell_list" id="worksheet_cell_list">
     12{% endif %}
     13
     14{% for cell in worksheet.cell_list() %}
     15{{ render_cell(cell, wrap, true, do_print or publish) }}
     16{% endfor %}
     17
     18{% if not do_print and not publish %}
     19</div>
     20<div class="insert_new_cell" id="insert_last_cell"></div>
     21<script type="text/javascript">
     22$(document).ready(function() {                                 
     23    $("#insert_last_cell").plainclick(function(e) {insert_new_cell_after(cell_id_list[cell_id_list.length-1]);});
     24    $("#insert_last_cell").shiftclick(function(e) {insert_new_text_cell_after(cell_id_list[cell_id_list.length-1]);});
     25});
     26</script>
     27{% endif %}
     28{% endmacro %}
  • deleted file sagenb/data/sage/html/notebook/slide_controls.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/slide_controls.html
    + -  
    1 
    2 <div class="hidden" id="slide_controls">
    3     <div class="slideshow_control">
    4         <a class="slide_arrow" onClick="slide_next()">&gt;</a>
    5         <a class="slide_arrow" onClick="slide_last()">&gt;&gt;</a> <span class="vbar"></span>
    6         <a class="cell_mode" onClick="cell_mode()">Exit</a>
    7     </div>
    8     <div class="slideshow_progress" id="slideshow_progress" onClick="slide_next()">
    9         <div class="slideshow_progress_bar" id="slideshow_progress_bar">&nbsp;</div>
    10         <div class="slideshow_progress_text" id="slideshow_progress_text">&nbsp;</div>
    11     </div>
    12     <div class="slideshow_control">
    13         <a class="slide_arrow" onClick="slide_first()">&lt;&lt;</a>
    14         <a class="slide_arrow" onClick="slide_prev()">&lt;</a>
    15     </div>
    16 </div>
    17 
    18 
    19 
    20 
    21 
    22 
    23 
  • sagenb/data/sage/html/notebook/specific_revision.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/specific_revision.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - rev - this revision's key
    8 - prev_rev - the previous revision's key
    9 - next_rev - the next revision's key
    10 - time_ago - a string containing the time since revision
    11 - body_worksheet_html - the body html of the worksheet
    12 - JSMATH - a boolean stating whether to include jsMath
    13 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    14 #}
     1{% extends "html/notebook/base_aux.html" %}
    152
    163{% set select = "revisions" %}
    174{% block sharebar_title %}
     
    4027{% block after_sharebar %}
    4128{{ actions() }}
    4229<div id="revision-data">
    43     {{ body_worksheet_html }}
     30    {{ worksheet.html(do_print=true, publish=true) }}
    4431</div>
    4532{{ actions() }}
    4633<script type="text/javascript">
  • new file sagenb/data/sage/html/notebook/text_cell.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/text_cell.html
    - +  
     1{#
     2INPUT:
     3
     4- cell -- Cell instance
     5
     6- wrap -- number of columns to wrap
     7
     8- do_print -- whether to display for printing
     9
     10- do_math_parse -- whether to parse jsMath
     11
     12- editing -- whether user is editing the cell
     13#}
     14<span id="cell_outer_{{ cell.id() }}">
     15
     16
     17    {% if not do_print %}
     18    <div class="insert_new_cell" id="insert_new_cell_before{{ cell.id() }}">
     19    </div>
     20    <script type="text/javascript">
     21        $("#insert_new_cell_before{{ cell.id() }}").plainclick(function(e) {insert_new_cell_before({{ cell.id() }});});
     22        $("#insert_new_cell_before{{ cell.id() }}").shiftclick(function(e) {insert_new_text_cell_before({{ cell.id() }});});
     23    </script>
     24    {% endif %}
     25    <div class="text_cell" id="cell_text_{{ cell.id() }}">
     26        {% if do_math_parse %}
     27            {{ cell.plain_text()|math_parse }}
     28        {% else %}
     29            {{ cell.plain_text() }}
     30    {% endif %}
     31    </div>
     32{% if JEDITABLE_TINYMCE and not cell.worksheet().is_published() and not cell.worksheet().docbrowser() and not do_print %}
     33    <script type="text/javascript">
     34        $("#cell_text_{{ cell.id() }}").unbind('dblclick').editable(function(value,settings) {
     35            evaluate_text_cell_input({{ cell.id() }},value,settings);
     36            return(value);
     37            },
     38            {
     39                tooltip   : "",
     40                placeholder : "",
     41        //      type   : 'textarea',
     42                type   : 'mce',
     43                onblur : 'ignore',
     44                select : false,
     45                submit : 'Save changes',
     46                cancel : 'Cancel changes',
     47                event  : "dblclick",
     48                style  : "inherit",
     49        });
     50    </script>
     51{% endif %}
     52
     53{% if editing and not do_print %}
     54<script>$("#cell_text_{{ cell.id() }}").trigger('dblclick');</script>
     55{% endif %}
     56</span>
     57 No newline at end of file
  • deleted file sagenb/data/sage/html/notebook/top_bar_and_worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/top_bar_and_worksheet.html
    + -  
    1 {#
    2 INPUT:
    3 - username - a string containing a username
    4 - worksheet_filename - a string containing a worksheet's filename
    5 - worksheet_html - a string containing the html for a worksheet
    6 - show_debug - a boolean stating whether to show debug information
    7   #}
    8 {% include "html/notebook/worksheet_topbar.tmpl" %}
    9 {% set toggle=true %}
    10 {% include "html/top_bar.html" %}
    11 {% if worksheet.filename() %}
    12     {{ worksheet_topbar(worksheet, "use", username) }}
    13 {% endif %}
    14 {% if show_debug %}
    15     {% include "html/notebook/debug_window.html" %}
    16 {% endif %}
    17 
    18 <div class="worksheet" id="worksheet">
    19     {{ worksheet_html }}
    20 </div>
    21 
  • sagenb/data/sage/html/notebook/upload_data_window.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/upload_data_window.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    9 #}
     1{% extends "html/notebook/base_aux.html" %}
     2
    103
    114{% block page_id %}upload-data-page{% endblock %}
    125
  • sagenb/data/sage/html/notebook/worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet.html
    a b  
    11{#
    22INPUT:
    3      - worksheet_name - a string containing a worksheet's name
    4      - worksheet_html - a string containing the html for a worksheet
    5      - do_print - a boolean stating whether to render a print version of the
    6                   worksheet
    7   #}
    8 {% extends "html/base.html" %}
    93
    10 {% block title %}Sage Worksheet: {{ worksheet_name }}{% endblock %}
     4- worksheet -- Worksheet object
    115
    12 {% block css %}main{% endblock %}
     6- publish -- boolean whether this is for the published version
    137
    14 {% block javascript %}
    15 <script type="text/javascript" src="/javascript/sage/main.js"></script>
    16 {% if do_print %}
    17 <script type="text/javascript" src="/javascript/sage/jsmath.js"></script>
    18 {% endif %}   
    19 {% endblock %}
     8- do_print -- boolean whether this is for a print version
    209
    21 {% block body_attrs %}
    22 {% if not do_print %}
    23     class="worksheet-online" onLoad="initialize_the_notebook();"
     10#}
     11
     12{% set wrap = conf['word_wrap_cols'] %}
     13{% if not publish %}
     14    {% set publish = worksheet.is_published() %}
    2415{% endif %}
    25 {% endblock %}
    2616
    27 {% block body %}
    28 {% if do_print %}
    29     <div class="worksheet_print_title"> {{ worksheet_name }}</div>
     17<div class="cell_input_active" id="cell_resizer"></div>
     18{% if not publish %}
     19<div class="worksheet_cell_list" id="worksheet_cell_list">
    3020{% endif %}
    31 {{ worksheet_html }}
    32 {% if do_print %}
    33     <script type="text/javascript">jsMath.Process();</script>
     21
     22{% for cell in worksheet.cell_list() %}
     23    {{ cell.html(wrap = wrap, div_wrap = true, do_print = do_print or publish) }}
     24{% endfor %}
     25
     26{% if not do_print and not publish %}
     27</div>
     28<div class="insert_new_cell" id="insert_last_cell"></div>
     29<script type="text/javascript">
     30$(document).ready(function() {                                 
     31    $("#insert_last_cell").plainclick(function(e) {insert_new_cell_after(cell_id_list[cell_id_list.length-1]);});
     32    $("#insert_last_cell").shiftclick(function(e) {insert_new_text_cell_after(cell_id_list[cell_id_list.length-1]);});
     33});
     34</script>
    3435{% endif %}
    35 {% endblock %}
     36
  • new file sagenb/data/sage/html/notebook/worksheet_page.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_page.html
    - +  
     1{% extends "html/notebook/base.html" %}
     2{#
     3INPUT:
     4- worksheet - an instance of Worksheet
     5- notebook - an instance of Notebook which contains worksheet
     6- show_debug - a boolean stating whether to show debug information
     7- do_print - a boolean stating whether the file is for print mode
     8#}
     9
     10{% block body_classes %}worksheet-online{% if not (worksheet.is_published() or notebook.user_is_guest(username) or worksheet.is_doc_worksheet()) %} active-worksheet-page{% endif %}{% endblock %}
     11{% block page_id %}user-worksheet-index{% endblock %}
     12
     13{% block worksheet_main %}
     14{% set toggle=true %}
     15<div class="worksheet" id="worksheet">
     16    {{ worksheet.html() }}
     17    {% if do_print %}
     18    <script language="javascript">$(document).ready(function(){jsMath.ProcessBeforeShowing();});</script>
     19    {% else %}
     20    <script type="text/javascript">
     21        $(document).ready(function() {                             
     22        cell_id_list={{ worksheet.cell_id_list() }};
     23        state_number={{ worksheet.state_number() }};
     24        {% if not published %}if(worksheet_name == "Untitled") rename_worksheet();{% endif %}
     25        });                     
     26    </script>
     27    {% endif %}
     28
     29</div>
     30
     31{% if show_debug %}
     32<div class='debug_window'>
     33    <div class='debug_output'><pre id='debug_output'></pre></div>
     34    <textarea rows=5 id='debug_input' class='debug_input'
     35              onKeyPress='return debug_keypress(event);'
     36              onFocus='debug_focus();' onBlur='debug_blur();'>
     37    </textarea>
     38</div>
     39{% endif %}
     40
     41{% if worksheet.is_only_viewer(username) %}
     42<script type="text/javascript">worksheet_locked=true;</script>
     43{% else %}
     44<script type="text/javascript">worksheet_locked=false;</script>
     45{% endif %}
     46{% if worksheet.computing() %}
     47<!-- Set the update checking back in motion. -->
     48<script type="text/javascript">
     49$(document).ready( function() {                         
     50    active_cell_list = {{ worksheet.queue_id_list() }};
     51    for (var i = 0; i < active_cell_list.length; i++) {
     52        cell_set_running(active_cell_list[i]);
     53    }
     54    start_update_check();
     55}                                                   
     56</script>
     57{% endif %}
     58{% endblock %}
  • deleted file sagenb/data/sage/html/notebook/worksheet_page_template.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_page_template.html
    + -  
    1 {% extends "html/base.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username  - a string containing a username
    7 - title - a string
    8 - select    - a string containing the control that is selected
    9 - backwards - a boolean
    10 - JSMATH - a boolean stating whether to include jsMath
    11 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    12 #}
    13 
    14 {% if not select %}
    15     {% set select = none %}
    16 {% endif %}
    17 
    18 {% if not backwards %}
    19     {% set backwards = false %}
    20 {% endif %}
    21    
    22 {% include "html/notebook/head.tmpl" %}
    23 {% include "html/notebook/worksheet_topbar.tmpl" %}
    24 
    25 {% block title %}
    26 {{ common_title(worksheet_filename, worksheet) }}
    27 {% endblock %}
    28    
    29 {% block css %}main{% endblock %}
    30 
    31 {% block javascript %}
    32 {{ common_javascript(worksheet, worksheet_filename, username, JSMATH, JEDITABLE_TINYMCE) }}
    33 {% endblock %}
    34 
    35 {% block body %}
    36 {% set toggle=true %}
    37 {% include "html/top_bar.html" %}
    38 {{ worksheet_topbar(worksheet, select, username, backwards) }}
    39 <hr class="usercontrol" />
    40 {% block before_sharebar %}{% endblock %}
    41 <span class="sharebar">{% block sharebar_title %}{% endblock %}</span>
    42 <br /><br /><br />
    43 {% block after_sharebar %}{% endblock %}
    44 {% endblock %}
    45 
  • sagenb/data/sage/html/notebook/worksheet_revision_list.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_revision_list.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - data - a list of pairs of the form ('how long ago', key)
    5 - worksheet - an instance of Worksheet
    6 - worksheet_filename - a string containing a worksheet's filename
    7 - username - a string containing a username
    8 - JSMATH - a boolean stating whether to include jsMath
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 #}
     1{% extends "html/notebook/base_aux.html" %}
    112
    123{% block page_id %}revision-list-page{% endblock %}
    134
     
    2617        </tr>
    2718    </thead>
    2819    <tbody>
    29         {% for desc, key in data|reverse %}
     20        {% for desc, key in worksheet.snapshot_data()|reverse %}
    3021        <tr>
    3122            <td><a href="revisions?rev={{ key }}">Revision {{ loop.revindex0 }}</a></td>
    3223            <td><span class="revs">{{ desc }}</span></td>
  • deleted file sagenb/data/sage/html/notebook/worksheet_settings.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_settings.html
    + -  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
    2 {#
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    9 #}
    10 
    11 {% block sharebar_title %}
    12 Worksheet Settings &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button name="button_save">Save Settings</button>  <input type="submit" value="Cancel" name="button_cancel"/>
    13 {% endblock %}
    14 
    15 {% block before_sharebar %}
    16 <form width=70% method="post" action="input_settings"  enctype="multipart/form-data">
    17 {% endblock %}
    18 {% block after_sharebar %}
    19 </form>
    20 {% endblock %}
    21 
    22 
    23 
  • sagenb/data/sage/html/notebook/worksheet_share.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_share.html
    a b  
    1 {% extends "html/notebook/worksheet_page_template.html" %}
     1{% extends "html/notebook/base_aux.html" %}
    22{#
    33INPUT:
    44    - worksheet - an instance of Worksheet
    5     - worksheet_filename - a string containing a worksheet's filename
    65    - username - a string containing a username
    76    - other_users - a list of strings containing other users names
    8     - user_is_admin - a boolean stating whether the user is an admin
    9     - JSMATH - a boolean stating whether to include jsMath
    10     - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    117#}
    128
    139{% block sharebar_title %}
     
    1713{% set select = "share" %}
    1814
    1915{% block after_sharebar %}
    20 {% if not (user_is_admin or username == worksheet.owner()) %}
     16{% if not (notebook.user_is_admin(username) or username == worksheet.owner()) %}
    2117    Only the owner of a worksheet is allowed to share it. You can do whatever you want if you <a href="copy">make your own copy</a>.
    2218{% else %}
    2319<p>This Sage Worksheet is currently shared with the people listed in the box below.</p>
  • deleted file sagenb/data/sage/html/notebook/worksheet_topbar.tmpl

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook/worksheet_topbar.tmpl
    + -  
    1 {#
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - select    - a string containing the control that is selected
    5 - username  - a string containing a username
    6 - backwards - a boolean
    7 #}
    8 {% macro worksheet_topbar(worksheet, select=None, username='guest',
    9 backwards=false, warn=false) %}
    10 <div id="worksheet-bar">
    11     <div class="worksheet_title">
    12         <a id="worksheet_title" class="worksheet_title"
    13            onClick="rename_worksheet(); return false;"
    14            title="Click to rename this worksheet">
    15             {{ worksheet.name() }}
    16         </a>
    17         <br> {{ worksheet.html_time_last_edited() }}
    18         {% if worksheet.warn_about_other_person_editing(username) and username != 'guest' and not worksheet.is_doc_worksheet() %}
    19         &nbsp;&nbsp;<span class="pingdown">(Someone else is viewing this worksheet)</span>
    20         {% endif %}
    21     </div>
    22     <div id="save-discard-buttons">
    23         {{ worksheet.html_save_discard_buttons() }}
    24     </div>
    25    
    26     <div id="worksheet-menu">
    27         {{ worksheet.html_menu() }}
    28     </div>
    29     <div id="share-publish-buttons">
    30         {{ worksheet.html_share_publish_buttons(select, backwards) }}
    31     </div>
    32 </div>
    33 <div class="hidden" id="slide_controls">
    34     <div class="slideshow_control">
    35         <a class="slide_arrow" onClick="slide_next()">&gt;</a>
    36         <a class="slide_arrow" onClick="slide_last()">&gt;&gt;</a> <span class="vbar"></span>
    37         <a class="cell_mode" onClick="cell_mode()">Exit</a>
    38     </div>
    39     <div class="slideshow_progress" id="slideshow_progress" onClick="slide_next()">
    40         <div class="slideshow_progress_bar" id="slideshow_progress_bar">&nbsp;</div>
    41         <div class="slideshow_progress_text" id="slideshow_progress_text">&nbsp;</div>
    42     </div>
    43     <div class="slideshow_control">
    44         <a class="slide_arrow" onClick="slide_first()">&lt;&lt;</a>
    45         <a class="slide_arrow" onClick="slide_prev()">&lt;</a>
    46     </div>
    47 </div>
    48 {% endmacro %}
  • deleted file sagenb/data/sage/html/notebook_settings.html

    diff -r 8afee2ec056a sagenb/data/sage/html/notebook_settings.html
    + -  
    1 {% extends "html/base.html" %}
    2 
    3 {% block title %}Notebook Settings{% endblock %}
    4 {% block css %}account_settings{% endblock %}
    5 {% block more_css %}
    6 <link rel="stylesheet" href="/javascript/jquery/plugins/farbtastic/farbtastic.css" type="text/css" /> 
    7 {% endblock %}
    8 
    9 {% block javascript %}
    10 <script type="text/javascript" src="/javascript/jquery/plugins/farbtastic/farbtastic.min.js"></script>
    11 {% endblock %}
    12 
    13 {% block body %}
    14 <h1>Notebook Settings</h1>
    15 <div class="section"><a href="/users">Manage Users</a> | <a href="/settings">My Settings</a> | <a href="/">My Worksheets</a> | <a href="/logout">Sign Out</a></div>
    16 
    17 <form method="get" action="/notebooksettings">
    18   <input type="hidden" name="form" value="on" />
    19   {%- if auto_table %}
    20   {{ auto_table }}
    21   {%- endif %}
    22   <div id="buttons">
    23     <input type="submit" value="Save">
    24     <input type="button" value="Cancel" style="margin-left:5px" onClick="parent.location='/'">
    25   </div>
    26 </form>
    27 {% endblock %}
  • deleted file sagenb/data/sage/html/registration.html

    diff -r 8afee2ec056a sagenb/data/sage/html/registration.html
    + -  
    1 {% extends "html/base.html" %}
    2 
    3 {% block title %}Sign up{% endblock %}
    4 
    5 {% block css %}registration{% endblock %}
    6 
    7 {% block body %}
    8 <div id="wrapper">
    9   <h1>Sign up for a Sage Notebook account</h1>
    10   {% if error %}
    11   <h2 class="error_found">Error{{ error[1:] }}found</h2>
    12   {% endif %}
    13   <form method="POST" action="/register">
    14     <ol>
    15       <li><h2>Create a username</h2>
    16         <p>Your username must start with a letter and be between 3 and 64
    17           characters long. You may only use letters, numbers, underscores, @,
    18           and dots.</p>
    19         <input type="text" name="username" value="{{ username }}" class="entry" tabindex="1" />
    20         {% if username_missing %}
    21         <p><span class="error">Error:</span> No username given</p>
    22         {% endif %}
    23         {% if username_taken %}
    24         <p><span class="error">Error:</span> Username already in use</p>
    25         {% endif %}
    26         {% if username_invalid %}
    27         <p><span class="error">Error:</span> Bad username</p>
    28         {% endif %}
    29       </li>
    30       <li><h2>Create a good password</h2>
    31         <p>Your password must be between 4 and 32 characters long. Your password can not contain your username nor spaces.</p>
    32         <input type="password" name="password" class="entry" tabindex="2" />
    33         {% if password_missing %}
    34         <p><span class="error">Error:</span> No password given</p>
    35         {% endif %}
    36         {% if password_invalid %}
    37         <p><span class="error">Error:</span> Bad password</p>
    38         {% endif %}
    39       </li>
    40       <li><h2>Re-type your password</h2>
    41         <input type="password" name="retype_password" class="entry" tabindex="3" />
    42         {% if passwords_dont_match or retype_password_missing %}
    43         <p><span class="error">Error:</span> Passwords didn't match</p>
    44         {% endif %}
    45       </li>
    46       {% if email or email_missing or email_invaild %}
    47       <li><h2>Enter your email address</h2>
    48         <p>Your email address is required for account confirmation and recovery. You will be emailed a confirmation link right after you successfully sign up.</p>
    49         <input type="text" name="email" value="{{ email_address }}" class="entry" tabindex="4" />
    50         {% if email_missing %}
    51         <p><span class="error">Error:</span> No email address given</p>
    52         {% endif %}
    53         {% if email_invalid %}
    54         <p><span class="error">Error:</span> Invalid email address</p>
    55         {% endif %}
    56       </li>
    57       {% endif %}
    58       {% if challenge %}
    59       <li><h2>Answer a challenge</h2>
    60         {{ challenge_html }}
    61         {% if challenge_missing %}
    62         <p><span class="error">Error:</span> No challenge response given</p>
    63         {% endif %}
    64         {% if challenge_invalid %}
    65         <p><span class="error">Error:</span> Invalid challenge response</p>
    66         {% endif %}
    67       </li>
    68       {% endif %}
    69     </ol>
    70     <button type="submit" tabindex="100" id="create-account-button">Create account</button>
    71     <a href="/"><button tabindex="101">Cancel</button></a>
    72   </form>
    73 </div>
    74 {% endblock %}
  • new file sagenb/data/sage/html/settings/account_settings.html

    diff -r 8afee2ec056a sagenb/data/sage/html/settings/account_settings.html
    - +  
     1{% extends "html/settings/base.html" %}
     2
     3{% block title %}Account Settings{% endblock %}
     4{% block page_id %}account-settings-page{% endblock %}
     5
     6{% block settings_main %}
     7<form method="post" action="/settings">
     8   
     9    <div class="section">
     10        <h2>Change Auto-Save Interval</h2>
     11        <div>
     12            Minutes:
     13            <select name="autosave">
     14                {% for i, selected in autosave_intervals %}
     15                <option{{ selected }}>{{ i }}</option>
     16                {% endfor %}
     17            </select>
     18        </div>
     19    </div>
     20    <div class="section">
     21        <h2>Change Password</h2>
     22        <div id="passwd">
     23            <div>
     24                <label for="old-pass">Old password</label>
     25                <input type="password" name="old-pass" />
     26            </div>
     27            <div>
     28                <label for="new-pass">New password</label>
     29                <input type="password" name="new-pass" />
     30            </div>
     31            <div>
     32                <label for="retype-pass">Retype new password</label>
     33                <input type="password" name="retype-pass" />
     34            </div>
     35        </div>
     36    </div>
     37
     38    {% if true %}
     39    <div class="section">
     40        <h2>Change E-mail Address</h2>
     41       
     42        <div>
     43            <div>
     44                <label>Current e-mail</label>
     45                {{ email_address }} {{ email_confirmed }}
     46            </div>
     47            <div>
     48                <label for="new-email">New e-mail</label>
     49                <input type="text" name="new-email" class="c1" />
     50            </div>
     51        </div>
     52    </div>
     53    {% endif %}
     54    <div id="buttons">
     55        <button type="submit">Save</button>
     56        <a href="/"><button>Cancel</button></a>
     57    </div>
     58</form>
     59{% endblock %}
  • new file sagenb/data/sage/html/settings/admin_add_user.html

    diff -r 8afee2ec056a sagenb/data/sage/html/settings/admin_add_user.html
    - +  
     1{% extends "html/settings/base.html" %}
     2{% block title %}Add New User{% endblock %}
     3{% block page_id %}add-user-page{% endblock %}
     4
     5{% block main %}
     6<h1>Add New User</h1>
     7{% if error %}
     8<h2 class="error_found">Username Error</h2>
     9{% endif %}
     10<form method="POST" action="/adduser">
     11<ol>
     12<li><h2>Pick a username</h2>
     13<p>The username must start with a letter and be between 4 and 32 characters long. It can only consist of letters, numbers, underscores, and one dot (.).</p>
     14<input type="text" name="username" value="{{ username_input if username_input else '' }}" />
     15{% if username_error %}
     16{% if username_error == 'invalid' %}
     17<p><span class="error">Error:</span> Invalid username</p>
     18{% else %}
     19<p><span class="error">Error:</span> Username taken</p>
     20{% endif %}
     21{% endif %}
     22</li>
     23</ol>
     24<div id="buttons">
     25    <button type="submit">Create Account</buttoN>
     26    <a href="/users"><button>Cancel</button></a>
     27</div>
     28</form>
     29</div>
     30{% endblock %}
     31 No newline at end of file
  • new file sagenb/data/sage/html/settings/base.html

    diff -r 8afee2ec056a sagenb/data/sage/html/settings/base.html
    - +  
     1{% extends "html/base_authenticated.html" %}
     2
     3{% block body_classes %}settings-page{% endblock %}
     4
     5{% block main %}
     6<h1>{{ render_title() }}</h1>
     7{% block settings_nav %}
     8<ul id="settings-nav" class="user-controls">
     9    {% if admin %}
     10    <li><a href="/users">Manage Users</a></li>
     11    <li><a href="/notebooksettings">Notebook Settings</a></li>
     12    {% endif %}
     13    <li><a href="/settings">Account Settings</a></li>
     14</ul>
     15{% endblock %}
     16{% block settings_main %}
     17<form method="post" action="/settings">
     18   
     19    <div class="section">
     20        <h2>Change Auto-Save Interval</h2>
     21        <div>
     22            Minutes:
     23            <select name="autosave">
     24                {% for i, selected in autosave_intervals %}
     25                <option{{ selected }}>{{ i }}</option>
     26                {% endfor %}
     27            </select>
     28        </div>
     29    </div>
     30    <div class="section">
     31        <h2>Change Password</h2>
     32        <div id="passwd">
     33            <div>
     34                <label for="old-pass">Old password</label>
     35                <input type="password" name="old-pass" />
     36            </div>
     37            <div>
     38                <label for="new-pass">New password</label>
     39                <input type="password" name="new-pass" />
     40            </div>
     41            <div>
     42                <label for="retype-pass">Retype new password</label>
     43                <input type="password" name="retype-pass" />
     44            </div>
     45        </div>
     46    </div>
     47
     48    {% if true %}
     49    <div class="section">
     50        <h2>Change E-mail Address</h2>
     51       
     52        <div>
     53            <div>
     54                <label>Current e-mail</label>
     55                {{ email_address }} {{ email_confirmed }}
     56            </div>
     57            <div>
     58                <label for="new-email">New e-mail</label>
     59                <input type="text" name="new-email" class="c1" />
     60            </div>
     61        </div>
     62    </div>
     63    {% endif %}
     64    <div id="buttons">
     65        <button type="submit">Save</button>
     66        <a href="/"><button>Cancel</button></a>
     67    </div>
     68</form>
     69{% endblock %}
     70{% endblock %}
  • new file sagenb/data/sage/html/settings/notebook_settings.html

    diff -r 8afee2ec056a sagenb/data/sage/html/settings/notebook_settings.html
    - +  
     1{% extends "html/settings/base.html" %}
     2{% block title %}Notebook Settings{% endblock %}
     3
     4{% block more_css %}
     5<link rel="stylesheet" href="/javascript/jquery/plugins/farbtastic/farbtastic.css" type="text/css" /> 
     6{% endblock %}
     7
     8{% block javascript %}
     9<script type="text/javascript" src="/javascript/jquery/plugins/farbtastic/farbtastic.min.js"></script>
     10{% endblock %}
     11
     12{% block page_id %}notebook-settings-page{% endblock %}
     13
     14{% block settings_main %}
     15<form method="get" action="/notebooksettings">
     16  <input type="hidden" name="form" value="on" />
     17  {%- if auto_table %}
     18  {{ auto_table }}
     19  {%- endif %}
     20  <div id="buttons">
     21    <input type="submit" value="Save">
     22    <input type="button" value="Cancel" style="margin-left:5px" onClick="parent.location='/'">
     23  </div>
     24</form>
     25{% endblock %}
     26 No newline at end of file
  • new file sagenb/data/sage/html/settings/user_management.html

    diff -r 8afee2ec056a sagenb/data/sage/html/settings/user_management.html
    - +  
     1{% extends "html/settings/base.html" %}
     2
     3{% block title %}Users{% endblock %}
     4{% block page_id %}user-management-page{% endblock %}
     5
     6{% block settings_main %}
     7    <h1>User Management</h1>
     8    <a href="/adduser" class="boldusercontrol">Add User</a>
     9    {% if reset %}
     10    <p>The password for the user {{ reset[0] }} has been reset to <strong>{{ reset[1] }}</strong></p>
     11    {% endif %}
     12    <table>
     13      <tr><th>Users</th><th>Password</th><th>Suspension</th></tr>
     14      {% for user in users %}
     15      {% if user != 'admin' %}
     16      <tr><td><a href="/home/{{ user }}/">{{ user }}</a></td><td><a href="/users/?reset={{ user }}">Reset</a></td><td><a href="/users/?suspension={{ user }}">{% if user.is_suspended() %}Unsuspend{% else %}Suspend{% endif %}</td></tr>
     17      {% endif %}
     18      {% endfor %}
     19    </table>
     20{% endblock %}
  • sagenb/data/sage/html/source_code.html

    diff -r 8afee2ec056a sagenb/data/sage/html/source_code.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22
    33{% block title %}{{ src_filename }} - Source Code{% endblock %}
    44
    55{% block css %}main{% endblock %}
    66
     7{% block more_css %}<link type="text/css" ref="stylesheet" href="/javascript/highlight/prettify.css" />{% endblock %}
     8
     9{% block page_id %}source-code-page{% endblock %}
     10
    711{% block body %}
    8 {% include "html/top_bar.html" %}
    9 <h1 align=center>Sage Source Browser</h1>
    10 <h2 align=center><tt>{{ src_filename }}  <a href="..">(browse directory)</a></tt></h2>
    11 <br><hr><br>
    12 <font size=+1><pre id="code">{{ src }}</pre></font>
    13 <br><hr><br>
     12<div>
     13<h1>Sage Source Browser</h1>
     14<h2 class="filename" >{{ src_filename }}  <a href="..">(browse directory)</a></h2>
     15</div>
     16
     17<code id="code">{{ src }}</code>
     18
    1419<script src="/javascript/highlight/prettify.js" type="text/javascript"></script>
    1520<script type="text/javascript">
    16 function get_element(id) {
    17   if(document.getElementById)
    18     return document.getElementById(id);
    19   if(document.all)
    20     return document.all[id];
    21   if(document.layers)
    22     return document.layers[id];
    23 }
    24 
    25 var x = get_element("code");
    26 x.innerHTML = prettyPrintOne(x.innerHTML);
     21          code = $('code');
     22          code.html(prettyPrintOne(code.html()))
    2723</script>
    2824{% endblock %}
  • sagenb/data/sage/html/template_error.html

    diff -r 8afee2ec056a sagenb/data/sage/html/template_error.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22
    33{% block title %}Error{% endblock %}
    44
  • deleted file sagenb/data/sage/html/top_bar.html

    diff -r 8afee2ec056a sagenb/data/sage/html/top_bar.html
    + -  
    1 <div id="top-bar">
    2   {% include "html/banner.html" %}
    3   <div id="controls">
    4     <ul>
    5       <li class="username">{{ username }}</li>
    6       {% if username == 'guest' %}
    7       <li><a title="Please log in to the Sage notebook" class="usercontrol" href="/">Log in</a></li>
    8       {% else %}
    9       {# TODO: Hack-ish. Remove on template cleanup. #}
    10       {% if toggle %}
    11       <li><a title="Toggle the top bar" class="usercontrol" onClick="$('#worksheet-bar').toggle()">Toggle</a></li>
    12       {% endif %}
    13       <li><a title="Back to your personal worksheet list" class="usercontrol" href="/home/{{ username }}">Home</a></li>
    14       {% if pub %}
    15       <li><span class="usercontrol">Published</span></li>
    16       {% else %}
    17       <li><a title="Browse the published worksheets" class="usercontrol" href="/pub">Published</a></li>
    18       <li><a title="View a log of recent computations" class="usercontrol" href="#" onClick="history_window()">Log</a></li>
    19       {% endif %}
    20       <li><a title="Change account settings including password" class="usercontrol" href="/settings">Settings</a></li>
    21       <li><a title="Documentation" class="usercontrol" href="#" onClick="help()">Help</a></li>
    22       <li><a title="Report a problem or submit a bug to improve Sage" class="usercontrol" href="#" onClick="bugreport()">Report a Problem</a></li>
    23       <li><a title="Log out of the Sage notebook" class="usercontrol" href="/logout">Sign out</a></li>
    24       {% endif %}
    25     </ul>
    26   </div>
    27 </div>
  • sagenb/data/sage/html/upload.html

    diff -r 8afee2ec056a sagenb/data/sage/html/upload.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22
    33{% block title %}Upload File{% endblock %}
    44
    5 {% block css %}main{% endblock %}
    6 
    75{% block page_id %}upload-worksheet-page{% endblock %}
    86
    9 {% block body %}
     7{% block main %}
    108
    11 {% include "html/top_bar.html" %}
    129<div>
    1310    <h2>Upload worksheet (an sws or txt file) to the Sage Notebook</h2>
    1411    <form method="POST" action="upload_worksheet"
  • deleted file sagenb/data/sage/html/user_management.html

    diff -r 8afee2ec056a sagenb/data/sage/html/user_management.html
    + -  
    1 <html>
    2   <head>
    3     <title>Users | {{ sitename }}</title>
    4     <style>
    5       body {
    6       font:1em Arial, Sans-serif;
    7       }
    8 
    9       table {
    10       border-collapse:collapse
    11       }
    12 
    13       th, td {
    14       border:1px solid #696969;
    15       padding:5px
    16       }
    17 
    18       th {
    19       background:#CCC
    20       }
    21 
    22       a:link, a:visited {
    23       color:blue
    24       }
    25     </style>
    26   </head>
    27   <body>
    28     <h1>User Management</h1>
    29     <a href="/adduser">Add User</a> | <a href="/notebooksettings">Notebook Settings</a> | <a href="/settings">My Settings</a> | <a href="/">My Worksheets</a> | <a href="/logout">Sign Out</a> {% if number_of_users %} <br/><br/>{{ number_of_users }} users {% endif %}<br/><br/>
    30     {% if reset %}
    31     <p>The password for the user {{ reset[0] }} has been reset to <strong>{{ reset[1] }}</strong></p>
    32     {% endif %}
    33     <table>
    34       <tr><th>Users</th><th>Password</th><th>Suspension</th></tr>
    35       {% for user in users %}
    36       {% if user != 'admin' %}
    37       <tr><td><a href="/home/{{ user }}/">{{ user }}</a></td><td><a href="/users/?reset={{ user }}">Reset</a></td><td><a href="/users/?suspension={{ user }}">{% if user.is_suspended() %}Unsuspend{% else %}Suspend{% endif %}</td></tr>
    38       {% endif %}
    39       {% endfor %}
    40     </table>
    41   </body>
    42 </html>
  • deleted file sagenb/data/sage/html/worksheet/menu.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/menu.html
    + -  
    1 {#
    2 INPUT
    3 - name - string with worksheet name
    4 - filename_ - string with worksheet filename
    5 - data - list of data to put in the Data menu
    6 - systems_enumerated - enumerated list of systems
    7 - system_names - list of system names
    8 - current_system_index - the currently selected system_index
    9 - pretty_print - a boolean stating whether to typeset as default
    10 - doc_worksheet - a boolean stating whether the worksheet is the doc worksheet
    11 #}
    12 <select class="worksheet"  onchange="go_option(this);" id="file-menu">
    13     <option title="Select a file related function" value=""  selected>File...</option>
    14     <option title="Load a new worksheet stored in a file" value="upload_worksheet_button();">Load worksheet from a file...</option>
    15     <option title="Create a new worksheet" value="new_worksheet();">New worksheet</option>
    16     <option title="Save this worksheet to an sws file" value="download_worksheet();">Save worksheet to a file...</option>
    17     <option title="Print this worksheet" value="print_worksheet();">Print</option>
    18     <option title="Rename this worksheet" value="rename_worksheet();">Rename worksheet</option>
    19     <option title="Copy this worksheet" value="copy_worksheet();">Copy worksheet</option>
    20     <option title="Move this worksheet to the trash" value="delete_worksheet('{{ filename_ }}');">Delete worksheet</option>
    21 </select>
    22 
    23 <select class="worksheet"  onchange="go_option(this);"  id="action-menu">
    24     <option title="Select a worksheet function" value="" selected>Action...</option>
    25     <option title="Interrupt currently running calculations, if possible" value="interrupt();">Interrupt</option>
    26     <option title="Restart the worksheet process" value="restart_sage();">Restart worksheet</option>
    27     <option title="Quit the worksheet process" value="save_worksheet_and_close();">Save and quit worksheet</option>
    28     <option value="">---------------------------</option>
    29     <option title="Evaluate all input cells in the worksheet" value="evaluate_all();">Evaluate All</option>
    30     <option title="Hide all output" value="hide_all();">Hide All Output</option>
    31     <option title="Show all output" value="show_all();">Show All Output</option>
    32     <option title="Delete all output" value="delete_all_output();">Delete All Output</option>
    33     <option value="">---------------------------</option>
    34     <option title="Switch to single-cell mode" value="slide_mode();">One Cell Mode</option>
    35     <option title="Switch to multi-cell mode" value="cell_mode();">Multi Cell Mode</option>
    36 </select>
    37 <select class="worksheet" onchange="handle_data_menu(this);" id="data-menu">
    38     <option title="Select an attached file" value="" selected>Data...</option>
    39     <option title="Upload or create a data file in a wide range of formats" value="__upload_data_file__">Upload or create file...</option>
    40     <option value="">--------------------</option>
    41     {% for name in data %}
    42     <option value="datafile?name={{ name }}">{{ name }}</option>
    43     {% endfor %}
    44 </select>
    45 
    46 {% if not doc_worksheet %}
    47 <select onchange="go_system_select(this, {{ current_system_index }});" class="worksheet" id="systems-menu">
    48     {% for system_index, system_name in systems_enumerated %}
    49         <option title="Evaluate all input cells using {{ system_names[system_index] }}"
    50             {{ "selected" if current_system_index == system_index else "" }} value="{{ system_names[system_index] }}">
    51             {{ system_name }}
    52         </option>
    53     {% endfor %}
    54 </select>   
    55 <input type="checkbox" title="Enable/disable pretty_printing"
    56        onchange="pretty_print_check(this.checked);"
    57        class="worksheet" value="pretty_print" {{ "checked" if pretty_print else "" }} />&nbsp;Typeset
    58 {% endif %}
  • deleted file sagenb/data/sage/html/worksheet/published_worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/published_worksheet.html
    + -  
    1 {#
    2 INPUT:
    3 - cell_id_list - a list of cell id's
    4 - cells_html - string of cells HTML
    5 #}
    6 {% set published = true %}
    7 {% set do_print = true %}
    8 
    9 {% include "html/worksheet/worksheet_body.html" %}
    10 
    11 
    12 <script language=javascript>jsMath.ProcessBeforeShowing();</script>
  • new file sagenb/data/sage/html/worksheet/ratings_info.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/ratings_info.html
    - +  
     1{% extends "html/base.html" %}
     2
     3{% block title %}Ratings for {{ worksheet.name() }}{% endblock %}
     4
     5{% block body %}
     6<h2 align=center>Ratings for {{ worksheet.name() }}</h2>
     7<h3 align=center><a href='/home/{{ worksheet.filename() }}'>Go to the worksheet.</a>
     8<table width=70%%align=center border=1 cellpadding=10 cellspacing=0>
     9    <tr bgcolor="#7799bb"><td width=30em>User</td><td width=10em align=center>Rating</td><td width=10em align=center width=60em>Comment</td></tr>
     10    {% for rating in worksheet.ratings()|sort %}
     11    <tr>
     12        <td>rating[0]{# Person #}</td>
     13        <td>rating[1]{# Rating #}</td>
     14        <td>{{'' if rating|length < 3 else rating[2]}}{# Comment #}</td>
     15    </tr>
     16    {% endfor %}
     17</table>
     18{% endblock %}
  • deleted file sagenb/data/sage/html/worksheet/save_discard_buttons.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/save_discard_buttons.html
    + -  
    1 {#
    2 INPUT:
    3 doc_worksheet - boolean stating whether this worksheet is the doc worksheet
    4 #}
    5 {% if not doc_worksheet %}
    6 <button name="button_save" title="Save changes" onClick="save_worksheet();">Save</button><button title="Save changes and close window" onClick="save_worksheet_and_close();" name="button_save">Save & quit</button><button title="Discard changes to this worksheet" onClick="worksheet_discard();">Discard & quit</button>
    7 {% endif %}
  • deleted file sagenb/data/sage/html/worksheet/share_publish_buttons.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/share_publish_buttons.html
    + -  
    1 
    2 {#
    3 INPUT:
    4 - worksheet - Worksheet instance
    5 - select - a boolean
    6 - backwards - a boolean
    7 #}
    8 {% if not worksheet.is_doc_worksheet() %}
    9 {% macro cls(x) %}
    10 {{ "control-select" if x == select else "control" }}
    11 {% endmacro %}
    12 {% macro backwards_text() %}
    13 {{ "../" if backwards else "" }}
    14 {% endmacro %}
    15 <a title="Print this worksheet" class="print-link" onClick="print_worksheet()"><img border=0 src="/images/icon_print.gif" alt="Print">Print</a>
    16 <a class="{{ cls('use') }}" title="Interactively use this worksheet" onClick="edit_worksheet();">Worksheet</a>       
    17 <a class="{{ cls('edit') }}" title="Edit text version of this worksheet" href="{{ backwards_text() }}edit">Edit</a>
    18 <a class="{{ cls('text') }}" title="View plain text version of this worksheet" href="{{ backwards_text() }}text">Text</a>
    19 <a class="{{ cls('undo') }}" title="View changes to this worksheet over time" href="{{ backwards_text() }}revisions">Undo</a>
    20 <a class="{{ cls('share') }}" title="Let others edit this worksheet" href="{{ backwards_text() }}share">Share</a>
    21 <a class="{{ cls('publish') }}" title="Make this worksheet publicly viewable" href="{{ backwards_text() }}publish">Publish</a>
    22 {% endif %}
  • deleted file sagenb/data/sage/html/worksheet/title.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/title.html
    + -  
    1 {#
    2 MARKED FOR DELETION.
    3 - worksheet - Worksheet instance
    4 - name - escaped name of the worksheet
    5 - username - string of username
    6 #}
    7 <div class="worksheet_title">
    8      <a id="worksheet_title" class="worksheet_title" onClick="rename_worksheet(); return false;" title="Click to rename this worksheet">{{ name }}</a>
    9      <br> {{ worksheet.html_time_last_edited() }}
    10      {% if warn and username != 'guest' and not doc_worksheet%}
    11      &nbsp;&nbsp;<span class="pingdown">(Someone else is viewing this worksheet)</span>
    12      {% endif %}
    13  </div>
    14  No newline at end of file
  • deleted file sagenb/data/sage/html/worksheet/worksheet.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/worksheet.html
    + -  
    1 {#
    2 INPUT:
    3 - do_print - a boolean
    4 - cell_id_list - a list of cell id's
    5 - confirm_before_leave - a boolean stating whether to popup a js confirm
    6   dialog before leaving
    7 - cells_html - string of cells HTML
    8 - published - a boolean stating whether the worksheet is published
    9 - state_number - worksheet.state_number()
    10 #}
    11 {% include "html/worksheet/worksheet_body.html" %}
    12 
    13 {% if do_print %}
    14 <script language="javascript">jsMath.ProcessBeforeShowing();</script>
    15 {% else %}
    16 <script type="text/javascript">
    17 $(document).ready(function() {                             
    18    cell_id_list={{ cell_id_list }};
    19    state_number={{ state_number }};
    20    {% if not published %}if(worksheet_name == "Untitled") rename_worksheet();{% endif %}
    21 });                     
    22 </script>
    23 {% endif %}
    24 
    25 {% if not do_print and confirm_before_leave %}
    26 <script type="text/javascript">
    27 $(document).ready(function() {                                 
    28             window.onbeforeunload = confirmBrowseAway;
    29             function confirmBrowseAway()
    30             {
    31             return "Unsubmitted cells will be lost.";
    32             }
    33 });                             
    34 </script>
    35 {% endif %}
    36 
  • deleted file sagenb/data/sage/html/worksheet/worksheet_body.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet/worksheet_body.html
    + -  
    1 {#
    2 INPUT:
    3 - cells_html - string of cells HTML
    4 - published - a boolean stating whether the worksheet is published
    5 #}
    6 
    7 <div class="cell_input_active" id="cell_resizer"></div>
    8 {% if not published %}
    9 <div class="worksheet_cell_list" id="worksheet_cell_list">
    10 {% endif %}
    11 
    12 {{ cells_html }}
    13 
    14 {% if not do_print and not published %}
    15 </div>
    16 <div class="insert_new_cell" id="insert_last_cell"></div>
    17 <script type="text/javascript">
    18         $("#insert_last_cell").plainclick(function(e) {insert_new_cell_after(cell_id_list[cell_id_list.length-1]);});
    19         $("#insert_last_cell").shiftclick(function(e) {insert_new_text_cell_after(cell_id_list[cell_id_list.length-1]);});
    20 </script>
    21 <div class="worksheet_bottom_padding"></div>
    22 {% endif %}
    23 
    24 
  • sagenb/data/sage/html/worksheet_listing.html

    diff -r 8afee2ec056a sagenb/data/sage/html/worksheet_listing.html
    a b  
    1 {% extends "html/base.html" %}
     1{% extends "html/base_authenticated.html" %}
    22{#
    33INPUT:
    4 - pub - a boolean stating whether to show in public mode.
    5 - typ - a string stating what kind of worksheets this listing shows
     4- pub -- a boolean stating whether to show in public mode.
     5- typ -- a string stating what kind of worksheets this listing shows
     6- worksheets -- list of Worksheet objects
    67#}
    78{% if pub %}
    89{% set worksheet_heading='Published Worksheets' %}
     
    1415{% set worksheet_heading='Archived Worksheets' %}
    1516{% endif %} 
    1617
    17 
    1818{% block title %}
    1919{{ worksheet_heading }}
    2020{% endblock %}
    2121
    22 {% block css %}main{% endblock %}
     22{% block page_id %}worksheet-listing-page{% endblock %}
    2323
    2424{% block javascript %}
    2525{% if not pub %}
     
    2727<script type="text/javascript" src="/javascript/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>
    2828<script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
    2929<script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
    30 {% endif %}
    31 {% if not pub %}
    3230<script type="text/javascript">
    33                     var worksheet_filenames = {{ worksheet_filenames }};
     31                            var worksheet_filenames = {{ worksheet_filenames }};
    3432</script>
    3533<script type="text/javascript" src="/javascript/sage/main.js"></script>
    3634<script type="text/javascript" src="/javascript/gears/gears_init.js"></script>
     
    4038{% endif %}
    4139{% endblock %}
    4240
    43 {% block onload %} onLoad="checkForGearsInstalled();"{% endblock %}
    4441
    45 {% block body %}
     42{% block main %}
     43<div id="user-main-controls" class="user-controls">
     44    {% if pub is not defined or not pub %}
     45    <a href="/new_worksheet" target="_blank">New Worksheet</a>
     46    <a href="/upload">Upload</a>
     47    {% if not accounts %}
     48    <a href="/download_worksheets.zip">Download All Active</a>
     49    {% endif %}
     50    {% endif %}
    4651
    47 {% include "html/list_top.html" %}
    48 
    49 <div id="worksheet-list-controls">
     52    <div id="search-area">
     53        <form action="." method="GET">
     54            <input type="hidden" value="{{ typ if not pub else 'pub' }}" name="typ" />
     55            <input id="search-worksheets" size="20" value="{{ search if search else "" }}" name="search" />
     56            <button class="add_new_worksheet_menu" id="search-worksheets-button" type="submit">Search Worksheets</button>
     57        </form>
     58    </div>
     59</div>       
     60<div id="worksheet-list-controls" class="controls">
    5061    {% if not pub %}
    5162    <div class="action-buttons">
    5263        {% if typ == 'archive' %}
     
    8192
    8293<table cellspacing="0" cellpadding="0" id="worksheet-list">
    8394    <thead>
    84       <tr>
    85         {% if not pub %}
    86         <td class="checkbox">
    87             <input id="controlbox" onClick="set_worksheet_list_checks();" class="entry" type="checkbox" />
    88         </td>
    89         {% else %}
    90         <td><a class="listcontrol" href=".?sort=rating">Rating</a></td>
    91         {% endif %}
     95        <tr>
     96            {% if not pub %}
     97            <td class="checkbox">
     98                <input id="controlbox" onClick="set_worksheet_list_checks();" class="entry" type="checkbox" />
     99            </td>
     100            {% else %}
     101            <td><a class="listcontrol" href=".?sort=rating">Rating</a></td>
     102            {% endif %}
    92103
    93         <td>
    94             <a class="listcontrol" href=".?typ={{ typ }}&sort=name{{ '' if sort != 'name' or reverse else '&reverse=True' }}">
    95                 {{ worksheet_heading }}
    96             </a>
    97         </td>
    98        
    99         <td>
    100             <a class="listcontrol" href=".?typ={{ typ }}&sort=owner{{ '' if sort != 'owner' or reverse else '&reverse=True' }}">
    101                 Owner {{ '' if pub else ' / Collaborators' }}
    102             </a>
    103         </td>
     104            <td>
     105                <a class="listcontrol" href=".?typ={{ typ }}&sort=name{{ '' if sort != 'name' or reverse else '&reverse=True' }}">
     106                    {{ worksheet_heading }}
     107                </a>
     108            </td>
     109           
     110            <td>
     111                <a class="listcontrol" href=".?typ={{ typ }}&sort=owner{{ '' if sort != 'owner' or reverse else '&reverse=True' }}">
     112                    Owner {{ '' if pub else ' / Collaborators' }}
     113                </a>
     114            </td>
    104115
    105         <td>
    106             <a class="listcontrol" href=".?typ={{ typ }}&{{ '' if sort != 'last_edited' or reverse else 'reverse=True' }}">
    107                 Last Edited
    108             </a>
    109         </td>
    110       </tr>
     116            <td>
     117                <a class="listcontrol" href=".?typ={{ typ }}{{ '' if sort != 'last_edited' or reverse else 'reverse&=True' }}">
     118                    Last Edited
     119                </a>
     120            </td>
     121        </tr>
    111122    </thead>
    112123    <tbody>
    113124        {% if not worksheets %}
    114125        {% if pub %}
    115126        <tr>
    116             <td colspan="5" style="padding:20px;text-align:center">
     127            <td colspan="5">
    117128                There are no published worksheets.
    118129            </td>
    119130        </tr>
    120131        {% elif typ == 'active' %}
    121132        <tr>
    122             <td colspan="5" style="padding:20px;text-align:center">
     133            <td colspan="5">
    123134                Welcome to Sage! You can <a href="/new_worksheet">create a new worksheet</a>,
    124135                view <a href="/pub/">published worksheets</a>, or read the
    125136                <a href="/help" target="_new">documentation</a>.
     
    145156                {% else %}
    146157               
    147158                <input type="checkbox" unchecked id="{{ name|css_escape }}" />
    148                     {# I'm removing this select since it is a massive performance killer and these
    149                     serve no real purpose at all.  Plus google docs got rid of the analogous menu.
    150                     <select onchange="go_option(this);" class="worksheet_edit">
    151                         <option value="" title="File options" selected>File</option>
    152                         <option value="list_rename_worksheet('{{ name }}','{{ worksheet.name() }}');" title="Change the name of this worksheet.">
    153                             Rename...
    154                         </option>           
    155                         <option value="list_edit_worksheet('{{ name }}');" title="Open this worksheet and edit it">Edit</option>
    156                         <option value="list_copy_worksheet('{{ name }}');" title="Copy this worksheet">Copy Worksheet</option>
    157                         <option value="list_share_worksheet('{{ name }}');" title="Share this worksheet with others">Collaborate</option>
    158                         <option value="list_publish_worksheet('{{ name }}');" title="Publish this worksheet on the internet">Publish</option>
    159                         <option value="list_revisions_of_worksheet('{{ name }}');" title="See all revisions of this worksheet">Revisions</option>
    160                     </select>
    161                     #}     
    162                     {% endif %}
    163                 </td>
     159                {# I'm removing this select since it is a massive performance killer and these
     160                serve no real purpose at all.  Plus google docs got rid of the analogous menu.
     161                <select onchange="go_option(this);" class="worksheet_edit">
     162                    <option value="" title="File options" selected>File</option>
     163                    <option value="list_rename_worksheet('{{ name }}','{{ worksheet.name() }}');" title="Change the name of this worksheet.">
     164                        Rename...
     165                    </option>           
     166                    <option value="list_edit_worksheet('{{ name }}');" title="Open this worksheet and edit it">Edit</option>
     167                    <option value="list_copy_worksheet('{{ name }}');" title="Copy this worksheet">Copy Worksheet</option>
     168                    <option value="list_share_worksheet('{{ name }}');" title="Share this worksheet with others">Collaborate</option>
     169                    <option value="list_publish_worksheet('{{ name }}');" title="Publish this worksheet on the internet">Publish</option>
     170                    <option value="list_revisions_of_worksheet('{{ name }}');" title="See all revisions of this worksheet">Revisions</option>
     171                </select>
     172                #}     
     173                {% endif %}
     174            </td>
    164175
    165                 <td class="worksheet_link">
    166                     <a title="{{ worksheet.name() | escape }}" id="name-{{ name|css_escape }}" class="worksheetname" href="/home/{{ name }}">
    167                         {% if worksheet.compute_process_has_been_started() %}(running) {% endif %}
    168                         {{ worksheet.truncated_name(50) | escape}}
    169                     </a>
    170                    
    171                     {% if not pub and worksheet.is_published() %}(Published){% endif %}
    172                 </td>
    173                 <td class="owner_collab">
     176            <td class="worksheet_link">
     177                <a title="{{ worksheet.name() | escape }}" id="name-{{ name|css_escape }}" class="worksheetname" href="/home/{{ name }}">
     178                    {% if worksheet.compute_process_has_been_started() %}(running) {% endif %}
     179                    {{ worksheet.truncated_name(50) | escape}}
     180                </a>
     181               
     182                {% if not pub and worksheet.is_published() %}(Published){% endif %}
     183            </td>
     184            <td class="owner_collab">
    174185
    175                     {% if not pub %}
    176                     {{ worksheet.owner() }}
    177                     {% else %}
    178                     {{worksheet.worksheet_that_was_published().owner()}}
    179                     {% endif %}
    180                    
    181                     {% if not pub and typ != 'trash' %}
     186                {% if not pub %}
     187                {{ worksheet.owner() }}
     188                {% else %}
     189                {{worksheet.worksheet_that_was_published().owner()}}
     190                {% endif %}
     191               
     192                {% if not pub and typ != 'trash' %}
    182193
    183                     {% set shared = False %}
     194                {% set shared = False %}
    184195
    185                     {% if worksheet.collaborator_names() %}
    186                     / {{ worksheet.collaborator_names(5) }}
    187                     {% set shared = True %}
    188                     {% endif %}
     196                {% if worksheet.collaborator_names() %}
     197                / {{ worksheet.collaborator_names(5) }}
     198                {% set shared = True %}
     199                {% endif %}
    189200
    190                     {% if worksheet.viewer_names() %}
    191                     / {{ worksheet.viewer_names(5) }}
    192                     {% set shared = True %}
    193                     {% endif %}
     201                {% if worksheet.viewer_names() %}
     202                / {{ worksheet.viewer_names(5) }}
     203                {% set shared = True %}
     204                {% endif %}
    194205
    195                     {% if (worksheet.owner() != username) or username == 'admin' %}
    196                     {% set shared = False %}
    197                     {% endif %}
    198                    
    199                     {% if shared %}
    200                     <a class="share" href="/home/{{ worksheet.filename() }}/share">Add or Delete</a>
    201                     {% else %}
    202                     <a class="share" href="/home/{{ worksheet.filename() }}/share">Share now</a>
    203                     {% endif %}
     206                {% if (worksheet.owner() != username) or username == 'admin' %}
     207                {% set shared = False %}
     208                {% endif %}
     209               
     210                {% if shared %}
     211                <a class="share" href="/home/{{ worksheet.filename() }}/share">Add or Delete</a>
     212                {% else %}
     213                <a class="share" href="/home/{{ worksheet.filename() }}/share">Share now</a>
     214                {% endif %}
    204215
    205                     {% if worksheet.has_published_version() %}
    206                     <a href="/home/{{ worksheet.published_version().filename() }}">
    207                         (published)
    208                     </a>
    209                     {% endif %}
    210                    
    211                     {% endif %}
    212                 </td>
    213                 <td>
    214                     {{ worksheet.html_time_since_last_edited() }}
    215                 </td>
    216             </tr>
    217             {% endfor %}
    218             {% endif %}
    219         </tbody>
    220     </table>
    221     {% endblock %}
     216                {% if worksheet.has_published_version() %}
     217                <a href="/home/{{ worksheet.published_version().filename() }}">
     218                    (published)
     219                </a>
     220                {% endif %}
     221               
     222                {% endif %}
     223            </td>
     224            <td>
     225                {{ worksheet.html_time_since_last_edited() }}
     226            </td>
     227        </tr>
     228        {% endfor %}
     229        {% endif %}
     230    </tbody>
     231</table>
     232{% endblock %}
  • new file sagenb/data/sage/js/master.js

    diff -r 8afee2ec056a sagenb/data/sage/js/master.js
    - +  
     1$(document).ready(function() {
     2    body = $('body')
     3    body_id = body.attr('id')
     4    if (body_id == 'worksheet-listing-page') {
     5        checkForGearsInstalled();
     6    }
     7
     8    if (body.hasClass('worksheet-online')) {
     9        initialize_the_notebook();
     10    }
     11});
     12 No newline at end of file
  • sagenb/notebook/cell.py

    diff -r 8afee2ec056a sagenb/notebook/cell.py
    a b  
    3939# we don't get several of these combined in one.
    4040re_cell = re.compile('"cell://.*?"')
    4141re_cell_2 = re.compile("'cell://.*?'")   # same, but with single quotes
     42# Matches script blocks
     43re_script = re.compile(r'<script[^>]*?>.*?</script>', re.DOTALL | re.I)
    4244
    4345JEDITABLE_TINYMCE = True
    4446
     
    4850from sphinx.application import Sphinx
    4951_SAGE_INTROSPECT = None
    5052
     53
    5154class Cell_generic:
    5255    def is_interactive_cell(self):
    5356        """
     
    7982        """
    8083        raise NotImplementedError
    8184
    82     def html_new_cell_before(self):
    83         """
    84         Returns the HTML code for inserting a new cell before self.
    85 
    86         EXAMPLES::
    87 
    88             sage: C = sagenb.notebook.cell.Cell(0, '2+3', '5', None)
    89             sage: print C.html_new_cell_before()
    90             <div class="insert_new_cell" id="insert_new_cell_before0">...
    91         """
    92         return """<div class="insert_new_cell" id="insert_new_cell_before%(id)s">
    93                  </div>
    94 <script type="text/javascript">
    95 $("#insert_new_cell_before%(id)s").plainclick(function(e) {insert_new_cell_before(%(id)s);});
    96 $("#insert_new_cell_before%(id)s").shiftclick(function(e) {insert_new_text_cell_before(%(id)s);});
    97 </script>"""%{'id': self.id()}
    98 
    99     def html_new_cell_after(self):
    100         """
    101         Returns the HTML code for inserting a new cell after self.
    102 
    103         EXAMPLES::
    104 
    105             sage: C = sagenb.notebook.cell.Cell(0, '2+3', '5', None)
    106             sage: print C.html_new_cell_after()
    107             <div class="insert_new_cell" id="insert_new_cell_after0">...
    108         """
    109         return """<div class="insert_new_cell" id="insert_new_cell_after%(id)s">
    110                  </div>
    111 <script type="text/javascript">
    112 $("#insert_new_cell_after%(id)s").plainclick(function(e) {insert_new_cell_after(%(id)s);});
    113 $("#insert_new_cell_after%(id)s").shiftclick(function(e) {insert_new_text_cell_after(%(id)s);});
    114 </script>"""%{'id': self.id()}
    115 
    116 
    11785class TextCell(Cell_generic):
    11886    def __init__(self, id, text, worksheet):
    11987        """
     
    202170        """
    203171        return self.__worksheet
    204172
    205     def html(self, ncols=0, do_print=False, do_math_parse=True, editing=False):
     173    def html(self, wrap=None, div_wrap=True, do_print=False, do_math_parse=True, editing=False):
    206174        """
    207175        Returns an HTML version of self as a string.
    208176
    209177        INPUT:
    210178
     179        - ``wrap`` -- number of columns to wrap at (not used)
     180
     181        - ``div_wrap`` -- whether to wrap in a div (not used)
     182       
    211183        - ``do_math_parse`` - bool (default: True)
    212184          If True, call math_parse (defined in cell.py)
    213185          on the html.
    214186
     187        - ``do_print`` - bool (default: False)
     188          If True, display for printing
     189
     190        - ``editing`` - bool (default: False)
     191          If True, # TODO: figure out what this does
     192
    215193        EXAMPLES::
    216194
    217195            sage: C = sagenb.notebook.cell.TextCell(0, '2+3', None)
     
    221199            sage: C.html(do_math_parse=True)
    222200            '...<div class="text_cell" id="cell_text_0"><span class="math">2+3</span>...'
    223201        """
    224         s = '<span id="cell_outer_%s">'%self.__id
    225 
    226         if not do_print:
    227             s += self.html_new_cell_before()
    228 
    229         s += """<div class="text_cell" id="cell_text_%s">%s</div>"""%(
    230             self.__id,
    231             self.html_inner(ncols=ncols, do_print=do_print, do_math_parse=do_math_parse, editing=editing))
    232 
    233         if JEDITABLE_TINYMCE and hasattr(self.worksheet(),'is_published') and not self.worksheet().is_published() and not self.worksheet().docbrowser() and not do_print:
    234 
    235             try:
    236                 z = ((self.__text).decode('utf-8')).encode('ascii', 'xmlcharrefreplace')
    237             except Exception, msg:
    238                 print msg
    239                 # better to get the worksheet at all than to get a blank screen and nothing.
    240                 z = self.__text
    241 
    242             s += """<script>$("#cell_text_%s").unbind('dblclick').editable(function(value,settings) {
    243 evaluate_text_cell_input(%s,value,settings);
    244 return(value);
    245 }, {
    246       tooltip   : "",
    247       placeholder : "",
    248 //      type   : 'textarea',
    249       type   : 'mce',
    250       onblur : 'ignore',
    251       select : false,
    252       submit : 'Save changes',
    253       cancel : 'Cancel changes',
    254       event  : "dblclick",
    255       style  : "inherit",
    256       data   : %r
    257   });
    258 </script>"""%(self.__id,self.__id, z)
    259 
    260 
    261         if editing and not do_print:
    262             s += """<script>$("#cell_text_%s").trigger('dblclick');</script>"""%self.__id
    263 
    264         s += '</span>'
    265         return s
    266 
    267     def html_inner(self,ncols=0, do_print=False, do_math_parse=True, editing=False):
    268         """
    269         Returns an HTML version of the content of self as a string.
    270 
    271         INPUT:
    272 
    273         - ``do_math_parse`` - bool (default: True)
    274           If True, call math_parse (defined in cell.py)
    275           on the html.
    276 
    277         EXAMPLES::
    278 
    279             sage: C = sagenb.notebook.cell.TextCell(0, '2+3', None)
    280             sage: C.html_inner()
    281             '2+3...'
    282             sage: C.set_input_text("$2+3$")
    283             sage: C.html_inner(do_math_parse=True)
    284             '<span class="math">2+3</span>...'
    285         """
    286         t = self.__text
    287         if do_math_parse:
    288             # Do dollar sign math parsing
    289             try:
    290                 t = math_parse(t)
    291             except Exception, msg:
    292                 # Since there is no guarantee the user's input/output
    293                 # is in any way valid, and we don't want to stop the
    294                 # server process (which is doing this work).
    295                 pass
    296         s = """%s"""%t
    297         return s
     202        from .template import template
     203        return template(os.path.join('html', 'notebook', 'text_cell.html'),
     204                        cell = self, wrap = wrap, do_print = do_print,
     205                        do_math_parse = do_math_parse, editing = editing,
     206                        div_wrap=div_wrap)
    298207
    299208
    300209    def plain_text(self, prompts=False):
     
    15101419        # be evaluated twice.  They are only evaluated in the wrapped
    15111420        # version of the output.
    15121421        if ncols == 0:
    1513             while True:
    1514                 i = t.lower().find('<script>')
    1515                 if i == -1: break
    1516                 j = t[i:].lower().find('</script>')
    1517                 if j == -1: break
    1518                 t = t[:i] + t[i+j+len('</script>'):]
    1519 
     1422            t = re_script.sub('', t)
    15201423        return t
    15211424
    15221425
     
    18021705        TODO: Remove this hack (:meth:`doc_html`)
    18031706        """
    18041707        self.evaluate()
    1805         if wrap is None:
    1806             wrap = self.notebook().conf()['word_wrap_cols']
    1807         evaluated = self.evaluated()
    1808         if evaluated:
    1809             cls = 'cell_evaluated'
    1810         else:
    1811             cls = 'cell_not_evaluated'
    1812 
    1813         html_in  = self.html_in(do_print=do_print)
    1814         introspect = "<div id='introspect_div_%s' class='introspection'></div>"%self.id()
    1815         #html_out = self.html_out(wrap, do_print=do_print)
    1816         html_out = self.html()
    1817         s = html_out
    1818         if div_wrap:
    1819             s = '\n\n<div id="cell_outer_%s" class="cell_visible"><div id="cell_%s" class="%s">'%(self.id(), self.id(), cls) + s + '</div></div>'
    1820         return s
     1708        return self.html(wrap, div_wrap, do_print)
    18211709
    18221710    def html(self, wrap=None, div_wrap=True, do_print=False):
    18231711        r"""
     
    18421730            sage: C.html()
    18431731            '\n\n<div id="cell_outer_0" cl...</div>'
    18441732        """
    1845         if do_print:
    1846             wrap = 68
    1847             div_wrap = 68
    1848         key = (wrap,div_wrap,do_print)
    1849 
    1850         if wrap is None:
    1851             wrap = self.notebook().conf()['word_wrap_cols']
    1852         evaluated = self.evaluated()
    1853         if evaluated or do_print:
    1854             cls = 'cell_evaluated'
    1855         else:
    1856             cls = 'cell_not_evaluated'
    1857 
    1858         html_in  = self.html_in(do_print=do_print)
    1859         introspect = "<div id='introspect_div_%s' class='introspection'></div>"%self.id()
    1860         html_out = self.html_out(wrap, do_print=do_print)
    1861 
    1862         if 'hideall' in self.percent_directives():
    1863             s = html_out
    1864         else:
    1865             s = html_in + introspect + html_out
    1866 
    1867         if div_wrap:
    1868             s = '\n\n<div id="cell_outer_%s" class="cell_visible"><div id="cell_%s" class="%s">'%(self.id(), self.id(), cls) + s + '</div></div>'
    1869 
    1870         #self._html_cache[key] = s
    1871         return s
    1872 
    1873     def html_in(self, do_print=False, ncols=80):
    1874         """
    1875         Returns the HTML code for the input of this cell.
    1876 
    1877         EXAMPLES::
    1878 
    1879             sage: C = sagenb.notebook.cell.Cell(0, '2+3', '5', None)
    1880             sage: print C.html_in()
    1881             <div class="insert_new_cell" id="insert_new_cell_before0"...</a>
    1882         """
    1883         s = ''
    1884         id = self.__id
    1885         t = self.__in.rstrip()
    1886 
    1887         cls = "cell_input_hide" if 'hide' in self.percent_directives() else "cell_input"
    1888 
    1889         if not do_print:
    1890             s += self.html_new_cell_before()
    1891 
    1892         r = max(1, number_of_rows(t.strip(), ncols))
    1893 
    1894         if do_print:
    1895             if 'hide' in self.percent_directives():
    1896                 return ''
    1897 
    1898             tt = escape(t).replace('\n','<br>').replace('  ',' &nbsp;') + '&nbsp;'
    1899             s += '<div class="cell_input_print">%s</div>'%tt
    1900         else:
    1901             s += """
    1902                <textarea class="%s" rows=%s cols=%s
    1903                   id         = 'cell_input_%s'
    1904                   onKeyPress = 'return input_keypress(%s,event);'
    1905                   onKeyDown  = 'return input_keydown(%s,event);'
    1906                   onKeyUp    = 'return input_keyup(%s, event);'
    1907                   onBlur     = 'cell_blur(%s); return true;'
    1908                   onFocus    = 'cell_focused(this,%s); return true;'
    1909                >%s</textarea>
    1910             """%(cls, r, ncols, id, id, id, id, id, id, t)
    1911 
    1912         if not do_print:
    1913            s+= '<a href="javascript:evaluate_cell(%s,0)" class="eval_button" id="eval_button%s" alt="Click here or press shift-return to evaluate">evaluate</a>'%(id,id)
    1914 
    1915         t = escape(t)+" "
    1916 
    1917         return s
    1918 
     1733        from .template import template
     1734        return template(os.path.join('html', 'notebook', 'cell.html'),
     1735                        cell=self, wrap=wrap,
     1736                        div_wrap=div_wrap, do_print=do_print)
    19191737
    19201738    def url_to_self(self):
    19211739        """
     
    20871905            files  = ('&nbsp'*3).join(files)
    20881906        return images + files
    20891907
    2090     def html_out(self, ncols=0, do_print=False):
    2091         r"""
    2092         Returns the HTML for self's output.
    2093 
    2094         INPUT:
    2095 
    2096         - ``do_print`` -- a boolean stating whether to output HTML
    2097           for print
    2098 
    2099         - ``ncols`` -- the number of columns
    2100 
    2101         EXAMPLES::
    2102 
    2103             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    2104             sage: nb.add_user('sage','sage','sage@sagemath.org',force=True)
    2105             sage: W = nb.create_new_worksheet('Test', 'sage')
    2106             sage: C = sagenb.notebook.cell.Cell(0, '2+3', '5', W)
    2107             sage: C.html_out()
    2108             '\n...<div class="cell_output_div">\n...</div>'
    2109         """
    2110         if do_print and self.cell_output_type() == 'hidden':
    2111             return '<pre>\n</pre>'
    2112 
    2113         out_nowrap = self.output_text(0, html=True)
    2114 
    2115         out_html = self.output_html()
    2116         if self.introspect():
    2117             out_wrap = out_nowrap
    2118         else:
    2119             out_wrap = self.output_text(ncols, html=True)
    2120 
    2121         typ = self.cell_output_type()
    2122 
    2123         if self.computing():
    2124             cls = "cell_div_output_running"
    2125         else:
    2126             cls = 'cell_div_output_' + typ
    2127 
    2128         top = '<div class="%s" id="cell_div_output_%s">'%(
    2129                          cls, self.__id)
    2130 
    2131         if do_print:
    2132             prnt = "print_"
    2133         else:
    2134             prnt = ""
    2135 
    2136         out_wrap   = '<div class="cell_output_%s%s" id="cell_output_%s">%s</div>'%(
    2137             prnt, typ, self.__id, out_wrap)
    2138         if not do_print:
    2139             out_nowrap = '<div class="cell_output_%snowrap_%s" id="cell_output_nowrap_%s">%s</div>'%(
    2140                 prnt, typ, self.__id, out_nowrap)
    2141         out_html   = '<div class="cell_output_html_%s" id="cell_output_html_%s">%s </div>'%(
    2142             typ, self.__id, out_html)
    2143 
    2144         if do_print:
    2145             out = out_wrap + out_html
    2146         else:
    2147             out = out_wrap + out_nowrap + out_html
    2148 
    2149         s = top + out + '</div>'
    2150 
    2151         r = ''
    2152         r += '&nbsp;'*(7-len(r))
    2153         tbl = """
    2154                <div class="cell_output_div">
    2155                <table class="cell_output_box"><tr>
    2156                <td class="cell_number" id="cell_number_%s" %s>
    2157                  %s
    2158                </td>
    2159                <td class="output_cell">%s</td></tr></table></div>"""%(
    2160                    self.__id,
    2161                    '' if do_print else 'onClick="cycle_cell_output_type(%s);"'%self.__id,
    2162                    r, s)
    2163 
    2164         return tbl
    2165 
    2166 
    2167 
    21681908########
    21691909
    21701910def format_exception(s0, ncols):
  • sagenb/notebook/js.py

    diff -r 8afee2ec056a sagenb/notebook/js.py
    a b  
    5757
    5858    """
    5959    global _cache_javascript
    60     if _cache_javascript is not None:
    61         return _cache_javascript
     60    #if _cache_javascript is not None:
     61    #    return _cache_javascript
    6262
    6363    from template import template
     64
    6465    s = template(os.path.join('js', 'notebook_lib.js'),
    6566                 SAGE_URL=SAGE_URL,
    6667                 KEY_CODES=keyhandler.all_tests())
     
    7172    # Evil" clause in the license.  Does that prevent us from
    7273    # distributing it (i.e., it adds an extra condition to the
    7374    # software)?  See http://www.crockford.com/javascript/jsmin.py.txt
    74     s = JavaScriptCompressor().getPacked(s)
     75#    s = JavaScriptCompressor().getPacked(s.encode('utf-8'))
    7576    _cache_javascript = s
    7677    return s
    7778
  • sagenb/notebook/notebook.py

    diff -r 8afee2ec056a sagenb/notebook/notebook.py
    a b  
    4242import server_conf  # server configuration
    4343import user_conf    # user configuration
    4444import user         # users
    45 from   template import template
     45from   template import template, prettify_time_ago
    4646
    4747
    4848try:
     
    11771177
    11781178
    11791179    ##########################################################
    1180     # Importing and exporting worksheets to a plain text format
    1181     ##########################################################
    1182 
    1183     def plain_text_worksheet_html(self, filename, prompts=True):
    1184         """
    1185         Return HTML containing the plain text version of a worksheet.
    1186 
    1187         INPUT:
    1188 
    1189         - ``filename`` - a string; filename of a worksheet
    1190 
    1191         - ``prompts`` - a bool (default: True); whether to format the
    1192           text for inclusion in docstrings
    1193 
    1194         OUTPUT:
    1195 
    1196         - a string - the worksheet's HTML representation
    1197         """
    1198         worksheet = self.get_worksheet_with_filename(filename)
    1199         text = escape(worksheet.plain_text(prompts = prompts))
    1200         return template(os.path.join("html", "notebook", "plain_text_worksheet.html"),
    1201                         worksheet_name = worksheet.name(),
    1202                         worksheet_plain_text = text)
    1203 
    1204     ##########################################################
    12051180    # Server configuration
    12061181    ##########################################################
    12071182    def conf(self):
     
    12461221    ##########################################################
    12471222    # Worksheet HTML generation
    12481223    ##########################################################
    1249     def worksheet_html(self, filename, do_print=False):
    1250         r"""
    1251         Return the HTML for a given worksheet.
    1252 
    1253         INPUT:
    1254 
    1255         - ``filename`` - a string; the worksheet's filename
    1256 
    1257         - ``do_print`` - a bool (default: False); whether this is a
    1258           printed worksheet
    1259 
    1260         OUTPUT:
    1261 
    1262         - a string - the worksheet rendered as HTML
    1263 
    1264         EXAMPLES::
    1265 
    1266             sage: nb = sagenb.notebook.notebook.load_notebook(tmp_dir()+'.sagenb')
    1267             sage: W = nb.create_new_worksheet('Test', 'admin')
    1268             sage: nb.worksheet_html(W.filename())
    1269             '...<!D...Test...cell_id_list=[1]...</body>...</html>'
    1270         """
    1271         worksheet = self.get_worksheet_with_filename(filename)
    1272         return template(os.path.join("html", "notebook", "worksheet.html"),
    1273                         worksheet_name = worksheet.name(),
    1274                  worksheet_html = worksheet.html(include_title=False, do_print=do_print),
    1275                         do_print = do_print)
    1276 
    1277 
    1278 
    12791224    def worksheet_list_for_public(self, username, sort='last_edited', reverse=False, search=None):
    12801225        W = [x for x in self.__worksheets.itervalues() if x.is_published() and not x.is_trashed(user)]
    12811226
     
    13231268            '\n\n{{{id=1|\n\n///\n}}}'
    13241269            sage: W.save_snapshot('admin')
    13251270            sage: nb.html_worksheet_revision_list('admin', W)
    1326             '...Revision...Last Edited...seconds...ago...'
     1271            u'...Revision...Last Edited...seconds...ago...'
    13271272        """
    13281273        data = worksheet.snapshot_data()  # pairs ('how long ago', key)
    13291274
    13301275        return template(os.path.join("html", "notebook", "worksheet_revision_list.html"),
    13311276                        data = data, worksheet = worksheet,
    13321277                        worksheet_filename = worksheet.filename(),
    1333                         username = username, JSMATH = JSMATH,
    1334                         JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1278                        username = username)
    13351279
    13361280
    13371281    def html_specific_revision(self, username, ws, rev):
     
    13511295        - a string - the revision rendered as HTML
    13521296        """
    13531297        t = time.time() - float(rev[:-4])
    1354         time_ago = worksheet.convert_seconds_to_meaningful_time_span(t)
     1298        time_ago = prettify_time_ago(t)
    13551299
    13561300        filename = ws.get_snapshot_text_filename(rev)
    13571301        txt = bz2.decompress(open(filename).read())
    13581302        W = self.scratch_worksheet()
    13591303        W.delete_cells_directory()
    13601304        W.edit_save(txt)
    1361         body_worksheet_html = W.html_worksheet_body(do_print=True, publish=True)
    13621305
    13631306        data = ws.snapshot_data()  # pairs ('how long ago', key)
    13641307        prev_rev = None
     
    13721315                break
    13731316
    13741317        return template(os.path.join("html", "notebook", "specific_revision.html"),
    1375                         worksheet = ws, worksheet_filename = ws.filename(),
     1318                        worksheet = ws,
    13761319                        username = username, rev = rev, prev_rev = prev_rev,
    1377                         next_rev = next_rev, time_ago = time_ago,
    1378                         body_worksheet_html = body_worksheet_html,
    1379                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1320                        next_rev = next_rev, time_ago = time_ago)
    13801321
    13811322    def html_share(self, worksheet, username):
    13821323        r"""
     
    13971338            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    13981339            sage: W = nb.create_new_worksheet('Test', 'admin')
    13991340            sage: nb.html_share(W, 'admin')
    1400             '...currently shared...add or remove collaborators...'
     1341            u'...currently shared...add or remove collaborators...'
    14011342        """
    14021343        U = self.users()
    14031344        other_users = [x for x, u in U.iteritems() if not u.is_guest() and not u.username() in [username, 'pub', '_sage_']]
     
    14061347        return template(os.path.join("html", "notebook", "worksheet_share.html"),
    14071348                        worksheet = worksheet,
    14081349                        worksheet_filename = worksheet.filename(),
    1409                         username = username, other_users = other_users,
    1410                         user_is_admin = self.user(username).is_admin(),
    1411                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
    1412 
     1350                        username = username, other_users = other_users)
     1351   
    14131352    def html_download_or_delete_datafile(self, ws, username, filename):
    14141353        r"""
    14151354        Return the HTML for the download or delete datafile page.
     
    14311370            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    14321371            sage: W = nb.create_new_worksheet('Test', 'admin')
    14331372            sage: nb.html_download_or_delete_datafile(W, 'admin', 'bar')
    1434             '...Data file: bar...DATA is a special variable...uploaded...'
     1373            u'...Data file: bar...DATA is a special variable...uploaded...'
    14351374        """
    1436         path = "/home/%s/data/%s"%(ws.filename(), filename)
    1437 
    1438         worksheets = self.get_worksheets_with_viewer(username)
    1439         active_worksheets = [worksheet for worksheet in worksheets if worksheet.is_active(username)]
    1440         sort_worksheet_list(active_worksheets, 'name', False)
    1441 
    14421375        ext = os.path.splitext(filename)[1].lower()
    14431376        file_is_image, file_is_text = False, False
    14441377        text_file_content = ""
     
    14521385        return template(os.path.join("html", "notebook", "download_or_delete_datafile.html"),
    14531386                        worksheet = ws, worksheet_filename = ws.filename(),
    14541387                        username = username,
    1455                         active_worksheets = active_worksheets,
    1456                         filename_ = filename, path = path,
     1388                        filename_ = filename,
    14571389                        file_is_image = file_is_image,
    14581390                        file_is_text = file_is_text,
    1459                         text_file_content = text_file_content,
    1460                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1391                        text_file_content = text_file_content)
    14611392
    14621393
    14631394    ##########################################################
    14641395    # Accessing all worksheets with certain properties.
    14651396    ##########################################################
     1397    def active_worksheets_for(self, username):
     1398        return [ws for ws in self.get_worksheets_with_viewer(username) if ws.is_active(username)]
     1399   
    14661400    def get_all_worksheets(self):
    14671401        return [x for x in self.__worksheets.itervalues() if not x.owner() in ['_sage_', 'pub']]
    14681402
     
    15421476    ###########################################################
    15431477    # HTML -- generate most html related to the whole notebook page
    15441478    ###########################################################
    1545     def html_debug_window(self):
    1546         r"""
    1547         Return the HTML for the debug window.
    1548 
    1549         OUTPUT:
    1550 
    1551         - a string - the debug window rendered as HTML
    1552 
    1553         EXAMPLES::
    1554 
    1555             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    1556             sage: nb.html_debug_window()
    1557             "\n<div class='debug_window'>...</div>"
    1558         """
    1559         return template(os.path.join("html", "notebook", "debug_window.html"))
    1560 
    1561 
    15621479    def html_plain_text_window(self, worksheet, username):
    15631480        r"""
    15641481        Return HTML for the window that displays a plain text version
     
    15791496            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    15801497            sage: W = nb.create_new_worksheet('Test', 'admin')
    15811498            sage: nb.html_plain_text_window(W, 'admin')
    1582             '...pre class="plaintext"...cell_intext...textfield...'
     1499            u'...pre class="plaintext"...cell_intext...textfield...'
    15831500        """
    15841501        plain_text = worksheet.plain_text(prompts=True, banner=False)
    15851502        plain_text = escape(plain_text).strip()
     
    16091526            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    16101527            sage: W = nb.create_new_worksheet('Test', 'admin')
    16111528            sage: nb.html_edit_window(W, 'admin')
    1612             '...textarea class="plaintextedit"...{{{id=1|...//...}}}...'
     1529            u'...textarea class="plaintextedit"...{{{id=1|...//...}}}...'
    16131530        """
    1614         text = worksheet.edit_text()
    1615         text = escape(text)
    1616         n_lines = text.count("\n")+1
    16171531
    16181532        return template(os.path.join("html", "notebook", "edit_window.html"),
    16191533                        worksheet = worksheet,
    16201534                        worksheet_filename = worksheet.filename(),
    1621                         username = username, text = text, n_lines = n_lines,
    1622                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1535                        username = username)
    16231536
    16241537    def html_beforepublish_window(self, worksheet, username):
    16251538        r"""
     
    16411554            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    16421555            sage: W = nb.create_new_worksheet('Test', 'admin')
    16431556            sage: nb.html_beforepublish_window(W, 'admin')
    1644             '...want to publish this worksheet?...re-publish when changes...'
     1557            u'...want to publish this worksheet?...re-publish when changes...'
    16451558        """
    16461559        msg = """You can publish your worksheet to the Internet, where anyone will be able to access and view it online.
    16471560        Your worksheet will be assigned a unique address (URL) that you can send to your friends and colleagues.<br/><br/>
     
    17071620            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    17081621            sage: W = nb.create_new_worksheet('Test', 'admin')
    17091622            sage: nb.html_upload_data_window(W, 'admin')
    1710             '...Upload or Create Data File...Browse...url...name of a new...'
     1623            u'...Upload or Create Data File...Browse...url...name of a new...'
    17111624        """
    17121625        return template(os.path.join("html", "notebook", "upload_data_window.html"),
    1713                         worksheet = ws, worksheet_filename = ws.filename(),
    1714                         username = username,
    1715                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1626                        worksheet = ws, username = username)
    17161627
    1717     def html(self, worksheet_filename=None, username='guest', show_debug=False, admin=False):
     1628    def html(self, worksheet_filename=None, username='guest', show_debug=False,
     1629             admin=False, do_print=False):
    17181630        r"""
    17191631        Return the HTML for a worksheet's index page.
    17201632
     
    17371649            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    17381650            sage: W = nb.create_new_worksheet('Test', 'admin')
    17391651            sage: nb.html(W.filename(), 'admin')
    1740             '...Test...cell_input...plainclick...state_number...worksheet_locked=false...'
     1652            u'...Test...cell_input...plainclick...state_number...worksheet_locked=false...'
    17411653        """
    17421654        if worksheet_filename is None or worksheet_filename == '':
    17431655            worksheet_filename = None
     
    17481660            except KeyError:
    17491661                W = None
    17501662
    1751         template_page = os.path.join("html", "notebook", "index.html")
     1663        template_page = os.path.join("html", "notebook", "worksheet_page.html")
    17521664        if W.docbrowser():
    17531665            template_page = os.path.join("html", "notebook", "doc_page.html")
     1666        elif do_print:
     1667            template_page = os.path.join('html', 'notebook', 'print_worksheet.html')
     1668        elif W.is_published() or self.user_is_guest(username):
     1669            template_page = os.path.join('html', 'notebook', 'guest_worksheet_page.html')
    17541670
    17551671        return template(template_page, worksheet = W,
    1756                         worksheet_filename = W.filename(),
    1757                         worksheet_html = W.html(), notebook = self,
    1758                         username = username, show_debug = show_debug,
    1759                         JSMATH = JSMATH, JEDITABLE_TINYMCE = JEDITABLE_TINYMCE)
     1672                        notebook = self, do_print=do_print,
     1673                        username = username, show_debug = show_debug)
    17601674
    17611675####################################################################
    17621676
     
    19931907# Misc
    19941908##########################################################
    19951909
    1996 def clean_name(name):
    1997     return ''.join([x if (x.isalnum() or x == '_') else '_' for x in name])
    19981910
    19991911def sort_worksheet_list(v, sort, reverse):
    20001912    """
  • sagenb/notebook/template.py

    diff -r 8afee2ec056a sagenb/notebook/template.py
    a b  
    1717
    1818import jinja
    1919
    20 from jinja.filters import stringfilter
     20from jinja.filters import stringfilter, simplefilter
    2121
    2222import os, re, sys
    2323
    2424from sagenb.misc.misc import SAGE_VERSION, DATA
     25from sagenb.notebook.cell import number_of_rows
     26from sagenb.notebook.jsmath import math_parse
    2527
    2628
    2729TEMPLATE_PATH = os.path.join(DATA, 'sage')
     
    7173    """
    7274    return css_illegal_re.sub('-', string)
    7375
    74 def contained_in(container):
     76def prettify_time_ago(t):
    7577    """
    76     Given a container, returns a function which takes an environment,
    77     context, and value and returns True if that value is in the
    78     container and False otherwise.  This is registered and used as a
    79     test in the templates.
     78    Converts seconds to a meaningful string.
     79
     80    INPUT
     81
     82    - t -- time in seconds
     83
     84    """
     85    if t < 60:
     86        s = int(t)
     87        if s == 1:
     88            return "1 second"
     89        return "%d seconds"%s
     90    if t < 3600:
     91        m = int(t/60)
     92        if m == 1:
     93            return "1 minute"
     94        return "%d minutes"%m
     95    if t < 3600*24:
     96        h = int(t/3600)
     97        if h == 1:
     98            return "1 hour"
     99        return "%d hours"%h
     100    d = int(t/(3600*24))
     101    if d == 1:
     102        return "1 day"
     103    return "%d days"%d
     104
     105def clean_name(name):
     106    """
     107    Converts a string to a safe/clean name by converting non-alphanumeric characters to underscores.
    80108
    81109    INPUT:
    82110
    83     - ``container`` - a container, e.g., a list or dictionary
     111    - name -- a string
    84112
    85113    EXAMPLES::
    86114
    87         sage: from sagenb.notebook.template import contained_in
    88         sage: f = contained_in([1,2,3])
    89         sage: f(None, None, 2)
    90         True
    91         sage: f(None, None, 4)
    92         False
     115        sage: from sagenb.notebook.template import clean_name
     116        sage: print clean_name('this!is@bad+string')
     117        this_is_bad_string
    93118    """
    94     def wrapped(env, context, value):
    95         return value in container
    96     return wrapped
    97 
     119    return ''.join([x if x.isalnum() else '_' for x in name])
    98120
    99121env.filters['css_escape'] = css_escape
    100 env.tests['contained_in'] = contained_in
    101 
    102 #A dictionary containing the default context
    103 #The values in this dictionary will be updated
    104 #by the
    105 default_context = {'sitename': 'Sage Notebook',
    106                    'sage_version': SAGE_VERSION}
     122env.filters['number_of_rows'] = simplefilter(number_of_rows)
     123env.filters['clean_name'] = stringfilter(clean_name)
     124env.filters['prettify_time_ago'] = simplefilter(prettify_time_ago)
     125env.filters['math_parse'] = stringfilter(math_parse)
    107126
    108127def template(filename, **user_context):
    109128    """
     
    136155        sage: 'Gr\xc3\xb6bner' in s
    137156        True
    138157    """
     158    from sagenb.notebook.notebook import JSMATH, JEDITABLE_TINYMCE
     159    from twist import notebook
     160    #A dictionary containing the default context
     161    default_context = {'sitename': 'Sage Notebook',
     162                       'sage_version': SAGE_VERSION,
     163                       'JSMATH': JSMATH,
     164                       'JEDITABLE_TINYMCE': JEDITABLE_TINYMCE,
     165                       'conf': notebook.conf() if notebook else None}
    139166    try:
    140167        tmpl = env.get_template(filename)
    141168    except jinja.exceptions.TemplateNotFound:
     
    143170    context = dict(default_context)
    144171    context.update(user_context)
    145172    r = tmpl.render(**context)
    146     return r.encode('utf-8')
     173    return r
  • sagenb/notebook/twist.py

    diff -r 8afee2ec056a sagenb/notebook/twist.py
    a b  
    135135    return template(os.path.join('html', 'error_message.html'),
    136136                    **template_dict)
    137137
     138class Response(http.Response):
     139    """
     140    An adapter for ``twisted.web2.http.Response`` that automatically
     141    encodes its stream into UTF-8.
     142
     143    INPUT:
     144
     145    - code -- HTTP status code for the response
     146
     147    - headers -- headers to be sent
     148
     149    - stream -- content body to send
     150    """
     151    def __init__(self, code=None, headers=None, stream=None):
     152        if stream is not None:
     153            if isinstance(stream, unicode):
     154                stream = stream.encode('utf-8', 'ignore')
     155        super(Response, self).__init__(code, headers, stream)
     156
    138157def HTMLResponse(*args, **kwds):
    139158    """
    140159    Returns an HTMLResponse object whose 'Content-Type' header has been set
     
    148167        <Headers: Raw: {'content-type': ['text/html; charset=utf-8']} Parsed: {'content-type': <RecalcNeeded>}>
    149168
    150169    """
    151     response = http.Response(*args, **kwds)
     170    response = Response(*args, **kwds)
    152171    response.headers.addRawHeader('Content-Type', 'text/html; charset=utf-8')
    153172    return response
    154173
     
    10081027
    10091028        td['admin'] = nu.is_admin()
    10101029
    1011         s = template(os.path.join('html', 'account_settings.html'), **td)
     1030        s = template(os.path.join('html', 'settings', 'account_settings.html'), **td)
    10121031        return HTMLResponse(stream = s)
    10131032
    10141033
     
    10231042
    10241043        template_dict = {}
    10251044        template_dict['auto_table'] = notebook.conf().html_table(updated)
    1026         s = template(os.path.join('html', 'notebook_settings.html'),
     1045        template_dict['admin'] = notebook.user(self.username).is_admin()
     1046        template_dict['username'] = self.username
     1047        s = template(os.path.join('html', 'settings', 'notebook_settings.html'),
    10271048                     **template_dict)
    1028         return http.Response(stream = s)
     1049        return Response(stream = s)
    10291050
    10301051
    10311052########################################################
     
    13121333class Worksheet_rating_info(WorksheetResource, resource.Resource):
    13131334    def render(self, ctx):
    13141335        s = self.worksheet.html_ratings_info()
    1315         return HTMLResponse(stream=message('''
    1316         <h2 align=center>Ratings for %s</h2>
    1317         <h3 align=center><a href='/home/%s'>Go to the worksheet.</a>
    1318         <br><br>
    1319         <table width=70%%align=center border=1 cellpadding=10 cellspacing=0>
    1320         <tr bgcolor="#7799bb"><td width=30em>User</td><td width=10em align=center>Rating</td><td width=10em align=center width=60em>Comment</td></tr>
    1321         %s
    1322         </table>
    1323         <br><br>
    1324         '''%(self.worksheet.name(), self.worksheet.filename(), s)))
    1325 
     1336        return HTMLResponse(stream=s)
    13261337
    13271338class Worksheet_rate(WorksheetResource, resource.Resource):
    13281339    def render(self, ctx):
     
    14271438        s = self.worksheet.interrupt()
    14281439        return HTMLResponse(stream='ok' if s else 'failed')
    14291440
    1430 class Worksheet_plain(WorksheetResource, resource.Resource):
    1431     def render(self, ctx):
    1432         s = notebook.plain_text_worksheet_html(self.name)
    1433         return HTMLResponse(stream=s)
    1434 
    14351441class Worksheet_hide_all(WorksheetResource, resource.Resource):
    14361442    def render(self, ctx):
    14371443        self.worksheet.hide_all()
     
    14541460
    14551461class Worksheet_print(WorksheetResource, resource.Resource):
    14561462    def render(self, ctx):
    1457         s = notebook.worksheet_html(self.name, do_print=True)
     1463        s = notebook.html(self.name, do_print=True)
    14581464        return HTMLResponse(stream=s)
    14591465
    14601466
     
    17861792    def render(self, ctx):
    17871793        s = css.css()
    17881794        gzip_handler(ctx)
    1789         response = http.Response(stream=s)
     1795        response = Response(stream=s)
    17901796        response.headers.addRawHeader('Content-Type', 'text/css; charset=utf-8')
    17911797        return response
    17921798
     
    17941800    def render(self, ctx):
    17951801        s = template(os.path.join('css', 'reset.css'))
    17961802        gzip_handler(ctx)
    1797         return http.Response(stream=s)
     1803        return Response(stream=s)
    17981804
    17991805class CSS(resource.Resource):
    18001806    addSlash = True
     
    18241830                     jsmath_macros = jsmath_macros,
    18251831                     jsmath_image_fonts = jsmath_image_fonts)
    18261832
    1827         return http.Response(stream=s)
     1833        return Response(stream=s)
    18281834
    18291835class Main_js(resource.Resource):
    18301836    def render(self, ctx):
    18311837        gzip_handler(ctx)
    18321838        s = js.javascript()
    1833         return http.Response(stream=s)
     1839        return Response(stream=s)
    18341840
    18351841class Keyboard_js_specific(resource.Resource):
    18361842    def __init__(self, browser_os):
     
    18381844
    18391845    def render(self, ctx):
    18401846        gzip_handler(ctx)
    1841         return http.Response(stream = self.s)
     1847        return Response(stream = self.s)
    18421848
    18431849class Keyboard_js(resource.Resource):
    18441850    def childFactory(self, request, browser_os):
     
    21482154        # VALIDATE OVERALL.
    21492155        if empty == required:
    21502156            # All required fields are empty.  Not really an error.
    2151             form = template(os.path.join('html', 'registration.html'),
     2157            form = template(os.path.join('html', 'accounts', 'registration.html'),
    21522158                            **empty_form_dict)
    21532159            return HTMLResponse(stream = form)
    21542160        elif validated != required:
     
    21562162            errors = len(required) - len(validated)
    21572163            template_dict['error'] = 'E ' if errors == 1 else 'Es '
    21582164
    2159             form = template(os.path.join('html', 'registration.html'),
     2165            form = template(os.path.join('html', 'accounts', 'registration.html'),
    21602166                            **template_dict)
    21612167            return HTMLResponse(stream = form)
    21622168
     
    21672173            template_dict['username_taken'] = True
    21682174            template_dict['error'] = 'E '
    21692175
    2170             form = template(os.path.join('html', 'registration.html'),
     2176            form = template(os.path.join('html', 'accounts', 'registration.html'),
    21712177                            **template_dict)
    21722178            return HTMLResponse(stream = form)
    21732179
     
    22482254
    22492255            return HTMLResponse(stream=message("A new password has been sent to your e-mail address.", '/'))
    22502256        else:
    2251             s = template(os.path.join('html', 'account_recovery.html'))
     2257            s = template(os.path.join('html', 'accounts', 'account_recovery.html'))
    22522258        return HTMLResponse(stream=s)
    22532259
    22542260class ListOfUsers(resource.Resource):
     
    22852291        users = sorted(notebook.valid_login_names())
    22862292        del users[users.index('admin')]
    22872293        template_dict['users'] = [notebook.user(i) for i in users]
    2288         return HTMLResponse(stream = template(os.path.join('html', 'user_management.html'), **template_dict))
     2294        template_dict['admin'] = notebook.user(self.username).is_admin()
     2295        template_dict['username'] = self.username
     2296        return HTMLResponse(stream = template(os.path.join('html', 'settings', 'user_management.html'), **template_dict))
    22892297
    22902298class AdminAddUser(resource.PostableResource):
    2291     def __init__(self, userdb):
    2292         self.userdb = userdb
     2299    def __init__(self, username):
     2300        self.username = username
    22932301
    22942302    def render(self, request):
    2295 
     2303        template_dict = {'admin': notebook.user(self.username).is_admin(),
     2304                         'username': self.username}
    22962305        if 'username' in request.args:
    22972306            username = request.args['username'][0]
    22982307            if not is_valid_username(username):
    2299                 return HTMLResponse(stream=template(os.path.join('html', 'admin_add_user.html'), error='username_invalid', username=username))
     2308                return HTMLResponse(stream=template(os.path.join('html', 'settings', 'admin_add_user.html'),
     2309                                                    error='username_invalid', username=username, **template_dict))
    23002310
    23012311            from random import choice
    23022312            import string
    23032313            chara = string.letters + string.digits
    23042314            password = ''.join([choice(chara) for i in range(8)])
    23052315            if username in notebook.usernames():
    2306                 return HTMLResponse(stream=template(os.path.join('html', 'admin_add_user.html'), error='username_taken', username=username))
     2316                return HTMLResponse(stream=template(os.path.join('html', 'settings', 'admin_add_user.html'),
     2317                                                    error='username_taken', username_input=username, **template_dict))
    23072318            notebook.add_user(username, password, '', force=True)
    2308             return HTMLResponse(stream=message('The temporary password for the new user <em>%s</em> is <em>%s</em>' % (username, password), '/adduser'))
     2319            return HTMLResponse(stream=message('The temporary password for the new user <em>%s</em> is <em>%s</em>' %
     2320                                               (username, password), '/adduser'))
    23092321        else:
    2310             return HTMLResponse(stream=template(os.path.join('html', 'admin_add_user.html')))
     2322           
     2323            return HTMLResponse(stream=template(os.path.join('html', 'settings', 'admin_add_user.html'), **template_dict))
    23112324
    23122325class InvalidPage(resource.Resource):
    23132326    addSlash = True
     
    24632476    # better call userchildFactory it in the base class (Toplevel)!
    24642477    def userchildFactory(self, request, name):
    24652478        try:
    2466             return UserToplevel.__dict__['userchild_%s'%name](username = self.username)
    2467         except KeyError:
     2479            return getattr(self.__class__, 'userchild_%s' % name )(username = self.username)
     2480        except AttributeError:
    24682481            pass
    24692482
    24702483    userchild_doc = Doc
     
    25062519
    25072520class AdminToplevel(UserToplevel):
    25082521    addSlash = True
    2509 
     2522   
    25102523    userchild_home = WorksheetsAdmin
    2511     child_users = ListOfUsers
    2512     child_adduser = AdminAddUser
    2513     child_notebooksettings = NotebookSettingsPage
     2524    userchild_users = ListOfUsers
     2525    userchild_adduser = AdminAddUser
     2526    userchild_notebooksettings = NotebookSettingsPage
    25142527
    25152528def user_type(username):
    25162529    # one of admin, guest, user
  • sagenb/notebook/worksheet.py

    diff -r 8afee2ec056a sagenb/notebook/worksheet.py
    a b  
    4343
    4444# Imports specifically relevant to the sage notebook
    4545from   cell import Cell, TextCell
    46 from template import template
     46from template import template, clean_name, prettify_time_ago
    4747
    4848# Set some constants that will be used for regular expressions below.
    4949whitespace = re.compile('\s')  # Match any whitespace character
     
    110110        sage: sagenb.notebook.worksheet.worksheet_filename('Example#%&! work\\sheet 3', 'sage10')
    111111        'sage10/Example_____work_sheet_3'
    112112    """
    113     return os.path.join(owner, _notebook.clean_name(name))
     113    return os.path.join(owner, clean_name(name))
    114114
    115115def Worksheet_from_basic(obj, notebook_worksheet_directory):
    116116    """
     
    11841184                del self.__published_version
    11851185                raise ValueError
    11861186        except AttributeError:
    1187             raise ValueError, "no published version"
     1187            raise ValueError("no published version")
    11881188
    11891189    def set_worksheet_that_was_published(self, W):
    11901190        """
     
    13191319            sage: W.rate(0, 'this lacks content', 'riemann')
    13201320            sage: W.rate(3, 'this is great', 'hilbert')
    13211321            sage: W.html_ratings_info()
    1322             '<tr><td>hilbert</td><td align=center>3</td><td>this is great</td></tr>\n<tr><td>riemann</td><td align=center>0</td><td>this lacks content</td></tr>'
     1322            u'...hilbert...3...this is great...this lacks content...'
    13231323        """
    1324         ratings = self.ratings()
    1325         lines = []
    1326         for z in sorted(ratings):
    1327             if len(z) == 2:
    1328                 person, rating = z
    1329                 comment = ''
    1330             else:
    1331                 person, rating, comment = z
    1332             lines.append('<tr><td>%s</td><td align=center>%s</td><td>%s</td></tr>'%(
    1333                 person, rating, '&nbsp;' if not comment else comment))
    1334         return '\n'.join(lines)
     1324        return template(os.path.join('html', 'worksheet', 'ratings_info.html'),
     1325                        worksheet = self)
    13351326
    13361327    def rating(self):
    13371328        """
     
    19721963        filenames = os.listdir(self.snapshot_directory())
    19731964        filenames.sort()
    19741965        t = time.time()
    1975         v = [(convert_seconds_to_meaningful_time_span(t - float(os.path.splitext(x)[0]))+ self._saved_by_info(x), x)  \
     1966        v = [(prettify_time_ago(t - float(os.path.splitext(x)[0]))+ self._saved_by_info(x), x)  \
    19761967             for x in filenames]
    19771968        self.__snapshot_data = v
    19781969        return v
     
    22682259                print msg
    22692260        return cells_html
    22702261
    2271     def html(self, include_title=True, do_print=False,
    2272              confirm_before_leave=False, read_only=False):
     2262    def html(self, do_print=False, publish=False):
    22732263        r"""
    22742264        INPUT:
    22752265
     
    22862276            sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    22872277            sage: W = nb.create_new_worksheet('Test', 'admin')
    22882278            sage: W.html()
    2289             '\n\n\n<div class="cell_input_active" id="cell_resizer"></div>\n\n<div class="worksheet_cell_list" id...'
     2279            u'...class="cell_input_active"..."worksheet_cell_list"...id="cell_1"...id="cell_output_html_1"'
    22902280        """
    2291         return template(os.path.join("html", "worksheet", "worksheet.html"),
    2292                         published = self.is_published(),
    2293                         do_print = do_print, confirm_before_leave = confirm_before_leave,
    2294                         cells_html = self.html_cell_list(do_print=do_print),
    2295                         cell_id_list = self.cell_id_list(),
    2296                         state_number = self.state_number())
     2281        return template(os.path.join("html", "notebook", "worksheet.html"),
     2282                        do_print=do_print, publish=publish, worksheet=self)
    22972283
    22982284    def truncated_name(self, max=30):
    22992285        name = self.name()
     
    23102296    def set_is_doc_worksheet(self, value):
    23112297        self.__is_doc_worksheet = value
    23122298
    2313     def html_save_discard_buttons(self):
    2314         r"""
    2315         OUTPUT:
    2316 
    2317         - string -- the HTML for the save, discard, etc. buttons
    2318 
    2319         EXAMPLES::
    2320 
    2321             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    2322             sage: W = nb.create_new_worksheet('Test', 'admin')
    2323             sage: W.html_save_discard_buttons()
    2324             '\n\n<button name="button_save" title="Save changes" onClick="save_worksheet();">Save<...'
    2325         """
    2326         return template(os.path.join("html", "worksheet", "save_discard_buttons.html"),
    2327                         doc_worksheet = self.is_doc_worksheet())
    2328 
    2329     def html_share_publish_buttons(self, select=None, backwards=False):
    2330         r"""
    2331         INPUT:
    2332 
    2333         - select - a boolean
    2334 
    2335         - backwards - a boolean
    2336 
    2337         OUTPUT:
    2338 
    2339         - string -- the HTML for the share, publish, etc. buttons
    2340 
    2341         EXAMPLES::
    2342 
    2343             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    2344             sage: W = nb.create_new_worksheet('Test', 'admin')
    2345             sage: W.html_share_publish_buttons()
    2346             '...Print...Worksheet...Edit...Undo...Share...Publish...'
    2347         """
    2348         return template(os.path.join("html", "worksheet", "share_publish_buttons.html"),
    2349                         worksheet = self, select = select, backwards = backwards)
    2350 
    2351     def html_menu(self):
    2352         r"""
    2353         OUTPUT:
    2354 
    2355         - string -- the HTML for the menus of the worksheet
    2356 
    2357         EXAMPLES::
    2358 
    2359             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    2360             sage: W = nb.create_new_worksheet('Test', 'admin')
    2361             sage: W.html_menu()
    2362             '...File...Action...Data...pretty_print...'
    2363         """
    2364         return template(os.path.join("html", "worksheet", "menu.html"),
    2365                         name = _notebook.clean_name(self.name()),
    2366                         filename_ = self.filename(), data = sorted(self.attached_data_files()),
    2367                         systems_enumerated = enumerate(self.notebook().systems()),
    2368                         system_names = self.notebook().system_names(),
    2369                         current_system_index = self.system_index(),
    2370                         pretty_print = self.pretty_print(),
    2371                         doc_worksheet = self.is_doc_worksheet())
    2372 
    2373     def html_worksheet_body(self, do_print, publish=False):
    2374         r"""
    2375         INPUT:
    2376 
    2377         - publish - a boolean stating whether the worksheet is published
    2378 
    2379         - do_print - a boolean
    2380 
    2381         OUTPUT:
    2382 
    2383         - string -- the HTML for the File menu of the worksheet
    2384 
    2385         EXAMPLES::
    2386 
    2387             sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()+'.sagenb')
    2388             sage: W = nb.create_new_worksheet('Test', 'admin')
    2389             sage: W.html_worksheet_body(false)
    2390             '\n\n<div class="cell_input_active" id="cell_resizer"></div>\n\n<div class="worksheet_cell_list" id...'
    2391         """
    2392         published = self.is_published() or publish
    2393         ncols = self.notebook().conf()['word_wrap_cols']
    2394         cells_html = ""
    2395         for cell in self.cell_list():
    2396             cells_html += cell.html(ncols, do_print=do_print) + '\n'
    2397 
    2398         return template(os.path.join("html", "worksheet", "worksheet_body.html"),
    2399                         cells_html = cells_html,
    2400                         published = published,
    2401                         do_print = do_print)
    2402 
    24032299
    24042300    ##########################################################
    24052301    # Last edited
     
    24452341            sage: W.last_to_edit()
    24462342            'john'
    24472343            sage: W.date_edited()
    2448             time.struct_time(tm_year=2009, tm_mon=10, tm_mday=8, tm_hour=12, tm_min=23, tm_sec=20, tm_wday=3, tm_yday=281, tm_isdst=1)
     2344            time.struct_time(tm_year=2009, tm_mon=10, tm_mday=..., tm_hour=..., tm_min=23, tm_sec=20, tm_wday=..., tm_yday=..., tm_isdst=...)
    24492345            sage: t = W.time_since_last_edited() # just test that call works
    24502346        """
    24512347        username = str(username); tm = float(tm)
     
    25142410
    25152411    def html_time_since_last_edited(self):
    25162412        t = self.time_since_last_edited()
    2517         tm = convert_seconds_to_meaningful_time_span(t)
     2413        tm = prettify_time_ago(t)
    25182414        return template(os.path.join("html", "worksheet", "time_since_last_edited.html"),
    25192415                        last_editor = self.last_to_edit(),
    25202416                        time = tm)
     
    41154011    return i
    41164012
    41174013
    4118 def convert_seconds_to_meaningful_time_span(t):
    4119     if t < 60:
    4120         s = int(t)
    4121         if s == 1:
    4122             return "1 second"
    4123         return "%d seconds"%s
    4124     if t < 3600:
    4125         m = int(t/60)
    4126         if m == 1:
    4127             return "1 minute"
    4128         return "%d minutes"%m
    4129     if t < 3600*24:
    4130         h = int(t/3600)
    4131         if h == 1:
    4132             return "1 hour"
    4133         return "%d hours"%h
    4134     d = int(t/(3600*24))
    4135     if d == 1:
    4136         return "1 day"
    4137     return "%d days"%d
    4138 
    4139 
    41404014def convert_time_to_string(t):
    41414015    return time.strftime('%B %d, %Y %I:%M %p', time.localtime(float(t)))
    41424016
  • sagenb/testing/notebook_test_case.py

    diff -r 8afee2ec056a sagenb/testing/notebook_test_case.py
    a b  
    145145        """
    146146        sel = self.selenium
    147147        sel.click("//button[@name='button_save' and @onclick='save_worksheet_and_close();']")
    148         self.wait_for_title('Active Worksheets')
     148        self.wait_for_title('Active Worksheets -- Sage')
    149149        sel.wait_for_page_to_load("30000")
    150150
    151151    def wait_for_title(self, title):
     
    176176        sel = self.selenium
    177177        sel.click("id=register-link")
    178178        sel.wait_for_page_to_load(30000)
    179         self.wait_for_title("Sign up")
     179        self.wait_for_title("Sign up -- Sage")
    180180
    181181        sel.type("username", username)
    182182        sel.type("password", password)
    183183        sel.type("retype_password", password)
    184184        sel.click("id=create-account-button")
    185185        sel.wait_for_page_to_load(30000)
    186         self.wait_for_title('Sign in')
     186        self.wait_for_title('Sign in -- Sage')
    187187        self.assertTrue(sel.is_text_present('regexp:Congratulations '))
    188188
    189189    def login_as(self, username, password='asdfasdf'):
     
    248248        sel = self.selenium
    249249        sel.click("link=Publish")
    250250        sel.wait_for_page_to_load("30000")
    251         sel.click("//input[@value='Yes']")
     251        sel.click("//button[text()='Yes']")
    252252        sel.wait_for_page_to_load("30000")
    253253        sel.click("link=Worksheet")
    254254        sel.wait_for_page_to_load("30000")
     
    261261        sel = self.selenium
    262262        sel.click("link=Publish")
    263263        sel.wait_for_page_to_load("30000")
    264         sel.click("//input[@value='Re-publish worksheet']")
     264        sel.click("//button[text()='Re-publish worksheet']")
    265265        sel.wait_for_page_to_load("30000")
    266266        sel.click("link=Worksheet")
    267267        sel.wait_for_page_to_load("30000")
  • sagenb/testing/tests/test_accounts.py

    diff -r 8afee2ec056a sagenb/testing/tests/test_accounts.py
    a b  
    8989
    9090
    9191        self.assertEqual(sel.get_location(), 'http://localhost:%d/home/chris/1/' % self.sagenb_port)
    92         self.assertEqual(sel.get_title(), 'Copy of Shared Worksheet (Sage)')
     92        self.assertEqual(sel.get_title(), u'Copy of Shared Worksheet -- Sage')
    9393        self.assert_(sel.is_text_present('by chris'), 'chris does not own the worksheet')
    9494        self.assertEqual(self.get_cell_output(1), '4')
    9595       
  • sagenb/testing/tests/test_worksheet.py

    diff -r 8afee2ec056a sagenb/testing/tests/test_worksheet.py
    a b  
    144144        sel.click("link=(Empty Trash)")
    145145        self.failUnless(re.search(r"^Emptying the trash will permanently delete all items in the trash\. Continue[\s\S]$", sel.get_confirmation()))
    146146
    147         self.wait_for_title('Deleted Worksheets')
     147        self.wait_for_title('Deleted Worksheets -- Sage')
    148148        sel.wait_for_page_to_load("30000")
    149149        #Leave and make sure that the file was actually deleted
    150150
  • sagenb/testing/tests/test_worksheet_list.py

    diff -r 8afee2ec056a sagenb/testing/tests/test_worksheet_list.py
    a b  
    9595            self.goto_published_worksheets()
    9696            self.assertEqual(sel.get_text('css=td.worksheet_link'), title,
    9797                             '%s-published worksheet %s not listed first' % (prefix, title))
    98             lastedit = sel.get_text('css=span.lastedit')
     98            lastedit = sel.get_text('css=.lastedit')
    9999            self.assert_(self.username in lastedit,
    100100                         '%s-published worksheet has wrong last edited field %s' % (prefix, lastedit))
    101101
  • new file sass/src/_accounts.sass

    diff -r 8afee2ec056a sass/src/_accounts.sass
    - +  
     1.accounts-page
     2 
     3  #wrapper
     4    :margin 0 auto
     5    :max-width 600px
     6
     7
     8  h1, h2, h3, h4, h5
     9    :font-weight normal
     10
     11
     12  h1
     13    :border-bottom 1px solid #696969
     14    :font-size 2em
     15    :padding 10px 0
     16
     17
     18  h2
     19    :font-weight bold
     20
     21
     22  h1, h2, p, li
     23    :margin-bottom 10px
     24
     25
     26  .entry
     27    :margin-bottom 10px
     28    :border 1px solid #999
     29    :padding 3px
     30    :width 200
     31
     32
     33  li
     34    :border-bottom 1px solid #CCC
     35
     36
     37  .error
     38    :color red
     39
     40
     41  .error_found
     42    :color red
     43    :font-size 1.5em
     44
     45
     46  button
     47    :margin-right 1em
     48
     49  form 
     50    label
     51      :display block
     52    div
     53      :margin-bottom 1em
     54    a
     55      :text-decoration none
     56 No newline at end of file
  • new file sass/src/_guest_worksheet.sass

    diff -r 8afee2ec056a sass/src/_guest_worksheet.sass
    - +  
     1#guest-worksheet-page
     2  h1, h2
     3    :text-align center
     4  ul.controls
     5    +horizontal-list(0.5em)
     6 No newline at end of file
  • new file sass/src/_login.sass

    diff -r 8afee2ec056a sass/src/_login.sass
    - +  
     1#login-page
     2  h2
     3    :font-size 1.5em
     4    :margin-bottom 0.375em
     5
     6  h1,h2,h3,h4,h5,h6
     7    :line-height 1em
     8
     9  p
     10    :margin-bottom 1em
     11
     12  strong
     13    :font-weight bold
     14
     15  #desc
     16    :float left
     17    :margin-right 400px
     18
     19  div
     20    :padding 0.5em 1em
     21
     22  #sign-in-box
     23    :background-color #efefff
     24    :float left
     25    :margin-left -400px
     26    :width 350px
     27   
     28    form
     29      label
     30        :display block
     31    a
     32      :font-size 0.875em
     33 No newline at end of file
  • new file sass/src/_prettify.sass

    diff -r 8afee2ec056a sass/src/_prettify.sass
    - +  
     1#source-code-page
     2  .str
     3    color: #080
     4
     5
     6  .kwd
     7    color: #008
     8
     9
     10  .com
     11    color: #800
     12
     13
     14  .typ
     15    color: #606
     16
     17
     18  .lit
     19    color: #066
     20
     21
     22  .pun
     23    color: #660
     24
     25
     26  .pln
     27    color: #000
     28
     29
     30  .tag
     31    color: #008
     32
     33
     34  .atn
     35    color: #606
     36
     37
     38  .atv
     39    color: #080
     40
     41
     42  .dec
     43    color: #606
  • new file sass/src/_print_worksheet.sass

    diff -r 8afee2ec056a sass/src/_print_worksheet.sass
    - +  
     1#print-page
     2  h1
     3    :text-align center
     4 No newline at end of file
  • new file sass/src/_pygment.sass

    diff -r 8afee2ec056a sass/src/_pygment.sass
    - +  
     1.hll
     2  :background-color #ffffcc
     3
     4
     5.c
     6  :color #408090
     7  :font-style italic
     8
     9
     10.err
     11  :border 1px solid #FF0000
     12
     13
     14.k
     15  :color #007020
     16  :font-weight bold
     17
     18
     19.o
     20  :color #666666
     21
     22
     23.cm
     24  :color #408090
     25  :font-style italic
     26
     27
     28.cp
     29  :color #007020
     30
     31
     32.c1
     33  :color #408090
     34  :font-style italic
     35
     36
     37.cs
     38  :color #408090
     39  :background-color #fff0f0
     40
     41
     42.gd
     43  :color #A00000
     44
     45
     46.ge
     47  :font-style italic
     48
     49
     50.gr
     51  :color #FF0000
     52
     53
     54.gh
     55  :color #000080
     56  :font-weight bold
     57
     58
     59.gi
     60  :color #00A000
     61
     62
     63.go
     64  :color #0000aa
     65
     66
     67.gp
     68  :color #c65d09
     69  :font-weight bold
     70
     71
     72.gs
     73  :font-weight bold
     74
     75
     76.gu
     77  :color #800080
     78  :font-weight bold
     79
     80
     81.gt
     82  :color #0040D0
     83
     84
     85.kc, .kd, .kn
     86  :color #007020
     87  :font-weight bold
     88
     89
     90.kp
     91  :color #007020
     92
     93
     94.kr
     95  :color #007020
     96  :font-weight bold
     97
     98
     99.kt
     100  :color #902000
     101
     102
     103.m
     104  :color #208050
     105
     106
     107.s, .na
     108  :color #4070a0
     109
     110
     111.nb
     112  :color #007020
     113
     114
     115.nc
     116  :color #0e84b5
     117  :font-weight bold
     118
     119
     120.no
     121  :color #60add5
     122
     123
     124.nd
     125  :color #555555
     126  :font-weight bold
     127
     128
     129.ni
     130  :color #d55537
     131  :font-weight bold
     132
     133
     134.ne
     135  :color #007020
     136
     137
     138.nf
     139  :color #06287e
     140
     141
     142.nl
     143  :color #002070
     144  :font-weight bold
     145
     146
     147.nn
     148  :color #0e84b5
     149  :font-weight bold
     150
     151
     152.nt
     153  :color #062873
     154  :font-weight bold
     155
     156
     157.nv
     158  :color #bb60d5
     159
     160
     161.ow
     162  :color #007020
     163  :font-weight bold
     164
     165
     166.w
     167  :color #bbbbbb
     168
     169
     170.mf, .mh, .mi, .mo
     171  :color #208050
     172
     173
     174.sb, .sc
     175  :color #4070a0
     176
     177
     178.sd
     179  :color #4070a0
     180  :font-style italic
     181
     182
     183.s2
     184  :color #4070a0
     185
     186
     187.se
     188  :color #4070a0
     189  :font-weight bold
     190
     191
     192.sh
     193  :color #4070a0
     194
     195
     196.si
     197  :color #70a0d0
     198  :font-style italic
     199
     200
     201.sx
     202  :color #c65d09
     203
     204
     205.sr
     206  :color #235388
     207
     208
     209.s1
     210  :color #4070a0
     211
     212
     213.ss
     214  :color #517918
     215
     216
     217.bp
     218  :color #007020
     219
     220
     221.vc, .vg, .vi
     222  :color #bb60d5
     223
     224
     225.il
     226  :color #208050
     227 No newline at end of file
  • new file sass/src/_settings.sass

    diff -r 8afee2ec056a sass/src/_settings.sass
    - +  
     1.settings-page
     2  :line-height 1.4
     3
     4  h1
     5    :font-size 2em
     6    :padding 0 5px
     7
     8  label
     9    :display block
     10
     11  #buttons
     12    :padding 5px
     13 
     14    button
     15      :margin-right 1em
     16    a
     17      :text-decoration none
     18
     19  h2
     20    :font-size 1.5em
     21    :margin 0 0 0.75em
     22
     23
     24  .section
     25    :border-bottom 1px solid #CCC
     26    :padding 5px
     27    :margin 0.5em 0
     28
     29    div
     30      :margin-bottom 0.5em
     31
     32  .error, .error_found
     33    :color red
     34
     35  .error_found
     36    :font-size 1.2em
     37
     38  .updated
     39    :color green
     40
     41  input.c1
     42    :width 200px
     43
     44#settings-nav
     45  +horizontal-list(0.5em)
     46  li
     47    :border-right 1px solid #ccc
     48    &:last-child, &.last
     49      :border-right none
     50
     51#user-management-page
     52  table
     53    :border-collapse collapse
     54  th, td
     55    :border 1px solid #696969
     56    :padding 0.25em
     57
     58  th
     59    :background #CCC
     60
     61  a:link, a:visited
     62    :color = !link_color
     63       
  • new file sass/src/_source.sass

    diff -r 8afee2ec056a sass/src/_source.sass
    - +  
     1@import partials/mixins.sass
     2
     3#source-code-page
     4  h1, h2
     5    :text-align center
     6  .filename
     7    +monospace-stack
     8  code
     9    :display block
     10    :border-top 1px solid #ccc
     11    :border-bottom 1px solid #ccc
     12    :padding 1em
     13 No newline at end of file
  • new file sass/src/_worksheet_aux.sass

    diff -r 8afee2ec056a sass/src/_worksheet_aux.sass
    - +  
     1#before-publish-page
     2  form
     3    a
     4      :text-decoration none
     5    button
     6      :margin-left 1em
     7      :margin-bottom 0.5em
     8    input
     9      :margin-left 1em
     10
     11#after-publish-page
     12  input
     13    :margin-top 1em
     14
     15#edit-page
     16  .sharebar
     17    span
     18      :margin-right 2em
     19 No newline at end of file
  • deleted file sass/src/account_settings.sass

    diff -r 8afee2ec056a sass/src/account_settings.sass
    + -  
    1 @import compass/reset.sass
    2 
    3 html
    4   :font-size 100.1%
    5 
    6 
    7 body
    8   :font 100%/1.4 Arial, Helvetica, sans-serif
    9 
    10 
    11 h1
    12   :background #DCDCDC
    13   :border-bottom 1px solid #CCC
    14   :font-size 2em
    15   :padding 0 5px
    16 
    17 label
    18   :display block
    19 
    20 #buttons
    21   :background #DCDCDC
    22   :padding 5px
    23  
    24   button
    25     :margin-right 1em
    26 
    27 h2
    28   :font-size 1.5em
    29 
    30 
    31 .section
    32   :border-bottom 1px solid #CCC
    33   :padding 5px
    34 
    35   div
    36     :margin-bottom 0.5em
    37 
    38 .error
    39   :color red
    40 
    41 .updated
    42   :color green
    43 
    44 
    45 input.c1
    46   :width 200px
  • sass/src/main.sass

    diff -r 8afee2ec056a sass/src/main.sass
    a b  
     1// The warning below is for those editing the generated .css files
     2/*  Warning: These .css files are automatically generated and will be overwritten */
     3/*  when they are next generated. Please edit the SASS source located at */
     4/* <sagenb-spkg-root>/sass/src. */
    15@import compass/utilities/general.sass
    26@import compass/utilities/lists.sass
     7@import partials/base.sass
    38@import partials/mixins.sass
    49@import typography/base.sass
    510
     11
    612body
    713  :background-color white
     14  +sans-serif-stack
    815
    916  &.worksheet-online
    1017    :margin-bottom 80%
    1118
     19
    1220.hidden
    1321  :display none
    1422
     
    4856    :text-indent 13px
    4957    :color black
    5058
    51 #controls
     59#main-controls
    5260  :float right
    5361  :width 65%
    5462
     
    99107
    100108
    101109div
    102   &#usercontrols
     110  &#user-controls
    103111    +clearfix
    104112    :clear both
    105113    :border-bottom 1px solid #c9d7f1
     
    274282    :border-left 2px solid #c0c0c0
    275283
    276284  &.introspection
    277     :font-family monospace
     285    +monospace-stack
    278286    :font-size 15px
    279287    :background-color #f1f1f1
    280288    :color blue
     
    291299  :border solid 1px black
    292300  :display inline
    293301  :margin 5px
    294   :font-family monospace
     302  +monospace-stack
    295303  :font-size 15px
    296304  :padding 5px
    297305
     
    326334span.search_doc_topbar
    327335  :z-index 12
    328336  :height 24px
    329   :font-family monospace
     337  +monospace-stack
    330338  :font-size 12px
    331339  :width 158px
    332340  :top 40px
     
    361369  :width 160px
    362370  :padding 4px
    363371  :z-index 12
    364   :font-family monospace
     372  +monospace-stack
    365373  :font-size 14px
    366374  :color #222222
    367375  :color #808080
     
    446454span
    447455  &.pane
    448456    :z-index 30
    449     :font-family monospace
     457    +monospace-stack
    450458    :font-size 12px
    451459    :position fixed
    452460    :left 5px
     
    462470  &.plusminus
    463471    :color black
    464472    :font-size 8pt
    465     :font-family monospace
     473    +monospace-stack
    466474
    467475    &:hover
    468476      :cursor pointer
     
    695703
    696704
    697705div
    698   &.worksheet_bottom_padding
    699     :height 50%
    700 
    701   &.worksheet_top_padding
    702     :height 5%
    703 
    704706  &.worksheet_menu
    705707    :top 50px
    706708
     
    848850
    849851span.control
    850852  :border 1px solid white
    851   :font-family monospace
     853  +monospace-stack
    852854  :font-size 14pt
    853855  :font-weight bold
    854856
     
    867869  &.worksheet
    868870    :background-color white
    869871    :border 1px solid #aaa
     872    :padding .75em 0.2em
    870873
    871874  &.banner
    872875    :background-color white
     
    894897  &:hover
    895898
    896899input.btn
    897   :font-family monospace
     900  +monospace-stack
    898901  :font-size 13pt
    899902  :font-weight bold
    900903  :color #808080
     
    962965  :color #000000
    963966  :background-color white
    964967  :border 1px solid  #a8a8a8
    965   :font-family monospace
     968  +monospace-stack
    966969  :font-size 12pt
    967970  :overflow hidden
    968971  :padding-bottom 1px
     
    979982  :color #000000
    980983  :background-color white
    981984  :border 1px solid  #a8a8a8
    982   :font-family monospace
     985  +monospace-stack
    983986  :font-size 12pt
    984987  :padding-bottom 1px
    985988  :padding-left 6px
     
    996999textarea.cell_input_hide
    9971000  :background-color white
    9981001  :border 0px solid white
    999   :font-family monospace
     1002  +monospace-stack
    10001003  :font-size 12pt
    10011004  :color #888888
    10021005  :overflow hidden
     
    10111014pre.cell_input_hide
    10121015  :background-color white
    10131016  :border 2px solid #e8e8e8
    1014   :font-family monospace
     1017  +monospace-stack
    10151018  :font-size 12pt
    10161019  :overflow hidden
    10171020  :padding-bottom 0px
     
    10281031textarea.cell_input_active
    10291032  :background-color white
    10301033  :border 2px solid  #8888fe
    1031   :font-family monospace
     1034  +monospace-stack
    10321035  :font-size 12pt
    10331036  :overflow hidden
    10341037  :padding-bottom 0px
     
    10451048  &.cell_input_active
    10461049    :background-color white
    10471050    :border 2px solid  #8888fe
    1048     :font-family monospace
     1051    +monospace-stack
    10491052    :font-size 12pt
    10501053    :padding-bottom 0px
    10511054    :padding-left 5px
     
    10621065  &.cell_input_print
    10631066    :background-color white
    10641067    :border 1px solid  #a8a8a8
    1065     :font-family monospace
     1068    +monospace-stack
    10661069    :font-size 12pt
    10671070    :padding-bottom 1px
    10681071    :padding-left 6px
     
    10721075    :margin-bottom 0px
    10731076    :line-height 1.2em
    10741077    :width 97%
     1078    :whitespace pre-wrap
    10751079
    10761080
    10771081textarea.cell_input:hover
     
    10941098
    10951099div
    10961100  &.cell_div_output
    1097     :font-family monospace
     1101    +monospace-stack
    10981102    :font-size 12pt
    10991103    :margin-top -5px
    11001104    :margin-bottom 5px
     
    11661170    :display none
    11671171
    11681172  &.cell_output_html_wrap, &.cell_output_html_nowrap
    1169     :font-family monospace
     1173    +monospace-stack
    11701174    :font-size 12pt
    11711175
    11721176  &.cell_output_html_hidden
    11731177    :display none
    11741178
    11751179  &.cell_div_output_running
    1176     :font-family monospace
     1180    +monospace-stack
    11771181    :font-size 12pt
    11781182    :margin 0px
    11791183    :background-color #ffffff
     
    12341238  &.debug_output
    12351239    :background-color white
    12361240    :border 0px
    1237     :font-family monospace
     1241    +monospace-stack
    12381242    :font-size 10pt
    12391243    :overflow scroll
    12401244    :padding-left 3px
     
    12461250textarea.debug_input
    12471251  :background-color white
    12481252  :border 1px solid #8888fe
    1249   :font-family monospace
     1253  +monospace-stack
    12501254  :font-size 12pt
    12511255  :overflow scroll
    12521256  :padding-left 3px
     
    12891293
    12901294/************ User Home (Worksheet listing) **************************/
    12911295
    1292 span
    1293   &.ratingmsg
    1294     :color #112abb
    1295     :padding 0.3em
    1296     :font-size 14px
     1296.ratingmsg
     1297  :color #112abb
     1298  :padding 0.3em
     1299  :font-size 14px
    12971300
    1298   &.pubmsg
    1299     :font-family sans-serif
    1300     :color #112abb
    1301     :padding 0.3em
    1302     :font-size 12px
     1301.pubmsg
     1302  :font-family sans-serif
     1303  :color #112abb
     1304  :padding 0.3em
     1305  :font-size 12px
    13031306
    13041307#worksheet-list
    13051308  :clear both
     
    13091312  td.checkbox
    13101313    :padding 4px
    13111314
    1312 a.usercontrol
     1315.controls a, .usercontrol
    13131316  :color #112abb
    1314   :padding 0.3em
    13151317  :font-size 14px
    13161318  :text-decoration underline
    13171319
    13181320  &:hover
    13191321    :cursor pointer
    13201322
     1323.controls
     1324  span
     1325    :color #112abb
     1326    :padding 0.3em
     1327    :font-size 14px
    13211328
    1322 span.usercontrol
     1329
     1330.user-controls a, .boldusercontrol
    13231331  :color #112abb
    1324   :padding 0.3em
     1332  :font-weight bold
    13251333  :font-size 14px
    13261334
     1335.user-controls a, .controls a, .controls span
     1336  :padding 0.3em
    13271337
    13281338a
    1329   &.boldusercontrol
    1330     :color #112abb
    1331     :padding 0.5em
    1332     :font-weight bold
    1333     :font-size 14px
    1334 
    13351339  &.control, &.control-select
    13361340    :background-color #7799bb
    13371341    :font-family sans-serif
     
    13541358      :cursor pointer
    13551359
    13561360
    1357 span.sharebar
     1361.sharebar
    13581362  :background-color #4477aa
    13591363  :font-family sans-serif
    13601364  :color #ffffff
    1361   :position absolute
    1362   :left 0.5em
    1363   :right 0ex
    13641365  :padding-top 0.5em
    13651366  :padding-bottom 0.5em
    13661367  :padding-left 2em
    1367   :font-size 18px
     1368  :font-size 1.25em
    13681369  :font-weight bold
    13691370
    13701371
     
    14511452  :height 0px
    14521453
    14531454
    1454 span
    1455   &.lastedit
    1456     :font-family sans-serif
    1457     :font-size 10px
    1458     :color #717171
     1455.lastedit
     1456  :font-family sans-serif
     1457  :font-size 10px
     1458  :color #717171
    14591459
    1460   &.revs
    1461     :font-family sans-serif
    1462     :font-size 12px
    1463     :font-weight bold
    1464     :color #333333
     1460.revs
     1461  :font-family sans-serif
     1462  :font-size 12px
     1463  :font-weight bold
     1464  :color #333333
    14651465
    1466   &.users
    1467     :font-family sans-serif
    1468     :font-size 13px
    1469     :color #222222
     1466.users
     1467  :font-family sans-serif
     1468  :font-size 13px
     1469  :color #222222
    14701470
    14711471
    14721472a.share
     
    15531553    :font-weight bold
    15541554    :color white
    15551555    :background-color #990000
     1556    :margin-left 1em
    15561557
    1557 /* These have been scraped directly from pygment. */
    1558 
    1559 .hll
    1560   :background-color #ffffcc
    1561 
    1562 
    1563 .c
    1564   :color #408090
    1565   :font-style italic
    1566 
    1567 
    1568 .err
    1569   :border 1px solid #FF0000
    1570 
    1571 
    1572 .k
    1573   :color #007020
    1574   :font-weight bold
    1575 
    1576 
    1577 .o
    1578   :color #666666
    1579 
    1580 
    1581 .cm
    1582   :color #408090
    1583   :font-style italic
    1584 
    1585 
    1586 .cp
    1587   :color #007020
    1588 
    1589 
    1590 .c1
    1591   :color #408090
    1592   :font-style italic
    1593 
    1594 
    1595 .cs
    1596   :color #408090
    1597   :background-color #fff0f0
    1598 
    1599 
    1600 .gd
    1601   :color #A00000
    1602 
    1603 
    1604 .ge
    1605   :font-style italic
    1606 
    1607 
    1608 .gr
    1609   :color #FF0000
    1610 
    1611 
    1612 .gh
    1613   :color #000080
    1614   :font-weight bold
    1615 
    1616 
    1617 .gi
    1618   :color #00A000
    1619 
    1620 
    1621 .go
    1622   :color #0000aa
    1623 
    1624 
    1625 .gp
    1626   :color #c65d09
    1627   :font-weight bold
    1628 
    1629 
    1630 .gs
    1631   :font-weight bold
    1632 
    1633 
    1634 .gu
    1635   :color #800080
    1636   :font-weight bold
    1637 
    1638 
    1639 .gt
    1640   :color #0040D0
    1641 
    1642 
    1643 .kc, .kd, .kn
    1644   :color #007020
    1645   :font-weight bold
    1646 
    1647 
    1648 .kp
    1649   :color #007020
    1650 
    1651 
    1652 .kr
    1653   :color #007020
    1654   :font-weight bold
    1655 
    1656 
    1657 .kt
    1658   :color #902000
    1659 
    1660 
    1661 .m
    1662   :color #208050
    1663 
    1664 
    1665 .s, .na
    1666   :color #4070a0
    1667 
    1668 
    1669 .nb
    1670   :color #007020
    1671 
    1672 
    1673 .nc
    1674   :color #0e84b5
    1675   :font-weight bold
    1676 
    1677 
    1678 .no
    1679   :color #60add5
    1680 
    1681 
    1682 .nd
    1683   :color #555555
    1684   :font-weight bold
    1685 
    1686 
    1687 .ni
    1688   :color #d55537
    1689   :font-weight bold
    1690 
    1691 
    1692 .ne
    1693   :color #007020
    1694 
    1695 
    1696 .nf
    1697   :color #06287e
    1698 
    1699 
    1700 .nl
    1701   :color #002070
    1702   :font-weight bold
    1703 
    1704 
    1705 .nn
    1706   :color #0e84b5
    1707   :font-weight bold
    1708 
    1709 
    1710 .nt
    1711   :color #062873
    1712   :font-weight bold
    1713 
    1714 
    1715 .nv
    1716   :color #bb60d5
    1717 
    1718 
    1719 .ow
    1720   :color #007020
    1721   :font-weight bold
    1722 
    1723 
    1724 .w
    1725   :color #bbbbbb
    1726 
    1727 
    1728 .mf, .mh, .mi, .mo
    1729   :color #208050
    1730 
    1731 
    1732 .sb, .sc
    1733   :color #4070a0
    1734 
    1735 
    1736 .sd
    1737   :color #4070a0
    1738   :font-style italic
    1739 
    1740 
    1741 .s2
    1742   :color #4070a0
    1743 
    1744 
    1745 .se
    1746   :color #4070a0
    1747   :font-weight bold
    1748 
    1749 
    1750 .sh
    1751   :color #4070a0
    1752 
    1753 
    1754 .si
    1755   :color #70a0d0
    1756   :font-style italic
    1757 
    1758 
    1759 .sx
    1760   :color #c65d09
    1761 
    1762 
    1763 .sr
    1764   :color #235388
    1765 
    1766 
    1767 .s1
    1768   :color #4070a0
    1769 
    1770 
    1771 .ss
    1772   :color #517918
    1773 
    1774 
    1775 .bp
    1776   :color #007020
    1777 
    1778 
    1779 .vc, .vg, .vi
    1780   :color #bb60d5
    1781 
    1782 
    1783 .il
    1784   :color #208050
    1785 
    1786 /* end stuff scraped from pygment */
     1558@import prettify.sass
     1559@import source.sass
     1560@import print_worksheet.sass
     1561@import guest_worksheet.sass
     1562@import worksheet_aux.sass
     1563@import settings.sass
     1564@import accounts.sass
     1565@import login.sass
     1566@import pygment.sass
  • deleted file sass/src/master.sass

    diff -r 8afee2ec056a sass/src/master.sass
    + -  
    1 @import compass/reset.sass
    2 
    3 html
    4   :font-size 100.1%
    5 
    6 body
    7   :font .9em/1.2em Arial, Helvetica, sans-serif
    8 
    9 div
    10   :padding 0.5em 1em
    11 
    12 #desc
    13   :float left
    14   :margin-right 400px
    15 
    16 #sign-in-box
    17   :float left
    18   :margin-left -400px
    19   :width 350px
    20   :background-color #efefff
    21   form
    22     label
    23       :display block
    24      
    25