Sha256: ac5c71904b4d05bdf94f34ee480658709a1b3bfab6a6561e8a335a87ce7a4e73

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

- datetime ||= nil
- datetime_str = datetime.utc.iso8601 if datetime
- if editable && f = form_builder
  .row.datetime-attribute{class: form_id}
    = f.hidden_field(attr_name, value: datetime_str)
    - # TODO(jon): Figure out a better way to do transforms. This works for now though.
    = f.hidden_field("transforms[#{attr_name}]", value: "DateTime#parse")

    .col-xs-12.col-md-4
      .input-group.pikadate
        %input.form-control{type: :text, value: datetime_str, id: "#{form_id}-date"}
        %span.input-group-addon
          %span.glyphicon.glyphicon-calendar

    .col-xs-12.col-md-4
      .input-group.clockpicker{"data-align" => "top", "data-autoclose" => "true", "data-placement" => "right"}
        %input.form-control{:type => "text", :value => datetime_str, id: "#{form_id}-time"}
        %span.input-group-addon
          %span.glyphicon.glyphicon-time

    .col-xs-12.col-md-4
      %small
        Date & Time are shown in UTC. If not time is provided, the current time in UTC will be used.


  - content_for(:javascript) do
    :javascript
      $(document).ready(function() {
        window.Upmin.Attributes.DateTime("#{form_id}");
      });


- else
  %p.well
    -# TODO(jon): Make this show an uneditable date and time field.
    = datetime

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upmin-admin-0.0.39 app/views/upmin/partials/attributes/_datetime.html.haml
upmin-admin-0.0.38 app/views/upmin/partials/attributes/_datetime.html.haml