Skip to content

Commit

Permalink
Merge branch 'master' of git.rackster.ch:ipynbsrv/ipynbsrv
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Glatthard committed Aug 11, 2015
2 parents 48a93f8 + 09a2e9b commit 77a4527
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/user-guide/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
site_name: User Guide
theme: readthedocs

docs_dir: .
site_dir: ../../ipynbsrv/wui/static/docs/user-guide
site_dir: ../../ipynbsrv/web/static/docs/user-guide

pages:
- [index.md, Home]
- 'Home' : 'index.md'
10 changes: 9 additions & 1 deletion ipynbsrv/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,15 @@ class ContainerImage(models.Model):
max_length=255,
help_text='The primary key the backend uses to identify this image.'
)
name = models.CharField(max_length=75)
name = models.CharField(
max_length=75,
validators=[
RegexValidator(
regex='^[A-z][\w\/]*$',
message='Invalid container snapshot name.'
)
]
)
description = models.TextField(blank=True, null=True)
# TODO: document placeholders
command = models.CharField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h4 class="modal-title">New Container Snapshot</h4>
<div class="form-group">
<label for="name">Name</label>
<input name="name" type="text" pattern="[A-Za-z1-9_-]+" class="form-control" required>
<p class="help-text">Allowed pattern: ^[A-z]\w*$</p>
</div>
<div class="form-group">
<label for="description">Description</label>
Expand Down
1 change: 1 addition & 0 deletions ipynbsrv/web/templates/web/images/modal_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h4 class="modal-title">New image</h4>
<div class="form-group">
<label for="img_name">Name</label>
<input name="img_name" type="text" pattern="[A-Za-z1-9_-]+" class="form-control" placeholder="e.g fhnw-maths " required>
<p class="help-text">Allowed pattern: ^[A-z][\w\/]*$</p>
</div>
<div class="form-group">
<label for="description">Description</label>
Expand Down
3 changes: 2 additions & 1 deletion ipynbsrv/web/templates/web/shares/modal_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ <h4 class="modal-title">New shared folder</h4>
<div class="modal-body">
<div class="form-group">
<label for="name">Name</label>
<input type="text" pattern="[A-Za-z1-9_-]+" class="form-control" name="name" placeholder="maths" required>
<input type="text" pattern="^[A-z]\w*$" class="form-control" name="name" placeholder="maths" required>
<p class="help-block">Allowed pattern: ^[A-z]\w*$</p>
</div>
<div class="form-group">
<label for="description">Description</label>
Expand Down

0 comments on commit 77a4527

Please sign in to comment.