Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
outils
question2answer
Commits
426ba54c
Commit
426ba54c
authored
Jul 29, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More styling/layout for comment voting
parent
2797e942
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
13 deletions
+45
-13
format.php
qa-include/app/format.php
+16
-8
qa-theme-base.php
qa-include/qa-theme-base.php
+2
-1
qa-styles.css
qa-theme/SnowFlat/qa-styles.css
+14
-4
qa-theme.php
qa-theme/SnowFlat/qa-theme.php
+13
-0
No files found.
qa-include/app/format.php
View file @
426ba54c
...
...
@@ -475,14 +475,22 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt
$fields
[
'vote_on_page'
]
=
strpos
(
$voteview
,
'-disabled-page'
)
?
'disabled'
:
'enabled'
;
$fields
[
'upvotes_view'
]
=
(
$upvotes
==
1
)
?
qa_lang_html_sub_split
(
'main/1_liked'
,
$upvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_liked'
,
$upvoteshtml
);
$fields
[
'downvotes_view'
]
=
(
$downvotes
==
1
)
?
qa_lang_html_sub_split
(
'main/1_disliked'
,
$downvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_disliked'
,
$downvoteshtml
);
$fields
[
'netvotes_view'
]
=
(
$netvotes
==
1
)
?
qa_lang_html_sub_split
(
'main/1_vote'
,
$netvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_votes'
,
$netvoteshtml
);
if
(
$iscomment
)
{
// for comments just show number, no additional text
$fields
[
'upvotes_view'
]
=
array
(
'prefix'
=>
''
,
'data'
=>
$upvoteshtml
,
'suffix'
=>
''
);
$fields
[
'downvotes_view'
]
=
array
(
'prefix'
=>
''
,
'data'
=>
$downvoteshtml
,
'suffix'
=>
''
);
$fields
[
'netvotes_view'
]
=
array
(
'prefix'
=>
''
,
'data'
=>
$netvoteshtml
,
'suffix'
=>
''
);
}
else
{
$fields
[
'upvotes_view'
]
=
$upvotes
==
1
?
qa_lang_html_sub_split
(
'main/1_liked'
,
$upvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_liked'
,
$upvoteshtml
);
$fields
[
'downvotes_view'
]
=
$downvotes
==
1
?
qa_lang_html_sub_split
(
'main/1_disliked'
,
$downvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_disliked'
,
$downvoteshtml
);
$fields
[
'netvotes_view'
]
=
$netvotes
==
1
?
qa_lang_html_sub_split
(
'main/1_vote'
,
$netvoteshtml
,
'1'
)
:
qa_lang_html_sub_split
(
'main/x_votes'
,
$netvoteshtml
);
}
// schema.org microdata - vote display might be formatted (e.g. '2k') so we use meta tag for true count
if
(
$microdata
)
{
...
...
qa-include/qa-theme-base.php
View file @
426ba54c
...
...
@@ -1804,8 +1804,9 @@ class qa_html_theme_base
if
(
$post
[
'vote_view'
]
==
'updown'
)
{
$this
->
output_split
(
$post
[
'upvotes_view'
],
'qa-upvote-count'
);
$this
->
output_split
(
$post
[
'downvotes_view'
],
'qa-downvote-count'
);
}
else
}
else
{
$this
->
output_split
(
$post
[
'netvotes_view'
],
'qa-netvote-count'
);
}
$this
->
output
(
'</div>'
);
}
...
...
qa-theme/SnowFlat/qa-styles.css
View file @
426ba54c
...
...
@@ -2618,11 +2618,21 @@ input[type="submit"], button {
}
.qa-c-list-item
.qa-netvote-count-data
{
font-size
:
13px
;
line-height
:
20
px
;
line-height
:
18
px
;
}
/*.qa-c-list-item .qa-netvote-count-pad {
display: none;
}*/
.qa-c-list-item
.qa-upvote-count
{
line-height
:
6px
;
}
.qa-c-list-item
.qa-downvote-count
{
line-height
:
14px
;
}
.qa-c-list-item
.qa-upvote-count-data
,
.qa-c-list-item
.qa-downvote-count-data
{
font-size
:
13px
;
font-weight
:
normal
;
}
.qa-c-list-item
.qa-vote-up-button
,
.qa-c-list-item
.qa-vote-down-button
,
...
...
qa-theme/SnowFlat/qa-theme.php
View file @
426ba54c
...
...
@@ -490,6 +490,19 @@ class qa_html_theme extends qa_html_theme_base
}
/**
* Hide votes when zero
* @param array $post
*/
public
function
vote_count
(
$post
)
{
if
(
$post
[
'raw'
][
'basetype'
]
===
'C'
&&
$post
[
'netvotes_view'
][
'data'
]
==
0
)
{
$post
[
'netvotes_view'
][
'data'
]
=
''
;
}
parent
::
vote_count
(
$post
);
}
/**
* Move user whometa to top in answer
*
* @since Snow 1.4
...
...
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