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
ef481417
Commit
ef481417
authored
Feb 03, 2017
by
alisan617
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change post type options to radio buttons actually just reveal them
parent
e71a6c24
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
76 deletions
+88
-76
common/static/common/js/discussion/views/discussion_thread_edit_view.js
+1
-1
common/static/common/js/discussion/views/new_post_view.js
+1
-1
common/static/common/js/spec/discussion/view/new_post_view_spec.js
+6
-6
common/static/common/templates/discussion/new-post.underscore
+11
-9
common/static/common/templates/discussion/thread-edit.underscore
+1
-1
common/static/common/templates/discussion/thread-type.underscore
+14
-10
common/static/common/templates/discussion/topic.underscore
+13
-15
common/static/sass/edx-pattern-library-shims/_form.scss
+27
-0
lms/static/sass/discussion/views/_create-edit-post.scss
+12
-33
lms/static/sass/discussion/views/_inline.scss
+2
-0
No files found.
common/static/common/js/discussion/views/discussion_thread_edit_view.js
View file @
ef481417
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
save
:
function
()
{
save
:
function
()
{
var
title
=
this
.
$
(
'.edit-post-title'
).
val
(),
var
title
=
this
.
$
(
'.edit-post-title'
).
val
(),
threadType
=
this
.
$
(
'.
post-type-input
:checked'
).
val
(),
threadType
=
this
.
$
(
'.
input-radio
:checked'
).
val
(),
body
=
this
.
$
(
'.edit-post-body textarea'
).
val
(),
body
=
this
.
$
(
'.edit-post-body textarea'
).
val
(),
postData
=
{
postData
=
{
title
:
title
,
title
:
title
,
...
...
common/static/common/js/discussion/views/new_post_view.js
View file @
ef481417
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
var
anonymous
,
anonymousToPeers
,
body
,
follow
,
group
,
threadType
,
title
,
topicId
,
url
,
var
anonymous
,
anonymousToPeers
,
body
,
follow
,
group
,
threadType
,
title
,
topicId
,
url
,
self
=
this
;
self
=
this
;
event
.
preventDefault
();
event
.
preventDefault
();
threadType
=
this
.
$
(
'.
post-type-input
:checked'
).
val
();
threadType
=
this
.
$
(
'.
input-radio
:checked'
).
val
();
title
=
this
.
$
(
'.js-post-title'
).
val
();
title
=
this
.
$
(
'.js-post-title'
).
val
();
body
=
this
.
$
(
'.js-post-body'
).
find
(
'.wmd-input'
).
val
();
body
=
this
.
$
(
'.js-post-body'
).
find
(
'.wmd-input'
).
val
();
group
=
this
.
$
(
'.js-group-select option:selected'
).
attr
(
'value'
);
group
=
this
.
$
(
'.js-group-select option:selected'
).
attr
(
'value'
);
...
...
common/static/common/js/spec/discussion/view/new_post_view_spec.js
View file @
ef481417
...
@@ -214,9 +214,9 @@
...
@@ -214,9 +214,9 @@
view
.
$
(
'.js-post-title'
).
val
(
'Test Title'
);
view
.
$
(
'.js-post-title'
).
val
(
'Test Title'
);
view
.
$
(
'.js-post-body textarea'
).
val
(
'Test body'
);
view
.
$
(
'.js-post-body textarea'
).
val
(
'Test body'
);
view
.
$
(
'.wmd-preview p'
).
html
(
'Test body'
);
view
.
$
(
'.wmd-preview p'
).
html
(
'Test body'
);
view
.
$
(
'
.js-follow
'
).
prop
(
'checked'
,
false
);
view
.
$
(
'
input[name=follow]
'
).
prop
(
'checked'
,
false
);
view
.
$
(
'
.js-anon
'
).
prop
(
'checked'
,
true
);
view
.
$
(
'
input[name=anonymous]
'
).
prop
(
'checked'
,
true
);
view
.
$
(
'
.js-anon-peers
'
).
prop
(
'checked'
,
true
);
view
.
$
(
'
input[name=anonymous_to_peers]
'
).
prop
(
'checked'
,
true
);
if
(
mode
===
'tab'
)
{
if
(
mode
===
'tab'
)
{
view
.
$
(
"a[data-discussion-id='2b3a858d0c884eb4b272dbbe3f2ffddd']"
).
click
();
view
.
$
(
"a[data-discussion-id='2b3a858d0c884eb4b272dbbe3f2ffddd']"
).
click
();
}
}
...
@@ -227,9 +227,9 @@
...
@@ -227,9 +227,9 @@
expect
(
$
(
"input[id$='post-type-question']"
)).
not
.
toBeChecked
();
expect
(
$
(
"input[id$='post-type-question']"
)).
not
.
toBeChecked
();
expect
(
view
.
$
(
'.js-post-title'
).
val
()).
toEqual
(
''
);
expect
(
view
.
$
(
'.js-post-title'
).
val
()).
toEqual
(
''
);
expect
(
view
.
$
(
'.js-post-body textarea'
).
val
()).
toEqual
(
''
);
expect
(
view
.
$
(
'.js-post-body textarea'
).
val
()).
toEqual
(
''
);
expect
(
view
.
$
(
'
.js-follow
'
)).
toBeChecked
();
expect
(
view
.
$
(
'
input[name=follow]
'
)).
toBeChecked
();
expect
(
view
.
$
(
'
.js-anon
'
)).
not
.
toBeChecked
();
expect
(
view
.
$
(
'
input[name=anonymous]
'
)).
not
.
toBeChecked
();
expect
(
view
.
$
(
'
.js-anon-peers
'
)).
not
.
toBeChecked
();
expect
(
view
.
$
(
'
input[name=anonymous_to_peers]
'
)).
not
.
toBeChecked
();
if
(
mode
===
'tab'
)
{
if
(
mode
===
'tab'
)
{
return
expect
(
view
.
$
(
'.post-topic option:selected'
).
text
()).
toEqual
(
'General'
);
return
expect
(
view
.
$
(
'.post-topic option:selected'
).
text
()).
toEqual
(
'General'
);
}
}
...
...
common/static/common/templates/discussion/new-post.underscore
View file @
ef481417
...
@@ -46,20 +46,22 @@
...
@@ -46,20 +46,22 @@
<div class="js-post-body editor" aria-describedby="new-post-editor-description" name="body"></div>
<div class="js-post-body editor" aria-describedby="new-post-editor-description" name="body"></div>
</div>
</div>
<div class="post-options">
<div class="post-options">
<label class="post-option is-enabled">
<label class="field-label label-inline">
<input type="checkbox" name="follow" class="post-option-input js-follow" checked>
<input type="checkbox" name="follow" class="field-input input-checkbox" checked>
<span class="icon fa fa-star" aria-hidden="true"></span><%- gettext("follow this post") %>
<span class="field-input-label">
<span class="icon fa fa-star" aria-hidden="true"></span><%- gettext("follow this post") %>
</span>
</label>
</label>
<% if (allow_anonymous) { %>
<% if (allow_anonymous) { %>
<label class="
post-option
">
<label class="
field-label label-inline
">
<input type="checkbox" name="anonymous" class="
post-option-input js-anon
">
<input type="checkbox" name="anonymous" class="
field-input input-checkbox
">
<
%- gettext("post anonymously") %
>
<
span class="field-input-label"><%- gettext("post anonymously") %></span
>
</label>
</label>
<% } %>
<% } %>
<% if (allow_anonymous_to_peers) { %>
<% if (allow_anonymous_to_peers) { %>
<label class="
post-option
">
<label class="
field-label label-inline
">
<input type="checkbox" name="anonymous_to_peers" class="
post-option-input js-anon-peers
">
<input type="checkbox" name="anonymous_to_peers" class="
field-input input-checkbox
">
<
%- gettext("post anonymously to classmates") %
>
<
span class="field-input-label"><%- gettext("post anonymously to classmates") %></span
>
</div>
</div>
<% } %>
<% } %>
</div>
</div>
...
...
common/static/common/templates/discussion/thread-edit.underscore
View file @
ef481417
<h
4><%- gettext("Editing post") %></h4
>
<h
3 class="thread-title"><%- gettext("Editing post") %></h3
>
<ul class="post-errors"></ul>
<ul class="post-errors"></ul>
<div class="forum-edit-post-form-wrapper"></div>
<div class="forum-edit-post-form-wrapper"></div>
<div class="post-field">
<div class="post-field">
...
...
common/static/common/templates/discussion/thread-type.underscore
View file @
ef481417
<div class="post-field">
<div class="post-field">
<
div
class="field-label">
<
label
class="field-label">
<span class="field-label-text">
<span class="field-label-text">
<% // Translators: This is the label for a control to select a forum post type %>
<% // Translators: This is the label for a control to select a forum post type %>
<%- gettext("Post type") %>
<%- gettext("Post type") %>
...
@@ -10,19 +10,23 @@
...
@@ -10,19 +10,23 @@
<div class="field-label">
<div class="field-label">
<fieldset class="field-input">
<fieldset class="field-input">
<legend class="sr"><%- gettext("Post type") %></legend>
<legend class="sr"><%- gettext("Post type") %></legend>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-question" value="question">
<label for="<%= form_id %>-post-type-question" class="post-type-label">
<label for="<%= form_id %>-post-type-question" class="post-type-label">
<span class="icon fa fa-question" aria-hidden="true"></span>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="field-input input-radio" id="<%= form_id %>-post-type-question" value="question">
<% // Translators: This is a forum post type %>
<span class="field-input-label">
<%- gettext("Question") %>
<span class="icon fa fa-question" aria-hidden="true"></span>
<% // Translators: This is a forum post type %>
<%- gettext("Question") %>
</span>
</label>
</label>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-discussion" value="discussion" checked>
<label for="<%= form_id %>-post-type-discussion" class="post-type-label">
<label for="<%= form_id %>-post-type-discussion" class="post-type-label">
<span class="icon fa fa-comments" aria-hidden="true"></span>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="field-input input-radio" id="<%= form_id %>-post-type-discussion" value="discussion" checked>
<% // Translators: This is a forum post type %>
<span class="field-input-label">
<%- gettext("Discussion") %>
<span class="icon fa fa-comments" aria-hidden="true"></span>
<% // Translators: This is a forum post type %>
<%- gettext("Discussion") %>
</span>
</label>
</label>
</fieldset>
</fieldset>
</div>
</div>
</
div
>
</
label
>
</div>
</div>
common/static/common/templates/discussion/topic.underscore
View file @
ef481417
<div class="post-field">
<label class="field-label">
<label class="field-label">
<span class="field-label-text">
<span class="field-label-text">
<%- gettext("Topic area") %>
<%- gettext("Topic area") %>
</span>
</span>
<div class="field-help" id="field_help_topic_area">
<div class="field-help" id="field_help_topic_area">
<%- gettext("Add your post to a relevant topic to help others find it. (Required)") %>
<%- gettext("Add your post to a relevant topic to help others find it. (Required)") %>
</div>
</div>
<div class="field-input">
<div class="field-input">
<select class="post-topic field-input" aria-describedby="field_help_topic_area" required>
<select class="post-topic field-input" aria-describedby="field_help_topic_area" required>
<%= edx.HtmlUtils.ensureHtml(topics_html) %>
<%= edx.HtmlUtils.ensureHtml(topics_html) %>
</select>
</select>
</div>
</div>
</label>
</label>
</div>
common/static/sass/edx-pattern-library-shims/_form.scss
0 → 100644
View file @
ef481417
/*
This file mirror UXPL Form field styles
*/
@import
'base/variables'
;
.post-type-label
{
@include
margin-right
(
$baseline
);
display
:
inline-block
;
line-height
:
100%
;
}
.field-label
{
.post-options
&
{
display
:
inline-block
;
}
.field-input
:checked
+
.field-input-label
{
color
:
$uxpl-blue-base
;
}
}
.input-radio
,
.input-checkbox
{
@include
margin-right
(
$baseline
/
2
);
}
lms/static/sass/discussion/views/_create-edit-post.scss
View file @
ef481417
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
.field-input
{
.field-input
{
display
:
inline-block
;
display
:
inline-block
;
width
:
70%
;
vertical-align
:
top
;
vertical-align
:
top
;
&
:not
([
type
=
"text"
])
{
&
:not
([
type
=
"text"
])
{
border-width
:
0
;
border-width
:
0
;
...
@@ -66,7 +65,7 @@
...
@@ -66,7 +65,7 @@
line-height
:
1
.5
;
line-height
:
1
.5
;
&
#field_help_post_type
{
&
#field_help_post_type
{
margin-top
:
(
$baseline
/
2
)
0
(
$baseline
/
3
)
0
;
@include
margin
(
$baseline
/
2
,
0
,
$baseline
*
0
.75
,
0
)
;
}
}
&
#new-post-editor-description
{
&
#new-post-editor-description
{
...
@@ -81,7 +80,15 @@
...
@@ -81,7 +80,15 @@
}
}
.post-options
{
.post-options
{
margin-bottom
:
(
$baseline
/
2
);
margin
:
$baseline
0
;
.field-label
{
@include
margin-right
(
$baseline
);
}
.icon
{
@include
margin-right
(
$baseline
/
4
);
}
}
}
}
}
...
@@ -137,39 +144,10 @@
...
@@ -137,39 +144,10 @@
// UI: inputs
// UI: inputs
.forum-new-post-form
,
.forum-new-post-form
,
.edit-post-form
{
.edit-post-form
{
.post-type-input
{
@extend
%text-sr
;
}
.post-type-label
{
.post-type-label
{
@include
margin
(
0
,
$baseline
/
2
,
0
,
0
);
@include
margin-right
(
$baseline
);
@include
white-button
;
font-size
:
$forum-base-font-size
;
box-sizing
:
border-box
;
display
:
inline-block
;
padding
:
0
$baseline
;
height
:
36px
;
text-align
:
center
;
color
:
$gray-d3
;
color
:
$gray-d3
;
border
:
1px
solid
$forum-color-border
;
font-weight
:
600
;
line-height
:
36px
;
.icon
{
@include
margin-right
(
$baseline
/
4
);
}
}
.post-type-input
:checked
+
.post-type-label
{
border
:
none
;
background-color
:
$forum-color-active-thread
;
color
:
$forum-color-active-text
;
background-image
:
none
;
box-shadow
:
none
;
}
.post-type-input
:focus
+
.post-type-label
{
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
0
.4
)
inset
,
0
0
2px
2px
$blue
;
}
}
input
[
type
=
text
]
.field-input
{
input
[
type
=
text
]
.field-input
{
...
@@ -177,6 +155,7 @@
...
@@ -177,6 +155,7 @@
border
:
1px
solid
$forum-color-border
;
border
:
1px
solid
$forum-color-border
;
border-radius
:
$forum-border-radius
;
border-radius
:
$forum-border-radius
;
padding
:
0
$baseline
/
2
;
padding
:
0
$baseline
/
2
;
width
:
70%
;
height
:
40px
;
height
:
40px
;
color
:
#333
;
color
:
#333
;
font-size
:
$forum-large-font-size
;
font-size
:
$forum-large-font-size
;
...
...
lms/static/sass/discussion/views/_inline.scss
View file @
ef481417
// forums - inline discussion styling
// forums - inline discussion styling
// ====================
// ====================
@import
'../../edx-pattern-library-shims/form'
;
.discussion.inline-discussion
{
.discussion.inline-discussion
{
.inline-threads
{
.inline-threads
{
border
:
1px
solid
$forum-color-border
;
border
:
1px
solid
$forum-color-border
;
...
...
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