- content_for :pagetitle do
  Code for #{@swarm.name} : Swarms : 

.page-header.swarmize-header
  %h1 
    Code for '#{@swarm.name}'
  %p
    %a{:href => swarm_path(@swarm)}
      = glyphicon('circle-arrow-left')
      Back to swarm
%dl
  %dt Token
  %dd
    %code= @swarm.token

  %dt Collector URL
  %dd
    %code= @swarm.collector_url

  %dt Embed code
  %dd
    %input{:value => "<iframe src='#{serve_from_cloudfront(embed_swarm_path(@swarm))}' width='460' height='#{@swarm.estimate_form_height}' frameBorder='0' seamless='seamless'></iframe>", :style => "width: 300px"}

%table.table
  %thead
    %tr
      %th Field name
      %th Field code
      %th Field type
      %th Possible values
  %tbody
    - @swarm.swarm_fields.each do |f|
      %tr
        %td= f.field_name
        %td
          %code= f.field_code
        %td
          %code= f.field_type
        %td
          - case f.field_type
          - when 'yesno'
            %code yes
            %br
            %code no
          - when 'rating'
            %code #{f.minimum}...#{f.maximum}
          - when 'pick_one', 'pick_several'
            - if f.possible_values
              - f.possible_values.each do |v|
                %code= v.parameterize.underscore
                %br




- content_for :pagetitle do
  Code for #{@swarm.name} : Swarms : 

.page-header.swarmize-header
  %h1 
    Code for '#{@swarm.name}'
  %p
    %a{:href => swarm_path(@swarm)}
      = glyphicon('circle-arrow-left')
      Back to swarm
%dl
  %dt Embed code
  %dd
    %input{:value => "<iframe src='#{serve_from_cloudfront(embed_swarm_path(@swarm))}' width='460' height='#{@swarm.estimate_form_height}' frameBorder='0' seamless='seamless'></iframe>", :style => "width: 300px"}

  %dt Token
  %dd
    %code= @swarm.token

  %dt Collector URL
  %dd
    %code= @swarm.collector_url

%table.table
  %thead
    %tr
      %th Field name
      %th Field code
      %th Field type
      %th Possible values
  %tbody
    - @swarm.swarm_fields.each do |f|
      %tr
        %td= f.field_name
        %td
          %code= f.field_code
        %td
          %code= f.field_type
        %td
          - case f.field_type
          - when 'yesno'
            %code yes
            %br
            %code no
          - when 'rating'
            %code #{f.minimum}...#{f.maximum}
          - when 'pick_one', 'pick_several'
            - if f.possible_values
              - f.possible_values.each do |v|
                %code= v.parameterize.underscore
                %br




Embed code should come first.
Embed code should come first.
