Skip to content

Commit

Permalink
Make nonprofits admin views translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
jvBatista committed Jun 6, 2023
1 parent f10e50b commit bba6a5f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 17 deletions.
34 changes: 24 additions & 10 deletions app/views/nonprofits/_admin_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
# Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE -%>
<div class='modal sidebar u-padding--15 superAdminSidebar' id='adminSidebar--profile'>
<p>
<a class='button--tiny details' href='<%= nonprofits_donations_path(@nonprofit) %>'>Donations</a>
<a class='button--tiny details' href='<%= nonprofits_supporters_path(@nonprofit) %>'>Supporters</a>
<a class='button--tiny details' href='<%= nonprofits_donations_path(@nonprofit) %>'>
<%= t('nonprofits.page.admin_sidebar.donations') %>
</a>
<a class='button--tiny details' href='<%= nonprofits_supporters_path(@nonprofit) %>'>
<%= t('nonprofits.page.admin_sidebar.supporters') %>
</a>
</p>
<hr>
<% if @nonprofit.billing_plan.nil? %>
<p><strong>Upgrade to:</strong></p>
<p><strong><%= t('nonprofits.page.admin_sidebar.upgrade_to') %>:</strong></p>
<table class='table--plaid'>
<tr>
<td><%= link_to "Discount", nonprofit_pricing_index_path(@nonprofit.id, {referrer: 'community'}) %></td>
Expand All @@ -19,22 +23,28 @@
<% end %>
<form autosubmit action='<%= nonprofit_path(@nonprofit) %>' method='put' parsley-validate>
<p><strong>Status: </strong></p>
<p><strong><%= t('nonprofits.page.admin_sidebar.status') %>: </strong></p>
<p class='u-marginBottom--10'>
<input type='hidden' name='nonprofit[vetted]' value='0'>
<input type='checkbox' name='nonprofit[vetted]' id='nonprofit-verified-input' <%= @nonprofit.vetted ? "checked=checked" : '' %> value='1'>
<label class='u-marginRight--20' for='nonprofit-verified-input'>Vetted</label>
<label class='u-marginRight--20' for='nonprofit-verified-input'>
<%= t('nonprofits.page.admin_sidebar.vetted') %>
</label>
<input type='hidden' name='nonprofit[published]' value='0'>
<input type='checkbox' name='nonprofit[published]' id='nonprofit-published-input' <%= @nonprofit.published ? "checked=checked" : '' %> value='1'>
<label for='nonprofit-published-input'>Published</label>
<label for='nonprofit-published-input'>
<%= t('nonprofits.page.admin_sidebar.published') %>
</label>
</p>
<button type='submit' class='button--tiny' data-loading='Saving...'>Save status</button>
<button type='submit' class='button--tiny' data-loading='Saving...'>
<%= t('nonprofits.page.admin_sidebar.save_status') %>
</button>
</form>
<hr>
<p><strong>Nonprofit Users:</strong></p>
<p><strong><%= t('nonprofits.page.admin_sidebar.nonprofit_users') %>:</strong></p>
<ul>
<% @nonprofit.roles.includes(:host).where(name: [:nonprofit_admin, :nonprofit_associate]).includes(:user).each do |role| %>
<li class='removeNpoUser'>
Expand All @@ -59,14 +69,18 @@
<% end %>
</ul>
<p><button class='button--tiny' open-modal='newRole'>New Admin</button></p>
<p><button class='button--tiny' open-modal='newRole'>
<%= t('nonprofits.page.admin_sidebar.new_admin') %>
</button></p>
<% if @nonprofit.charges.empty? %>
<hr>
<form autosubmit action='<%= nonprofit_path(@nonprofit) %>' method='delete'
data-confirm data-redirect="/admin">
<input type='hidden' name='required_input'>
<button type="submit" class='button--tiny red' data-loading='Deleting...'>Destroy Nonprofit</button>
<button type="submit" class='button--tiny red' data-loading='Deleting...'>
<%= t('nonprofits.page.admin_sidebar.destroy_nonprofit') %>
</button>
</form>
<% end %>

Expand Down
12 changes: 6 additions & 6 deletions app/views/nonprofits/_admin_top_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
<section class='admin-topNav tour-admin'>
<div class='container u-centered'>
<p><strong>Manage Profile Page</strong></p>
<p><strong><%= t('nonprofits.page.admin_top_nav.manage_profile') %></strong></p>
<a class='button--small edit'>
<!--= on 'click' (open_modal 'settingsModal') -->
<i class='fa fa-gear'></i> Settings
<i class='fa fa-gear'></i> <%= t('nonprofits.page.admin_top_nav.settings') %>
</a>
<a class='button--small edit'>
<!--= on 'click' (open_modal 'uploadBackgroundImage') -->
<i class='fa fa-image'></i> Header Image
<i class='fa fa-image'></i> <%= t('nonprofits.page.admin_top_nav.header_image') %>
</a>
<a class='button--small edit'>
<!--= on 'click' (open_modal 'uploadCarouselImages') -->
<i class='fa fa-image'></i> Main image
<i class='fa fa-image'></i> <%= t('nonprofits.page.admin_top_nav.main_image') %>
</a>
<a class='button--tiny edit' href='?preview=t'>
<i class='fa fa-eye'></i> Preview Mode
<i class='fa fa-eye'></i> <%= t('nonprofits.page.admin_top_nav.preview_mode') %>
</a>
<% if current_role?(:super_admin) %>
<p><i class='icon icon-pacman-ghost'></i> For super admin:
<p><i class='icon icon-pacman-ghost'></i> <%= t('nonprofits.page.admin_top_nav.for_super_admin') %>:
NPO ID: <%= @nonprofit.id %>
</p>
<% end %>
Expand Down
20 changes: 19 additions & 1 deletion config/locales/en/nonprofits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,22 @@ en:
actions:
start_campaign: Start a Campaign
start_campaign_for: "Start a Campaign for %{nonprofit_name}"
create_event: Create an Event
create_event: Create an Event
admin_sidebar:
donations: Donations
supporters: Supporters
upgrade_to: Upgrade to
status: Status
vetted: Vetted
published: Published
save_status: Save status
nonprofit_users: Nonprofit Users
new_admin: New Admin
destroy_nonprofit: Destroy Nonprofit
admin_top_nav:
manage_profile: Manage Profile Page
settings: Settings
header_image: Header Image
main_image: Main Image
preview_mode: Preview Mode
for_super_admin: For super admin

0 comments on commit bba6a5f

Please sign in to comment.