Commit f442bf2b authored by Klaus Stein's avatar Klaus Stein
Browse files

Improve ImageMap edit

parent 75a2431c
......@@ -18,3 +18,26 @@
width: 90%;
}
}
table.image_map {
td {
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.wwide {
max-width: 16em;
}
.wide {
max-width: 8em;
}
.narrow {
max-width: 3rem;
}
}
div.warning {
margin: 1rem;
padding: 1rem;
border: 2px solid #a00;
background: #ffd;
}
......@@ -11,6 +11,14 @@
</ul>
</div>
<% end %>
<div class="warning">
<p>
You should not use this page to edit map image details.
</p>
<p>It is currently exposed only for georeferencing (click the image on the map shown below to start this).<br />
Do not forget to save afterwards :-)
</p>
</div>
<figure class="map">
<div class="imagemap-map" data-image="<%= url_for(image_map.image_hd) %>" data-anchors="<%= RGeo::GeoJSON.encode(image_map.anchors_or_buffer).to_json %>" data-clip="<%= RGeo::GeoJSON.encode(image_map.clip).to_json %>"></div>
......@@ -23,8 +31,8 @@
</div>
<div class="field">
<%= form.label :image %>
<%= form.file_field :image %>
<%= form.label :image %> <em>(this will overwrite! better use image upload on <%= link_to 'Map', image_map.map %>!)</em>
<%= form.file_field :image, style: 'max-width: 40em;' %>
</div>
<div class="field">
......
......@@ -2,25 +2,25 @@
<h1>Image Maps</h1>
<table>
<table class="image_map">
<thead>
<tr>
<th>Name</th>
<th>Anchors</th>
<th>Clip</th>
<th>Map</th>
<th colspan="3"></th>
<th colspan="2"></th>
</tr>
</thead>
<tbody>
<% @image_maps.each do |image_map| %>
<tr>
<td><%= image_map.name %></td>
<td><%= image_map.anchors %></td>
<td><%= image_map.clip %></td>
<td><%= image_map.map_id %></td>
<td><%= link_to 'Show', image_map %></td>
<td><%= link_to image_map.name, image_map %></td>
<td class="narrow"><%= image_map.anchors %></td>
<td class="narrow"><%= image_map.clip %></td>
<td class="wwide"><% if m=image_map.map and t=joined(m.repo_doc_ref || '-/-', m.repo_doc_ref_part) %>
<%= link_to t, m, title: t %><% end %></td>
<td><%= link_to 'Edit', edit_image_map_path(image_map) %></td>
<td><%= link_to 'Destroy', image_map, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
......
......@@ -38,8 +38,9 @@
class: 'preview', alt: im.name, title: im.id),
url_for(im.image_hd), target: '_blank', title: im.name %>
<figcaption>
<%= im.sizeinfo_s %>
<%= link_to '↓', rails_blob_path(im.image), download: im.name %>
<%= im.sizeinfo_s %><br />
<%= link_to '↓ download', rails_blob_path(im.image), download: im.name %>
<%= link_to 'edit', im %>
</figcaption>
</figure>
<% end %>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment