created version diff
This commit is contained in:
@@ -14,21 +14,6 @@
|
||||
ago)
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<% command = pull_command(@record) %>
|
||||
Type this into your server's console to pull latest saved version<br />
|
||||
<%= text_field_tag 'command_pull', command, readonly: true, class: 'form-control-sm', size: command.length %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<% command = push_command(@record) %>
|
||||
Type this into your server's console to push servers version into CHUB<br />
|
||||
<%= text_field_tag 'command_push', command, readonly: true, class: 'form-control-sm', size: command.length %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row editor">
|
||||
<div class="col-md-5">
|
||||
@@ -48,8 +33,48 @@
|
||||
<%= button_tag(type: "button", class: "btn btn-success", id: "save_button") do %>Save as v<%= @record.last_version.number + 1 %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<h3>Sync:</h3>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<% command = pull_command(@record) %>
|
||||
CHUB -> Your Server<br />
|
||||
<%= text_field_tag 'command_pull', command, readonly: true, class: 'form-control-sm', size: command.length %>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<% command = push_command(@record) %>
|
||||
Your Server -> CHUB<br />
|
||||
<%= text_field_tag 'command_push', command, readonly: true, class: 'form-control-sm', size: command.length %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Last Modified</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @record.file_versions[1..-1].each do |version| %>
|
||||
<tr>
|
||||
<td>v<%= version.number %></td>
|
||||
<td><%= distance_of_time_in_words(version.updated_at, Time.now) %></td>
|
||||
<td><%= button_to(file_version_path(version), method: :get, class: "btn btn-default inline") do %>
|
||||
View
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<%= form_tag(update_by_form_configuration_file_url(@record), method: :put, id: "update_form") do %>
|
||||
<%= hidden_field_tag('content','', id: 'content') %>
|
||||
|
||||
32
web/app/views/file_versions/show.html.erb
Normal file
32
web/app/views/file_versions/show.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<% content_for :javascript_includes do %>
|
||||
<%= javascript_include_tag "jsdifflib.js" %>
|
||||
<%= javascript_include_tag "show_file_version.js" %>
|
||||
<% end %>
|
||||
|
||||
<h1>Diff: v<%=@record.configuration_file.last_version.number %> vs v<%=@record.number %></h1>
|
||||
|
||||
<div class="row hidden">
|
||||
<div class="textInput">
|
||||
<h2>Base Text</h2>
|
||||
<textarea id="baseText"><%= @record.configuration_file.last_version.content %></textarea>
|
||||
</div>
|
||||
<div class="textInput spacer">
|
||||
<h2>New Text</h2>
|
||||
<textarea id="newText">
|
||||
<%= @record.content %>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="diffoutput" class="col-md-6"></div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<%= button_to(restore_file_version_path(@record), method: :post, class: "btn btn-danger", id: "restore_button") do %>
|
||||
Restore v<%= @record.number %> as latest
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user