Sha256: 3e390a96713a6088eb093fdcd56409fd51a2b5f96fb51b3f32e81bd3723b5f4b

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

<%
# USAGE: Displays a version picker for the given object.
#
# VARIABLES:
# * record: The record to show a version picker for.
# * target: The DOM id to update when refreshing the version.
%>

<% if record.versions.present? %>
  <form class="version_chooser">
    <div>
      Version <%= select_tag("version", options_for_select(record.versions.reverse.map { |version| ["#{version.created_at.strftime('%B %d, %Y at %I:%M %p')}", version.id]})) %><%= image_tag "spinner.gif", :alt => "Spinner", :id => "version_loading", :style => "display: none; margin-left: 0.5em;" %>
    </div>
  </form>
  <% content_for :javascript_insert do %>
    <script type='text/javascript'>
      $(function() {
        $('#version').change(function(event) {
          $('#version_loading').show();
          var version_id = event.target.value;
          $('#<%= target %>').load('/versions/'+version_id+'/edit', function(response, status, xhr) {
            $('#version_loading').hide();
          });
        })
      })
    </script>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
calagator-1.0.0.rc2 app/views/calagator/versions/_chooser.html.erb
calagator-1.0.0.rc1 app/views/calagator/versions/_chooser.html.erb
calagator-0.0.1.pre1 app/views/calagator/versions/_chooser.html.erb