Commit 097e1705 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Improve Upload forms for app and home page

parent 02445392
...@@ -23,12 +23,18 @@ ...@@ -23,12 +23,18 @@
<h3>Add Application</h3> <h3>Add Application</h3>
<div class="form-group"> <div class="form-group">
<label>Application Name: <label>Application Name:
<input name="app-name" class="app-name form-control" type="text" size="30" value="" required> <input name="app-name" class="app-name form-control"
type="text" size="30" value="" required
placeholder="My App Name">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Application Path: <label>Application Path:
<input name="load-zip-to-path" class="load-zip-to-path form-control" type="text" size="30" value="" pattern="[a-zA-Z0-9]+" title="Alphanumeric Characters" required> <input name="load-zip-to-path"
class="load-zip-to-path form-control" type="text"
size="30" value="" pattern="[a-zA-Z0-9]+"
title="Alphanumeric Characters" required
placeholder="my-app-path/">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -39,12 +45,18 @@ ...@@ -39,12 +45,18 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label> Path in Zip: <label> Path in Zip:
<input name="load-zip-path" class="load-from-zip-path form-control" type="text" size="30" value=""> <input name="load-zip-path"
class="load-from-zip-path form-control" type="text"
size="50" value=""
placeholder="Use if index.html is not at the root of the zip. e.g.: cribjs-editor-master/"
title="Use if index.html is not at the root of the zip. e.g.: cribjs-editor-master/">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> And redirect to: <label> And redirect to:
<input name="redirect-url" class="redirect-url form-control" type="text" size="30" value="index.html"> <input name="redirect-url" class="redirect-url form-control"
type="text" size="30" value="index.html"
title="Will be used as home page">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -23,24 +23,32 @@ ...@@ -23,24 +23,32 @@
<h3>Fill This site from a zip URL</h3> <h3>Fill This site from a zip URL</h3>
<div class="form-group"> <div class="form-group">
<label>Zip Url: <label>Zip Url:
<input name="load-zip-url" class="load-zip-url form-control" type="text" size="60"></label> <input name="load-zip-url" class="load-zip-url form-control"
type="text" size="60"></label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> Path in Zip: <label> Path in Zip:
<input name="load-from-zip-path" class="load-from-zip-path form-control" type="text" size="30" value="/"> <input name="load-from-zip-path"
class="load-from-zip-path form-control" type="text"
size="30" value="">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> to path: <label> to path:
<input name="load-zip-to-path" class="load-zip-to-path form-control" type="text" size="30" value="/"> <input name="load-zip-to-path"
class="load-zip-to-path form-control" type="text" size="30"
value="">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> And redirect to: <label> And redirect to:
<input name="redirect-url" class="redirect-url form-control" type="text" size="30" value=""> <input name="redirect-url" class="redirect-url form-control"
type="text" size="30" value="">
</label> </label>
</div> </div>
<button name="load-zip-contents" class="load-zip-contents btn btn-default" type="submit">Import from URL</button> <button name="load-zip-contents"
class="load-zip-contents btn btn-default"
type="submit">Import from URL</button>
</form> </form>
</div> </div>
<div class="nav_content container"> <div class="nav_content container">
...@@ -49,24 +57,32 @@ ...@@ -49,24 +57,32 @@
<h3>Import from zip File</h3> <h3>Import from zip File</h3>
<div class="form-group"> <div class="form-group">
<label>Zip File: <label>Zip File:
<input name="load-zip-file" class="load-zip-file form-control" type="file" size="30"></label> <input name="load-zip-file" class="load-zip-file form-control"
type="file" size="30"></label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> Path in Zip: <label> Path in Zip:
<input name="load-zip-path" class="load-from-zip-path form-control" type="text" size="30" value="/"> <input name="load-zip-path"
class="load-from-zip-path form-control" type="text"
size="30" value="">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> to path: <label> to path:
<input name="load-zip-to-path" class="load-zip-to-path form-control" type="text" size="30" value="/"> <input name="load-zip-to-path"
class="load-zip-to-path form-control" type="text" size="30"
value="">
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> And redirect to: <label> And redirect to:
<input name="redirect-url" class="redirect-url form-control" type="text" size="30" value=""> <input name="redirect-url" class="redirect-url form-control"
type="text" size="30" value="">
</label> </label>
</div> </div>
<button name="load-zip-contents" class="load-zip-contents btn btn-default" type="submit">Import from File</button> <button name="load-zip-contents"
class="load-zip-contents btn btn-default"
type="submit">Import from File</button>
</form> </form>
</div> </div>
......
...@@ -98,8 +98,6 @@ ...@@ -98,8 +98,6 @@
} }
if ( params.hasOwnProperty("to_path") ) { if ( params.hasOwnProperty("to_path") ) {
gadget.props.element.querySelector("form.crib-load-from-zip-url .load-zip-to-path").value = params.to_path; gadget.props.element.querySelector("form.crib-load-from-zip-url .load-zip-to-path").value = params.to_path;
} else {
gadget.props.element.querySelector("form.crib-load-from-zip-url .load-zip-to-path").value = site;
} }
if ( params.hasOwnProperty("zip_url") ) { if ( params.hasOwnProperty("zip_url") ) {
gadget.props.element.querySelector("form.crib-load-from-zip-url .load-zip-url").value = params.zip_url; gadget.props.element.querySelector("form.crib-load-from-zip-url .load-zip-url").value = params.zip_url;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment