Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
c34875f3
Commit
c34875f3
authored
9 years ago
by
Mateus Rambo Strey
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.c3sl.ufpr.br:portalmec/portalmec
parents
c070dcea
cc42a1ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/assets/javascripts/application/search.js
+18
-30
18 additions, 30 deletions
app/assets/javascripts/application/search.js
app/views/shared/application/_search.erb
+1
-1
1 addition, 1 deletion
app/views/shared/application/_search.erb
with
19 additions
and
31 deletions
app/assets/javascripts/application/search.js
+
18
−
30
View file @
c34875f3
...
...
@@ -470,40 +470,28 @@ var runDropdown = function(element) {
};
var
getElementsNumber
=
function
(
className
)
{
$
.
ajax
({
url
:
'
/search/get_class_size
'
,
data
:
{
class
:
className
},
dataType
:
"
json
"
,
success
:
function
(
data
)
{
switch
(
className
)
{
case
'
LearningObject
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
data
.
number
+
"
conteúdos
"
);
break
;
case
'
Collection
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
data
.
number
+
"
coleções
"
);
break
;
case
'
User
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
data
.
number
+
"
usuários
"
);
break
;
default
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar conteúdo
"
);
}
},
error
:
function
()
{
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar conteúdo
"
);
}
});
};
$
(
document
).
ready
(
function
(){
getElementsNumber
(
'
LearningObject
'
);
var
lo_num
=
$
(
'
.search-input input
'
).
attr
(
"
data-lo
"
);
var
collection_num
=
$
(
'
.search-input input
'
).
attr
(
"
data-collection
"
);
var
user_num
=
$
(
'
.search-input input
'
).
attr
(
"
data-user
"
);
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
lo_num
+
"
conteúdos
"
);
$
(
'
.search-input select
'
).
change
(
function
(){
getElementsNumber
(
$
(
this
).
val
());
switch
(
$
(
this
).
val
())
{
case
'
LearningObject
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
lo_num
+
"
conteúdos
"
);
break
;
case
'
Collection
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
collection_num
+
"
coleções
"
);
break
;
case
'
User
'
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar em
"
+
user_num
+
"
usuários
"
);
break
;
default
:
$
(
'
.search-input input
'
).
attr
(
'
placeholder
'
,
"
Buscar conteúdo
"
);
}
})
});
This diff is collapsed.
Click to expand it.
app/views/shared/application/_search.erb
+
1
−
1
View file @
c34875f3
<div
class=
"search-input"
>
<form
action=
"/search"
method=
"get"
>
<div
class=
"input-group"
id=
"search"
>
<input
type=
"text"
placeholder=
""
class=
"form-control"
name=
"query"
id=
"main_search"
>
<input
type=
"text"
data-lo=
"
<%=
number_with_delimiter
(
LearningObject
.
count
,
delimiter:
"."
)
%>
"
data-user=
"
<%=
number_with_delimiter
(
User
.
count
,
delimiter:
"."
)
%>
"
data-collection=
"
<%=
number_with_delimiter
(
Collection
.
count
,
delimiter:
"."
)
%>
"
placeholder=
""
class=
"form-control"
name=
"query"
id=
"main_search"
>
<select
name=
"search_class"
id=
"search_class"
class=
"form-control"
>
<option
value=
"LearningObject"
selected
>
Conteúdos Educacionais
</option>
<option
value=
"Collection"
>
Coleções
</option>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment