Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
7bc5d236
Commit
7bc5d236
authored
Jan 24, 2013
by
mainlove
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.5.6' of
https://github.com/b3log/b3log-solo.git
into
0.5.6
parents
11d350f2
44ef41b2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
6 deletions
+175
-6
core/src/main/java/org/b3log/solo/processor/ArticleProcessor.java
.../main/java/org/b3log/solo/processor/ArticleProcessor.java
+90
-0
core/src/main/java/org/b3log/solo/service/ArticleQueryService.java
...main/java/org/b3log/solo/service/ArticleQueryService.java
+6
-0
war/src/main/webapp/admin-plugin-list.ftl
war/src/main/webapp/admin-plugin-list.ftl
+2
-2
war/src/main/webapp/js/admin/latkeAdmin.js
war/src/main/webapp/js/admin/latkeAdmin.js
+49
-1
war/src/main/webapp/js/admin/latkeAdmin.min.js
war/src/main/webapp/js/admin/latkeAdmin.min.js
+9
-1
war/src/main/webapp/js/admin/pluginList.js
war/src/main/webapp/js/admin/pluginList.js
+19
-2
No files found.
core/src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
7bc5d236
...
...
@@ -566,6 +566,70 @@ public final class ArticleProcessor {
renderer
.
setJSONObject
(
jsonObject
);
}
/**
* Gets author articles paged with the specified context.
*
* @param context the specified context
* @param request the specified request
*/
@RequestProcessing
(
value
=
"/articles/authors/\\d+/\\d+"
,
uriPatternsMode
=
URIPatternMode
.
REGEX
,
method
=
HTTPRequestMethod
.
GET
)
public
void
getAuthorsArticlesByPage
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
)
{
final
JSONObject
jsonObject
=
new
JSONObject
();
final
String
authorId
=
getAuthorsArticlesPagedAuthorId
(
request
.
getRequestURI
());
final
int
currentPageNum
=
getAuthorsArticlesPagedCurrentPageNum
(
request
.
getRequestURI
());
Stopwatchs
.
start
(
"Get Author-Articles Paged[authorId="
+
authorId
+
", pageNum="
+
currentPageNum
+
']'
);
try
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
true
);
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
final
int
pageSize
=
preference
.
getInt
(
Preference
.
ARTICLE_LIST_DISPLAY_COUNT
);
final
JSONObject
authorRet
=
userQueryService
.
getUser
(
authorId
);
if
(
null
==
authorRet
)
{
context
.
getResponse
().
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
}
final
JSONObject
author
=
authorRet
.
getJSONObject
(
User
.
USER
);
final
String
authorEmail
=
author
.
optString
(
User
.
USER_EMAIL
);
final
List
<
JSONObject
>
articles
=
articleQueryService
.
getArticlesByAuthorEmail
(
authorEmail
,
currentPageNum
,
pageSize
);
if
(!
articles
.
isEmpty
())
{
filler
.
setArticlesExProperties
(
articles
,
author
,
preference
);
}
final
int
articleCount
=
author
.
getInt
(
UserExt
.
USER_PUBLISHED_ARTICLE_COUNT
);
final
int
pageCount
=
(
int
)
Math
.
ceil
((
double
)
articleCount
/
(
double
)
pageSize
);
final
JSONObject
result
=
new
JSONObject
();
final
JSONObject
pagination
=
new
JSONObject
();
pagination
.
put
(
Pagination
.
PAGINATION_PAGE_COUNT
,
pageCount
);
result
.
put
(
Pagination
.
PAGINATION
,
pagination
);
result
.
put
(
Article
.
ARTICLES
,
articles
);
jsonObject
.
put
(
Keys
.
RESULTS
,
result
);
}
catch
(
final
Exception
e
)
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
LOGGER
.
log
(
Level
.
SEVERE
,
"Gets article paged failed"
,
e
);
}
finally
{
Stopwatchs
.
end
();
}
final
JSONRenderer
renderer
=
new
JSONRenderer
();
context
.
setRenderer
(
renderer
);
renderer
.
setJSONObject
(
jsonObject
);
}
/**
* Shows author articles with the specified context.
*
...
...
@@ -1012,6 +1076,32 @@ public final class ArticleProcessor {
return
StringUtils
.
substringBeforeLast
(
archiveAndPageNum
,
"/"
);
}
/**
* Gets the request page number from the specified request URI.
*
* @param requestURI the specified request URI
* @return page number
*/
private
static
int
getAuthorsArticlesPagedCurrentPageNum
(
final
String
requestURI
)
{
return
Requests
.
getCurrentPageNum
(
StringUtils
.
substringAfterLast
(
requestURI
,
"/"
));
}
/**
* Gets the request author id from the specified request URI.
*
* @param requestURI the specified request URI
* @return author id
*/
private
static
String
getAuthorsArticlesPagedAuthorId
(
final
String
requestURI
)
{
String
authorIdAndPageNum
=
requestURI
.
substring
((
Latkes
.
getContextPath
()
+
"/articles/authors/"
).
length
());
if
(!
authorIdAndPageNum
.
endsWith
(
"/"
))
{
authorIdAndPageNum
+=
"/"
;
}
return
StringUtils
.
substringBefore
(
authorIdAndPageNum
,
"/"
);
}
/**
* Gets the request page number from the specified request URI and author id.
*
...
...
core/src/main/java/org/b3log/solo/service/ArticleQueryService.java
View file @
7bc5d236
...
...
@@ -362,6 +362,8 @@ public final class ArticleQueryService {
// Skips the unpublished article
continue
;
}
article
.
put
(
ARTICLE_CREATE_TIME
,
((
Date
)
article
.
get
(
ARTICLE_CREATE_DATE
)).
getTime
());
// Markdown to HTML for content and abstract
markdown
(
article
);
...
...
@@ -420,6 +422,8 @@ public final class ArticleQueryService {
// Skips the unpublished article
continue
;
}
article
.
put
(
ARTICLE_CREATE_TIME
,
((
Date
)
article
.
get
(
ARTICLE_CREATE_DATE
)).
getTime
());
// Markdown to HTML for content and abstract
markdown
(
article
);
...
...
@@ -649,6 +653,8 @@ public final class ArticleQueryService {
for
(
int
i
=
0
;
i
<
articles
.
length
();
i
++)
{
final
JSONObject
article
=
articles
.
getJSONObject
(
i
);
article
.
put
(
ARTICLE_CREATE_TIME
,
((
Date
)
article
.
get
(
ARTICLE_CREATE_DATE
)).
getTime
());
// Markdown to HTML for content and abstract
markdown
(
article
);
...
...
war/src/main/webapp/admin-plugin-list.ftl
View file @
7bc5d236
...
...
@@ -2,7 +2,7 @@
</div>
<div id="pluginPagination" class="margin12 right">
</div>
<div class="clear"></div>
<div id="PluginSetting" class="none">
<div id="pluginSetting" class="none">
</div>
<div class="clear"></div>
${plugins}
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
7bc5d236
...
...
@@ -3017,6 +3017,12 @@ admin.pluginList = {
}]);
this
.
tablePagination
.
initPagination
();
$
(
"
#pluginSetting
"
).
dialog
({
width
:
700
,
height
:
180
,
"
modal
"
:
true
,
"
hideFooter
"
:
true
});
this
.
getList
(
page
);
},
...
...
@@ -3062,7 +3068,15 @@ admin.pluginList = {
}
});
},
<<<<<<<
HEAD
=======
<<<<<<<
HEAD
=======
>>>>>>>
692
cfe019926f553440bb6a3e2517360118353a7
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
toSetting
:
function
(
pluginId
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
...
...
@@ -3078,6 +3092,7 @@ admin.pluginList = {
success
:
function
(
result
,
textStatus
){
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
<<<<<<<
HEAD
$
(
"
#PluginSetting
"
).
html
(
result
);
$
(
"
#PluginSetting
"
).
dialog
({
width
:
700
,
...
...
@@ -3086,11 +3101,36 @@ admin.pluginList = {
"
hideFooter
"
:
true
});
$
(
"
#PluginSetting
"
).
dialog
(
"
open
"
);
=======
<<<<<<<
HEAD
$
(
"
#PluginSetting
"
).
html
(
result
);
$
(
"
#PluginSetting
"
).
dialog
({
width
:
700
,
height
:
190
,
"
modal
"
:
true
,
"
hideFooter
"
:
true
});
$
(
"
#PluginSetting
"
).
dialog
(
"
open
"
);
=======
$
(
"
#pluginSetting
"
).
html
(
result
);
$
(
"
#pluginSetting
"
).
dialog
(
"
open
"
);
>>>>>>>
692
cfe019926f553440bb6a3e2517360118353a7
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
<<<<<<<
HEAD
=======
<<<<<<<
HEAD
=======
>>>>>>>
692
cfe019926f553440bb6a3e2517360118353a7
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
changeStatus
:
function
(
pluginId
,
status
)
{
if
(
status
===
"
ENABLED
"
)
{
status
=
"
DISABLED
"
;
...
...
@@ -3133,7 +3173,15 @@ admin.register["plugin-list"] = {
"
refresh
"
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
""
);
}
<<<<<<<
HEAD
}
=======
<<<<<<<
HEAD
}
=======
}
>>>>>>>
692
cfe019926f553440bb6a3e2517360118353a7
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
...
...
@@ -3833,4 +3881,4 @@ admin.register["about"] = {
"
refresh
"
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
\ No newline at end of file
}
war/src/main/webapp/js/admin/latkeAdmin.min.js
View file @
7bc5d236
This source diff could not be displayed because it is too large. You can
view the blob
instead.
war/src/main/webapp/js/admin/pluginList.js
View file @
7bc5d236
...
...
@@ -56,6 +56,12 @@ admin.pluginList = {
}]);
this
.
tablePagination
.
initPagination
();
$
(
"
#pluginSetting
"
).
dialog
({
width
:
700
,
height
:
180
,
"
modal
"
:
true
,
"
hideFooter
"
:
true
});
this
.
getList
(
page
);
},
...
...
@@ -101,7 +107,7 @@ admin.pluginList = {
}
});
},
toSetting
:
function
(
pluginId
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
...
...
@@ -117,6 +123,7 @@ admin.pluginList = {
success
:
function
(
result
,
textStatus
){
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
<<<<<<<
HEAD
$
(
"
#PluginSetting
"
).
html
(
result
);
$
(
"
#PluginSetting
"
).
dialog
({
width
:
700
,
...
...
@@ -125,11 +132,21 @@ admin.pluginList = {
"
hideFooter
"
:
true
});
$
(
"
#PluginSetting
"
).
dialog
(
"
open
"
);
=======
$
(
"
#pluginSetting
"
).
html
(
result
);
$
(
"
#pluginSetting
"
).
dialog
(
"
open
"
);
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
<<<<<<<
HEAD
=======
>>>>>>>
branch
'
0.5.6
'
of
https
:
//github.com/b3log/b3log-solo.git
changeStatus
:
function
(
pluginId
,
status
)
{
if
(
status
===
"
ENABLED
"
)
{
status
=
"
DISABLED
"
;
...
...
@@ -172,4 +189,4 @@ admin.register["plugin-list"] = {
"
refresh
"
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
}
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