<% end %>
diff --git a/app/views/admin/organizations/_form.html.erb b/app/views/admin/organizations/_form.html.erb
index 2af8ac8eb..aeae2bc7d 100644
--- a/app/views/admin/organizations/_form.html.erb
+++ b/app/views/admin/organizations/_form.html.erb
@@ -39,10 +39,25 @@ and renders all form fields for a resource's editable attributes.
<% end %>
- <% page.attributes.each do |attribute| -%>
-
- <%= render_field attribute, f: f %>
-
+ <% page.attributes(controller.action_name).each do |title, attributes| -%>
+
<% end -%>
diff --git a/app/views/admin/organizations/edit.html.erb b/app/views/admin/organizations/edit.html.erb
index abacffce4..6c7484551 100644
--- a/app/views/admin/organizations/edit.html.erb
+++ b/app/views/admin/organizations/edit.html.erb
@@ -17,7 +17,7 @@ It displays a header, and renders the `_form` partial to do the heavy lifting.
<% content_for(:title) { t("administrate.actions.edit_resource", name: page.page_title) } %>
-
+
<%= content_for(:title) %>
@@ -27,7 +27,7 @@ It displays a header, and renders the `_form` partial to do the heavy lifting.
t("administrate.actions.show_resource", name: page.page_title),
[namespace, page.resource],
class: "button",
- ) if valid_action?(:show) && show_action?(:show, page.resource) %>
+ ) if accessible_action?(page.resource, :show) %>
diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb
index 89d8dcf31..21a8e013d 100644
--- a/app/views/admin/organizations/index.html.erb
+++ b/app/views/admin/organizations/index.html.erb
@@ -58,5 +58,6 @@ It renders the `_table` partial to display details about the resources.
resources: resources,
table_title: "page-title"
) %>
- <%= paginate resources, param_name: '_page' %>
+
+ <%= render("pagination", resources: resources) %>
diff --git a/app/views/admin/organizations/new.html.erb b/app/views/admin/organizations/new.html.erb
index d90cc6800..adacff316 100644
--- a/app/views/admin/organizations/new.html.erb
+++ b/app/views/admin/organizations/new.html.erb
@@ -22,7 +22,7 @@ to do the heavy lifting.
) %>
<% end %>
-
+
<%= content_for(:title) %>
diff --git a/app/views/admin/organizations/show.html.erb b/app/views/admin/organizations/show.html.erb
index 282c41b76..8cfa51f53 100644
--- a/app/views/admin/organizations/show.html.erb
+++ b/app/views/admin/organizations/show.html.erb
@@ -18,7 +18,7 @@ as well as a link to its edit page.
<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %>
-
+
<%= content_for(:title) %>
@@ -27,28 +27,39 @@ as well as a link to its edit page.
<%= link_to(
t("administrate.actions.edit_resource", name: page.page_title),
[:edit, namespace, page.resource],
- class: "button",
- ) if valid_action?(:edit) && show_action?(:edit, page.resource) %>
+ class: "button mt-2",
+ ) if accessible_action?(page.resource, :edit) %>
+
+ <%= link_to(
+ t("administrate.actions.destroy"),
+ [namespace, page.resource],
+ class: "button button--danger mt-2",
+ method: :delete,
+ data: { confirm: t("administrate.actions.confirm") }
+ ) if accessible_action?(page.resource, :destroy) %>
- <% end -%>
+ <% page.attributes.each do |title, attributes| %>
+
<% end %>
diff --git a/app/views/admin/services/_collection.html.erb b/app/views/admin/services/_collection.html.erb
index 1a3915eff..fafe8b01f 100644
--- a/app/views/admin/services/_collection.html.erb
+++ b/app/views/admin/services/_collection.html.erb
@@ -24,17 +24,17 @@ to display a collection of resources in an HTML table.
<% collection_presenter.attribute_types.each do |attr_name, attr_type| %>
<% end %>
diff --git a/app/views/admin/services/_form.html.erb b/app/views/admin/services/_form.html.erb
index 944b77ae7..8186ebf90 100644
--- a/app/views/admin/services/_form.html.erb
+++ b/app/views/admin/services/_form.html.erb
@@ -33,10 +33,25 @@ and renders all form fields for a resource's editable attributes.
<% end %>
- <% page.attributes.each do |attribute| -%>
-
- <%= render_field attribute, f: f %>
-
+ <% page.attributes(controller.action_name).each do |title, attributes| -%>
+
<% end -%>
diff --git a/app/views/admin/services/index.html.erb b/app/views/admin/services/index.html.erb
index cd956b8a5..b4754b9d3 100644
--- a/app/views/admin/services/index.html.erb
+++ b/app/views/admin/services/index.html.erb
@@ -23,34 +23,14 @@ It renders the `_table` partial to display details about the resources.
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection
%>
-<% content_for(:title) do %>
- <%= display_resource_name(page.resource_name) %>
-<% end %>
-
-
-
-
+<%=
+ render("index_header",
+ resources: resources,
+ search_term: search_term,
+ page: page,
+ show_search_bar: show_search_bar,
+ )
+%>
<%= render(
@@ -62,5 +42,5 @@ It renders the `_table` partial to display details about the resources.
table_title: "page-title"
) %>
- <%= paginate resources, param_name: '_page' %>
+ <%= render("pagination", resources: resources) %>
diff --git a/app/views/admin/services/new.html.erb b/app/views/admin/services/new.html.erb
index d90cc6800..adacff316 100644
--- a/app/views/admin/services/new.html.erb
+++ b/app/views/admin/services/new.html.erb
@@ -22,7 +22,7 @@ to do the heavy lifting.
) %>
<% end %>
-
+
<%= content_for(:title) %>
diff --git a/app/views/admin/services/show.html.erb b/app/views/admin/services/show.html.erb
index 2e860e39c..7a7d26541 100644
--- a/app/views/admin/services/show.html.erb
+++ b/app/views/admin/services/show.html.erb
@@ -18,7 +18,7 @@ as well as a link to its edit page.
<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %>
-
+
<%= content_for(:title) %>
@@ -28,22 +28,38 @@ as well as a link to its edit page.
t("administrate.actions.edit_resource", name: page.page_title),
[:edit, namespace, page.resource],
class: "button",
- ) if valid_action?(:edit) && show_action?(:edit, page.resource) %>
+ ) if accessible_action?(page.resource, :edit) %>
+
+ <%= link_to(
+ t("administrate.actions.destroy"),
+ [namespace, page.resource],
+ class: "button button--danger",
+ method: :delete,
+ data: { confirm: t("administrate.actions.confirm") }
+ ) if accessible_action?(page.resource, :destroy) %>
+ <% page.attributes.each do |title, attributes| %>
+
<% end %>
diff --git a/app/views/fields/has_one/_form.html.erb b/app/views/fields/has_one/_form.html.erb
index 8bdfa53ee..01bd843d0 100644
--- a/app/views/fields/has_one/_form.html.erb
+++ b/app/views/fields/has_one/_form.html.erb
@@ -18,11 +18,21 @@ The form will be rendered as nested_from to parent relationship.
<%= f.fields_for field.attribute, field.data || field.nested_form.resource.class.new do |has_one_f| %>
<% end %>
diff --git a/app/views/fields/has_one/_index.html.erb b/app/views/fields/has_one/_index.html.erb
index e6fc01a44..4ff3ad174 100644
--- a/app/views/fields/has_one/_index.html.erb
+++ b/app/views/fields/has_one/_index.html.erb
@@ -16,7 +16,8 @@ By default, the relationship is rendered as a link to the associated object.
%>
<% if field.linkable? %>
- <%= link_to(
+ <%= link_to_if(
+ accessible_action?(field.data, :show),
field.display_associated_resource,
[namespace, field.data],
) %>
diff --git a/app/views/fields/has_one/_show.html.erb b/app/views/fields/has_one/_show.html.erb
index a4b3dc5fe..b8636f6ef 100644
--- a/app/views/fields/has_one/_show.html.erb
+++ b/app/views/fields/has_one/_show.html.erb
@@ -18,23 +18,30 @@ All show page attributes of has_one relationship would be rendered
<% if field.linkable? %>
- <% field.nested_show.attributes.each do |attribute| -%>
-
<% end %>
diff --git a/config/clock.rb b/config/clock.rb
index 28f0b3b7c..abf0bfa45 100644
--- a/config/clock.rb
+++ b/config/clock.rb
@@ -23,7 +23,7 @@ module Clockwork
end
end
- every(3.hours, "Fetch Instagram Media Posts") do
- Instagram::FetchMediaPostsJob.perform_later
- end
+ # every(3.hours, "Fetch Instagram Media Posts") do
+ # Instagram::FetchMediaPostsJob.perform_later
+ # end
end