Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Papermerge.Js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Jonas Leder
Papermerge.Js
Commits
e93fad4f
Commit
e93fad4f
authored
3 years ago
by
Eugen Ciur
Browse files
Options
Downloads
Patches
Plain Diff
basic tag creation
parent
99343a56
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/components/tags.hbs
+0
-26
0 additions, 26 deletions
app/components/tags.hbs
app/controllers/tags/index.js
+36
-0
36 additions, 0 deletions
app/controllers/tags/index.js
app/templates/tags/index.hbs
+51
-2
51 additions, 2 deletions
app/templates/tags/index.hbs
with
87 additions
and
28 deletions
app/components/tags.hbs
deleted
100644 → 0
+
0
−
26
View file @
99343a56
<div
class=
"tags"
>
<table
class=
"table table-striped"
>
<thead>
<tr
class=
"text-uppercase"
>
<th
class=
"border-top-0"
><input
type=
"checkbox"
/></th>
<th
class=
"border-top-0"
>
Tag Name
</th>
<th
class=
"border-top-0"
>
Pinned?
</th>
<th
class=
"border-top-0"
>
Description
</th>
</tr>
</thead>
<tbody>
{{#
each
@tags
as
|
tag
|
}}
<tr>
<th
scope=
"row"
><input
type=
"checkbox"
/></th>
<td>
<LinkTo
@
route=
"tags.edit"
@
model=
{{
tag
.
id
}}
>
{{
tag
.
name
}}
</LinkTo>
</td>
<td>
{{
tag
.
pinned
}}
</td>
<td>
{{
tag
.
description
}}
</td>
</tr>
{{/
each
}}
</tbody>
</table>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/controllers/tags/index.js
0 → 100644
+
36
−
0
View file @
e93fad4f
import
Controller
from
'
@ember/controller
'
;
import
{
action
}
from
'
@ember/object
'
;
export
default
class
TagsController
extends
Controller
{
@
action
onToggleNew
()
{
this
.
set
(
'
new
'
,
!
this
.
new
);
}
@
action
onCreate
()
{
this
.
store
.
createRecord
(
'
tag
'
,
{
name
:
this
.
new_name
,
description
:
this
.
new_description
,
pinned
:
true
,
bg_color
:
"
#ff0000
"
,
fg_color
:
"
#ffffff
"
}).
save
();
this
.
set
(
'
new_name
'
,
""
);
this
.
set
(
'
new_description
'
,
""
);
this
.
set
(
'
new_fg_color
'
,
"
#ffffff
"
);
this
.
set
(
'
new_bg_color
'
,
"
#ff0000
"
);
this
.
set
(
'
new
'
,
false
);
}
@
action
onCancel
()
{
this
.
set
(
'
new
'
,
false
);
this
.
set
(
'
new_name
'
,
""
);
this
.
set
(
'
new_description
'
,
""
);
this
.
set
(
'
new_fg_color
'
,
"
#ffffff
"
);
this
.
set
(
'
new_bg_color
'
,
"
#ff0000
"
);
}
}
This diff is collapsed.
Click to expand it.
app/templates/tags/index.hbs
+
51
−
2
View file @
e93fad4f
<h1>
Tags Index
</h1>
<LinkTo
@
route=
"tags.add"
class=
"btn btn-success"
>
New
</LinkTo>
<button
class=
"btn btn-success"
type=
"button"
{{
on
"click"
this
.
onToggleNew
}}
>
New
</button>
{{#if
this
.
new
}}
<div>
<p>
<Input
type=
"text"
@
value=
{{
this
.
new_name
}}
/>
<Input
type=
"text"
@
value=
{{
this
.
new_description
}}
/>
<Input
@
type=
"color"
@
value=
{{
this
.
new_fg_color
}}
/>
<Input
@
type=
"color"
@
value=
{{
this
.
new_bg_color
}}
/>
</p>
<p>
<Input
@
type=
"checkbox"
@
checked=
{{
this
.
pinned
}}
/>
Is Pinned?
</p>
<button
type=
"button"
{{
on
"click"
this
.
onCreate
}}
class=
"btn btn-success"
>
Create Tag
</button>
<button
type=
"button"
{{
on
"click"
this
.
onCancel
}}
class=
"btn btn-secondary"
>
Cancel
</button>
</div>
{{/if}}
<Tags
@
tags=
{{
@model
}}
/>
\ No newline at end of file
<div
class=
"tags"
>
<table
class=
"table table-striped"
>
<thead>
<tr
class=
"text-uppercase"
>
<th
class=
"border-top-0"
>
Tag Name
</th>
<th
class=
"border-top-0"
>
Pinned?
</th>
<th
class=
"border-top-0"
>
Description
</th>
</tr>
</thead>
<tbody>
{{#
each
@model
as
|
tag
|
}}
<tr>
<td>
<LinkTo
@
route=
"tags.edit"
@
model=
{{
tag
.
id
}}
>
{{
tag
.
name
}}
</LinkTo>
</td>
<td>
{{
tag
.
pinned
}}
</td>
<td>
{{
tag
.
description
}}
</td>
</tr>
{{/
each
}}
</tbody>
</table>
</div>
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