99 var verb = Model .IsInstall ? " install" : " upgrade" ;
1010 var proceed = Model .IsInstall ? " Proceed with Installation" : " Proceed with Upgrade" ;
1111}
12- <h1 >
13- FunnelWeb @properNoun
12+ <h1 >FunnelWeb @properNoun
1413</h1 >
1514<p class =' important' >
1615 Welcome to your FunnelWeb installation!
2019 the database. You will see this page any time you upgrade FunnelWeb.
2120</p >
2221
23- <h2 >Change Database Provider</h2 >
24- @using (Html .BeginForm (" ChangeProvider" , " Install" , FormMethod .Post , new { Area = " Admin" }))
22+ @if (Model .IsSettingsReadOnly )
2523{
24+ <h2 >Settings Read Only </h2 >
25+ @Model.ReadOnlyReason
26+
27+ if (Model .CanConnect )
28+ {
29+ < p class = 'good' >
30+ The connection string below appears to work . Ready to go .
31+ < / p >
32+ }
33+ else
34+ {
35+ <p class =' bad' >
36+ The connection string below is invalid . You will need to change it before proceeding
37+ with this @verb . The error was :
38+ </p >
39+ <pre >@Model.ConnectionError </pre >
40+ }
41+
42+ <h3 >Current Settings </h3 >
43+
2644 <div class =" form-body" >
2745 <div class =" editor-label" >
28- @Html.LabelFor(m => m .DatabaseProvider )
46+ @Html.LabelFor(m => m .DatabaseProvider ):
2947 </div >
3048 <div class =" editor-field" >
31- @Html.DropDownListFor(
32- m => m .DatabaseProvider ,
33- Model .DatabaseProviders .Select (provider => new SelectListItem
34- {
35- Text = provider ,
36- Value = provider ,
37- Selected = provider == Model .DatabaseProvider
38- }))
39- <input type =" submit" id =" changeProvider" class =" submit" value =" Change Provider" />
49+ @Html.TextBoxFor(
50+ m => m .DatabaseProvider ,
51+ new { @readonly = true } )
4052 </div >
53+
54+ <div class =" editor-label" >
55+ @Html.LabelFor(m => m .ConnectionString ):
4156 </div >
42- }
43- <h2 >
44- Change Connection String</h2 >
45- @if (Model .CanConnect )
46- {
47- <p class =' good' >
48- The connection string below appears to work . However , you can change it if you wish
49- to use an alternative database .
50- </p >
51- }
52- else
53- {
54- <p class =' bad' >
55- The connection string below is invalid . You will need to change it before proceeding
56- with this @verb . The error was :
57- </p >
58- <pre >@Model.ConnectionError </pre >
59- }
60-
61- @using (Html .BeginForm (" Test" , " Install" , FormMethod .Post , new { Area = " Admin" }))
62- {
63- <div class =" form-body" >
57+ <div class =" editor-field" >
58+ @Html.TextAreaFor(m => m .ConnectionString , new { @readonly = true } )
59+ </div >
60+ @if (Model .DatabaseProviderSupportsSchema )
61+ {
6462 <div class =" editor-label" >
65- @Html.LabelFor(m => m .ConnectionString )
63+ @Html.LabelFor(m => m .Schema ) :
6664 </div >
6765 <div class =" editor-field" >
68- @Html.TextAreaFor(m => m .ConnectionString , Html .AttributesFor (m => m .ConnectionString ))
69- @Html.ValidationMessageFor(m => m .ConnectionString )
70- @Html.HintFor(m => m .ConnectionString )
66+ @Html.TextBoxFor(m => m .Schema , new { @readonly = true } )
7167 </div >
72- @if (Model .DatabaseProviderSupportsSchema )
73- {
68+ }
69+ </div >
70+ }
71+ else
72+ {
73+ <h2 >Change Database Provider </h2 >
74+ using (Html .BeginForm (" ChangeProvider" , " Install" , FormMethod .Post , new { Area = " Admin" }))
75+ {
76+ <div class =" form-body" >
7477 <div class =" editor-label" >
75- @Html.LabelFor(m => m .Schema )
78+ @Html.LabelFor(m => m .DatabaseProvider )
7679 </div >
7780 <div class =" editor-field" >
78- @Html.TextBoxFor(m => m .Schema , Html .AttributesFor (m => m .ConnectionString ))
79- @Html.ValidationMessageFor(m => m .Schema )
80- @Html.HintFor(m => m .Schema )
81+ @Html.DropDownListFor(
82+ m => m .DatabaseProvider ,
83+ Model .DatabaseProviders .Select (provider => new SelectListItem
84+ {
85+ Text = provider ,
86+ Value = provider ,
87+ Selected = provider == Model .DatabaseProvider
88+ }))
89+ <input type =" submit" id =" changeProvider" class =" submit" value =" Change Provider" />
8190 </div >
82- }
83- <div class =" editor-label" >
8491 </div >
85- <div class =" editor-field" >
86- <input type =" submit" id =" submit" class =" submit" value =" Save and Test" />
92+ }
93+ <h2 >Change Connection String </h2 >
94+ if (Model .CanConnect )
95+ {
96+ < p class = 'good' >
97+ The connection string below appears to work . However , you can change it if you wish
98+ to use an alternative database .
99+ < / p >
100+ }
101+ else
102+ {
103+ <p class =' bad' >
104+ The connection string below is invalid . You will need to change it before proceeding
105+ with this @verb . The error was :
106+ </p >
107+ <pre >@Model.ConnectionError </pre >
108+ }
109+ using (Html .BeginForm (" Test" , " Install" , FormMethod .Post , new { Area = " Admin" }))
110+ {
111+ <div class =" form-body" >
112+ <div class =" editor-label" >
113+ @Html.LabelFor(m => m .ConnectionString )
114+ </div >
115+ <div class =" editor-field" >
116+ @Html.TextAreaFor(m => m .ConnectionString , Html .AttributesFor (m => m .ConnectionString ))
117+ @Html.ValidationMessageFor(m => m .ConnectionString )
118+ @Html.HintFor(m => m .ConnectionString )
119+ </div >
120+ @if (Model .DatabaseProviderSupportsSchema )
121+ {
122+ <div class =" editor-label" >
123+ @Html.LabelFor(m => m .Schema )
124+ </div >
125+ <div class =" editor-field" >
126+ @Html.TextBoxFor(m => m .Schema , Html .AttributesFor (m => m .ConnectionString ))
127+ @Html.ValidationMessageFor(m => m .Schema )
128+ @Html.HintFor(m => m .Schema )
129+ </div >
130+ }
131+ <div class =" editor-label" >
132+ </div >
133+ <div class =" editor-field" >
134+ <input type =" submit" id =" submit" class =" submit" value =" Save and Test" />
135+ </div >
87136 </div >
88- </div >
137+ }
138+
89139}
90140@if (Model .CanConnect )
91141{
@@ -111,9 +161,11 @@ else
111161 {
112162 <text >
113163 <p class =' good' >
114- Your database is up to date . No @verb is necessary .</p >
164+ Your database is up to date . No @verb is necessary .
165+ </p >
115166 <p class = 'important' >
116- < a href = " @Url.Content(" ~ / " )" > Sweet ! < / a >< / p >
167+ < a href = " @Url.Content(" ~ / " )" > Sweet ! < / a >
168+ < / p >
117169 < / text >
118170 }
119171 else
0 commit comments