frontline 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +0 -0
- data/LICENSE +19 -0
- data/README.md +92 -0
- data/Rakefile +21 -0
- data/assets/ansi_up.js +143 -0
- data/assets/api.js +533 -0
- data/assets/bootstrap/css/bootstrap-responsive.min.css +9 -0
- data/assets/bootstrap/css/bootstrap.min.css +9 -0
- data/assets/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/assets/bootstrap/img/glyphicons-halflings.png +0 -0
- data/assets/bootstrap/js/bootstrap.min.js +6 -0
- data/assets/jquery.cookie.js +95 -0
- data/assets/jquery.js +6 -0
- data/assets/noty/jquery.noty.js +520 -0
- data/assets/noty/layouts/top.js +34 -0
- data/assets/noty/layouts/topRight.js +43 -0
- data/assets/noty/promise.js +432 -0
- data/assets/noty/themes/default.js +156 -0
- data/assets/select2-bootstrap.css +86 -0
- data/assets/select2/select2-spinner.gif +0 -0
- data/assets/select2/select2.css +615 -0
- data/assets/select2/select2.min.js +22 -0
- data/assets/select2/select2.png +0 -0
- data/assets/select2/select2x2.png +0 -0
- data/assets/typeahead.js-bootstrap.css +49 -0
- data/assets/typeahead.min.js +7 -0
- data/assets/ui.css +28 -0
- data/assets/xhr.js +19 -0
- data/bin/frontline +19 -0
- data/frontline.gemspec +31 -0
- data/images/0.png +0 -0
- data/lib/frontline.rb +23 -0
- data/lib/frontline/actions.rb +15 -0
- data/lib/frontline/app.rb +86 -0
- data/lib/frontline/controllers/controllers.rb +71 -0
- data/lib/frontline/controllers/index.rb +167 -0
- data/lib/frontline/controllers/models.rb +104 -0
- data/lib/frontline/controllers/sources.rb +11 -0
- data/lib/frontline/frontline.rb +11 -0
- data/lib/frontline/helpers.rb +179 -0
- data/lib/frontline/inflect.rb +183 -0
- data/lib/frontline/templates/controllers/controller.slim +27 -0
- data/lib/frontline/templates/controllers/index.slim +56 -0
- data/lib/frontline/templates/controllers/route.slim +17 -0
- data/lib/frontline/templates/controllers/route_editor.slim +45 -0
- data/lib/frontline/templates/controllers/route_layout.slim +88 -0
- data/lib/frontline/templates/editor.slim +17 -0
- data/lib/frontline/templates/error.slim +36 -0
- data/lib/frontline/templates/index/applications.slim +123 -0
- data/lib/frontline/templates/layout.slim +182 -0
- data/lib/frontline/templates/models/index.slim +31 -0
- data/lib/frontline/templates/models/migration.slim +46 -0
- data/lib/frontline/templates/models/migration_layout.slim +159 -0
- data/lib/frontline/templates/models/model.slim +34 -0
- metadata +245 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
== js_tag src: route(:assets, :xhr), suffix: Frontline::ASSETS_SUFFIX
|
2
|
+
|
3
|
+
- if (result = controllers).is_a?(Hash)
|
4
|
+
.tabbable.tabs-left
|
5
|
+
ul.nav.nav-tabs#controllersNav
|
6
|
+
- result.each_value do |c|
|
7
|
+
li class=('active' if params[:name] == c[:name])
|
8
|
+
- onclick = "history.pushState(null, null, '%s');" % route(name: c[:name])
|
9
|
+
- url = route(:route_layout, c[:name])
|
10
|
+
a href=("#" << c[:dom_id]) data-toggle="tab" data-url=url onclick=onclick
|
11
|
+
i.icon-cog
|
12
|
+
|
|
13
|
+
= c[:name]
|
14
|
+
|
15
|
+
.tab-content
|
16
|
+
- result.each_value do |c|
|
17
|
+
- active = params[:name] == c[:name]
|
18
|
+
.tab-pane class=('active' if active) id=c[:dom_id]
|
19
|
+
== render_p(:route_layout, controller: c) if active
|
20
|
+
|
21
|
+
javascript:
|
22
|
+
$(function() {
|
23
|
+
Frontline.ajaxifyTabs('#controllersNav');
|
24
|
+
});
|
25
|
+
|
26
|
+
- else
|
27
|
+
- styled_halt 500, result.to_s.strip.split("\n")
|
@@ -0,0 +1,56 @@
|
|
1
|
+
javascript:
|
2
|
+
var controllerCrudifier = new Frontline.CRUD('#{route :controller}', '#body');
|
3
|
+
|
4
|
+
ul.nav.nav-tabs
|
5
|
+
li.active
|
6
|
+
a href="#controllersTab" data-toggle="tab" Controllers
|
7
|
+
li
|
8
|
+
a href="#newControllerTab" data-toggle="tab" New Controller
|
9
|
+
|
10
|
+
.tab-content
|
11
|
+
.tab-pane.active#controllersTab
|
12
|
+
#body == render_p :controller
|
13
|
+
|
14
|
+
.tab-pane#newControllerTab
|
15
|
+
form.form-inline#newControllerForm
|
16
|
+
.input-append
|
17
|
+
input.input-xxlarge name="name" type="text" placeholder="Controller names, space separated"
|
18
|
+
a.btn href="#" onclick="controllerCrudifier.create('#newControllerForm');"
|
19
|
+
i.icon-play
|
20
|
+
|
21
|
+
hr
|
22
|
+
.lead Optional Setups
|
23
|
+
.form-horizontal
|
24
|
+
.control-group
|
25
|
+
label.control-label Engine
|
26
|
+
.controls
|
27
|
+
select.frontline-selectable name="engine" data-placeholder="inherited"
|
28
|
+
option
|
29
|
+
- EConstants::VIEW__ENGINE_BY_SYM.each_key do |e|
|
30
|
+
option value=e =e
|
31
|
+
br
|
32
|
+
small.muted selected engine will be added to Gemfile
|
33
|
+
|
34
|
+
.control-group
|
35
|
+
label.control-label Map
|
36
|
+
.controls
|
37
|
+
input name="route" type="text" placeholder="none"
|
38
|
+
br
|
39
|
+
small.muted
|
40
|
+
a href="http://espresso.github.io/Routing.html" target="_blank"
|
41
|
+
| espresso.github.io/Routing.html
|
42
|
+
|
43
|
+
.control-group
|
44
|
+
label.control-label Format
|
45
|
+
.controls
|
46
|
+
input name="format" type="text" placeholder="none"
|
47
|
+
br
|
48
|
+
small
|
49
|
+
a href="http://espresso.github.io/Routing.html#format" target="_blank"
|
50
|
+
| espresso.github.io/Routing.html#format
|
51
|
+
|
52
|
+
#routeEditorModal.modal.hide.fade.routeEditorModal
|
53
|
+
.modal-header
|
54
|
+
button.close type="button" data-dismiss="modal" aria-hidden="true" ×
|
55
|
+
b#routeEditorModalHeader
|
56
|
+
.modal-body#routeEditorModalBody
|
@@ -0,0 +1,17 @@
|
|
1
|
+
- if controller = controllers[controller]
|
2
|
+
== js_tag src: route(:assets, :xhr), suffix: Frontline::ASSETS_SUFFIX
|
3
|
+
|
4
|
+
- crudifier = 'crudifierFor' << controller[:dom_id]
|
5
|
+
- route_editor_id = 'routeEditorFor' << controller[:dom_id]
|
6
|
+
div id=route_editor_id
|
7
|
+
|
8
|
+
- controller[:routes].each_value do |route|
|
9
|
+
.well.well-small style="display: inline-block; margin: .2em;"
|
10
|
+
|
11
|
+
- data = [route(:route_editor, controller[:name], route[:name]), route_editor_id]
|
12
|
+
- onclick = "Frontline.routeEditor('%s', '#%s');" % data
|
13
|
+
a href="#" onclick=onclick
|
14
|
+
i.icon-edit
|
15
|
+
|
|
16
|
+
span style="font-size: 1.2em;"
|
17
|
+
= route[:name]
|
@@ -0,0 +1,45 @@
|
|
1
|
+
== js_tag src: route(:assets, :xhr), suffix: Frontline::ASSETS_SUFFIX
|
2
|
+
- route_editor_id = 'routeEditorFor' << @controller[:dom_id]
|
3
|
+
- close_editor = "$('#%s').html(null);" % route_editor_id
|
4
|
+
- crudifier = 'crudifierFor' << @controller[:dom_id]
|
5
|
+
|
6
|
+
.form-inline
|
7
|
+
|
8
|
+
a.btn onclick=close_editor
|
9
|
+
i.icon-remove
|
10
|
+
| Close Editor
|
11
|
+
|
|
12
|
+
|
13
|
+
- dom_id = 'selectorFor%s_%sPreview' % [@controller[:dom_id], @route[:name]]
|
14
|
+
- url = session[:application].last + @route[:route]
|
15
|
+
span.input-append
|
16
|
+
input.openWindow type="text" id=dom_id data-url=url placeholder="slash-separated arguments"
|
17
|
+
a.btn href="#" onclick=("Frontline.openWindow('%s');" % dom_id)
|
18
|
+
i.icon-eye-open
|
19
|
+
| Preview
|
20
|
+
|
21
|
+
p
|
22
|
+
.tabbable
|
23
|
+
ul.nav.nav-tabs
|
24
|
+
- @files.each do |(path,name,dom_id,active)|
|
25
|
+
li class=('active' if active)
|
26
|
+
a href=('#' << dom_id) data-toggle="tab" = name
|
27
|
+
li
|
28
|
+
- onclick = "%s.delete('%s'); %s" % [crudifier, @route[:name], close_editor]
|
29
|
+
a.text-error href="#" onclick=onclick
|
30
|
+
i.icon-remove
|
31
|
+
| Delete
|
32
|
+
b = @route[:name]
|
33
|
+
| action
|
34
|
+
|
35
|
+
.tab-content
|
36
|
+
- @files.each do |(path,name,dom_id,active)|
|
37
|
+
- editor_id = 'routeEditorFor' << dom_id
|
38
|
+
.tab-pane id=dom_id class=('active' if active)
|
39
|
+
textarea id=editor_id = File.read(dst_path(:root, path))
|
40
|
+
|
41
|
+
- onclick = "fileCrudifier.saveFile('%s', '#%s');" % [path, editor_id]
|
42
|
+
- save_button = button_tag!(onclick: onclick, class: 'btn btn-success saveButton') { \
|
43
|
+
i_tag(class: 'icon-ok') << ' Save' \
|
44
|
+
} + ' '
|
45
|
+
== ace(editor_id, file: name, toolbar_prepend: save_button)
|
@@ -0,0 +1,88 @@
|
|
1
|
+
== js_tag src: route(:assets, :xhr), suffix: Frontline::ASSETS_SUFFIX
|
2
|
+
|
3
|
+
- crudifier = 'crudifierFor' + controller[:dom_id]
|
4
|
+
- navmap = [:new, :existing].inject({}) do |m,t| \
|
5
|
+
m.merge t => '%sActionsTabFor%s' % [t, controller[:name]] \
|
6
|
+
end
|
7
|
+
|
8
|
+
javascript:
|
9
|
+
var #{crudifier} = new Frontline.CRUD(
|
10
|
+
'#{route(:route, controller[:name])}', '#routesFor#{controller[:dom_id]}'
|
11
|
+
);
|
12
|
+
|
13
|
+
ul.nav.nav-pills
|
14
|
+
li.active
|
15
|
+
a href=("#" << navmap[:existing]) data-toggle="tab"
|
16
|
+
= controller[:name]
|
17
|
+
| Actions
|
18
|
+
li
|
19
|
+
a href=("#" << navmap[:new]) data-toggle="tab" New Actions
|
20
|
+
li.dropdown
|
21
|
+
a.dropdown-toggle data-toggle="dropdown" href="#"
|
22
|
+
| Maintenance
|
23
|
+
b class="caret"
|
24
|
+
ul.dropdown-menu
|
25
|
+
li
|
26
|
+
- onclick = "fileCrudifier.toggleEditor('%s');" % controller[:file]
|
27
|
+
a href="#" onclick=onclick
|
28
|
+
i.icon-edit
|
29
|
+
| Edit Controller
|
30
|
+
|
31
|
+
- if helper_file = controller[:helper_file]
|
32
|
+
li
|
33
|
+
- onclick = "fileCrudifier.toggleEditor('%s'); return false;" % helper_file
|
34
|
+
a href="#" onclick=onclick
|
35
|
+
i.icon-edit
|
36
|
+
| Edit Helpers
|
37
|
+
|
38
|
+
- if controller[:routes].any?
|
39
|
+
li.divider
|
40
|
+
li
|
41
|
+
- onclick = "Frontline.runSpecs('%s', '%s');" % [route(:run_specs), controller[:name]]
|
42
|
+
a href="#" onclick=onclick
|
43
|
+
i.icon-play
|
44
|
+
span Run Specs
|
45
|
+
|
46
|
+
li.divider
|
47
|
+
li
|
48
|
+
- confirm = 'You are about to delete an entire Controller! This action can not be undone! Continue?'
|
49
|
+
- onclick = "controllerCrudifier.delete('%s', '%s');" % [controller[:name], confirm]
|
50
|
+
a.text-error href="#" onclick=onclick
|
51
|
+
i.icon-remove
|
52
|
+
| Delete
|
53
|
+
|
54
|
+
.tab-content
|
55
|
+
.tab-pane.active id=navmap[:existing]
|
56
|
+
div id=("routesFor%s" % controller[:dom_id])
|
57
|
+
== render_p(:route, controller: controller[:name])
|
58
|
+
|
59
|
+
.tab-pane id=navmap[:new]
|
60
|
+
- form_id = 'newRoutesFor%sForm' % controller[:dom_id]
|
61
|
+
form.form-inline id=form_id
|
62
|
+
.input-append
|
63
|
+
input.input-xlarge name="name" type="text" placeholder="Action name(s), space separated"
|
64
|
+
- onclick = "%s.create('#%s');" % [crudifier, form_id]
|
65
|
+
a.btn type="button" onclick=onclick
|
66
|
+
i.icon-play
|
67
|
+
|
68
|
+
hr
|
69
|
+
.lead Optional Setups
|
70
|
+
.form-horizontal
|
71
|
+
.control-group
|
72
|
+
label.control-label Engine
|
73
|
+
.controls
|
74
|
+
select.frontline-selectable name="engine" data-placeholder="inherited"
|
75
|
+
option
|
76
|
+
- EConstants::VIEW__ENGINE_BY_SYM.each_key do |e|
|
77
|
+
option value=e =e
|
78
|
+
br
|
79
|
+
small.muted selected engine will be added to Gemfile
|
80
|
+
|
81
|
+
.control-group
|
82
|
+
label.control-label Format
|
83
|
+
.controls
|
84
|
+
input name="format" type="text" placeholder="none"
|
85
|
+
br
|
86
|
+
small
|
87
|
+
a href="http://espresso.github.io/Routing.html#format" target="_blank"
|
88
|
+
| espresso.github.io/Routing.html#format
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#editorModal.modal.hide.fade.FrontlineModal
|
2
|
+
|
3
|
+
.modal-header
|
4
|
+
button.close type="button" data-dismiss="modal" ×
|
5
|
+
|
6
|
+
b = unrootify(@file)
|
7
|
+
|
8
|
+
.modal-body
|
9
|
+
textarea#editor = File.read(@file)
|
10
|
+
- onclick = "fileCrudifier.saveFile('%s');" % params[:path]
|
11
|
+
- save_button = button_tag!(onclick: onclick, class: 'btn btn-success saveButton') { \
|
12
|
+
i_tag(class: 'icon-ok') << ' Save' \
|
13
|
+
} + ' '
|
14
|
+
== ace(:editor, toolbar_prepend: save_button, file: @file)
|
15
|
+
|
16
|
+
javascript:
|
17
|
+
$('#editorModal').modal();
|
@@ -0,0 +1,36 @@
|
|
1
|
+
.alert.alert-error
|
2
|
+
h4 Something went wrong...
|
3
|
+
.text-info
|
4
|
+
| Please consider to report this at
|
5
|
+
a href="https://github.com/espresso/frontline/issues" github.com/espresso/frontline
|
6
|
+
h5 = error.first
|
7
|
+
|
8
|
+
h4.text-info Backtrace:
|
9
|
+
- error.each do |l|
|
10
|
+
div = l
|
11
|
+
|
12
|
+
h4.text-info Path:
|
13
|
+
= rq.path
|
14
|
+
|
15
|
+
h4.text-info Request Method:
|
16
|
+
= rq.request_method
|
17
|
+
|
18
|
+
h4.text-info Params:
|
19
|
+
table
|
20
|
+
- params.each_pair do |key,val|
|
21
|
+
tr
|
22
|
+
td
|
23
|
+
.pull-right.text-info
|
24
|
+
= '%s: ' % key
|
25
|
+
td
|
26
|
+
= val.is_a?(String) ? val : val.inspect
|
27
|
+
|
28
|
+
h4.text-info Env:
|
29
|
+
table
|
30
|
+
- env.each_pair do |key,val|
|
31
|
+
tr
|
32
|
+
td
|
33
|
+
.pull-right.text-info
|
34
|
+
= '%s: ' % key
|
35
|
+
td
|
36
|
+
= val.is_a?(String) ? val : val.inspect
|
@@ -0,0 +1,123 @@
|
|
1
|
+
javascript:
|
2
|
+
$(function() {
|
3
|
+
applicationCrudifier = new Frontline.ApplicationCRUD('#{route(:application)}');
|
4
|
+
$('#dbType').typeahead({local: ["MySQL","PostgreSQL","SQLite"]});
|
5
|
+
});
|
6
|
+
|
7
|
+
- content_for :existing_applications do
|
8
|
+
- applications.each do |(name,path,url)|
|
9
|
+
.well.well-small
|
10
|
+
- onclick = "applicationCrudifier.removeFromList('%s');" % name
|
11
|
+
a.frontline-tooltip href="#" onclick=onclick data-toggle="tooltip" title="Remove from list"
|
12
|
+
i.icon-minus
|
13
|
+
|
|
14
|
+
b
|
15
|
+
a href=route(:application, name: name) = name
|
16
|
+
br
|
17
|
+
small.muted = path
|
18
|
+
|
19
|
+
- content_for :new_applications do
|
20
|
+
.text-center
|
21
|
+
|
22
|
+
input.input-block-level#applicationName type="text" placeholder="name"
|
23
|
+
input.input-block-level#applicationPath type="text" placeholder="path"
|
24
|
+
|
25
|
+
- attrs = {type: :button}
|
26
|
+
- attrs[:onclick] = "applicationCrudifier.generate();"
|
27
|
+
- attrs[:value] = "Generate a Brand New Application"
|
28
|
+
input.btn.btn-success.btn-large.btn-block *attrs
|
29
|
+
|
30
|
+
- attrs = {type: :button}
|
31
|
+
- attrs[:onclick] = "applicationCrudifier.load();"
|
32
|
+
- attrs[:value] = "Load Application from given path"
|
33
|
+
input.btn.btn-info.btn-large.btn-block *attrs
|
34
|
+
|
35
|
+
hr
|
36
|
+
div style="text-align: left;"
|
37
|
+
div
|
38
|
+
.lead Optional Setups
|
39
|
+
.form-horizontal
|
40
|
+
.control-group
|
41
|
+
label.control-label Preview URL
|
42
|
+
.controls
|
43
|
+
input.input-block-level#previewURL type="text" value="http://localhost:5252"
|
44
|
+
|
45
|
+
form.form-horizontal#applicationSettingsForm
|
46
|
+
.control-group
|
47
|
+
label.control-label Server
|
48
|
+
.controls
|
49
|
+
select.frontline-selectable.input-block-level name="server" data-placeholder="Thin"
|
50
|
+
option
|
51
|
+
- Enginery::KNOWN_WEB_SERVERS.each do |s|
|
52
|
+
option value=s =s
|
53
|
+
|
54
|
+
.control-group
|
55
|
+
label.control-label Port
|
56
|
+
.controls
|
57
|
+
input.input-small type="text" name="port" placeholder="5252"
|
58
|
+
|
59
|
+
|
60
|
+
.control-group
|
61
|
+
label.control-label Engine
|
62
|
+
.controls
|
63
|
+
select.frontline-selectable.input-block-level name="engine" data-placeholder="ERB"
|
64
|
+
option
|
65
|
+
- EConstants::VIEW__ENGINE_BY_SYM.each_key do |e|
|
66
|
+
option value=e =e
|
67
|
+
|
68
|
+
.control-group
|
69
|
+
label.control-label ORM
|
70
|
+
.controls
|
71
|
+
select.frontline-selectable.input-block-level name="orm" data-placeholder="none"
|
72
|
+
option
|
73
|
+
- %w[ActiveRecord DataMapper Sequel].each do |orm|
|
74
|
+
option value=orm = orm
|
75
|
+
|
76
|
+
.control-group
|
77
|
+
label.control-label Database
|
78
|
+
.controls
|
79
|
+
.btn-group.dropup
|
80
|
+
button.btn.dropdown-toggle data-toggle="dropdown"
|
81
|
+
| none
|
82
|
+
span.caret
|
83
|
+
|
84
|
+
ul.dropdown-menu.sticky-dropdown
|
85
|
+
li
|
86
|
+
input#dbType name="db_type" type="text" placeholder="type"
|
87
|
+
- %w[host port name user pass].each do |s|
|
88
|
+
li
|
89
|
+
input name=("db_" + s) type="text" placeholder=s
|
90
|
+
|
91
|
+
.control-group
|
92
|
+
label.control-label Format
|
93
|
+
.controls
|
94
|
+
input.input-block-level type="text" name="format" placeholder="none"
|
95
|
+
br
|
96
|
+
small.muted
|
97
|
+
a href="http://espresso.github.io/Routing.html#format" target="_blank"
|
98
|
+
| espresso.github.io/Routing.html#format
|
99
|
+
|
100
|
+
.control-group
|
101
|
+
label.control-label Host(s)
|
102
|
+
.controls
|
103
|
+
input.input-block-level type="text" name="host" placeholder="space separated list of hosts"
|
104
|
+
br
|
105
|
+
small.muted
|
106
|
+
a href="http://espresso.github.io/Routing.html#hosts" target="_blank"
|
107
|
+
| espresso.github.io/Routing.html#hosts
|
108
|
+
|
109
|
+
- if applications.any?
|
110
|
+
.row-fluid
|
111
|
+
.span3
|
112
|
+
.span6
|
113
|
+
h4 Applications
|
114
|
+
- yield_content :existing_applications
|
115
|
+
|
116
|
+
.span3
|
117
|
+
|
118
|
+
.row-fluid
|
119
|
+
.span4
|
120
|
+
.span4
|
121
|
+
h4 Generate/Load Applications
|
122
|
+
- yield_content :new_applications
|
123
|
+
.span4
|
@@ -0,0 +1,182 @@
|
|
1
|
+
doctype html
|
2
|
+
html
|
3
|
+
head
|
4
|
+
title = self.class
|
5
|
+
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
|
6
|
+
meta name="viewport" content="width=device-width, initial-scale=1.0"
|
7
|
+
- assets_mapper route(:assets), suffix: Frontline::ASSETS_SUFFIX do
|
8
|
+
== js_tag 'jquery'
|
9
|
+
== js_tag 'jquery.cookie'
|
10
|
+
|
11
|
+
- cd 'bootstrap'
|
12
|
+
== js_tag 'js/bootstrap.min'
|
13
|
+
== css_tag 'css/bootstrap.min'
|
14
|
+
== css_tag 'css/bootstrap-responsive.min'
|
15
|
+
|
16
|
+
- cd '../select2'
|
17
|
+
== js_tag 'select2.min'
|
18
|
+
== css_tag 'select2'
|
19
|
+
|
20
|
+
- cd '../noty'
|
21
|
+
== js_tag 'jquery.noty'
|
22
|
+
== js_tag 'layouts/top'
|
23
|
+
== js_tag 'layouts/topRight'
|
24
|
+
== js_tag 'themes/default'
|
25
|
+
|
26
|
+
- cd '/'
|
27
|
+
== js_tag 'ansi_up'
|
28
|
+
== js_tag 'typeahead.min'
|
29
|
+
== css_tag 'typeahead.js-bootstrap'
|
30
|
+
== css_tag 'select2-bootstrap'
|
31
|
+
== js_tag 'api'
|
32
|
+
== js_tag 'xhr'
|
33
|
+
== css_tag 'ui'
|
34
|
+
|
35
|
+
javascript:
|
36
|
+
Frontline = new FrontlineAPI();
|
37
|
+
gitDeployer = new Frontline.Git('#{Frontline::Index.route :git}');
|
38
|
+
var fileCrudifier = new Frontline.FileCRUD('#{Frontline::Index.route(:file)}');
|
39
|
+
|
40
|
+
body
|
41
|
+
.container-fluid
|
42
|
+
.row-fluid
|
43
|
+
.span
|
44
|
+
- if session[:application]
|
45
|
+
.navbar.navbar-fixed-top
|
46
|
+
.navbar-inner
|
47
|
+
.container
|
48
|
+
|
49
|
+
a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"
|
50
|
+
span.icon-bar
|
51
|
+
span.icon-bar
|
52
|
+
span.icon-bar
|
53
|
+
|
54
|
+
.nav-collapse.collapse
|
55
|
+
ul.nav
|
56
|
+
li.divider-vertical
|
57
|
+
li
|
58
|
+
a href=Frontline::Index::base_url
|
59
|
+
i.icon-list
|
60
|
+
| Applications
|
61
|
+
li.divider-vertical
|
62
|
+
|
63
|
+
li.dropdown
|
64
|
+
a.dropdown-toggle href="#" data-toggle="dropdown"
|
65
|
+
i.icon-wrench
|
66
|
+
|
|
67
|
+
span.text-info
|
68
|
+
= session[:application].first
|
69
|
+
|
|
70
|
+
b.caret
|
71
|
+
ul.dropdown-menu
|
72
|
+
- applications.each do |(name,path)|
|
73
|
+
li class=('active' if name == session[:application].first)
|
74
|
+
a href=Frontline::Index.route(:application, name: name) = name
|
75
|
+
li.divider-vertical
|
76
|
+
|
77
|
+
- [ \
|
78
|
+
Frontline::Controllers, \
|
79
|
+
Frontline::Models, \
|
80
|
+
Frontline::Sources, \
|
81
|
+
].each do |ctrl|
|
82
|
+
li class=('active' if rq.script_name =~ /\A#{ctrl.base_url}/)
|
83
|
+
a href=ctrl.base_url = ctrl.name.split('::').last
|
84
|
+
li.divider-vertical
|
85
|
+
|
86
|
+
li.dropdown
|
87
|
+
a.dropdown-toggle href="#" data-toggle="dropdown"
|
88
|
+
| Maintenance
|
89
|
+
b.caret
|
90
|
+
ul.dropdown-menu
|
91
|
+
- maintenance_files.each do |file|
|
92
|
+
li
|
93
|
+
- onclick = "fileCrudifier.toggleEditor('%s');"
|
94
|
+
a href="#" onclick=(onclick % file)
|
95
|
+
i.icon-pencil
|
96
|
+
|
|
97
|
+
= File.basename(file)
|
98
|
+
|
99
|
+
li.divider
|
100
|
+
- %w[install update].each do |task|
|
101
|
+
li
|
102
|
+
- onclick = "Frontline.runCmd('%s')" % Frontline::Index.route(:bundler, task)
|
103
|
+
a href="#" onclick=onclick
|
104
|
+
i.icon-play
|
105
|
+
|
|
106
|
+
= 'bundle %s' % task
|
107
|
+
|
108
|
+
- if datamapper?
|
109
|
+
li.divider
|
110
|
+
- %w[auto_migrate auto_upgrade].each do |task|
|
111
|
+
li
|
112
|
+
- confirm = 'This will run %s for ALL MODELS! Continue?' % task
|
113
|
+
- url = Frontline::Models.route(:run_datamapper_task, task)
|
114
|
+
- onclick = "Frontline.runCmd('%s', '%s')" % [url, confirm]
|
115
|
+
a href="#" onclick=onclick
|
116
|
+
i.icon-play
|
117
|
+
|
|
118
|
+
= task.gsub('_', ' ')
|
119
|
+
|
120
|
+
li.divider
|
121
|
+
li
|
122
|
+
- onclick = "Frontline.runSpecs('%s');" % Frontline::Controllers.route(:run_specs)
|
123
|
+
a href="#" onclick=onclick
|
124
|
+
i.icon-play
|
125
|
+
span Run Specs
|
126
|
+
|
127
|
+
li.divider
|
128
|
+
li.dropdown-submenu
|
129
|
+
a href="#" Outstanding Migrations
|
130
|
+
ul.dropdown-menu
|
131
|
+
- %w[up down].each do |vector|
|
132
|
+
li
|
133
|
+
- onclick = "new Frontline.Migrations('%s').run('%s');"
|
134
|
+
a href="#" onclick=(onclick % [Frontline::Models.route(:run_migrations), vector])
|
135
|
+
i class=('icon-arrow-%s' % vector)
|
136
|
+
span Run #{vector}
|
137
|
+
|
138
|
+
li.divider-vertical
|
139
|
+
li.dropdown.sticky-dropdown
|
140
|
+
a.dropdown-toggle href="#" data-toggle="dropdown"
|
141
|
+
| Git
|
142
|
+
b.caret
|
143
|
+
ul.dropdown-menu
|
144
|
+
|
145
|
+
li
|
146
|
+
a href="#" onclick="gitDeployer.push();"
|
147
|
+
b git push
|
148
|
+
|
149
|
+
li.divider
|
150
|
+
|
151
|
+
li style="margin: 0 1em 0 1em;"
|
152
|
+
.text-info git add . && git commit -am
|
153
|
+
input#GitCommit type="text" placeholder="type message and press enter"
|
154
|
+
li.divider
|
155
|
+
|
156
|
+
li style="margin: 0 1em 0 1em;"
|
157
|
+
.text-info git remote add origin
|
158
|
+
input#GitOrigin type="text" placeholder="type URL and press enter"
|
159
|
+
li.divider
|
160
|
+
|
161
|
+
li
|
162
|
+
a href="#" onclick="gitDeployer.init();"
|
163
|
+
b git init
|
164
|
+
|
165
|
+
li.divider-vertical
|
166
|
+
li.hide#lastOperationToggler
|
167
|
+
a href="#" onclick="$('#PTYModal').modal(); return false;" Logs
|
168
|
+
|
169
|
+
.content
|
170
|
+
== yield
|
171
|
+
|
172
|
+
#editorContainer
|
173
|
+
#PTYModal.modal.hide.fade.FrontlineModal
|
174
|
+
.modal-header
|
175
|
+
button.close type="button" data-dismiss="modal" aria-hidden="true" ×
|
176
|
+
b#PTYModalHeader
|
177
|
+
pre.modal-body#PTYModalBody
|
178
|
+
|
179
|
+
javascript:
|
180
|
+
$(function() {
|
181
|
+
new FrontlineAPI().PTYEventListener("#{Frontline::Index.route(:streamer)}");
|
182
|
+
});
|