forked from erlef/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added routes, controller, views, and templates for working groups, volunteers, wg chairs, and wg volunteers CRUD interfaces for use within the admin portion of the site. - Shortened/Renamed create/update/get/delete_working_group_* to create/update/get/delete_wg_* - Added created_by and updated_by columns on working groups, volunteers, working group volunteers to record the last person who modified a resource - Added the entire priv/plts dir to .gitignore - Added is_url?/1 to Erlef.Inputs - Added validate_email/2 and validate_url/2 to Erlef.Schema - Added Erlef.Context which includes helpers for context modules - Added audit/1 in ErlefWeb.controller/0 for extracting the member id from a conn in controllers - Added convention for requiring functions that mutate the database to be given an keyword list consisting of an audit k/v, where the value holds a member_id which can in turn be used to populate updated_by and created_by columns on a table. - Added Erlef.Admins.resource_counts/0 for fetching various resource counts from the database for use on the admin dashboard. - Shortened/Renamed create/update/get/delete_working_group_* to create/update/get/delete_wg_* - Renamed WorkingGroup.proposal and proposal_html to charter and charter_html - Removed all delete_* related functions in Erlef.Groups - Fixed up case form in Erlef.Agenda.get_combined/0 - Bring in datatables and toast-ui-editor as static resources (assets/static) - Remove rogue body tag in admin layout
- Loading branch information
Showing
48 changed files
with
1,663 additions
and
321 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
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,3 +1,11 @@ | ||
@import "../node_modules/bootstrap/dist/css/bootstrap.css"; | ||
@import "../node_modules/admin-lte/dist/css/adminlte.css"; | ||
@import "../node_modules/@fortawesome/fontawesome-free/css/all.css"; | ||
|
||
span.help-block { | ||
display: inline-block; | ||
margin-top: 0.5em; | ||
background-color: #ffc107; | ||
border-radius: 0.3em; | ||
padding: 0.3em; | ||
} |
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,31 @@ | ||
defmodule Erlef.Context do | ||
@moduledoc """ | ||
Context module helpers | ||
""" | ||
|
||
def audit_attrs(:create, params, audit) do | ||
case all_atoms_map?(params) do | ||
true -> | ||
params | ||
|> Map.put(:created_by, audit.member_id) | ||
|> Map.put(:updated_by, audit.member_id) | ||
|
||
false -> | ||
params | ||
|> Map.put("created_by", audit.member_id) | ||
|> Map.put("updated_by", audit.member_id) | ||
end | ||
end | ||
|
||
def audit_attrs(:update, params, audit) do | ||
case all_atoms_map?(params) do | ||
true -> | ||
Map.put(params, :updated_by, audit.member_id) | ||
|
||
false -> | ||
Map.put(params, "updated_by", audit.member_id) | ||
end | ||
end | ||
|
||
def all_atoms_map?(map), do: Enum.all?(Map.keys(map), &is_atom/1) | ||
end |
Oops, something went wrong.