Skip to content

Commit 362abe7

Browse files
committed
change announcement class to question
fix style hidden add topic with student
1 parent 6871ca6 commit 362abe7

12 files changed

Lines changed: 105 additions & 32 deletions

File tree

File renamed without changes.

webapp/project/src/components/announcement/announcement.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/project/src/components/announcement/announcement.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/project/src/components/announcement/announcement.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ $screen-lg-min: 1200px;
99
.announcements-left-menu {
1010
.title {
1111
font-size: 20px;
12+
a{
13+
color: #333;
14+
}
1215
}
1316
.announcements-headline{
1417
margin: 5px 0;

webapp/project/src/components/class/views/ClassTopics.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Link} from 'react-router-dom'
44
import ClassAddTopicModal from "./ClassAddTopicModal";
55
import {classActions} from "../../../actions";
66
import {classService} from "../../../services";
7+
import {userUtils} from "../../../utils";
78

89
class ClassTopics extends Component {
910
constructor() {
@@ -53,7 +54,8 @@ class ClassTopics extends Component {
5354
}
5455

5556
render() {
56-
const {topics, classId, currentTopic} = this.props
57+
const {topics, classId, currentTopic, currentUser} = this.props
58+
const isTeacher = userUtils.checkIsTeacher(currentUser)
5759
return (
5860
<div className="class-topics has-border-radius clearfix">
5961
<h3>Topics</h3>
@@ -62,15 +64,18 @@ class ClassTopics extends Component {
6264
topics.map((topic, index) =>
6365
this.renderTopic(topic, index, classId, currentTopic))
6466
}
65-
<div className="class-add-topic clearfix">
66-
<button className="btn btn-white pull-right" onClick={this.openModalAddTopic}>
67-
Add topic
68-
</button>
69-
<ClassAddTopicModal classId={classId}
70-
modalIsOpen={this.state.modalAddTopic}
71-
closeModal={this.closeModalAddTopic}
72-
onSubmit={this.handleAddTopic}/>
73-
</div>
67+
{
68+
isTeacher &&
69+
<div className="class-add-topic clearfix">
70+
<button className="btn btn-white pull-right" onClick={this.openModalAddTopic}>
71+
Add topic
72+
</button>
73+
<ClassAddTopicModal classId={classId}
74+
modalIsOpen={this.state.modalAddTopic}
75+
closeModal={this.closeModalAddTopic}
76+
onSubmit={this.handleAddTopic}/>
77+
</div>
78+
}
7479
</div>
7580
)
7681
}

webapp/project/src/components/commons/Post.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ class Post extends Component {
6262
<div className="post-context clearfix">
6363
<div className="post-context-left">
6464
{
65-
post.isAssigmentPost &&
65+
post.isAssigmentPost ?
6666
<div className="post-is-assignment">
6767
<div className="post-assignment-image"></div>
6868
</div>
69+
:
70+
<div className="post-is-question">
71+
<div className="post-question-image"></div>
72+
</div>
6973
}
7074
<img className="post-user-profile-picture img-circle"
7175
src={(post && post.userCreate) && fileUtils.renderFileSource(post.userCreate.profileImageID, userUtils.renderSourceProfilePictureDefault(post.userCreate.gender))}></img>

webapp/project/src/components/commons/common.css

Lines changed: 32 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/project/src/components/commons/common.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/project/src/components/commons/common.scss

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,37 @@ ul.nav {
205205
.post-context-left {
206206
float: left;
207207
display: flex;
208+
.post-is-question {
209+
-webkit-align-items: center;
210+
align-items: center;
211+
display: -webkit-box;
212+
display: -moz-box;
213+
display: -webkit-flex;
214+
display: -ms-flexbox;
215+
display: flex;
216+
-webkit-flex-shrink: 0;
217+
flex-shrink: 0;
218+
-webkit-justify-content: center;
219+
justify-content: center;
220+
background-color: $main-color;
221+
height: 5rem;
222+
width: 5rem;
223+
margin-right: 15px;
224+
@media (max-width: $screen-xs-max) {
225+
height: 3rem;
226+
width: 3rem;
227+
margin-right: 5px;
228+
}
229+
.post-question-image {
230+
background-position: -7.5rem -119rem;
231+
background-image: url('/images/images-assignment-question.svg');
232+
background-repeat: no-repeat;
233+
background-size: 10.5rem, 121.4rem;
234+
flex-shrink: 0;
235+
height: 2.4rem;
236+
width: 2.4rem;
237+
}
238+
}
208239
.post-is-assignment {
209240
-webkit-align-items: center;
210241
align-items: center;
@@ -228,7 +259,7 @@ ul.nav {
228259
}
229260
.post-assignment-image {
230261
background-position: -7.5rem -88.1rem;
231-
background-image: url('/images/images.svg');
262+
background-image: url('/images/images-assignment-question.svg');
232263
background-repeat: no-repeat;
233264
background-size: 10.5rem, 121.4rem;
234265
flex-shrink: 0;
@@ -359,9 +390,7 @@ ul.nav {
359390
}
360391
.form-control {
361392
height: 35px;
362-
@media (max-width: $screen-md-max) {
363-
width: 100%;
364-
}
393+
width: 100%;
365394
}
366395
.fa {
367396
font-size: 16px;

webapp/project/src/components/commons/views/NewPost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class NewPost extends Component {
5959
<Tab>
6060
<div className="new-post-headline-content">
6161
<i className="fa fa-edit"></i>
62-
<span>Announcement</span>
62+
<span>Question</span>
6363
</div>
6464
</Tab>
6565
{

0 commit comments

Comments
 (0)