Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reload the sidebar after each PJAX request
- Add a border radius, whiten the "guide page" - Extract organization actions into partial
- Loading branch information
Showing
10 changed files
with
85 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
$(document).pjax('a.organization-link', '#organization-content', {push: false} ); | ||
$(document).pjax('a.edit-link-pjax', '#organization-content', {push: false} ); | ||
$(document).pjax('a.organization-link', '#organization-content', {push: false}); | ||
$(document).pjax('a.edit-link-pjax', '#organization-content', {push: false}); | ||
|
||
$(document).on('submit', '#edit-form form', function(event) { | ||
$.pjax.submit(event, '#organization-content', {push: false}); | ||
$.pjax.submit(event, '#organization-content', {push: false}); | ||
}); | ||
|
||
$('#organization-content').on('pjax:success', function() { | ||
if (('.org-address').length >= 1 ){ | ||
displayMap($('.org-address').text()); | ||
} | ||
}) | ||
if (('.org-address').length >= 1 ) { | ||
displayMap($('.org-address').text()); | ||
} | ||
|
||
$.pjax.reload("#sidebar-pjax-container", { | ||
url: "/organizations/sidebar", | ||
push: false, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
body { | ||
background-color: $base-background-color; | ||
background-color: #F2F2F2; | ||
} | ||
|
||
.content { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="organization-actions organization-details-actions"> | ||
<%= link_to( | ||
"Edit", | ||
edit_organization_path(@organization), | ||
class: "edit-link-pjax", | ||
) %> | ||
<% if @organization.status == "pending" %> | ||
<%= link_to( | ||
"Approve", | ||
organization_path(@organization, organization: { status: "approved" }), | ||
class: "button edit-link-pjax", | ||
method: :put, | ||
) %> | ||
<% else %> | ||
<%= link_to( | ||
"Unapprove", | ||
organization_path(@organization, organization: { status: "pending" }), | ||
class: "button edit-link-pjax", | ||
method: :put, | ||
) %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sidebar.html.erb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="sidebar organization-sidebar"> | ||
<div class="organization-search"> | ||
<input type="search" /> | ||
</div> | ||
|
||
<% @organization_groups.each do |status, group| %> | ||
<div class="organization-category"%> | ||
<h2><%= status.titleize %> Records (<%= group.count %>)</h1> | ||
</div> | ||
|
||
<ul class="organization-list"> | ||
<% group.each do |organization| %> | ||
<%= content_tag(:li, class: "organization-listing organization-#{ | ||
organization.valid? ? "valid" : "invalid" | ||
}") do %> | ||
<%= link_to( | ||
organization.name, | ||
organization, | ||
remote: true, | ||
class: 'organization-link' | ||
) %> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters