2008-12-15 20:19:22 +01:00
|
|
|
<%- @title = "New Wiki Web"; @content_width = 500 -%>
|
2007-01-22 14:43:50 +01:00
|
|
|
|
|
|
|
<p>
|
|
|
|
Each web serves as an isolated name space for wiki pages,
|
|
|
|
so different subjects or projects can write about different <i>MuppetShows</i>.
|
|
|
|
</p>
|
|
|
|
|
2007-05-11 18:47:38 +02:00
|
|
|
<% form_tag({ :controller => 'admin', :action => 'create_web' },
|
2007-01-22 14:43:50 +01:00
|
|
|
{ 'id' => 'setup', 'method' => 'post',
|
2007-01-22 15:36:51 +01:00
|
|
|
'onsubmit' => 'cleanAddress(); return validateSetup()',
|
2007-05-11 18:47:38 +02:00
|
|
|
'accept-charset' => 'utf-8' }) do
|
2007-01-22 14:43:50 +01:00
|
|
|
%>
|
|
|
|
|
|
|
|
<ol class="setup">
|
|
|
|
<li>
|
|
|
|
<h2 style="margin-bottom: 3px">Name and address for your new web</h2>
|
|
|
|
<div class="help">
|
|
|
|
The name of the web is included in the title on all pages.
|
|
|
|
The address is the base path that all pages within the web live beneath.
|
|
|
|
Ex: the address "rails" gives URLs like <i>/rails/show/HomePage</i>.
|
|
|
|
The address can only consist of letters and digits.
|
|
|
|
</div>
|
|
|
|
<div class="inputBox">
|
2007-02-19 00:27:36 +01:00
|
|
|
<label for="web_name">Name:</label> <input type="text" id="web_name" name="name" onchange="proposeAddress();" />
|
|
|
|
  
|
|
|
|
<label for="web_address">Address:</label> <input type="text" id="web_address" name="address" onchange="cleanAddress();" />
|
2007-01-22 14:43:50 +01:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
2007-02-19 06:14:55 +01:00
|
|
|
<p style="text-align:right;font-size:.85em;">
|
2007-02-19 00:27:36 +01:00
|
|
|
<label for="system_password">Enter system password</label>
|
2007-01-22 14:43:50 +01:00
|
|
|
<input type="password" id="system_password" name="system_password" />
|
|
|
|
and
|
|
|
|
<input type="submit" value="Create Web" />
|
|
|
|
</p>
|
|
|
|
|
2008-12-15 20:19:22 +01:00
|
|
|
<%- end -%>
|
2007-01-22 14:43:50 +01:00
|
|
|
|
2007-02-19 06:14:55 +01:00
|
|
|
<script type="text/javascript">
|
2007-01-22 14:43:50 +01:00
|
|
|
function proposeAddress() {
|
|
|
|
document.getElementById('web_address').value =
|
|
|
|
document.getElementById('web_name').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleanAddress() {
|
|
|
|
document.getElementById('web_address').value =
|
|
|
|
document.getElementById('web_address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
|
|
}
|
|
|
|
|
|
|
|
function validateSetup() {
|
|
|
|
if (document.getElementById('web_name').value == "") {
|
|
|
|
alert("You must pick a name for the new web");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (document.getElementById('web_address').value == "") {
|
|
|
|
alert("You must pick an address for the new web");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (document.getElementById('system_password').value == "") {
|
|
|
|
alert("You must enter the system password");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
</script>
|