Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
4a1b70f7
Commit
4a1b70f7
authored
Nov 07, 2011
by
Aleksei Kvitinskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tags to admin project form
parent
af7bed2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
34 deletions
+48
-34
app/assets/javascripts/projects.js
app/assets/javascripts/projects.js
+16
-0
app/views/admin/projects/_form.html.haml
app/views/admin/projects/_form.html.haml
+29
-20
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+3
-14
No files found.
app/assets/javascripts/projects.js
View file @
4a1b70f7
...
@@ -40,3 +40,19 @@ $(document).ready(function(){
...
@@ -40,3 +40,19 @@ $(document).ready(function(){
function
focusSearch
()
{
function
focusSearch
()
{
$
(
"
#search
"
).
focus
();
$
(
"
#search
"
).
focus
();
}
}
function
taggifyForm
(){
var
tag_field
=
$
(
'
#tag_field
'
).
tagify
();
tag_field
.
tagify
(
'
inputField
'
).
autocomplete
({
source
:
'
/tags.json
'
});
$
(
'
form
'
).
submit
(
function
()
{
var
tag_field
=
$
(
'
#tag_field
'
)
tag_field
.
val
(
tag_field
.
tagify
(
'
serialize
'
)
);
return
true
;
});
}
app/views/admin/projects/_form.html.haml
View file @
4a1b70f7
=
form_for
[
:admin
,
@admin_project
]
do
|
f
|
=
form_for
[
:admin
,
@admin_project
]
do
|
f
|
-
if
@admin_project
.
errors
.
any?
-
if
@admin_project
.
errors
.
any?
#error_explanation
#error_explanation
%h2
=
"
#{
pluralize
(
@admin_project
.
errors
.
count
,
"error"
)
}
prohibited this admin_project from being saved:"
%h2
=
"
#{
pluralize
(
@admin_project
.
errors
.
count
,
"error"
)
}
prohibited this admin_project from being saved:"
%ul
%ul
-
@admin_project
.
errors
.
full_messages
.
each
do
|
msg
|
-
@admin_project
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%li
=
msg
.span-24
.form-row
.span-12
=
f
.
label
:name
.field
%br
=
f
.
label
:name
=
f
.
text_field
:name
%br
.form-row
=
f
.
text_field
:name
=
f
.
label
:code
.field
%br
=
f
.
label
:code
=
f
.
text_field
:code
%br
.form-row
=
f
.
text_field
:code
=
f
.
label
:path
.field
%br
=
f
.
label
:path
=
f
.
text_field
:path
%br
=
f
.
text_field
:path
.span-10
.form-row
.field
=
f
.
label
:tag_list
=
f
.
label
:description
%br
%br
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
=
f
.
text_area
:description
.form-row
=
f
.
label
:description
%br
=
f
.
text_area
:description
.clear
.clear
.actions
.actions
=
f
.
submit
'Save'
,
:class
=>
"lbutton"
=
f
.
submit
'Save'
,
:class
=>
"lbutton"
:javascript
$
(
function
(){
taggifyForm
();
})
app/views/projects/_form.html.haml
View file @
4a1b70f7
...
@@ -29,8 +29,8 @@
...
@@ -29,8 +29,8 @@
%tr
%tr
%td
=
f
.
label
:tag_list
%td
=
f
.
label
:tag_list
%td
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
%td
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
.f
ield
.f
orm-row
=
f
.
label
:description
=
f
.
label
:description
%br
/
%br
/
=
f
.
text_area
:description
,
:style
=>
"height:140px;width:932px;"
=
f
.
text_area
:description
,
:style
=>
"height:140px;width:932px;"
...
@@ -55,16 +55,5 @@
...
@@ -55,16 +55,5 @@
:javascript
:javascript
$
(
function
(){
$
(
function
(){
var
tag_field
=
$
(
'
#tag_field
'
).
tagify
();
taggifyForm
();
tag_field
.
tagify
(
'
inputField
'
).
autocomplete
({
source
:
'
/tags.json
'
});
$
(
'
form
'
).
submit
(
function
()
{
var
tag_field
=
$
(
'
#tag_field
'
)
tag_field
.
val
(
tag_field
.
tagify
(
'
serialize
'
)
);
return
true
;
});
})
})
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