Revision bf4a13d3
Added by Walden Raines over 10 years ago
app/views/config_templates/_form.html.erb | ||
---|---|---|
<div class="tab-pane active" id="primary">
|
||
<%= text_f f, :name %>
|
||
|
||
<%= alert :class => 'controls alert-success', :header => '',
|
||
<%= alert :class => 'alert-success', :header => '',
|
||
:text => icon_text("info-sign", (_('Note: %s ') % link_to(_('Useful template functions and macros'),
|
||
"http://www.theforeman.org/manuals/#{SETTINGS[:version].short}/index.html#4.4.3ProvisioningTemplates", :rel => 'external')).html_safe) %>
|
||
<div class='control-group'>
|
||
<div class='form-group'>
|
||
<label class="control-label" for="template"><%= _("Template editor") %></label>
|
||
<div class='controls'>
|
||
<div class="navbar-inner">
|
||
<div class="btn-group" data-toggle="buttons-radio" >
|
||
<button type="button" style="margin-top: 8px;" class="btn btn-small active" onclick="set_code()"><%= _("Code") %></button>
|
||
<button type="button" style="margin-top: 8px;" class="btn btn-small" onclick="set_preview()"><%= _("Preview") %></button>
|
||
</div>
|
||
<button type='button' style='margin-top: 8px;' class='btn btn-small' onclick='set_fullscreen()' title="<%= _("Full screen") %>"><i class="icon-resize-full"></i></button>
|
||
<div class="fr">
|
||
<%= select_tag('keybinding', content_tag(:optgroup, options_for_select([_('Default'), 'Vim', 'Emacs']), :label => _('Key Binding')), :class => 'input-small', :style=>"margin-top: 8px;height: 26px;") %>
|
||
</div>
|
||
<div class="navbar navbar-form">
|
||
<div class="btn-group" data-toggle="buttons" >
|
||
<label class="btn btn-default btn-sm active" onclick="set_code()">
|
||
<input type="radio" name="options" id="option1" ><%= _("Code") %>
|
||
</label>
|
||
<label class="btn btn-default btn-sm" onclick="set_preview()">
|
||
<input type="radio" name="options" id="option2" ><%= _("Preview") %>
|
||
</label>
|
||
</div>
|
||
<button type='button' class='btn btn-default btn-sm' onclick='set_fullscreen()' title="<%= _("Full screen") %>"><i class="glyphicon glyphicon-resize-full"></i></button>
|
||
<div class="fr">
|
||
<%= select_tag('keybinding', content_tag(:optgroup, options_for_select([_('Default'), 'Vim', 'Emacs']), :label => _('Key Binding')), :class => 'form-control input-sm') %>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<%= textarea_f f, :template, :class => "span12 template_text", :fluid=>true, :label =>'', :'data-file-name' => @config_template.name %>
|
||
<%= textarea_f f, :template, :class => "template_text", :label =>'',:size => "col-md-12", :'data-file-name' => @config_template.name %>
|
||
|
||
|
||
<%= file_field_f f, :template, :class => "template_file span4",
|
||
<%= file_field_f f, :template, :class => "template_file",:size => "col-md-12",
|
||
:help_block => _("Selecting a file will override the editor and load the file instead") %>
|
||
<%= textarea_f f, :audit_comment, :class => "span12", :fluid=>true, :rows => 3, :label => _("Audit Comment"),
|
||
<%= textarea_f f, :audit_comment, :size => "col-md-12", :rows => 3, :label => _("Audit Comment"),
|
||
:help_block => _("The Audit Comment field is saved with the template auditing to document the template changes") %>
|
||
</div>
|
||
<div class="tab-pane" id="template_type">
|
||
... | ... | |
</div>
|
||
</div>
|
||
<div class="tab-pane" id="history">
|
||
<div class='controls'>
|
||
<% if @history.try(:any?) %>
|
||
<% @history.each do |audit| %>
|
||
<% next unless audit_template? audit %>
|
||
<div class='row'>
|
||
<div class='span6'>
|
||
<b><%= audit_user(audit) %> <%= audit.comment %></b>
|
||
</div>
|
||
<div class='span2 ra'><h6><%= audit_time audit %></h6></div>
|
||
<div class='span8 audit-content'>
|
||
<%= link_to_function icon_text("retweet", _("Revert")), "revert_template(this)", :data => {:url => revision_config_templates_url, :version => audit.id } %>
|
||
<%= link_to icon_text("eye-open", _("Show Diff")), audit_path(audit), :rel => 'external' %>
|
||
</div>
|
||
<% if @history.try(:any?) %>
|
||
<% @history.each do |audit| %>
|
||
<% next unless audit_template? audit %>
|
||
<div class='row'>
|
||
<div class='col-md-6'>
|
||
<b><%= audit_user(audit) %> <%= audit.comment %></b>
|
||
</div>
|
||
<% end %>
|
||
<% else %>
|
||
<%= alert :header => _('No history found'), :text => _('Save something and try again') %>
|
||
<% end %>
|
||
</div>
|
||
<div class='col-md-2 ra'><h6><%= audit_time audit %></h6></div>
|
||
<div class='col-md-8 audit-content'>
|
||
<%= link_to_function icon_text("retweet", _("Revert")), "revert_template(this)", :data => {:url => revision_config_templates_url, :version => audit.id } %>
|
||
<%= link_to icon_text("eye-open", _("Show Diff")), audit_path(audit), :rel => 'external' %>
|
||
</div>
|
||
</div>
|
||
<% end %>
|
||
<% else %>
|
||
<%= alert :header => _('No history found'), :text => _('Save something and try again') %>
|
||
<% end %>
|
||
</div>
|
||
|
||
|
||
... | ... | |
</div>
|
||
<%= submit_or_cancel f %>
|
||
</div>
|
||
<div class='exit-fullscreen hide'>
|
||
<%= link_to_function icon_text('resize-small'), 'exit_fullscreen()', :class => 'btn btn-large', :title => _('Exit Full Screen') %>
|
||
<div class='exit-fullscreen hidden'>
|
||
<%= link_to_function icon_text('resize-small'), 'exit_fullscreen()', :class => 'btn btn-default btn-lg', :'data-placement'=>'bottom', :title => _('Exit Full Screen') %>
|
||
</div>
|
||
<div class='hide' id="old"><%= @config_template.template %></div>
|
||
<div class='hide' id="new"><%= @config_template.template %></div>
|
Also available in: Unified diff
Fixes #3811 updating to bootstrap 3