Add essential view templates for mods and worlds functionality
- views/mods/details.ejs: Detailed mod information and management page - views/mods/index.ejs: Main mod management interface with world selection - views/worlds/details.ejs: World configuration and settings page - views/worlds/new.ejs: New world creation form These templates were previously ignored but are required for core functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
70
views/worlds/new.ejs
Normal file
70
views/worlds/new.ejs
Normal file
@@ -0,0 +1,70 @@
|
||||
<%
|
||||
const body = `
|
||||
<div class="page-header">
|
||||
<div style="margin-bottom: 16px;">
|
||||
<a href="/worlds" style="color: var(--primary-color); text-decoration: none;">← Back to Worlds</a>
|
||||
</div>
|
||||
<h2>Create New World</h2>
|
||||
<p>Create a new Luanti world</p>
|
||||
</div>
|
||||
|
||||
${typeof error !== 'undefined' && error ? `
|
||||
<div class="alert alert-danger">
|
||||
${error}
|
||||
</div>
|
||||
` : ''}
|
||||
|
||||
<div class="card">
|
||||
<form method="POST" action="/worlds/create">
|
||||
${typeof csrfToken !== 'undefined' && csrfToken ? `<input type="hidden" name="_csrf" value="${csrfToken}">` : ''}
|
||||
<div class="form-group">
|
||||
<label for="name">World Name *</label>
|
||||
<input
|
||||
type="text"
|
||||
id="name"
|
||||
name="name"
|
||||
class="form-control"
|
||||
required
|
||||
pattern="[a-zA-Z0-9_-]+"
|
||||
title="Only letters, numbers, underscore and hyphen allowed"
|
||||
value="${typeof formData !== 'undefined' && formData && formData.name ? formData.name : ''}"
|
||||
/>
|
||||
<small style="color: var(--text-secondary);">Only letters, numbers, underscore and hyphen allowed</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="gameid">Game Type *</label>
|
||||
<select id="gameid" name="gameid" class="form-control" required style="max-width: 300px;">
|
||||
${typeof games !== 'undefined' && games.length > 0 ? games.map((game, index) => `
|
||||
<option
|
||||
value="${game.name}"
|
||||
${typeof formData !== 'undefined' && formData && formData.gameid === game.name ? 'selected' : (index === 0 && (typeof formData === 'undefined' || !formData || !formData.gameid) ? 'selected' : '')}
|
||||
>
|
||||
${game.title || game.name}
|
||||
</option>
|
||||
`).join('') : `
|
||||
<option value="minetest_game" selected>Minetest Game</option>
|
||||
<option value="minimal">Minimal</option>
|
||||
`}
|
||||
</select>
|
||||
<small style="color: var(--text-secondary);">Choose the base game for your world</small>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 12px; margin-top: 24px;">
|
||||
<button type="submit" class="btn btn-primary">Create World</button>
|
||||
<a href="/worlds" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info" style="margin-top: 24px;">
|
||||
<strong>World Creation Notes:</strong><br>
|
||||
• World creation may take a few moments to complete<br>
|
||||
• You will be redirected to the worlds list when creation starts<br>
|
||||
• Additional world settings can be configured after creation<br>
|
||||
• Make sure the selected game is properly installed
|
||||
</div>
|
||||
`;
|
||||
%>
|
||||
|
||||
<%- include('../layout', { body: body, currentPage: 'worlds', title: title }) %>
|
Reference in New Issue
Block a user