Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
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
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
osuny
Admin
Commits
fe91e27e
Commit
fe91e27e
authored
2 years ago
by
alexisben
Browse files
Options
Downloads
Patches
Plain Diff
Datatable block : Upgrade and fix draggable
parent
a3f87962
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/stylesheets/commons/_block.sass
+25
-1
25 additions, 1 deletion
app/assets/stylesheets/commons/_block.sass
app/views/admin/communication/blocks/templates/datatable/_edit.html.erb
+30
-32
30 additions, 32 deletions
...n/communication/blocks/templates/datatable/_edit.html.erb
with
55 additions
and
33 deletions
app/assets/stylesheets/commons/_block.sass
+
25
−
1
View file @
fe91e27e
...
...
@@ -3,4 +3,28 @@
display
:
none
[
data-v-app
]
.spinner-border
display
:
none
\ No newline at end of file
display
:
none
.fake-table
display
:
table
border-collapse
:
collapse
caption-side
:
bottom
border
:
1px
solid
$border-color
.thead
,
.tbody
display
:
table-row-group
.tr
display
:
table-row
border-bottom
:
1px
solid
$border-color
.td
display
:
table-cell
min-width
:
120px
&
:not
(
:first-child
)
border-left
:
1px
solid
$border-color
.thead
white-space
:
nowrap
.tbody
.tr
&
:nth-child
(
even
)
background
:
$table-striped-bg
&
:hover
background
:
$table-hover-bg
This diff is collapsed.
Click to expand it.
app/views/admin/communication/blocks/templates/datatable/_edit.html.erb
+
30
−
32
View file @
fe91e27e
<div
class=
"table-responsive mb-5"
>
<
table
class=
"table table
-bordered table-hover
"
>
<thead>
<tr>
<td
v-for=
"(column, index) in data.columns"
>
<
div
class=
"
fake-
table table"
>
<
div
class=
"
thead
"
>
<
div
class=
"
tr
"
>
<
div
class=
"
td
"
v-for=
"(column, index) in data.columns"
>
<div
class=
"d-flex"
>
<input
type=
"text"
class=
"form-control"
...
...
@@ -12,8 +12,8 @@
<i
class=
"fas fa-times"
></i>
</a>
</div>
</
t
d>
<
t
d
class=
"text-end"
>
</d
iv
>
<d
iv
class=
"
td
text-end"
>
<a
class=
"btn btn-primary me-2"
v-on:click=
"data.columns.push('')"
>
<i
class=
"fas fa-plus"
></i>
colonne
...
...
@@ -22,33 +22,31 @@
v-on:click=
"data.elements.push({cells: []})"
>
<i
class=
"fas fa-plus"
></i>
ligne
</a>
</td>
</tr>
</thead>
<tbody>
<draggable
:list=
"data.elements"
handle=
".dragHandle"
>
<tr
v-for=
"(row, index) in data.elements"
>
<td
v-for=
"(column, columnIndex) in data.columns"
>
<input
type=
"text"
class=
"form-control"
v-model=
"row.cells[columnIndex]"
>
</td>
<td
class=
"text-end"
>
<div
class=
"d-flex"
>
<a
class=
"btn btn-danger"
v-on:click=
"data.elements.splice(index, 1)"
>
<i
class=
"fas fa-times"
></i>
</a>
</div>
</div>
</div>
<draggable
:list=
"data.elements"
handle=
".dragHandle"
class=
"tbody"
>
<div
class=
"tr"
v-for=
"(row, index) in data.elements"
>
<div
class=
"td"
v-for=
"(column, columnIndex) in data.columns"
>
<input
type=
"text"
class=
"form-control"
v-model=
"row.cells[columnIndex]"
>
</div>
<div
class=
"td"
class=
"text-end"
>
<div
class=
"d-flex"
>
<a
class=
"btn btn-danger"
v-on:click=
"data.elements.splice(index, 1)"
>
<i
class=
"fas fa-times"
></i>
</a>
<a
class=
"btn ms-auto dragHandle"
>
<i
class=
"fa fa-bars handle"
></i>
</a>
</div>
</td>
</tr>
</draggable>
</tbody>
</table>
<a
class=
"btn ms-auto dragHandle"
>
<i
class=
"fa fa-bars handle"
></i>
</a>
</div>
</div>
</div>
</draggable>
</div>
</div>
<div
class=
"row"
>
...
...
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