Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
5aa2ad84
Commit
5aa2ad84
authored
Nov 15, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added xmodule for showing a 'find collaborator' link.
parent
ba57e8a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
0 deletions
+89
-0
common/lib/xmodule/setup.py
+1
-0
common/lib/xmodule/xmodule/collaborate_module.py
+31
-0
lms/static/sass/_collaborate.scss
+47
-0
lms/static/sass/application.scss
+1
-0
lms/templates/xmodules/collaborate_module.html
+9
-0
No files found.
common/lib/xmodule/setup.py
View file @
5aa2ad84
...
...
@@ -36,6 +36,7 @@ setup(
"videodev = xmodule.backcompat_module:TranslateCustomTagDescriptor"
,
"videosequence = xmodule.seq_module:SequenceDescriptor"
,
"discussion = xmodule.discussion_module:DiscussionDescriptor"
,
"collaborate = xmodule.collaborate_module:CollaborateDescriptor"
,
]
}
)
common/lib/xmodule/xmodule/collaborate_module.py
0 → 100644
View file @
5aa2ad84
from
lxml
import
etree
from
pkg_resources
import
resource_string
,
resource_listdir
from
xmodule.x_module
import
XModule
from
xmodule.raw_module
import
RawDescriptor
import
json
class
CollaborateModule
(
XModule
):
# js = {'coffee':
# [resource_string(__name__, 'js/src/time.coffee'),
# resource_string(__name__, 'js/src/discussion/display.coffee')]
# }
# js_module_name = "FindCollaborators"
def
get_html
(
self
):
context
=
{
'collaborate_room'
:
self
.
collaborate_room
,
}
return
self
.
system
.
render_template
(
'xmodules/collaborate_module.html'
,
context
)
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
,
shared_state
,
**
kwargs
)
if
isinstance
(
instance_state
,
str
):
instance_state
=
json
.
loads
(
instance_state
)
xml_data
=
etree
.
fromstring
(
definition
[
'data'
])
self
.
collaborate_room
=
xml_data
.
attrib
[
'collaborate_room'
]
class
CollaborateDescriptor
(
RawDescriptor
):
module_class
=
CollaborateModule
template_dir_name
=
"collaborate"
lms/static/sass/_collaborate.scss
0 → 100644
View file @
5aa2ad84
@mixin
blue-button
{
display
:
block
;
height
:
35px
;
padding
:
0
15px
;
border-radius
:
3px
;
border
:
1px
solid
#2d81ad
;
@include
linear-gradient
(
top
,
#6dccf1
,
#38a8e5
);
font-size
:
13px
;
font-weight
:
700
;
line-height
:
32px
;
color
:
#fff
;
text-shadow
:
0
1px
0
rgba
(
0
,
0
,
0
,
.3
);
box-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
0
.4
)
inset
,
0
1px
1px
rgba
(
0
,
0
,
0
,
.15
);
&
:hover
{
border-color
:
#297095
;
@include
linear-gradient
(
top
,
#4fbbe4
,
#2090d0
);
}
}
.collaborate_module
{
float
:
right
;
.find_collaborator
{
@include
blue-button
;
font-size
:
13px
;
z-index
:
25
;
// To make the collaborate-status show up below
position
:
relative
;
// To make the z-index work
}
.collaborate-status
{
//Displays below the .find_collaborator, like a little dropdown menu
font-size
:
12px
;
display
:
block
;
height
:
22px
;
border-radius
:
3px
;
background-color
:
#10242E
;
color
:
#fff
;
margin
:
-10px
10px
;
padding
:
12px
15px
0px
;
z-index
:
20
;
position
:
relative
;
}
}
lms/static/sass/application.scss
View file @
5aa2ad84
...
...
@@ -29,4 +29,5 @@
@import
'multicourse/help'
;
@import
'discussion'
;
@import
'collaborate'
;
@import
'news'
;
lms/templates/xmodules/collaborate_module.html
0 → 100644
View file @
5aa2ad84
<
%!
import
urllib
%
>
<div
class=
"collaborate_module"
>
<a
class=
"find_collaborator"
href=
"#"
onclick=
"window.open('http://127.0.0.1:3000/pair/${collaborate_room | urllib.quote}', 'collaborate_window', 'width=780, height=590'); return false;"
>
Collaborate on ${collaborate_room | h}
</a>
<span
class=
"collaborate-status"
>
Connecting...
</span>
</div>
\ No newline at end of file
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