~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to templates/setup.tpl.html

  • Committer: Elan Ruusamäe
  • Date: 2015-04-03 17:16:08 UTC
  • Revision ID: glen@delfi.ee-20150403171608-u41tcmt49uayv0g4
discard {literal} from templates

it is rarely needed in Smarty3

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
{block "title"}Eventum Installation{/block}
4
4
 
5
5
{block name="content"}
6
 
{literal}
 
6
 
7
7
<script type="text/javascript">
8
8
<!--
9
9
function validateForm(f)
10
10
{
11
11
    if (Validation.isFieldWhitespace('hostname')) {
12
12
        Validation.selectField('hostname');
13
 
        alert('{/literal}{t escape=js}Please enter the hostname for the server of this installation of Eventum.{/t}{literal}');
 
13
        alert('{t escape=js}Please enter the hostname for the server of this installation of Eventum.{/t}');
14
14
        return false;
15
15
    }
16
16
    if (Validation.isFieldWhitespace('relative_url')) {
17
17
        Validation.selectField('relative_url');
18
 
        alert('{/literal}{t escape=js}Please enter the relative URL of this installation of Eventum.{/t}{literal}');
 
18
        alert('{t escape=js}Please enter the relative URL of this installation of Eventum.{/t}');
19
19
        return false;
20
20
    }
21
21
    if (Validation.isFieldWhitespace('db_hostname')) {
22
22
        Validation.selectField('db_hostname');
23
 
        alert('{/literal}{t escape=js}Please enter the database hostname for this installation of Eventum.{/t}{literal}');
 
23
        alert('{t escape=js}Please enter the database hostname for this installation of Eventum.{/t}');
24
24
        return false;
25
25
    }
26
26
    if (Validation.isFieldWhitespace('db_name')) {
27
27
        Validation.selectField('db_name');
28
 
        alert('{/literal}{t escape=js}Please enter the database name for this installation of Eventum.{/t}{literal}');
 
28
        alert('{t escape=js}Please enter the database name for this installation of Eventum.{/t}');
29
29
        return false;
30
30
    }
31
31
    if (Validation.isFieldWhitespace('db_username')) {
32
32
        Validation.selectField('db_username');
33
 
        alert('{/literal}{t escape=js}Please enter the database username for this installation of Eventum.{/t}{literal}');
 
33
        alert('{t escape=js}Please enter the database username for this installation of Eventum.{/t}');
34
34
        return false;
35
35
    }
36
36
    if (Eventum.getField('alternate_user').is(':checked')) {
37
37
        if (Validation.isFieldWhitespace('eventum_user')) {
38
38
            Validation.selectField('eventum_user');
39
 
            alert('{/literal}{t escape=js}Please enter the alternate username for this installation of Eventum.{/t}{literal}');
 
39
            alert('{t escape=js}Please enter the alternate username for this installation of Eventum.{/t}');
40
40
            return false;
41
41
        }
42
42
    }
44
44
    var field = Eventum.getField('setup[smtp][from]');
45
45
    if (Validation.isFieldWhitespace(field)) {
46
46
        Validation.selectField(field);
47
 
        alert('{/literal}{t escape=js}Please enter the sender address that will be used for all outgoing notification emails.{/t}{literal}');
 
47
        alert('{t escape=js}Please enter the sender address that will be used for all outgoing notification emails.{/t}');
48
48
        return false;
49
49
    }
50
50
    if (!Validation.isEmail(field.val())) {
51
51
        Validation.selectField(field);
52
 
        alert('{/literal}{t escape=js}Please enter a valid email address for the sender address.{/t}{literal}');
 
52
        alert('{t escape=js}Please enter a valid email address for the sender address.{/t}');
53
53
        return false;
54
54
    }
55
55
    field = Eventum.getField('setup[smtp][host]');
56
56
    if (Validation.isWhitespace(field)) {
57
57
        Validation.selectField(field);
58
 
        alert('{/literal}{t escape=js}Please enter the SMTP server hostname.{/t}{literal}');
 
58
        alert('{t escape=js}Please enter the SMTP server hostname.{/t}');
59
59
        return false;
60
60
    }
61
61
    field = Eventum.getField('setup[smtp][port]');
62
62
    if ((Validation.isFieldWhitespace(field)) || (!Validation.isNumberOnly(field.val()))) {
63
63
        Validation.selectField(field);
64
 
        alert('{/literal}{t escape=js}Please enter the SMTP server port number.{/t}{literal}');
 
64
        alert('{t escape=js}Please enter the SMTP server port number.{/t}');
65
65
        return false;
66
66
    }
67
67
    var auth_field = Eventum.getField('setup[smtp][auth]');
68
68
    if (!Validation.hasOneChecked(auth_field)) {
69
 
        alert('{/literal}{t escape=js}Please indicate whether the SMTP server requires authentication or not.{/t}{literal}');
 
69
        alert('{t escape=js}Please indicate whether the SMTP server requires authentication or not.{/t}');
70
70
        return false;
71
71
    }
72
72
    if (auth_field.val() == 1) {
73
73
      if (Validation.isFieldWhitespace('setup[smtp][username]')) {
74
74
          Validation.selectField('setup[smtp][username]');
75
 
          alert('{/literal}{t escape=js}Please enter the SMTP server username.{/t}{literal}');
 
75
          alert('{t escape=js}Please enter the SMTP server username.{/t}');
76
76
          return false;
77
77
      }
78
78
      if (Validation.isFieldWhitespace('setup[smtp][password]')) {
79
79
          Validation.selectField('setup[smtp][password]');
80
 
          alert('{/literal}{t escape=js}Please enter the SMTP server password.{/t}{literal}');
 
80
          alert('{t escape=js}Please enter the SMTP server password.{/t}');
81
81
          return false;
82
82
      }
83
83
    }
104
104
}
105
105
//-->
106
106
</script>
107
 
{/literal}
 
107
 
108
108
 
109
109
{if $result|default:'' != '' and $result|default:'' != 'success'}
110
110
<br />
474
474
</form>
475
475
</table>
476
476
 
477
 
{literal}
 
477
 
478
478
<script type="text/javascript">
479
479
<!--
480
480
window.onload = setFocus;
482
482
{
483
483
    document.install_form.hostname.focus();
484
484
    toggleAlternateUserFields();
485
 
{/literal}
 
485
 
486
486
    {if $smarty.request.setup.smtp.auth|default:'' != 1}
487
487
    disableAuthFields(true);
488
488
    {/if}
489
 
{literal}
 
489
 
490
490
}
491
491
//-->
492
492
</script>
493
 
{/literal}
 
493
 
494
494
{/if}
495
495
{/block}