Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
diaspora
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Gigadoc 2
diaspora
Commits
f3e897ab
Commit
f3e897ab
authored
Dec 28, 2015
by
Steffen van Bergerem
Committed by
Jonne Haß
Dec 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activate hovercards for logged out users
closes #6603
parent
40ff47f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
Changelog.md
Changelog.md
+2
-0
app/assets/javascripts/app/views/hovercard_view.js
app/assets/javascripts/app/views/hovercard_view.js
+2
-1
app/controllers/people_controller.rb
app/controllers/people_controller.rb
+2
-2
features/desktop/hovercards.feature
features/desktop/hovercards.feature
+14
-5
spec/javascripts/app/views/hovercard_view_spec.js
spec/javascripts/app/views/hovercard_view_spec.js
+6
-3
No files found.
Changelog.md
View file @
f3e897ab
...
...
@@ -11,6 +11,8 @@
## Features
Display hovercards without aspect dropdown when logged out
[
#6603
](
https://github.com/diaspora/diaspora/pull/6603
)
# 0.5.5.1
*
Fix XSS on profile pages
...
...
app/assets/javascripts/app/views/hovercard_view.js
View file @
f3e897ab
...
...
@@ -25,7 +25,7 @@ app.views.Hovercard = app.views.Base.extend({
this
.
hashtags
=
this
.
$
(
'
.hashtags
'
);
this
.
person_link
=
this
.
$
(
'
a.person
'
);
this
.
person_handle
=
this
.
$
(
'
div.handle
'
);
this
.
active
=
app
.
currentUser
.
authenticated
()
;
this
.
active
=
true
;
},
postRenderTemplate
:
function
()
{
...
...
@@ -126,6 +126,7 @@ app.views.Hovercard = app.views.Base.extend({
return
$
(
'
<a/>
'
,{
href
:
"
/tags/
"
+
tag
.
substring
(
1
)}).
text
(
tag
)[
0
]
;
}))
);
if
(
!
app
.
currentUser
.
authenticated
()){
return
;
}
// set aspect dropdown
// TODO render me client side!!!
var
href
=
this
.
href
();
...
...
app/controllers/people_controller.rb
View file @
f3e897ab
...
...
@@ -3,8 +3,8 @@
# the COPYRIGHT file.
class
PeopleController
<
ApplicationController
before_action
:authenticate_user!
,
except:
[
:show
,
:stream
]
before_action
:find_person
,
only:
[
:show
,
:stream
,
:hovercard
]
before_action
:authenticate_user!
,
except:
%i(show stream hovercard)
before_action
:find_person
,
only:
%i(show stream hovercard)
respond_to
:html
,
:except
=>
[
:tag_index
]
respond_to
:json
,
:only
=>
[
:index
,
:show
]
...
...
features/desktop/hovercards.feature
View file @
f3e897ab
...
...
@@ -6,15 +6,15 @@ Feature: Hovercards
Background
:
Given
a user named
"Bob Jones"
with email
"bob@bob.bob"
And
"bob@bob.bob"
has a public post with text
"public stuff"
And
"bob@bob.bob"
has a public post with text
"public stuff
#hashtag
"
And
a user named
"Alice"
with email
"alice@alice.alice"
And
"alice@alice.alice"
has a public post with text
"alice public stuff"
And
the post with text
"public stuff"
is reshared by
"alice@alice.alice"
And
the post with text
"public stuff
#hashtag
"
is reshared by
"alice@alice.alice"
And
the post with text
"alice public stuff"
is reshared by
"bob@bob.bob"
And
I sign in as
"alice@alice.alice"
Scenario
:
Hovercards on the main stream
Given
I am on
"bob@bob.bob"
's page
Given
I sign in as
"alice@alice.alice"
And
I am on
"bob@bob.bob"
's page
Then
I should see
"public stuff"
within
".stream_element"
When
I activate the first hovercard
Then
I should see a hovercard
...
...
@@ -22,7 +22,8 @@ Feature: Hovercards
Then
I should not see a hovercard
Scenario
:
Hovercards on the main stream in reshares
Given
I am on
"bob@bob.bob"
's page
Given
I sign in as
"alice@alice.alice"
And
I am on
"bob@bob.bob"
's page
Then
I should see
"Alice"
within
"#main_stream"
When
I hover
"Alice"
within
"#main_stream"
Then
I should not see a hovercard
...
...
@@ -30,3 +31,11 @@ Feature: Hovercards
Then
I should see
"Bob Jones"
within
"#main_stream"
When
I hover
"Bob Jones"
within
"#main_stream"
Then
I should see a hovercard
Scenario
:
Hovercards on the tag stream as a logged out user
Given
I am on the tag page for
"hashtag"
Then
I should see
"public stuff"
within
".stream_element"
When
I activate the first hovercard
Then
I should see a hovercard
When
I deactivate the first hovercard
Then
I should not see a hovercard
spec/javascripts/app/views/hovercard_view_spec.js
View file @
f3e897ab
...
...
@@ -5,9 +5,12 @@ describe("app.views.Hovercard", function() {
this
.
view
=
new
app
.
views
.
Hovercard
();
});
describe
(
"
initialize
"
,
function
()
{
it
(
"
deactivates hovercards
"
,
function
()
{
expect
(
this
.
view
.
active
).
toBeFalsy
();
describe
(
"
_populateHovercardWith
"
,
function
()
{
it
(
"
doesn't fetch the aspect dropdown
"
,
function
()
{
spyOn
(
jQuery
,
"
ajax
"
).
and
.
callThrough
();
this
.
view
.
parent
=
spec
.
content
();
this
.
view
.
_populateHovercardWith
({});
expect
(
jQuery
.
ajax
).
not
.
toHaveBeenCalled
();
});
});
});
...
...
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