Skip to content

Commit 5d3f3ef

Browse files
author
Laur0r
authored
Merge pull request #86 from learnweb/feature/use-moodle-general-table
Use generaltable for discussionlist and use generic css classes
2 parents be97c65 + 44021fd commit 5d3f3ef

File tree

6 files changed

+5
-82
lines changed

6 files changed

+5
-82
lines changed

locallib.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
177177

178178
// Iterate through every visible discussion.
179179
$i = 0;
180-
$rowcount = 0;
181180
$preparedarray = array();
182181
foreach ($discussions as $discussion) {
183182
$preparedarray[$i] = array();
@@ -245,9 +244,6 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
245244
// Use the discussions name instead of the subject of the first post.
246245
$discussion->subject = $discussion->name;
247246

248-
// Increase the rowcount.
249-
$rowcount = ($rowcount + 1) % 2;
250-
251247
// Format the subjectname and the link to the topic.
252248
$preparedarray[$i]['subjecttext'] = format_string($discussion->subject);
253249
$preparedarray[$i]['subjectlink'] = $CFG->wwwroot . '/mod/moodleoverflow/discussion.php?d=' . $discussion->discussion;
@@ -334,7 +330,6 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
334330

335331
// Add all created data to an array.
336332

337-
$preparedarray[$i]['rowcount'] = $rowcount;
338333
$preparedarray[$i]['statusstarter'] = $statusstarter;
339334
$preparedarray[$i]['statusteacher'] = $statusteacher;
340335
$preparedarray[$i]['statusboth'] = $statusboth;

styles.css

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212
/*
1313
* The discussionlist in the view.php
1414
*/
15-
.moodleoverflowheaderlist {
16-
border-collapse: separate;
17-
border-style: solid;
18-
border-width: 1px;
19-
margin-top: 10px;
20-
width: 100%;
21-
}
22-
23-
.moodleoverflowheaderlist td {
24-
border-style: solid;
25-
border-width: 1px 0 0 1px;
26-
}
2715

2816
.moodleoverflowheaderlist th.header.replies .iconsmall {
2917
margin: 0 .3em;
@@ -55,64 +43,6 @@
5543
text-align: center;
5644
}
5745

58-
.moodleoverflowheaderlist tbody tr:nth-of-type(odd) {
59-
background-color: #fafafa;
60-
}
61-
62-
.moodleoverflowheaderlist {
63-
background-color: #f9feff;
64-
}
65-
66-
.moodleoverflowheaderlist .table-active:hover {
67-
background-color: #dff8ff;
68-
}
69-
70-
.moodleoverflowheaderlist .table-active:hover > td,
71-
.moodleoverflowheaderlist .table-active:hover > th {
72-
background-color: #dff8ff;
73-
}
74-
75-
.moodleoverflowheaderlist .table-success:hover {
76-
background-color: #d0e9c6;
77-
}
78-
79-
.moodleoverflowheaderlist .table-success:hover > td,
80-
.moodleoverflowheaderlist .table-success:hover > th {
81-
background-color: #d0e9c6;
82-
}
83-
84-
.moodleoverflowheaderlist .table-info:hover {
85-
background-color: #c4e3f3;
86-
}
87-
88-
.moodleoverflowheaderlist .table-info:hover > td,
89-
.moodleoverflowheaderlist .table-info:hover > th {
90-
background-color: #c4e3f3;
91-
}
92-
93-
.moodleoverflowheaderlist .table-warning:hover {
94-
background-color: #faf2cc;
95-
}
96-
97-
.moodleoverflowheaderlist .table-warning:hover > td,
98-
.moodleoverflowheaderlist .table-warning:hover > th {
99-
background-color: #faf2cc;
100-
}
101-
102-
.moodleoverflowheaderlist .table-danger:hover {
103-
background-color: #ebcccc;
104-
}
105-
106-
.moodleoverflowheaderlist .table-danger:hover > td,
107-
.moodleoverflowheaderlist .table-danger:hover > th {
108-
background-color: #ebcccc;
109-
}
110-
111-
.moodleoverflowheaderlist,
112-
.moodleoverflowheaderlist td {
113-
border: none;
114-
}
115-
11646
.moodleoverflowheaderlist thead .header,
11747
.moodleoverflowheaderlist tbody .discussion td {
11848
padding-left: .5em;
@@ -292,8 +222,6 @@
292222
}
293223

294224
.moodleoverflowpost {
295-
background-color: #fff;
296-
border: 1px solid rgba(238, 238, 238, 1);
297225
border-radius: 0;
298226
display: block;
299227
margin-bottom: 5px;

templates/answer.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<a id="p{{ postid }}"></a>
3535

3636
{{! Start the post. Mark it read or unread. }}
37-
<div class="moodleoverflowpost clearfix{{ postclass }}{{# isfirstpost}} firstpost starter{{/isfirstpost}}" role="region" aria-label="{{ discussionby }}">
37+
<div class="moodleoverflowpost border clearfix{{ postclass }}{{# isfirstpost}} firstpost starter{{/isfirstpost}}" role="region" aria-label="{{ discussionby }}">
3838

3939
<table>
4040
<tbody>

templates/discussion_list.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{{! There are discussions. Start to print the table. }}
3636
{{#hasdiscussions}}
3737

38-
<table cellspacing="0" class="moodleoverflowheaderlist">
38+
<table cellspacing="0" class="moodleoverflowheaderlist generaltable">
3939

4040
{{! Print the heading row of the table. }}
4141
<thead>
@@ -95,7 +95,7 @@
9595

9696
{{! Loop through all discussions. }}
9797
{{#discussions}}
98-
<tr class="discussion r{{ rowcount }}">
98+
<tr class="discussion">
9999

100100
{{! The status of the discussion. }}
101101
<td class="topic replies">

templates/post_dummy_cantsee.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<a id="p{{ postid }}"></a>
2929

30-
<div class="moodleoverflowpost clearfix" role="region" aria-label="{{# str}} hiddenmoodleoverflowpost, moodleoverflow {{/str}}">
30+
<div class="moodleoverflowpost border clearfix" role="region" aria-label="{{# str}} hiddenmoodleoverflowpost, moodleoverflow {{/str}}">
3131

3232
{{! The heading row. }}
3333
<div class="row header">

templates/question.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<a id="p{{ postid }}"></a>
3535

3636
{{! Start the post. Mark it read or unread. }}
37-
<div class="moodleoverflowpost clearfix{{ postclass }}{{# isfirstpost}} firstpost starter{{/isfirstpost}}" role="region"
37+
<div class="moodleoverflowpost border clearfix{{ postclass }}{{# isfirstpost}} firstpost starter{{/isfirstpost}}" role="region"
3838
aria-label="{{ discussionby }}">
3939

4040
<div>

0 commit comments

Comments
 (0)