Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
edx
course-discovery
Commits
7860ad08
Commit
7860ad08
authored
Apr 19, 2017
by
Awais
Committed by
Awais Qureshi
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding social links.
ECOM-7736
parent
7ff7f3cd
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
127 additions
and
19 deletions
+127
-19
course_discovery/apps/publisher/tests/test_wrapper.py
+9
-1
course_discovery/apps/publisher/wrappers.py
+5
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.po
+14
-1
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.po
+1
-1
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
+14
-1
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.mo
+0
-0
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.po
+1
-1
course_discovery/static/js/publisher/modal-screen.js
+19
-11
course_discovery/static/sass/publisher/publisher.scss
+25
-0
course_discovery/templates/publisher/course_run_detail/_instructor_profile.html
+39
-3
No files found.
course_discovery/apps/publisher/tests/test_wrapper.py
View file @
7860ad08
...
...
@@ -7,7 +7,8 @@ from django.test import TestCase
from
course_discovery.apps.core.tests.helpers
import
make_image_file
from
course_discovery.apps.course_metadata.choices
import
CourseRunPacing
from
course_discovery.apps.course_metadata.tests.factories
import
OrganizationFactory
,
PersonFactory
,
PositionFactory
from
course_discovery.apps.course_metadata.tests.factories
import
(
OrganizationFactory
,
PersonFactory
,
PersonSocialNetworkFactory
,
PositionFactory
)
from
course_discovery.apps.publisher.choices
import
CourseRunStateChoices
,
PublisherUserRole
from
course_discovery.apps.publisher.models
import
Seat
from
course_discovery.apps.publisher.tests
import
factories
...
...
@@ -185,12 +186,17 @@ class CourseRunWrapperTests(TestCase):
self
.
course_run
.
staff
=
[
staff
,
staff_2
]
self
.
course_run
.
save
()
facebook
=
PersonSocialNetworkFactory
(
person
=
staff_2
,
type
=
'facebook'
)
twitter
=
PersonSocialNetworkFactory
(
person
=
staff_2
,
type
=
'twitter'
)
expected
=
[
{
'uuid'
:
str
(
staff
.
uuid
),
'full_name'
:
staff
.
full_name
,
'image_url'
:
staff
.
get_profile_image_url
,
'profile_url'
:
staff
.
profile_url
,
'social_networks'
:
{},
'bio'
:
staff
.
bio
},
{
'uuid'
:
str
(
staff_2
.
uuid
),
...
...
@@ -199,6 +205,8 @@ class CourseRunWrapperTests(TestCase):
'position'
:
position
.
title
,
'organization'
:
position
.
organization_name
,
'profile_url'
:
staff
.
profile_url
,
'social_networks'
:
{
'facebook'
:
facebook
.
value
,
'twitter'
:
twitter
.
value
},
'bio'
:
staff_2
.
bio
}
]
...
...
course_discovery/apps/publisher/wrappers.py
View file @
7860ad08
...
...
@@ -197,6 +197,11 @@ class CourseRunWrapper(BaseWrapper):
'full_name'
:
staff
.
full_name
,
'image_url'
:
staff
.
get_profile_image_url
,
'profile_url'
:
staff
.
profile_url
,
'bio'
:
staff
.
bio
,
'social_networks'
:
{
staff
.
type
:
staff
.
value
for
staff
in
staff
.
person_networks
.
all
()
}
}
if
hasattr
(
staff
,
'position'
):
...
...
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
View file @
7860ad08
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/django.po
View file @
7860ad08
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 1
1:50
+0500\n"
"POT-Creation-Date: 2017-04-20 1
2:22
+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -1030,6 +1030,7 @@ msgid "Organization"
msgstr ""
#: templates/publisher/_add_instructor_popup.html
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Bio"
msgstr ""
...
...
@@ -2315,6 +2316,18 @@ msgid "Profile URL "
msgstr ""
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "FaceBook URL "
msgstr ""
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Twitter URL "
msgstr ""
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Blog URL "
msgstr ""
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Close"
msgstr ""
...
...
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.mo
View file @
7860ad08
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.po
View file @
7860ad08
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 1
1:50
+0500\n"
"POT-Creation-Date: 2017-04-20 1
2:22
+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
View file @
7860ad08
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
View file @
7860ad08
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 1
1:50
+0500\n"
"POT-Creation-Date: 2017-04-20 1
2:22
+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -1189,6 +1189,7 @@ msgid "Organization"
msgstr "Örgänïzätïön Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: templates/publisher/_add_instructor_popup.html
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Bio"
msgstr "Bïö Ⱡ'σяєм#"
...
...
@@ -2742,6 +2743,18 @@ msgid "Profile URL "
msgstr "Pröfïlé ÛRL Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "FaceBook URL "
msgstr "FäçéBöök ÛRL Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#"
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Twitter URL "
msgstr "Twïttér ÛRL Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Blog URL "
msgstr "Blög ÛRL Ⱡ'σяєм ιρѕυм ∂σł#"
#: templates/publisher/course_run_detail/_instructor_profile.html
msgid "Close"
msgstr "Çlösé Ⱡ'σяєм ιρѕ#"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.mo
View file @
7860ad08
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.po
View file @
7860ad08
...
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 1
1:50
+0500\n"
"POT-Creation-Date: 2017-04-20 1
2:22
+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
course_discovery/static/js/publisher/modal-screen.js
View file @
7860ad08
...
...
@@ -37,15 +37,14 @@ $(document).ready(function(){
$
(
'#instructorProfileModal div.organization'
).
html
(
data
[
'organization'
]);
$
(
'#instructorProfileModal img.image_url'
).
attr
(
'src'
,
data
[
'image_url'
]);
$
(
'#instructorProfileModal a.btn-download'
).
attr
(
'href'
,
data
[
'image_url'
]);
$
(
'#instructorProfileModal div.position'
).
html
(
data
[
'position'
]);
$
(
'#instructorProfileModal div.bio'
).
html
(
data
[
'bio'
]);
if
(
data
[
'profile_url'
])
{
$
(
'#instructorProfileModal a.profile_url'
).
attr
(
"href"
,
data
[
'profile_url'
]);
$
(
'#instructorProfileModal div.profile_url_copy'
).
html
(
data
[
'profile_url'
]).
hide
();
}
else
$
(
'#instructorProfileModal a.profile_url'
).
attr
(
"href"
,
'#'
);
assignData
(
'.profile_url'
,
data
[
'profile_url'
]);
assignData
(
'.facebook_url'
,
data
[
'social_networks'
][
'facebook'
]);
assignData
(
'.twitter_url'
,
data
[
'social_networks'
][
'twitter'
]);
assignData
(
'.blog_url'
,
data
[
'social_networks'
][
'blog'
]);
$
(
'#instructorProfileModal div.position'
).
html
(
data
[
'position'
]);
});
});
...
...
@@ -72,9 +71,18 @@ function clearModalError($modal) {
function
resetModalData
()
{
$
(
'#instructorProfileModal div.full_name'
).
html
(
''
);
$
(
'#instructorProfileModal div.organization'
).
html
(
''
);
$
(
'#instructorProfileModal img.image_url'
).
attr
(
'src'
,
''
);
$
(
'#instructorProfileModal a.btn-download'
).
attr
(
'href'
,
''
);
$
(
'#instructorProfileModal a.profile_url'
).
attr
(
"href"
,
''
);
$
(
'#instructorProfileModal div.profile_url_copy'
).
html
(
''
);
$
(
'#instructorProfileModal img.image_url'
).
attr
(
'src'
,
'#'
);
$
(
'#instructorProfileModal div.position'
).
html
(
''
);
$
(
'#instructorProfileModal a.btn-download'
).
attr
(
'href'
,
'#'
);
$
(
'#instructorProfileModal div.bio'
).
html
(
''
);
assignData
(
'.facebook_url'
,
'#'
);
assignData
(
'.twitter_url'
,
'#'
);
assignData
(
'.profile_url'
,
'#'
);
assignData
(
'.blog_url'
,
'#'
);
}
function
assignData
(
element
,
data
){
$
(
element
).
attr
(
"href"
,
data
);
$
(
element
+
'_copy'
).
html
(
data
);
}
course_discovery/static/sass/publisher/publisher.scss
View file @
7860ad08
...
...
@@ -657,3 +657,28 @@
width
:
120px
;
height
:
120px
;
}
.social-links
{
text-align
:
center
;
margin-top
:
20px
;
.heading
{
&
.icon
{
display
:
inline-block
;
width
:
30%
;
>
a
{
font-weight
:
bold
;
font-size
:
1
.1em
;
vertical-align
:
middle
;
color
:
#065683
;
}
.btn
{
@include
padding
(
5px
,
5px
,
5px
,
5px
);
@include
margin-left
(
6px
);
}
}
}
}
course_discovery/templates/publisher/course_run_detail/_instructor_profile.html
View file @
7860ad08
{% load i18n %}
{% load compress %}
{% load i18n %}
{% load staticfiles %}
<div
id=
"instructorProfileModal"
class=
"modal"
>
...
...
@@ -39,7 +38,34 @@
<a
class=
"profile_url"
target=
"_blank"
>
{% trans "Profile URL "%}
</a>
{% include "publisher/course_run_detail/_clipboard.html" %}
</div>
<div
class=
"copy profile_url_copy"
></div>
<div
class=
"copy profile_url_copy hidden"
></div>
</div>
<div
class=
"info-item"
>
<div
class=
"heading"
>
{% trans "Bio" %}:
{% include "publisher/course_run_detail/_clipboard.html" %}
</div>
<div
class=
"copy bio"
></div>
</div>
<div
class=
"social-links"
>
<div
class=
"heading icon"
>
<a
class=
"facebook_url"
target=
"_blank"
>
{% trans "FaceBook URL "%}
</a>
{% include "publisher/course_run_detail/_clipboard.html" %}
<div
class=
"copy facebook_url_copy hidden"
></div>
</div>
<div
class=
"heading icon"
>
<a
class=
"twitter_url"
target=
"_blank"
>
{% trans "Twitter URL "%}
</a>
{% include "publisher/course_run_detail/_clipboard.html" %}
<div
class=
"copy twitter_url_copy hidden"
></div>
</div>
<div
class=
"heading icon"
>
<a
class=
"blog_url"
target=
"_blank"
>
{% trans "Blog URL "%}
</a>
{% include "publisher/course_run_detail/_clipboard.html" %}
<div
class=
"copy blog_url_copy hidden"
></div>
</div>
</div>
<div
class=
"actions"
>
...
...
@@ -47,3 +73,13 @@
</div>
</div>
</div>
{% block extra_js %}
<script
src=
"{% static 'bower_components/clipboard/dist/clipboard.min.js' %}"
></script>
<script>
new
Clipboard
(
".btn-copy"
,
{
text
:
function
(
trigger
)
{
return
$
(
trigger
).
next
(
'.copy'
).
text
().
trim
();
}
});
</script>
{% endblock %}
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