New search for members + contacts on list + csv export
This commit is contained in:
parent
8044cb975a
commit
e6c698c98d
5 changed files with 133 additions and 271 deletions
|
|
@ -1,17 +1,18 @@
|
||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.readonly.ch/bouzoure/pop-camarades/helpers"
|
"git.readonly.ch/bouzoure/pop-camarades/helpers"
|
||||||
|
"git.readonly.ch/bouzoure/pop-camarades/helpers/database"
|
||||||
"git.readonly.ch/bouzoure/pop-camarades/models"
|
"git.readonly.ch/bouzoure/pop-camarades/models"
|
||||||
|
"github.com/charmbracelet/log"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Contacts(c *fiber.Ctx) error {
|
func Contacts(c *fiber.Ctx) error {
|
||||||
|
|
@ -46,131 +47,53 @@ func Contacts(c *fiber.Ctx) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
filterSection := c.Query("se")
|
searchJSON := c.Query("s")
|
||||||
filterArchive := c.Query("a")
|
var params database.PeopleSearchParams
|
||||||
filterSearch := c.Query("s")
|
|
||||||
|
|
||||||
sqlFilterSections := allowedSections
|
if len(searchJSON) > 0 {
|
||||||
sqlFilterAppend := "IS NULL"
|
err = json.Unmarshal([]byte(searchJSON), ¶ms)
|
||||||
if filterArchive == "1" {
|
if err != nil {
|
||||||
sqlFilterAppend = "IS NOT NULL"
|
log.Warn(err)
|
||||||
sqlFilterSections = allowedSectionsArchived
|
searchJSON = ""
|
||||||
}
|
|
||||||
|
|
||||||
var filterSectionUint uint
|
|
||||||
if len(filterSection) > 0 {
|
|
||||||
filterSectionUint64, err := strconv.ParseUint(filterSection, 10, 0)
|
|
||||||
if err == nil {
|
|
||||||
for _, s := range sqlFilterSections {
|
|
||||||
if s == uint(filterSectionUint64) {
|
|
||||||
filterSectionUint = uint(filterSectionUint64)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if filterSectionUint > 0 {
|
params.PageNumber, _ = strconv.Atoi(c.Query("p"))
|
||||||
sqlFilterAppend = fmt.Sprintf(
|
params.PageSize = 50
|
||||||
"%s AND section_id = %d",
|
params.PersonType = "contacts"
|
||||||
sqlFilterAppend,
|
|
||||||
filterSectionUint,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
var sqlFilterSearch string
|
|
||||||
if len(filterSearch) > 0 {
|
|
||||||
sqlFilterSearch = fmt.Sprintf(
|
|
||||||
"%%%s%%", filterSearch,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
var count int64
|
|
||||||
if len(filterSearch) > 0 {
|
|
||||||
db.Model(&models.Person{}).Where(
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND (first_name LIKE ? OR last_name LIKE ?) AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, allowedSections, sqlFilterSearch, sqlFilterSearch,
|
|
||||||
).Count(&count)
|
|
||||||
} else {
|
|
||||||
db.Model(&models.Person{}).Where(
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, allowedSections,
|
|
||||||
).Count(&count)
|
|
||||||
}
|
|
||||||
|
|
||||||
page, _ := strconv.Atoi(c.Query("p"))
|
|
||||||
pagination := helpers.Paginate(50, int(count), page)
|
|
||||||
|
|
||||||
var people []models.Person
|
|
||||||
if len(filterSearch) > 0 {
|
|
||||||
result := db.Unscoped().Offset(
|
|
||||||
pagination.Offset,
|
|
||||||
).Limit(
|
|
||||||
pagination.PageSize,
|
|
||||||
).Order(
|
|
||||||
"concat(last_name, first_name) collate nocase asc",
|
|
||||||
).Preload(
|
|
||||||
"Section",
|
|
||||||
).Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND (first_name LIKE ? OR last_name LIKE ?) AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections, sqlFilterSearch, sqlFilterSearch,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result := db.Unscoped().Offset(
|
|
||||||
pagination.Offset,
|
|
||||||
).Limit(
|
|
||||||
pagination.PageSize,
|
|
||||||
).Order(
|
|
||||||
"concat(last_name, first_name) collate nocase asc",
|
|
||||||
).Preload(
|
|
||||||
"Section",
|
|
||||||
).Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var sections []models.Section
|
var sections []models.Section
|
||||||
db.Order(
|
db.Order("name collate nocase asc").Find(§ions, "contains_contacts = ? AND id IN ?", true, allowedSections)
|
||||||
"name collate nocase asc",
|
params.AllowedSections = allowedSections
|
||||||
).Find(
|
|
||||||
§ions,
|
// Security for active contacts
|
||||||
"contains_contacts = ? AND id IN ?",
|
if !permShow {
|
||||||
true, sqlFilterSections,
|
params.Active = false
|
||||||
)
|
}
|
||||||
|
|
||||||
|
// Security for archived contacts
|
||||||
|
if !permShowArchived {
|
||||||
|
params.Archive = false
|
||||||
|
}
|
||||||
|
|
||||||
|
results, err := database.PeopleSearch(params)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var fields []models.Field
|
||||||
|
db.Order("position asc").Find(&fields, "person_type = ?", "contact")
|
||||||
|
|
||||||
return c.Render("people", fiber.Map{
|
return c.Render("people", fiber.Map{
|
||||||
"PageTitle": "Contacts",
|
"PageTitle": "Contacts",
|
||||||
"MembersPage": false,
|
"MembersPage": false,
|
||||||
"People": people,
|
"People": results.Results,
|
||||||
"Pagination": pagination,
|
"Pagination": results.Pagination,
|
||||||
"PermShow": permShow,
|
"PermShow": permShow,
|
||||||
"PermShowArchived": permShowArchived,
|
"PermShowArchived": permShowArchived,
|
||||||
|
"SearchJSON": searchJSON,
|
||||||
"Sections": sections,
|
"Sections": sections,
|
||||||
"FilterArchive": filterArchive,
|
"Fields": fields,
|
||||||
"FilterSection": filterSectionUint,
|
|
||||||
"FilterSearch": filterSearch,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,76 +129,38 @@ func ContactsExport(c *fiber.Ctx) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
filterSection := c.Query("se")
|
searchJSON := c.Query("s")
|
||||||
filterArchive := c.Query("a")
|
var params database.PeopleSearchParams
|
||||||
filterSearch := c.Query("s")
|
|
||||||
|
|
||||||
sqlFilterSections := allowedSections
|
if len(searchJSON) > 0 {
|
||||||
sqlFilterAppend := "IS NULL"
|
err = json.Unmarshal([]byte(searchJSON), ¶ms)
|
||||||
if filterArchive == "1" {
|
if err != nil {
|
||||||
sqlFilterAppend = "IS NOT NULL"
|
log.Warn(err)
|
||||||
sqlFilterSections = allowedSectionsArchived
|
searchJSON = ""
|
||||||
}
|
|
||||||
|
|
||||||
var filterSectionUint uint
|
|
||||||
if len(filterSection) > 0 {
|
|
||||||
filterSectionUint64, err := strconv.ParseUint(filterSection, 10, 0)
|
|
||||||
if err == nil {
|
|
||||||
for _, s := range sqlFilterSections {
|
|
||||||
if s == uint(filterSectionUint64) {
|
|
||||||
filterSectionUint = uint(filterSectionUint64)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if filterSectionUint > 0 {
|
params.PageSize = 0
|
||||||
sqlFilterAppend = fmt.Sprintf(
|
params.PersonType = "members"
|
||||||
"%s AND section_id = %d",
|
|
||||||
sqlFilterAppend,
|
var sections []models.Section
|
||||||
filterSectionUint,
|
db.Order("name collate nocase asc").Find(§ions, "contains_members = ? AND id IN ?", true, allowedSections)
|
||||||
)
|
params.AllowedSections = allowedSections
|
||||||
|
|
||||||
|
// Security for active contacts
|
||||||
|
if !permShow {
|
||||||
|
params.Active = false
|
||||||
}
|
}
|
||||||
|
|
||||||
var sqlFilterSearch string
|
// Security for archived contacts
|
||||||
if len(filterSearch) > 0 {
|
if !permShowArchived {
|
||||||
sqlFilterSearch = fmt.Sprintf(
|
params.Archive = false
|
||||||
"%%%s%%", filterSearch,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var people []models.Person
|
results, err := database.PeopleSearch(params)
|
||||||
if len(filterSearch) > 0 {
|
if err != nil {
|
||||||
result := db.Unscoped().Order(
|
|
||||||
"last_name collate nocase asc, first_name collate nocase asc",
|
|
||||||
).Preload("Section").Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND (first_name LIKE ? OR last_name LIKE ?) AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections, sqlFilterSearch, sqlFilterSearch,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
result := db.Unscoped().Order(
|
|
||||||
"last_name collate nocase asc, first_name collate nocase asc",
|
|
||||||
).Preload("Section").Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_contact = ? AND section_id IN ? AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var fields []models.Field
|
var fields []models.Field
|
||||||
db.Order("position asc").Preload(
|
db.Order("position asc").Preload(
|
||||||
|
|
@ -324,7 +209,7 @@ func ContactsExport(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, person := range people {
|
for _, person := range results.Results {
|
||||||
c.Writef("\"%s\";", person.FirstName)
|
c.Writef("\"%s\";", person.FirstName)
|
||||||
c.Writef("\"%s\";", person.LastName)
|
c.Writef("\"%s\";", person.LastName)
|
||||||
c.Writef("\"%s\";", person.Email)
|
c.Writef("\"%s\";", person.Email)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -11,9 +10,9 @@ import (
|
||||||
"git.readonly.ch/bouzoure/pop-camarades/helpers"
|
"git.readonly.ch/bouzoure/pop-camarades/helpers"
|
||||||
"git.readonly.ch/bouzoure/pop-camarades/helpers/database"
|
"git.readonly.ch/bouzoure/pop-camarades/helpers/database"
|
||||||
"git.readonly.ch/bouzoure/pop-camarades/models"
|
"git.readonly.ch/bouzoure/pop-camarades/models"
|
||||||
|
"github.com/charmbracelet/log"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PersonValidation struct {
|
type PersonValidation struct {
|
||||||
|
|
@ -82,6 +81,16 @@ func Members(c *fiber.Ctx) error {
|
||||||
db.Order("name collate nocase asc").Find(§ions, "contains_members = ? AND id IN ?", true, allowedSections)
|
db.Order("name collate nocase asc").Find(§ions, "contains_members = ? AND id IN ?", true, allowedSections)
|
||||||
params.AllowedSections = allowedSections
|
params.AllowedSections = allowedSections
|
||||||
|
|
||||||
|
// Security for active contacts
|
||||||
|
if !permShow {
|
||||||
|
params.Active = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Security for archived contacts
|
||||||
|
if !permShowArchived {
|
||||||
|
params.Archive = false
|
||||||
|
}
|
||||||
|
|
||||||
results, err := database.PeopleSearch(params)
|
results, err := database.PeopleSearch(params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -135,76 +144,38 @@ func MembersExport(c *fiber.Ctx) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
filterSection := c.Query("se")
|
searchJSON := c.Query("s")
|
||||||
filterArchive := c.Query("a")
|
var params database.PeopleSearchParams
|
||||||
filterSearch := c.Query("s")
|
|
||||||
|
|
||||||
sqlFilterSections := allowedSections
|
if len(searchJSON) > 0 {
|
||||||
sqlFilterAppend := "IS NULL"
|
err = json.Unmarshal([]byte(searchJSON), ¶ms)
|
||||||
if filterArchive == "1" {
|
if err != nil {
|
||||||
sqlFilterAppend = "IS NOT NULL"
|
log.Warn(err)
|
||||||
sqlFilterSections = allowedSectionsArchived
|
searchJSON = ""
|
||||||
}
|
|
||||||
|
|
||||||
var filterSectionUint uint
|
|
||||||
if len(filterSection) > 0 {
|
|
||||||
filterSectionUint64, err := strconv.ParseUint(filterSection, 10, 0)
|
|
||||||
if err == nil {
|
|
||||||
for _, s := range sqlFilterSections {
|
|
||||||
if s == uint(filterSectionUint64) {
|
|
||||||
filterSectionUint = uint(filterSectionUint64)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if filterSectionUint > 0 {
|
params.PageSize = 0
|
||||||
sqlFilterAppend = fmt.Sprintf(
|
params.PersonType = "members"
|
||||||
"%s AND section_id = %d",
|
|
||||||
sqlFilterAppend,
|
var sections []models.Section
|
||||||
filterSectionUint,
|
db.Order("name collate nocase asc").Find(§ions, "contains_members = ? AND id IN ?", true, allowedSections)
|
||||||
)
|
params.AllowedSections = allowedSections
|
||||||
|
|
||||||
|
// Security for active contacts
|
||||||
|
if !permShow {
|
||||||
|
params.Active = false
|
||||||
}
|
}
|
||||||
|
|
||||||
var sqlFilterSearch string
|
// Security for archived contacts
|
||||||
if len(filterSearch) > 0 {
|
if !permShowArchived {
|
||||||
sqlFilterSearch = fmt.Sprintf(
|
params.Archive = false
|
||||||
"%%%s%%", filterSearch,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var people []models.Person
|
results, err := database.PeopleSearch(params)
|
||||||
if len(filterSearch) > 0 {
|
if err != nil {
|
||||||
result := db.Unscoped().Order(
|
|
||||||
"last_name collate nocase asc, first_name collate nocase asc",
|
|
||||||
).Preload("Section").Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_member = ? AND section_id IN ? AND (first_name LIKE ? OR last_name LIKE ?) AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections, sqlFilterSearch, sqlFilterSearch,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
result := db.Unscoped().Order(
|
|
||||||
"last_name collate nocase asc, first_name collate nocase asc",
|
|
||||||
).Preload("Section").Find(
|
|
||||||
&people,
|
|
||||||
fmt.Sprintf(
|
|
||||||
"is_member = ? AND section_id IN ? AND deleted_at %s",
|
|
||||||
sqlFilterAppend,
|
|
||||||
),
|
|
||||||
true, sqlFilterSections,
|
|
||||||
)
|
|
||||||
|
|
||||||
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var fields []models.Field
|
var fields []models.Field
|
||||||
db.Order("position asc").Preload(
|
db.Order("position asc").Preload(
|
||||||
|
|
@ -253,7 +224,7 @@ func MembersExport(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, person := range people {
|
for _, person := range results.Results {
|
||||||
c.Writef("\"%s\";", person.FirstName)
|
c.Writef("\"%s\";", person.FirstName)
|
||||||
c.Writef("\"%s\";", person.LastName)
|
c.Writef("\"%s\";", person.LastName)
|
||||||
c.Writef("\"%s\";", person.Email)
|
c.Writef("\"%s\";", person.Email)
|
||||||
|
|
|
||||||
|
|
@ -45,15 +45,7 @@ func PeopleSearch(params PeopleSearchParams) (PeopleSearchResults, error) {
|
||||||
|
|
||||||
// SQL qeury for results
|
// SQL qeury for results
|
||||||
sqlQuery := `--sql
|
sqlQuery := `--sql
|
||||||
SELECT people.id,
|
SELECT people.*,
|
||||||
people.is_member,
|
|
||||||
people.is_contact,
|
|
||||||
people.first_name,
|
|
||||||
people.last_name,
|
|
||||||
people.address1,
|
|
||||||
people.postal_code,
|
|
||||||
people.city,
|
|
||||||
people.section_id,
|
|
||||||
sections.name AS Section__name
|
sections.name AS Section__name
|
||||||
FROM people
|
FROM people
|
||||||
INNER JOIN sections
|
INNER JOIN sections
|
||||||
|
|
@ -328,6 +320,16 @@ func PeopleSearch(params PeopleSearchParams) (PeopleSearchResults, error) {
|
||||||
params.PageNumber,
|
params.PageNumber,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var sqlPagination string
|
||||||
|
if params.PageSize > 0 {
|
||||||
|
sqlPagination = `--sql
|
||||||
|
LIMIT @pagination_limit
|
||||||
|
OFFSET @pagination_offset
|
||||||
|
`
|
||||||
|
sqlParams = append(sqlParams, sql.Named("pagination_limit", results.Pagination.PageSize))
|
||||||
|
sqlParams = append(sqlParams, sql.Named("pagination_offset", results.Pagination.Offset))
|
||||||
|
}
|
||||||
|
|
||||||
// Build and run paginated result query
|
// Build and run paginated result query
|
||||||
sqlQuery = fmt.Sprintf(`--sql
|
sqlQuery = fmt.Sprintf(`--sql
|
||||||
%s
|
%s
|
||||||
|
|
@ -335,12 +337,8 @@ func PeopleSearch(params PeopleSearchParams) (PeopleSearchResults, error) {
|
||||||
%s
|
%s
|
||||||
GROUP BY people.id
|
GROUP BY people.id
|
||||||
ORDER BY CONCAT(people.last_name, people.first_name) COLLATE NOCASE ASC
|
ORDER BY CONCAT(people.last_name, people.first_name) COLLATE NOCASE ASC
|
||||||
LIMIT @pagination_limit
|
%s
|
||||||
OFFSET @pagination_offset
|
`, sqlQuery, sqlFieldJoins, sqlFilters, sqlPagination)
|
||||||
`, sqlQuery, sqlFieldJoins, sqlFilters)
|
|
||||||
|
|
||||||
sqlParams = append(sqlParams, sql.Named("pagination_limit", results.Pagination.PageSize))
|
|
||||||
sqlParams = append(sqlParams, sql.Named("pagination_offset", results.Pagination.Offset))
|
|
||||||
|
|
||||||
sqlResult := db.Raw(sqlQuery, sqlParams...).Scan(&results.Results)
|
sqlResult := db.Raw(sqlQuery, sqlParams...).Scan(&results.Results)
|
||||||
if sqlResult.Error != nil {
|
if sqlResult.Error != nil {
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,10 @@ function search() {
|
||||||
|
|
||||||
fields = {}
|
fields = {}
|
||||||
$("[data-optional-field]:not(:disabled)").each(function() {
|
$("[data-optional-field]:not(:disabled)").each(function() {
|
||||||
|
if (!advancedSearch) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var index = $(this).attr("data-optional-field");
|
var index = $(this).attr("data-optional-field");
|
||||||
var value = $(this).val();
|
var value = $(this).val();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,15 +67,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6 col-lg-3 mb-3 pt-3">
|
<div class="col-sm-6 col-lg-3 mb-3 pt-3">
|
||||||
|
|
||||||
|
{% if PermShow %}
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input class="form-check-input" type="checkbox" role="switch" data-search-field="active" data-search-advanced="false" id="active" checked>
|
<input class="form-check-input" type="checkbox" role="switch" data-search-field="active" data-search-advanced="false" id="active" checked>
|
||||||
{% if MembersPage %}
|
{% if MembersPage %}
|
||||||
<label class="form-check-label" for="active">Afficher membres actifs</label>
|
<label class="form-check-label" for="active">Afficher membres actifs</label>
|
||||||
{% else %}
|
{% else %}
|
||||||
<label class="form-check-label" for="active">Afficher contactss actifs</label>
|
<label class="form-check-label" for="active">Afficher contacts actifs</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if PermShowArchived %}
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input class="form-check-input" type="checkbox" role="switch" data-search-field="archive" data-search-advanced="false" id="archive">
|
<input class="form-check-input" type="checkbox" role="switch" data-search-field="archive" data-search-advanced="false" id="archive">
|
||||||
{% if MembersPage %}
|
{% if MembersPage %}
|
||||||
|
|
@ -84,6 +87,7 @@
|
||||||
<label class="form-check-label" for="archive">Afficher contacts archivés</label>
|
<label class="form-check-label" for="archive">Afficher contacts archivés</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue