created version diff

This commit is contained in:
Senad Uka
2016-02-21 20:31:56 +01:00
parent ac099e3210
commit 6fd266d7ea
12 changed files with 809 additions and 19 deletions

View File

@@ -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') %>