Zine

open source content publishing system


Changeset 1334:0f6f0e1b3515


Ignore:
Timestamp:
01/10/10 20:00:33 (2 years ago)
Author:
Georg Brandl <georg@…>
Branch:
default
Message:

Work on the web migration template: add more information before performing the upgrade, and style the output a bit differently.

Location:
zine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • zine/templates/admin/perform_upgrade.html

    r1318 r1334  
    1515 
    1616    div.msg { 
    17       width: 90%; 
     17      width: 40em; 
    1818      margin: 0 auto 0 auto; 
    1919      padding: 20px; 
     
    3131 
    3232    h2 { 
    33       border-bottom: 1px solid #cfcfcf; 
    34       margin-left: 10px; 
     33      border-top: 5px solid #cfcfcf; 
     34      padding-top: 5px; 
     35      margin-left: -20px; 
    3536      margin-bottom: 0; 
    36       margin-right: 10px; 
     37      margin-right: -20px; 
    3738      text-align: center; 
    3839    } 
    3940 
    4041    h3 { 
    41       font-weight: small; 
    42       border-bottom: 1px dashed #cfcfcf; 
    43       margin-left: 10px; 
    44       margin-bottom: 0; 
    45       margin-right: 150px; 
     42      font-weight: normal; 
     43      border-bottom: 1px solid #cfcfcf; 
    4644    } 
    4745 
     
    5452    } 
    5553 
    56     p { 
    57       margin: 0; 
    58       padding: 0; 
    59     } 
    60  
    6154    div.message { 
    6255      border: 1px solid #E8B5B5; 
    63       margin: 0 -10px 10px -10px; 
    64       padding: 8px 8px 8px 32px; 
     56      padding: 8px; 
    6557      -moz-border-radius: 3px; 
    6658      -webkit-border-radius: 3px; 
     
    7365      margin-top: 10px; 
    7466      margin-left: 10px; 
    75       margin-right: 150px; 
    76       padding-top: 0; 
    77       padding-bottom: 0; 
     67      margin-right: 10px; 
    7868      background-color: #F7FAFD; 
    7969      border-color: #B4D2E7; 
    8070    } 
    81     span.progress, dl dt { 
     71 
     72    .progress { 
    8273      font-size: 80%; 
    8374      font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Monaco', monospace; 
     75    } 
     76 
     77    p.finish { 
     78      border-top: 5px solid #cfcfcf; 
     79      padding-top: 5px; 
     80      margin-left: -20px; 
     81      margin-right: -20px; 
     82      text-align: center; 
    8483    } 
    8584 
     
    9291      <h1>{{ _("Upgrade In Progress") }}</h1> 
    9392      <p>{% trans %}<b>Database upgrade in progress!</b>{% endtrans %}</p> 
    94     {% elif live_log is defined %} 
     93    {%- elif live_log is defined %} 
    9594      <h1>{{ _("Upgrading...") }}</h1> 
    96       <p>{% trans %}Upgrade in process. 
     95      <p>{% trans %}Upgrade in progress. 
    9796        <strong>Don't hit cancel!</strong>{% endtrans %}</p> 
    9897      {%- for event in live_log %}{{ event }}{%- endfor %} 
    99       <p>{% trans %}Database upgraded successfully.{% endtrans %}</p> 
     98      <p class="finish">{% trans %}Database upgrade finished.{% endtrans %}</p> 
    10099      <br/> 
    101       <div class="message">{% trans %}Zine is in maintenance mode. 
     100      <div class="message">{% trans %}Zine maintenance mode has been switched on. 
    102101          Please <a href="{{ blog_url }}">check your blog</a> to see if the 
    103           upgrade was perfect. 
    104           Don't forget to <a href="{{ maintenance_url }}">turn it off again</a> 
    105           once you finish. 
     102          blog works fine with the upgraded database. 
     103          Don't forget to <a href="{{ maintenance_url }}">turn maintenance mode 
     104          off again</a> once you finish. 
    106105      {% endtrans %}</div> 
     106      {# XXX offer advice in case the upgrade failed? #} 
    107107      {{ finish() }} 
    108     {% else %} 
    109       <h1>{{ _("Upgrade") }}</h1> 
     108    {%- else %} 
     109      <h1>{{ _("Upgrade required") }}</h1> 
    110110      <p>{% trans %}<b>Zine requires a database upgrade!</b>{% endtrans %}</p> 
     111      <p>{% trans %}A database upgrade can become necessary when a new version 
     112          of Zine or one of your plugins is installed.{% endtrans %}</p> 
     113      <p>{% trans %}When you click “Perform upgrade”, your database will be 
     114          brought in sync with the format the installed software expects.  While 
     115          this is designed not to corrupt your database, you can back it up 
     116          now before clicking “Perform upgrade”.{% endtrans %}</p> 
    111117      <br/> 
    112118      <form action="" method="POST"> 
    113         <input type="submit" name="upgrade" value="Upgrade!"> 
     119        <input type="submit" name="upgrade" value="{{ _("Perform upgrade") }}"> 
    114120      </form> 
    115121    {%- endif %} 
  • zine/upgrades/__init__.py

    r1333 r1334  
    245245        version = self._migrate_version(schema, version, upgrade) 
    246246 
     247        yield '<h2>Migrating %s</h2>\n' % repository.id 
     248 
    247249        changeset = schema.changeset(version) 
    248250        if not changeset: 
    249             yield '<p>Repository %s is already up to date.</p>\n' % repository.id 
     251            yield '<p>This repository is already up to date.</p>\n' 
    250252            return 
    251253 
    252         yield '<h2>Migrating %s</h2>\n' % repository.id 
    253254        for ver, change in changeset: 
    254255            nextver = ver + changeset.step 
  • zine/upgrades/versions/001_split_tables.py

    r1333 r1334  
    285285    metadata2.bind = migrate_engine 
    286286 
    287     yield '<div class="message info"><dl>' 
    288     yield '<dt>.</dt><dd> comment</dd>\n' 
    289     yield '<dt>+</dt><dd> comment with <tt>parent_id</tt></dd>\n' 
    290     yield '<dt>E</dt><dd> Error handling comment</dd>\n' 
    291     yield '</dl></div>\n' 
     287    yield '<div class="message info">' 
     288    yield '<span class="progress">.&nbsp;&nbsp;</span>comment<br/>\n' 
     289    yield '<span class="progress">+&nbsp;&nbsp;</span>comment with parent_id<br/>\n' 
     290    yield '<span class="progress">E&nbsp;&nbsp;</span>error handling comment<br/>\n' 
     291    yield '</div>\n' 
    292292 
    293293    yield '<ul>' 
     
    432432    metadata2.bind = migrate_engine 
    433433 
    434     yield '<div class="message info"><dl>' 
    435     yield '<dt>.</dt><dd> comment</dd>\n' 
    436     yield '<dt>+</dt><dd> comment with <tt>parent_id</tt></dd>\n' 
    437     yield '<dt>E</dt><dd> Error handling comment</dd>\n' 
    438     yield '</dl></div>\n' 
     434    yield '<div class="message info">' 
     435    yield '<span class="progress">.&nbsp;&nbsp;</span>comment<br/>\n' 
     436    yield '<span class="progress">+&nbsp;&nbsp;</span>comment with parent_id<br/>\n' 
     437    yield '<span class="progress">E&nbsp;&nbsp;</span>error handling comment<br/>\n' 
     438    yield '</div>\n' 
    439439 
    440440    yield '<ul>' 
  • zine/upgrades/webapp.py

    r1331 r1334  
    119119            open(self.lockfile, 'w').write('locked on database upgrade\n') 
    120120            mdb = ManageDatabase(request.app) 
    121             db.session.close()  # Close open sessions 
     121            db.session.close()  # close open sessions 
    122122            def finish(): 
    123                 # this runs after the upgrade finishes 
     123                # this is run from the template after the upgrade finishes 
    124124                remove(self.lockfile) 
    125                 db.session.close()  # Close open sessions 
    126                 self.wants_reload = True    # Force application reload 
     125                db.session.close()  # close open sessions 
     126                self.wants_reload = True    # force application reload 
    127127                return ''   # just because I need to return something to jinja 
    128128 
Note: See TracChangeset for help on using the changeset viewer.