Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
ec1993e3
Commit
ec1993e3
authored
Feb 20, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autocomplete for keywords and hashtags via ajax with /api/aggs?field=...
parent
bee9be79
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
322 deletions
+119
-322
main.py
services/main.py
+14
-2
comex_user.css
static/css/comex_user.css
+43
-0
comex_user_autocompletes.js
static/js/comex_user_autocompletes.js
+62
-320
No files found.
services/main.py
View file @
ec1993e3
...
...
@@ -194,8 +194,20 @@ def aggs_api():
API to read DB aggregation data (ex: for autocompletes)
"""
if
'field'
in
request
.
args
:
# field name itself is tested by db module
result
=
db
.
get_field_aggs
(
request
.
args
[
'field'
])
hap_thresh
=
None
if
'hapax'
in
request
.
args
:
try
:
hap_thresh
=
int
(
request
.
args
[
'hapax'
])
print
(
"new hap_thresh"
,
hap_thresh
)
except
:
pass
if
hap_thresh
is
not
None
:
# field name itself is tested by db module
result
=
db
.
get_field_aggs
(
request
.
args
[
'field'
],
hapax_threshold
=
hap_thresh
)
else
:
result
=
db
.
get_field_aggs
(
request
.
args
[
'field'
])
return
dumps
(
result
)
else
:
raise
TypeError
(
"aggs API query is missing 'field' argument"
)
...
...
static/css/comex_user.css
View file @
ec1993e3
...
...
@@ -333,3 +333,46 @@ input.is-realperson {
#btn-midname
{
opacity
:
.8
;
}
.ui-menu-item
{
color
:
#337AB7
!important
;
font-family
:
"Droid Sans"
,
Calibri
,
"Helvetica Neue"
,
Helvetica
,
sans-serif
;
letter-spacing
:
normal
;
}
.ui-menu-item
:hover
{
color
:
#fff
!important
;
font-weight
:
bold
!important
;
}
/*.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
margin: 2px 0 0 0;
list-style: none;
background-color: #ffffff;
border-color: #ccc;
border-color: rgba(0, 0, 0, 0.2);
border-style: solid;
border-width: 1px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
}*/
static/js/comex_user_autocompletes.js
View file @
ec1993e3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment