Pojostick/ipsr-mosaic

View on GitHub
app/views/mosaics/gallery.html.haml

Summary

Maintainability
Test Coverage
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
    = javascript_include_tag "gallery.js"
  %body
    %h3{:align => "center", :style => "color: red;"} #{flash[:notice]}
    #wrapper
      #filter
        %ul
          #filtertitle 
            Filter by: 
          %li
            %a{:href => "#"}
              Completion:
              %span{:id => "complete", :style => "font-weight: bold;"}
            %ul{:style => "width: 16em;"}
              %li{:style => "overflow-y: hidden;"}
                %div{:id => "completeslider", :style => "margin: 4px 1em;"}
          %li
            %a{:href => "#"}
              Distinct colors:
              %span{:id => "colorcount", :style => "font-weight: bold;"}
            %ul{:style => "width: 16em;"}
              %li{:style => "overflow-y: hidden;"}
                %div{:id => "colorcountslider", :style => "margin: 4px 1em;"}
          %li
            %a{:href => "#"}
              Moves used:
              %span{:id => "movescount", :style => "font-weight: bold;"}
            %ul{:style => "width: 16em;"}
              %li{:style => "overflow-y: hidden;"}
                %div{:id => "movescountslider", :style => "margin: 4px 1em;"}
          -# %li
          -#   %a{:href => "#"} Dominant color
          -#   %ul
          -#     %li.boldhover
          -#       - Mosaic.colors.each do |color|
          -#         = link_to "#{color}", gallery_path(dominant: color), :style => "color: white; text-shadow: 1px 1px 1px black; background-color: #{color};"
          %li
            %a{:href => "#"}
              Time taken:
              %span{:id => "timetaken", :style => "font-weight: bold;"}
            %ul{:style => "width: 16em;"}
              %li{:style => "overflow-y: hidden;"}
                %div{:id => "timetakenslider", :style => "margin: 4px 1em;"}
          %li{:style => "float: right;"}
            %a{:id => "refresh", :href => "#"} Refresh
                  
    // A view to display list of galleries for the researchers.
    = form_tag download_gallery_path(:format => :csv), :method => :post, :id => 'mosaics_form' do
      %table{:align => "center", :style => "border: 0px solid transparent; background-color: transparent;"}
        #mosaic.mosaic
          - @mosaics.each_slice(3) do |mosaic_slice|
            %tr{:style => "padding: 50px; margin: 50px;"}
              - mosaic_slice.each do |mosaic|
                %td{:align => "center", :style => "padding: 50px; margin: 50px;"}
                  %h1{:align => "center", :style => "margin-bottom: 5px;"}= link_to "Mosaic ##{mosaic.id}", mosaic_path(mosaic)
                  %table{:align => "center", :cellpadding => "0", :cellspacing => "0"}
                    - mosaic.grid.split.each_slice(mosaic.width) do |slice|
                      %tr
                        - slice.each do |color|
                          %td{:align => "center"}
                            .block{:style => "background-color: #{color}; width: 25px; height: 25px;"}
    
                  = check_box_tag "mosaics[#{mosaic.id}]", 1, @checked_mosaics.include?(mosaic.id.to_s)
                  = label_tag("Download")
                  
      %center
        = submit_tag "Download selected", :id => "download_button"
    %center   
      = form_tag download_all_path(:format => :csv), :method => :post, :id => 'mosaics_form' do    
        = submit_tag "Download all", :id => "downloadall_button"
      = will_paginate(@mosaics, :remote => true)
    %div{@APPDATA, :id => "APPDATA"}