aboutsummaryrefslogtreecommitdiff
path: root/src/views/dialogs/admin
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-07-30 18:40:08 -0400
committerPaul Duncan <pabs@pablotron.org>2016-07-30 18:40:08 -0400
commitbb2a315df93c173db84d2d6fc0cf1b2bdbd931a7 (patch)
tree831f46bd240348af1df70eb0abf98bb92b360f3e /src/views/dialogs/admin
parent9cec164e724465c11ff91772cdad3126de663ade (diff)
downloadguff-bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7.tar.bz2
guff-bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7.zip
refactor site dialogs and add site editing
Diffstat (limited to 'src/views/dialogs/admin')
-rw-r--r--src/views/dialogs/admin/site.ecr (renamed from src/views/dialogs/admin/site-add.ecr)91
1 files changed, 48 insertions, 43 deletions
diff --git a/src/views/dialogs/admin/site-add.ecr b/src/views/dialogs/admin/site.ecr
index 0f99364..fa5d7d7 100644
--- a/src/views/dialogs/admin/site-add.ecr
+++ b/src/views/dialogs/admin/site.ecr
@@ -1,4 +1,4 @@
-<div id='site-add-dialog' class='modal fade' role='dialog'>
+<div id='<%= @id %>-dialog' class='modal fade' role='dialog'>
<div class='modal-dialog modal-lg' role='document'>
<div class='modal-content'>
<div class='modal-header'>
@@ -15,11 +15,16 @@
<h4 class='modal-title'>
<i class='fa fa-plus-circle'></i>
- New Site
+ <%= h(@name) %>
</h4><!-- modal-title -->
</div><!-- modal-header -->
- <div class='modal-body'>
+ <div class='modal-body loading'>
+ <i class='fa fa-spinner fa-spin'></i>
+ Loading...
+ </div><!-- modal-body -->
+
+ <div class='modal-body loading-done'>
<div class='row'>
<div class='col-md-3'>
<ul class='nav nav-pills nav-stacked' role='tablist'><%=
@@ -30,27 +35,27 @@
<div class='col-md-9'>
<div class='tab-content'>
<div
- id='site-add-pane-content'
+ id='<%= @id %>-pane-content'
class='tab-pane active'
role='tabpanel'
>
<div class='row'>
<div class='col-md-6'>
<div class='form-group'>
- <label for='site-add-name'>
+ <label for='<%= @id %>-name'>
Name
</label>
<input
type='text'
- id='site-add-name'
+ id='<%= @id %>-name'
class='form-control'
title='Enter site name.'
placeholder='Some Site'
- aria-describedby='site-add-name-help'
+ aria-describedby='<%= @id %>-name-help'
/>
- <p id='site-add-name-help' class='help-block'>
+ <p id='<%= @id %>-name-help' class='help-block'>
Site name.
</p>
</div><!-- form-group -->
@@ -58,21 +63,21 @@
<div class='col-md-6'>
<div class='form-group'>
- <label for='site-add-slug'>
+ <label for='<%= @id %>-slug'>
Slug
</label>
<input
type='text'
- id='site-add-slug'
+ id='<%= @id %>-slug'
class='form-control'
title='Enter site slug (lowercase).'
readonly='readonly'
placeholder='some-site'
- aria-describedby='site-add-slug-help'
+ aria-describedby='<%= @id %>-slug-help'
/>
- <p id='site-add-slug-help' class='help-block'>
+ <p id='<%= @id %>-slug-help' class='help-block'>
Name of files directory on server.
</p>
</div><!-- form-group -->
@@ -80,71 +85,71 @@
</div><!-- row -->
<div class='form-group'>
- <label for='site-add-body'>
+ <label for='<%= @id %>-body'>
Description
</label>
<textarea
- id='site-add-body'
+ id='<%= @id %>-body'
class='form-control'
title='Enter site description.'
placeholder='A brief site description'
- aria-describedby='site-add-body-help'
+ aria-describedby='<%= @id %>-body-help'
/></textarea>
- <p id='site-add-body-help' class='help-block'>
+ <p id='<%= @id %>-body-help' class='help-block'>
Brief description of site.
</p>
</div><!-- form-group -->
<div class='form-group'>
- <label for='site-add-domains'>
+ <label for='<%= @id %>-domains'>
Domains
</label>
<textarea
- id='site-add-domains'
+ id='<%= @id %>-domains'
class='form-control'
title='Newline-delimited list of site domains.'
placeholder='some.example.com'
- aria-describedby='site-add-domains-help'
+ aria-describedby='<%= @id %>-domains-help'
/></textarea>
- <p id='site-add-domains-help' class='help-block'>
+ <p id='<%= @id %>-domains-help' class='help-block'>
Newline-deilmited list of site domains.
</p>
</div><!-- form-group -->
</div><!-- tab-pane -->
<div
- id='site-add-pane-domains'
+ id='<%= @id %>-pane-domains'
class='tab-pane'
role='tabpanel'
>
</div><!-- tab-pane -->
<div
- id='site-add-pane-theme'
+ id='<%= @id %>-pane-theme'
class='tab-pane'
role='tabpanel'
>
<div class='row'>
<div class='col-md-12'>
<div class='form-group'>
- <label for='site-add-theme_id'>
+ <label for='<%= @id %>-theme_id'>
Theme
</label>
<select
- id='site-add-theme_id'
+ id='<%= @id %>-theme_id'
class='form-control'
title='Choose site theme.'
- aria-describedby='site-add-theme-help'
+ aria-describedby='<%= @id %>-theme-help'
><%=
theme_options
%></select>
- <p id='site-add-theme-help' class='help-block'>
+ <p id='<%= @id %>-theme-help' class='help-block'>
Site theme.
</p>
</div><!-- form-group -->
@@ -154,18 +159,18 @@
<div class='row'>
<div class='col-md-6'>
<div class='form-group'>
- <label for='site-add-styles'>
+ <label for='<%= @id %>-styles'>
Styles
</label>
<textarea
- id='site-add-styles'
+ id='<%= @id %>-styles'
class='form-control asset-list'
title='Newline-delimited site styles.'
- aria-describedby='site-add-styles-help'
+ aria-describedby='<%= @id %>-styles-help'
></textarea>
- <p id='site-add-styles-help' class='help-block'>
+ <p id='<%= @id %>-styles-help' class='help-block'>
Newline-delimited site styles.
</p>
</div><!-- form-group -->
@@ -173,18 +178,18 @@
<div class='col-md-6'>
<div class='form-group'>
- <label for='site-add-scripts'>
+ <label for='<%= @id %>-scripts'>
Scripts
</label>
<textarea
- id='site-add-scripts'
+ id='<%= @id %>-scripts'
class='form-control asset-list'
title='Newline-delimited site scripts.'
- aria-describedby='site-add-scripts-help'
+ aria-describedby='<%= @id %>-scripts-help'
></textarea>
- <p id='site-add-scripts-help' class='help-block'>
+ <p id='<%= @id %>-scripts-help' class='help-block'>
Newline-delimited site scripts.
</p>
</div><!-- form-group -->
@@ -193,26 +198,26 @@
</div><!-- tab-pane -->
<div
- id='site-add-pane-other'
+ id='<%= @id %>-pane-other'
class='tab-pane'
role='tabpanel'
>
<div class='row'>
<div class='col-md-12'>
<div class='form-group'>
- <label for='site-add-lang'>
+ <label for='<%= @id %>-lang'>
Language
</label>
<input
type='text'
- id='site-add-lang'
+ id='<%= @id %>-lang'
class='form-control'
title='Enter site IETF language tag (BCP 47).'
- aria-describedby='site-add-lang-help'
+ aria-describedby='<%= @id %>-lang-help'
/>
- <p id='site-add-lang-help' class='help-block'>
+ <p id='<%= @id %>-lang-help' class='help-block'>
<a
href='https://en.wikipedia.org/wiki/IETF_language_tag'
title='View IETF language tag information.'
@@ -231,9 +236,9 @@
<div class='modal-footer'>
<button
- id='site-add-confirm'
+ id='<%= @id %>-confirm'
class='btn btn-primary'
- title='Create site.'
+ title='<%= h(@save_text) %>'
>
<span class='hidden loading'>
<i class='fa fa-spinner fa-spin'></i>
@@ -241,8 +246,8 @@
</span>
<span class='loading'>
- <i class='fa fa-plus-circle'></i>
- Create Site
+ <i class='fa <%= h(@save_icon) %>'></i>
+ <%= h(@save_name) %>
</span>
</button>