Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
C
colt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nala Ginrut
colt
Commits
41ccb8e9
Verified
Commit
41ccb8e9
authored
Oct 19, 2020
by
Nala Ginrut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix intro edit & update
parent
14115fec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
47 deletions
+48
-47
app/controllers/dashboard.scm
app/controllers/dashboard.scm
+2
-2
app/models/posts.scm
app/models/posts.scm
+3
-0
pub/js/editor.js
pub/js/editor.js
+43
-45
No files found.
app/controllers/dashboard.scm
View file @
41ccb8e9
...
...
@@ -127,7 +127,7 @@
(
article-name
(
hash-ref
json-content
"name"
))
(
article-content
(
hash-ref
json-content
"content"
))
(
article-status
(
hash-ref
json-content
"status"
))
(
article-oid
(
hash-ref
json-content
"oid"
))
(
article-oid
(
hash-ref
json-content
"oid"
))
(
article-tags
(
hash-ref
json-content
"tags"
))
(
update-timestamp?
(
hash-ref
json-content
"update_timestamp"
))
(
oid
(
git-edit-article
article-title
article-name
article-content
...
...
@@ -157,7 +157,7 @@
(
lambda
(
rc
)
(
let-values
(((
title
author
blog
disqus
pubkey
old-passwd
new-passwd
)
(
:from-post
rc
'get-vals
"title"
"author"
"blog-url"
"disqus"
"disqus-pubkey"
"old-passwd"
"new-passwd"
)))
"disqus"
"disqus-pubkey"
"old-passwd"
"new-passwd"
)))
(
let/ec
return
(
when
(
and
new-passwd
(
not
(
string-null?
new-passwd
)))
(
if
(
check-passwd
old-passwd
)
...
...
app/models/posts.scm
View file @
41ccb8e9
...
...
@@ -137,6 +137,9 @@
(
define
(
cache-the-post!
oid
op
)
(
let
((
new-post
(
get-one-post-from-git
oid
)))
(
cond
((
string=?
(
meta-data-title
(
post-meta-data
new-post
))
"_____colt_____Intro"
)
(
set!
*intro*
(
list
new-post
)))
((
eq?
op
'post
)
(
set!
*all-post-objs*
(
sort-by-time
...
...
pub/js/editor.js
View file @
41ccb8e9
/*
@licstart The following is the entire license notice for the
JavaScript code in this page.
@licstart The following is the entire license notice for the
JavaScript code in this page.
Copyright (C) 2019 Mu Lei known as NalaGinrut <mulei@gnu.org>
Copyright (C) 2019 Mu Lei known as NalaGinrut <mulei@gnu.org>
The JavaScript code in this page is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
The JavaScript code in this page is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this page.
*/
@licend The above is the entire license notice
for the JavaScript code in this page.
*/
var
children_nodes
;
var
quill
;
var
url_name
;
...
...
@@ -124,35 +124,33 @@ function intro_submit() {
submit_button
.
innerText
=
"
Submiting...
"
;
submit_button
.
disabled
=
true
;
$
(
document
).
ready
(
function
()
{
$
.
ajax
({
type
:
"
POST
"
,
url
:
"
/v1/colt/edit_article
"
,
contentType
:
"
application/json; charset=utf-8
"
,
dataType
:
"
json
"
,
data
:
JSON
.
stringify
({
"
title
"
:
title
,
"
name
"
:
"
About me
"
,
"
content
"
:
article_content
,
"
status
"
:
status
,
"
oid
"
:
article_oid
,
"
tags
"
:
tags
,
"
update_timestamp
"
:
false
}),
success
:
function
(
oid
)
{
if
(
"
failed
"
===
oid
)
{
show_msg_layer
(
"
Edit failed, please check!
"
);
submit_button
.
innerText
=
"
Submit
"
;
submit_button
.
disabled
=
false
;
}
else
window
.
location
.
pathname
=
"
/about
"
;
localStorage
.
setItem
(
'
colt.saved_content
'
,
""
);
fetch
(
'
/v1/colt/edit_article
'
,
{
method
:
'
POST
'
,
body
:
JSON
.
stringify
({
"
title
"
:
title
,
"
name
"
:
"
About me
"
,
"
content
"
:
article_content
,
"
status
"
:
status
,
"
oid
"
:
article_oid
,
"
tags
"
:
tags
,
"
update_timestamp
"
:
false
}),
headers
:
{
'
Content-Type
'
:
'
application/json; charset=utf-8
'
}})
.
then
(
response
=>
response
.
text
())
.
then
(
oid
=>
{
if
(
"
failed
"
===
oid
)
{
show_msg_layer
(
"
Edit failed, please check!
"
);
submit_button
.
innerText
=
"
Submit
"
;
submit_button
.
disabled
=
false
;
}
else
window
.
location
.
pathname
=
"
/about
"
;
localStorage
.
setItem
(
'
colt.saved_content
'
,
""
);
})
})
}
function
edit_submit
()
{
...
...
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