diff options
Diffstat (limited to 'app/views/nodes')
| -rw-r--r-- | app/views/nodes/edit.html.erb | 15 | ||||
| -rw-r--r-- | app/views/nodes/new.html.erb | 5 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 10 |
3 files changed, 27 insertions, 3 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 25f15c2..07b42d4 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -82,17 +82,27 @@ | |||
| 82 | <ul id="related_asset_list" class="thumbnail_list"> | 82 | <ul id="related_asset_list" class="thumbnail_list"> |
| 83 | <% @page.related_assets.includes(:asset).each do |related| %> | 83 | <% @page.related_assets.includes(:asset).each do |related| %> |
| 84 | <li data-url="<%= node_related_asset_path(@node, related) %>" | 84 | <li data-url="<%= node_related_asset_path(@node, related) %>" |
| 85 | data-asset-id="<%= related.asset.id %>" | ||
| 85 | data-large-url="<%= related.asset.upload.url(:large) %>" | 86 | data-large-url="<%= related.asset.upload.url(:large) %>" |
| 86 | data-original-url="<%= related.asset.upload.url %>" | 87 | data-original-url="<%= related.asset.upload.url %>" |
| 87 | data-name="<%= related.asset.name %>"> | 88 | data-name="<%= related.asset.name %>" |
| 89 | data-has-credit="<%= related.asset.has_credit? %>" | ||
| 90 | data-headline="<%= related.headline? %>" | ||
| 91 | class="<%= "is_headline" if related.headline? %>"> | ||
| 88 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> | 92 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> |
| 89 | <%= image_tag related.asset.upload.url(:thumb) %> | 93 | <%= image_tag related.asset.upload.url(:thumb) %> |
| 94 | <button type="button" class="related_asset_set_headline" | ||
| 95 | aria-pressed="<%= related.headline? %>" aria-label="Set as headline image" | ||
| 96 | title="Use this photo as the page's headline image"> | ||
| 97 | <%= icon("star", library: "tabler", "aria-hidden": true) %> | ||
| 98 | </button> | ||
| 90 | <button type="button" class="related_asset_remove" aria-label="Remove image"> | 99 | <button type="button" class="related_asset_remove" aria-label="Remove image"> |
| 91 | <%= icon("x", library: "tabler", "aria-hidden": true) %> | 100 | <%= icon("x", library: "tabler", "aria-hidden": true) %> |
| 92 | </button> | 101 | </button> |
| 93 | </li> | 102 | </li> |
| 94 | <% end %> | 103 | <% end %> |
| 95 | </ul> | 104 | </ul> |
| 105 | <p class="field_hint">The starred photo becomes this page's headline image on the public site. If none is starred, visitors get a link to browse all attached images instead.</p> | ||
| 96 | <%= text_field_tag nil, nil, id: "related_asset_search_term", placeholder: "Search images to attach…", autocomplete: "off" %> | 106 | <%= text_field_tag nil, nil, id: "related_asset_search_term", placeholder: "Search images to attach…", autocomplete: "off" %> |
| 97 | <div id="related_asset_search_results" class="search_results"></div> | 107 | <div id="related_asset_search_results" class="search_results"></div> |
| 98 | </div> | 108 | </div> |
| @@ -102,6 +112,9 @@ | |||
| 102 | <li> | 112 | <li> |
| 103 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> | 113 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> |
| 104 | <img src=""> | 114 | <img src=""> |
| 115 | <button type="button" class="related_asset_set_headline" aria-pressed="false" aria-label="Set as headline image"> | ||
| 116 | <%= icon("star", library: "tabler", "aria-hidden": true) %> | ||
| 117 | </button> | ||
| 105 | <button type="button" class="related_asset_remove" aria-label="Remove image"> | 118 | <button type="button" class="related_asset_remove" aria-label="Remove image"> |
| 106 | <%= icon("x", library: "tabler", "aria-hidden": true) %> | 119 | <%= icon("x", library: "tabler", "aria-hidden": true) %> |
| 107 | </button> | 120 | </button> |
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 890d46e..805fbc9 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb | |||
| @@ -41,7 +41,10 @@ | |||
| 41 | <div class="node_description">Resulting path</div> | 41 | <div class="node_description">Resulting path</div> |
| 42 | <div class="node_content"> | 42 | <div class="node_content"> |
| 43 | <span id="resulting_path">—</span> | 43 | <span id="resulting_path">—</span> |
| 44 | <button type="button" id="copy_resulting_path" class="unselected">copy</button> | 44 | <button type="button" id="copy_resulting_path" class="unselected copy_button" data-copy-target="#resulting_path"> |
| 45 | <span class="copy_button_label">copy</span> | ||
| 46 | </button> | ||
| 47 | |||
| 45 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> | 48 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> |
| 46 | </div> | 49 | </div> |
| 47 | 50 | ||
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index af05778..a7be3c6 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -254,11 +254,19 @@ | |||
| 254 | </div> | 254 | </div> |
| 255 | 255 | ||
| 256 | <% if @page.assets.images.any? %> | 256 | <% if @page.assets.images.any? %> |
| 257 | <% headline_asset_id = @page.related_assets.find_by(headline: true)&.asset_id %> | ||
| 257 | <div class="node_description">Images</div> | 258 | <div class="node_description">Images</div> |
| 258 | <div class="node_content node_info_group"> | 259 | <div class="node_content node_info_group"> |
| 259 | <ul class="thumbnail_list"> | 260 | <ul class="thumbnail_list"> |
| 260 | <% @page.assets.images.each do |asset| %> | 261 | <% @page.assets.images.each do |asset| %> |
| 261 | <li><%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %></li> | 262 | <li class="<%= "is_headline" if asset.id == headline_asset_id %>"> |
| 263 | <%= link_to image_tag(asset.upload.url(:thumb)), asset_path(asset) %> | ||
| 264 | <% if asset.id == headline_asset_id %> | ||
| 265 | <span class="headline_indicator" title="This page's headline image"> | ||
| 266 | <%= icon("star", library: "tabler", "aria-hidden": true) %> | ||
| 267 | </span> | ||
| 268 | <% end %> | ||
| 269 | </li> | ||
| 262 | <% end %> | 270 | <% end %> |
| 263 | </ul> | 271 | </ul> |
| 264 | </div> | 272 | </div> |
