source: trunk/services/templates/versions_diff.ihtml @ 502

Last change on this file since 502 was 502, checked in by anonymous, 9 years ago

Many minor fixes during pulso development

File size: 2.5 KB
Line 
1<header class="row">
2    <div class="large-12 columns">
3        <h1><?php echo $nav->get('title'); ?></h1>
4    </div>
5</header>
6<main role="main">
7    <div class="row">
8        <div class="large-12 columns">
9            <?php
10            if (is_array($data) && !empty($data)) {
11                ?>
12                <table class="list">
13                    <thead>
14                        <tr>
15                            <th class="sc-padleft"><?php echo _("Field"); ?></th>
16                            <th class="sc-padleft"><?php echo _("Saved version"); ?></th>
17                            <th class="sc-padleft"><?php echo _("Current record"); ?></th>
18                        </tr>
19                    </thead>
20                    <tbody>
21                        <?php
22                        foreach ($current as $k=>$v_c) {
23                            if (isset($data[$k])) {
24                                $v_d =  $data[$k];
25                                $td_style = '';
26                            } else {
27                                $v_d = '(Unavailable)';
28                                $td_style = 'color: #e00;';
29                            }
30                            $tr_style = $v_d != $v_c ? 'font-weight:bold;' : '';
31                            ?>
32                            <tr style="<?php echo $tr_style; ?>">
33                                <td class="sc-nowrap"><label><?php echo oTxt($k); ?></label></td>
34                                <td style="<?php echo $td_style; ?>"><?php echo oTxt($v_d); ?></td>
35                                <td style="<?php echo $td_style; ?>"><?php echo oTxt($v_c); ?></td>
36                            </tr>
37                        <?php } ?>
38                    </tbody>
39                </table>
40                <p class="sc-help"><?php echo _("Emboldened lines indicate something changed between the saved version and the current record."); ?></p>
41            <?php
42            }
43
44            // Buttons.
45            $action_links = array();
46            if (!getFormData('current', false)) {
47                $action_links[] = array('href' => $app->oHREF('?op=restore', array('version_id', 'version_title')), 'value' => _("Restore this saved version"), 'class' => 'small button alert', 'accesskey' => 'r');
48            }
49            $action_links[] = array('href' => $app->ohref('?op=cancel'), 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c');
50            HTML::printButtons($action_links);
51            ?>
52        </div>
53    </div>
54</main>
Note: See TracBrowser for help on using the repository browser.