Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
f1765bc1
Commit
f1765bc1
authored
Aug 06, 2018
by
Jorgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make typo list scrollable. Improve styles.
parent
9594acdc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
17 deletions
+43
-17
footer.php
cp/application/views/footer.php
+2
-2
typos.php
cp/application/views/users/typos.php
+2
-1
index.jsx
cp/javascript/src/components/Typo/index.jsx
+20
-5
style.css
cp/javascript/src/components/Typo/style.css
+1
-0
index.jsx
cp/javascript/src/components/TypoList/index.jsx
+6
-5
stylesheet.css
cp/stylesheet/stylesheet.css
+12
-4
No files found.
cp/application/views/footer.php
View file @
f1765bc1
</div>
</div>
<div
class=
"footer
bg-primary
"
>
<span
class=
"
text-white
copyright"
>
Копирайт (С) 2018 "Этерсофт"
</span>
<div
class=
"footer"
>
<span
class=
"copyright"
>
Копирайт (С) 2018 "Этерсофт"
</span>
</div>
</body>
...
...
cp/application/views/users/typos.php
View file @
f1765bc1
<div
id=
"root"
class=
"body border border-
light
"
>
<div
id=
"root"
class=
"body border border-
white
"
>
</div>
\ No newline at end of file
cp/javascript/src/components/Typo/index.jsx
View file @
f1765bc1
...
...
@@ -96,16 +96,16 @@ export default class Typo extends Component {
if
(
show
)
{
console
.
log
(
"Render typo #"
+
typo
.
id
);
}
else
{
console
.
log
(
"Render hidden typo #"
+
typo
.
id
)
;
return
null
;
}
if
(
!
this
.
state
.
textHighlighted
)
{
this
.
_highlightTypoInContext
();
this
.
state
.
textHighlighted
=
true
;
}
}
return
(
<
Card
className=
{
className
}
>
<
Card
id=
{
`typo-${typo.id}`
}
className=
{
className
}
>
<
CardHeader
>
Опечатка #
{
typo
.
id
}
<
span
id=
"typo-id"
>
...
...
@@ -144,11 +144,25 @@ export default class Typo extends Component {
);
}
/**
* Hides typo card
*/
hideTypoCard
(
completeFunc
)
{
$
(
`#typo-
${
this
.
typo
.
id
}
`
).
animate
({
marginLeft
:
"3000px"
,
opacity
:
0
},
500
,
completeFunc
);
}
applyCorrection
=
()
=>
{
this
.
acceptCallback
(
this
.
typo
.
correctedText
);
this
.
hideTypoCard
(()
=>
{
this
.
acceptCallback
(
this
.
typo
.
correctedText
);
});
};
declineCorrection
=
()
=>
{
this
.
declineCallback
();
this
.
hideTypoCard
(()
=>
{
this
.
declineCallback
();
});
};
}
\ No newline at end of file
cp/javascript/src/components/Typo/style.css
View file @
f1765bc1
.TypoCard
{
width
:
80%
;
margin
:
0
auto
;
margin-bottom
:
25px
;
}
.TypoCard
.card-body
{
...
...
cp/javascript/src/components/TypoList/index.jsx
View file @
f1765bc1
...
...
@@ -13,8 +13,8 @@ const alertify = require("alertify.js");
export
default
class
TypoList
extends
Component
{
state
=
{
currentTypo
:
0
,
siteId
:
0
,
resolvedTypos
:
[]
};
/**
...
...
@@ -31,7 +31,7 @@ export default class TypoList extends Component {
alertify
.
success
(
`<p>Опечатка
${
typoId
}
была подтверждена.</p>
<p>Исправления применены к тексту, содержащему опечатку.</p>`
);
this
.
state
.
currentTypo
++
;
this
.
state
.
resolvedTypos
.
push
(
typoId
)
this
.
_decrementSiteTyposCount
();
this
.
forceUpdate
();
return
;
...
...
@@ -54,7 +54,8 @@ export default class TypoList extends Component {
this
.
_setTypoStatus
(
0
,
typoId
,
this
.
state
.
siteId
)
.
done
(()
=>
{
alertify
.
success
(
`Опечатка
${
typoId
}
была отклонена`
);
this
.
state
.
currentTypo
++
;
this
.
state
.
resolvedTypos
.
push
(
typoId
)
this
.
_decrementSiteTyposCount
();
this
.
forceUpdate
();
})
...
...
@@ -112,13 +113,13 @@ export default class TypoList extends Component {
console
.
log
(
"Render typolist for site "
+
this
.
state
.
siteId
);
if
(
typos
.
length
===
0
||
this
.
state
.
currentTypo
>=
typos
.
length
)
{
if
(
typos
.
length
===
0
||
this
.
state
.
resolvedTypos
.
length
>=
typos
.
length
)
{
return
TypoList
.
_displayEmptyMessage
();
}
const
typoCards
=
typos
.
map
((
typo
,
index
)
=>
<
Typo
key=
{
typo
.
id
}
typo=
{
typo
}
show=
{
this
.
state
.
currentTypo
===
index
}
show=
{
!
this
.
state
.
resolvedTypos
.
includes
(
typo
.
id
)
}
acceptCallback=
{
this
.
acceptCorrection
.
bind
(
this
,
typo
.
id
)
}
declineCallback=
{
this
.
declineCorrection
.
bind
(
this
,
typo
.
id
)
}
/>
);
...
...
cp/stylesheet/stylesheet.css
View file @
f1765bc1
...
...
@@ -26,7 +26,8 @@ body {
}
.footer
{
position
:
absolute
;
color
:
black
;
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
text-align
:
center
;
...
...
@@ -34,6 +35,8 @@ body {
.footer
.copyright
{
font-size
:
80%
;
float
:
right
;
margin-right
:
10px
;
}
.typo
{
...
...
@@ -59,9 +62,14 @@ li.nav-item {
border-radius
:
0
!important
;
}
li
.nav-item
:hover
{
border-bottom
:
1px
solid
#007bff
;
border-radius
:
0
!important
;
li
.nav-item
>
a
.nav-link
{
transition-property
:
background-color
;
transition-duration
:
0.8s
;
}
li
.nav-item
>
a
.nav-link
:hover
{
background-color
:
#ffd556
;
border-radius
:
0.25em
;
}
a
.nav-link.active
{
...
...
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