Commit 80a9620a by Arjun Singh

Merge branch 'feature/tomg/new-discussions' of github.com:MITx/mitx into…

Merge branch 'feature/tomg/new-discussions' of github.com:MITx/mitx into feature/tomg/new-discussions
parents 9d222469 4f4f35f5
...@@ -16,13 +16,15 @@ if Backbone? ...@@ -16,13 +16,15 @@ if Backbone?
else else
@page = 1 @page = 1
toggleNewPost: (event) -> toggleNewPost: (event) ->
event.preventDefault()
if @newPostForm.is(':hidden') if @newPostForm.is(':hidden')
@newPostForm.slideDown(300) @newPostForm.slideDown(300)
else else
@newPostForm.slideUp(300) @newPostForm.slideUp(300)
hideNewPost: (event) -> hideNewPost: (event) ->
event.preventDefault()
@newPostForm.slideUp(300) @newPostForm.slideUp(300)
toggleDiscussion: (event) -> toggleDiscussion: (event) ->
......
...@@ -195,8 +195,8 @@ class @DiscussionThreadInlineView extends DiscussionContentView ...@@ -195,8 +195,8 @@ class @DiscussionThreadInlineView extends DiscussionContentView
@expanded = true @expanded = true
@$el.find('.post-body').html(@model.get('body')) @$el.find('.post-body').html(@model.get('body'))
@convertMath() @convertMath()
@$el.find('.expand-post').hide() @$el.find('.expand-post').css('display', 'none')
@$el.find('.collapse-post').show() @$el.find('.collapse-post').css('display', 'block')
@$el.find('.post-extended-content').show() @$el.find('.post-extended-content').show()
@makeWmdEditor "reply-body" @makeWmdEditor "reply-body"
if @$el.find('.loading').length if @$el.find('.loading').length
...@@ -206,6 +206,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView ...@@ -206,6 +206,6 @@ class @DiscussionThreadInlineView extends DiscussionContentView
@expanded = false @expanded = false
@$el.find('.post-body').html(@model.get('abbreviatedBody')) @$el.find('.post-body').html(@model.get('abbreviatedBody'))
@convertMath() @convertMath()
@$el.find('.collapse-post').hide() @$el.find('.collapse-post').css('display', 'none')
@$el.find('.post-extended-content').hide() @$el.find('.post-extended-content').hide()
@$el.find('.expand-post').show() @$el.find('.expand-post').css('display', 'block')
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
height: 35px; height: 35px;
padding: 0 15px; padding: 0 15px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #444; border: 1px solid #aaa;
@include linear-gradient(top, #eee, #ccc); @include linear-gradient(top, #eee, #ccc);
font-size: 13px; font-size: 13px;
font-weight: 700; font-weight: 700;
...@@ -37,6 +37,25 @@ ...@@ -37,6 +37,25 @@
} }
} }
@mixin dark-grey-button {
display: block;
height: 35px;
padding: 0 15px;
border-radius: 3px;
border: 1px solid #222;
background: -webkit-linear-gradient(top, #777, #555);
font-size: 13px;
font-weight: 700;
line-height: 32px;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 1px 1px rgba(0, 0, 0, .15);
&:hover {
background: -webkit-linear-gradient(top, #888, #666);
}
}
@mixin discussion-wmd-input { @mixin discussion-wmd-input {
width: 100%; width: 100%;
height: 240px; height: 240px;
...@@ -291,6 +310,7 @@ body.discussion { ...@@ -291,6 +310,7 @@ body.discussion {
@include white-button; @include white-button;
height: 40px; height: 40px;
margin-top: 15px; margin-top: 15px;
border-color: #444;
line-height: 36px; line-height: 36px;
.drop-arrow { .drop-arrow {
...@@ -488,6 +508,7 @@ body.discussion { ...@@ -488,6 +508,7 @@ body.discussion {
.new-post-cancel { .new-post-cancel {
@include white-button; @include white-button;
bordre-color: #444;
float: left; float: left;
margin: 10px 0 0 15px; margin: 10px 0 0 15px;
} }
...@@ -1198,27 +1219,32 @@ body.discussion { ...@@ -1198,27 +1219,32 @@ body.discussion {
padding: 10px 20px; padding: 10px 20px;
> header .vote-btn { > header .vote-btn {
position: relative;
z-index: 100;
margin-top: 5px; margin-top: 5px;
} }
.post-tools { .post-tools {
@include clearfix;
margin-top: 15px;
.ui-icon { .ui-icon {
display: inline; display: inline;
float: right;
}
a {
display: inline;
float: left; float: left;
height: 26px; width: 13px;
padding: 0 12px; height: 13px;
border-radius: 3px; margin-right: 4px;
border: 1px solid #b2b2b2; background: url(../images/small-grey-arrows.png) no-repeat;
@include linear-gradient(top, #fff 35%, #ebebeb);
font-size: 13px; &.expand {
line-height: 24px; margin-top: 5px;
color: #737373; background-position: 0 0;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); }
width: 6em;
&.collapse {
margin-top: 6px;
background-position: -13px 0;
}
} }
} }
} }
...@@ -1275,6 +1301,8 @@ body.discussion { ...@@ -1275,6 +1301,8 @@ body.discussion {
} }
.vote-btn { .vote-btn {
position: relative;
z-index: 100;
float: right; float: right;
display: block; display: block;
height: 27px; height: 27px;
...@@ -1420,7 +1448,6 @@ body.discussion { ...@@ -1420,7 +1448,6 @@ body.discussion {
padding: 0; padding: 0;
@include clearfix; @include clearfix;
li { li {
float: left; float: left;
margin-right: 8px; margin-right: 8px;
...@@ -1541,38 +1568,90 @@ body.discussion { ...@@ -1541,38 +1568,90 @@ body.discussion {
.discussion-module { .discussion-module {
@extend .discussion-body; @extend .discussion-body;
.discussion-show {
@include white-button;
display: inline-block;
}
.new-post-btn {
display: inline-block;
}
section.discussion { section.discussion {
/* Course content p has a default margin-bottom of 1.416em, this is just to reset that */ margin-top: 20px;
/* Course content p has a default margin-bottom of 1.416em, this is just to reset that */
.discussion-thread { .discussion-thread {
padding: 0.5em; padding: 0.5em 0;
p { p {
margin-bottom: 0em; margin-bottom: 0em;
} }
.discussion-article { .discussion-article {
border: 1px solid; border: 1px solid #b2b2b2;
border-radius: 3px; border-radius: 3px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
min-height: 0; min-height: 0;
padding: 1em; padding: 10px 10px 40px;
.discussion-post { .discussion-post {
@include clearfix;
header { header {
padding-bottom: 0.1em; padding-bottom: 0;
margin-bottom: 10px; margin-bottom: 15px;
h3 {
font-size: 22px;
font-weight: 700;
margin-bottom: 0px;
}
} }
.post-body { .post-body {
font-size: 14px; font-size: 14px;
clear: both; clear: both;
} }
} }
.post-tools {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
border-radius: 0 0 3px 3px;
border-top: 1px solid #ddd;
@include linear-gradient(top, #f2f2f2, #e2e2e2);
a {
display: block;
width: 100%;
text-align: center;
font-size: 12px;
line-height: 30px;
&.expand-post:before {
content: '▾ ';
}
&.collapse-post:before {
content: '▴ ';
}
&.collapse-post {
display: none;
}
}
}
.responses { .responses {
margin-top: 10px; margin-top: 10px;
header { header {
padding-bottom: 0em; padding-bottom: 0em;
margin-bottom: 5px; margin-bottom: 5px;
.posted-by { .posted-by {
font-size: 0.8em; font-size: 0.8em;
} }
...@@ -1581,20 +1660,20 @@ body.discussion { ...@@ -1581,20 +1660,20 @@ body.discussion {
margin-bottom: 0.2em; margin-bottom: 0.2em;
font-size: 14px; font-size: 14px;
} }
} }
.discussion-reply-new { .discussion-reply-new {
.wmd-input { .wmd-input {
height: 120px; height: 120px;
} }
} }
// Content that is hidden by default in the inline view // Content that is hidden by default in the inline view
.post-extended-content{ .post-extended-content{
display: none; display: none;
} }
.collapse-post{
display:none;
}
} }
} }
} }
...@@ -1612,11 +1691,13 @@ body.discussion { ...@@ -1612,11 +1691,13 @@ body.discussion {
.new-post-form { .new-post-form {
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
padding: 30px;
border-radius: 3px; border-radius: 3px;
background: rgba(0, 0, 0, .55); background: rgba(0, 0, 0, .55);
color: #fff; color: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, .5) inset, 0 1px 0 rgba(255, 255, 255, .5); box-shadow: none;
@include clearfix; @include clearfix;
@include box-sizing(border-box);
.form-row { .form-row {
margin-bottom: 20px; margin-bottom: 20px;
...@@ -1681,6 +1762,22 @@ body.discussion { ...@@ -1681,6 +1762,22 @@ body.discussion {
font-weight: 700; font-weight: 700;
} }
.tagsinput {
padding: 10px;
box-sizing: border-box;
border: 1px solid #333;
border-radius: 3px;
background: #fff;
font-family: 'Monaco', monospace;
font-size: 13px;
line-height: 1.6;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;
span.tag {
margin-bottom: 0;
}
}
.submit { .submit {
@include blue-button; @include blue-button;
float: left; float: left;
...@@ -1698,10 +1795,11 @@ body.discussion { ...@@ -1698,10 +1795,11 @@ body.discussion {
@include white-button; @include white-button;
float: left; float: left;
margin: 10px 0 0 15px; margin: 10px 0 0 15px;
border-color: #444;
} }
.options { .options {
margin-top: 40px; margin-top: 5px;
label { label {
display: inline; display: inline;
...@@ -1744,6 +1842,7 @@ body.discussion { ...@@ -1744,6 +1842,7 @@ body.discussion {
.new-post-btn { .new-post-btn {
@include blue-button; @include blue-button;
display: inline-block;
font-size: 13px; font-size: 13px;
margin-right: 4px; margin-right: 4px;
} }
...@@ -1756,28 +1855,42 @@ body.discussion { ...@@ -1756,28 +1855,42 @@ body.discussion {
margin: 8px 7px 0 0; margin: 8px 7px 0 0;
background: url(../images/new-post-icon.png) no-repeat; background: url(../images/new-post-icon.png) no-repeat;
} }
.moderator-actions {
padding-left: 0 !important;
}
section.pagination { section.pagination {
margin-top: 30px;
nav.discussion-paginator { nav.discussion-paginator {
ol{ float: right;
li{
ol {
li {
list-style: none; list-style: none;
display: inline-block; display: inline-block;
padding-right: 0.5em; padding-right: 0.5em;
a { a {
@include white-button @include white-button;
} }
} }
li.current-page{ li.current-page{
height: 35px; height: 35px;
padding: 0 15px;
border: 1px solid #ccc;
border-radius: 3px;
font-size: 13px; font-size: 13px;
font-weight: 700; font-weight: 700;
line-height: 32px; line-height: 32px;
color: #333; color: #333;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 1px 1px rgba(0, 0, 0, .15);
} }
} }
} }
} }
} }
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
// Course base / layout styles // Course base / layout styles
@import 'course/layout/courseware_header'; @import 'course/layout/courseware_header';
@import 'course/layout/footer'; @import 'course/layout/footer';
@import 'course/base/mixins';
@import 'course/base/base'; @import 'course/base/base';
@import 'course/base/extends'; @import 'course/base/extends';
@import 'module/module-styles.scss'; @import 'module/module-styles.scss';
......
...@@ -39,11 +39,6 @@ a { ...@@ -39,11 +39,6 @@ a {
} }
} }
form { form {
label { label {
display: block; display: block;
...@@ -132,6 +127,9 @@ img { ...@@ -132,6 +127,9 @@ img {
} }
} }
.test-class {
border: 1px solid #f00;
}
.toast-notification { .toast-notification {
...@@ -143,13 +141,16 @@ img { ...@@ -143,13 +141,16 @@ img {
padding: 15px 20px 17px; padding: 15px 20px 17px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #333; border: 1px solid #333;
@include linear-gradient(top, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0)); background: -webkit-linear-gradient(top, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0)) rgba(30, 30, 30, .92);
background-color: rgba(30, 30, 30, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .1) inset;
@include box-shadow(0 1px 3px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .1) inset);
font-size: 13px; font-size: 13px;
color: #fff; color: #fff;
opacity: 0; opacity: 0;
@include transition(all .2s); -webkit-transition: all .2s;
p, span {
color: #fff;
}
.error-icon { .error-icon {
display: block; display: block;
...@@ -191,5 +192,4 @@ img { ...@@ -191,5 +192,4 @@ img {
margin-top: 10px; margin-top: 10px;
text-align: center; text-align: center;
} }
} }
\ No newline at end of file
...@@ -35,4 +35,23 @@ ...@@ -35,4 +35,23 @@
&:hover { &:hover {
@include linear-gradient(top, #fff, #ddd); @include linear-gradient(top, #fff, #ddd);
} }
}
@mixin dark-grey-button {
display: block;
height: 35px;
padding: 0 15px;
border-radius: 3px;
border: 1px solid #222;
background: -webkit-linear-gradient(top, #777, #555);
font-size: 13px;
font-weight: 700;
line-height: 32px;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 1px 1px rgba(0, 0, 0, .15);
&:hover {
background: -webkit-linear-gradient(top, #888, #666);
}
} }
\ No newline at end of file
...@@ -7,24 +7,22 @@ ...@@ -7,24 +7,22 @@
<div class="new-post-form-errors"> <div class="new-post-form-errors">
</div> </div>
<form class="new-post-form"> <form class="new-post-form">
<div class="right-column"> <div class="form-row">
<div class="form-row"> <input type="text" class="new-post-title" name="title" placeholder="Title">
<input type="text" class="new-post-title" name="title" placeholder="Title"> </div>
</div> <div class="form-row">
<div class="form-row"> <div class="new-post-body" name="body" placeholder="Enter your question or comment&hellip;"></div>
<div class="new-post-body" name="body" placeholder="Enter your question or comment&hellip;"></div> <!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>-->
<!---<div class="new-post-preview"><span class="new-post-preview-label">Preview</span></div>--> </div>
</div> <div class="form-row">
<div class="form-row"> <input type="text" class="new-post-tags" name="tags" placeholder="Tags">
<input type="text" class="new-post-tags" name="tags" placeholder="Tags"> </div>
</div> <input type="submit" class="submit" value="Add post">
<input type="submit" class="submit" value="Add post"> <a href="#" class="new-post-cancel">Cancel</a>
<a href="#" class="new-post-cancel">Cancel</a> <div class="options">
<div class="options"> <input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<input type="checkbox" name="follow" class="discussion-follow" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label> <br>
<br> <input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
<input type="checkbox" name="anonymous" class="discussion-anonymous" id="new-post-anonymous"><label for="new-post-anonymous">post anonymously</label>
</div>
</div> </div>
</form> </form>
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="discussion-post local"> <div class="discussion-post local">
<header> <header>
<a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>{{votes.up_count}}</span></a> <a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote"><span class="plus-icon">+</span> <span class='votes-count-number'>{{votes.up_count}}</span></a>
<h1>{{title}}</h1> <h3>{{title}}</h3>
<p class="posted-details"> <p class="posted-details">
<span class="timeago" title="{{created_at}}">{{created_at}}</span> by <span class="timeago" title="{{created_at}}">{{created_at}}</span> by
<a href="{{user_url}}">{{username}}</a> <a href="{{user_url}}">{{username}}</a>
...@@ -11,12 +11,9 @@ ...@@ -11,12 +11,9 @@
&bull; This thread is closed. &bull; This thread is closed.
</span> </span>
</p> </p>
<div class="local post-tools">
<a href="javascript:void(0)" class="expand-post">Expand<span class="ui-icon ui-icon-triangle-1-e" /></a>
<a href="javascript:void(0)" class="collapse-post">Collapse<span class="ui-icon ui-icon-triangle-1-s" /></a>
</div>
</header> </header>
<div class="post-body">{{abbreviatedBody}}</div> <div class="post-body">{{abbreviatedBody}}</div>
<ul class="moderator-actions post-extended-content"> <ul class="moderator-actions post-extended-content">
<li style="display: none"><a class="action-edit" href="javascript:void(0)"><span class="edit-icon"></span> Edit</a></li> <li style="display: none"><a class="action-edit" href="javascript:void(0)"><span class="edit-icon"></span> Edit</a></li>
<li style="display: none"><a class="action-delete" href="javascript:void(0)"><span class="delete-icon"></span> Delete</a></li> <li style="display: none"><a class="action-delete" href="javascript:void(0)"><span class="delete-icon"></span> Delete</a></li>
...@@ -35,4 +32,9 @@ ...@@ -35,4 +32,9 @@
</div> </div>
</form> </form>
<div class="local post-tools">
<a href="javascript:void(0)" class="expand-post">View discussion</a>
<a href="javascript:void(0)" class="collapse-post">Hide discussion</a>
</div>
</article> </article>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment