mumuki-laboratory 5.6.2 → 5.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/application/_modules.scss +0 -1
- data/app/assets/stylesheets/application/modules/_discussion.scss +16 -0
- data/app/assets/stylesheets/application/modules/_kids.scss +25 -0
- data/app/controllers/concerns/organizations_controller_template.rb +2 -1
- data/app/controllers/discussions_messages_controller.rb +1 -1
- data/app/models/assignment.rb +2 -2
- data/app/models/message.rb +2 -2
- data/app/views/discussions/_message.html.erb +3 -0
- data/lib/mumuki/laboratory/locales/en.yml +1 -0
- data/lib/mumuki/laboratory/locales/es.yml +1 -0
- data/lib/mumuki/laboratory/locales/pt.yml +1 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/models/discussion_spec.rb +13 -0
- metadata +2 -3
- data/app/assets/stylesheets/application/modules/_pagination.scss +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 304a4ed4733a6f648ce0437780519c8c3f3fe874cf3b96ce96d2eea351a5b250
|
4
|
+
data.tar.gz: 295c271a9fff7056a7309fdcd9f07f7206abbc5cc8a8df44fb2cb9f9e0cc273d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be00363a9eb23b5797bc81ff39da5e11edb8a8d38bd0558b12b54ac03ac879c1b933f9cf990c03e427387039f16e569df9aaf3b619b28310149672a1f2d7cc19
|
7
|
+
data.tar.gz: 07bef8f427e030ddbf4c636d757836dddc95184e0856be511043f2d281c0d4ddecb60e6367cb3eec2112e4b44eb1650b1c2ce70b18c4e3296499c1d18f8a2571
|
@@ -5,6 +5,7 @@ $discussion-toolbar-color: #f6f6fa;
|
|
5
5
|
$message-divider-color: #ecf0f1;
|
6
6
|
$discussion-button-color: #fafafa;
|
7
7
|
$toolbar-filter-color: #808080;
|
8
|
+
$moderator-star-color: #dd9900;
|
8
9
|
|
9
10
|
.discussions-list {
|
10
11
|
margin: 30px 0;
|
@@ -41,6 +42,17 @@ $toolbar-filter-color: #808080;
|
|
41
42
|
justify-content: center;
|
42
43
|
}
|
43
44
|
|
45
|
+
.discussion-pagination .pagination li {
|
46
|
+
a, span {
|
47
|
+
background-color: lighten($brand-primary, 10%);
|
48
|
+
}
|
49
|
+
&:hover, &.active, &.active:hover {
|
50
|
+
a, span {
|
51
|
+
background-color: $brand-primary;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
44
56
|
.discussion-language-icon {
|
45
57
|
float: right;
|
46
58
|
margin-right: 10px;
|
@@ -165,6 +177,10 @@ $toolbar-filter-color: #808080;
|
|
165
177
|
width: 100%;
|
166
178
|
}
|
167
179
|
|
180
|
+
.moderator-star {
|
181
|
+
color: $moderator-star-color;
|
182
|
+
}
|
183
|
+
|
168
184
|
.discussion-user-menu {
|
169
185
|
a {
|
170
186
|
padding: 5px 10px;
|
@@ -105,6 +105,31 @@ $kids-speech-tabs-width: 40px;
|
|
105
105
|
}
|
106
106
|
.mu-kids-character-speech-bubble {
|
107
107
|
|
108
|
+
@media screen and (max-width: $screen-sm-max) {
|
109
|
+
h4 {
|
110
|
+
&.text-warning {
|
111
|
+
font-size: 18px;
|
112
|
+
margin-top: 8px;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
ul.results-list li {
|
116
|
+
font-size: 13px
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
@media screen and (max-width: $screen-xs-max) {
|
121
|
+
h4 {
|
122
|
+
font-size: 20px;
|
123
|
+
&.text-warning {
|
124
|
+
font-size: 14px;
|
125
|
+
margin-top: 5px;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
ul.results-list li {
|
129
|
+
font-size: 12px
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
108
133
|
&.passed_with_warnings {
|
109
134
|
padding-top: 5px;
|
110
135
|
padding-bottom: 5px;
|
@@ -26,7 +26,8 @@ module OrganizationsControllerTemplate
|
|
26
26
|
.permit(:book,
|
27
27
|
:contact_email, :name, :locale, :description,
|
28
28
|
:logo_url, :banner_url, :open_graph_image_url, :favicon_url, :breadcrumb_image_url,
|
29
|
-
:raise_hand_enabled, :
|
29
|
+
:raise_hand_enabled, :report_issue_enabled, :forum_enabled,
|
30
|
+
:feedback_suggestions_enabled, :public, :immersive,
|
30
31
|
:theme_stylesheet, :extension_javascript,
|
31
32
|
:terms_of_service, :community_link, login_methods: [])
|
32
33
|
.tap { |it| it.merge!(book: Book.find_by!(slug: it[:book])) if it[:book] }
|
data/app/models/assignment.rb
CHANGED
@@ -4,7 +4,7 @@ class Assignment < ApplicationRecord
|
|
4
4
|
|
5
5
|
belongs_to :exercise
|
6
6
|
has_one :guide, through: :exercise
|
7
|
-
has_many :messages, -> { order(date: :desc) }, foreign_key: :submission_id, primary_key: :submission_id
|
7
|
+
has_many :messages, -> { where.not(submission_id: nil).order(date: :desc) }, foreign_key: :submission_id, primary_key: :submission_id
|
8
8
|
|
9
9
|
belongs_to :submitter, class_name: 'User'
|
10
10
|
|
@@ -28,7 +28,7 @@ class Assignment < ApplicationRecord
|
|
28
28
|
|
29
29
|
def persist_submission!(submission)
|
30
30
|
transaction do
|
31
|
-
messages.destroy_all
|
31
|
+
messages.destroy_all if submission_id.present?
|
32
32
|
update! submission_id: submission.id
|
33
33
|
update_submissions_count!
|
34
34
|
update_last_submission!
|
data/app/models/message.rb
CHANGED
@@ -28,8 +28,8 @@ class Message < ApplicationRecord
|
|
28
28
|
from_user?(user) || user&.moderator?
|
29
29
|
end
|
30
30
|
|
31
|
-
def authorize!
|
32
|
-
raise Mumukit::Auth::UnauthorizedAccessError unless authorized?(
|
31
|
+
def authorize!(user)
|
32
|
+
raise Mumukit::Auth::UnauthorizedAccessError unless authorized?(user)
|
33
33
|
end
|
34
34
|
|
35
35
|
def as_platform_json
|
@@ -6,6 +6,9 @@
|
|
6
6
|
<span class="message-date">
|
7
7
|
<%= t(:time_since, time: time_ago_in_words(message.created_at)) %>
|
8
8
|
</span>
|
9
|
+
<% if user.moderator? %>
|
10
|
+
<%= fa_icon(:star, {'data-toggle': 'tooltip', title: (t :moderator), class: 'moderator-star'}) %>
|
11
|
+
<% end %>
|
9
12
|
<% if message.authorized? current_user %>
|
10
13
|
<span class="actions">
|
11
14
|
<%= link_to fa_icon('trash-o'), discussion_message_path(@discussion, message), method: :delete, data: { confirm: t(:are_you_sure, action: t(:destroy_message)) } %>
|
@@ -111,6 +111,7 @@ en:
|
|
111
111
|
messages: Messages
|
112
112
|
messages_error: Previous messages are unavailable. Please try again later.
|
113
113
|
more_messages: More
|
114
|
+
moderator: Moderator
|
114
115
|
mumuki_catchphrase: Improve your programming skills
|
115
116
|
mumuki_short_description: Mumuki is a simple, open and collaborative platform for sharing and solving programming exercises. It is aimed to help people with learning and teaching programing languages and paradigms
|
116
117
|
my_submissions: My Submissions
|
@@ -122,6 +122,7 @@ es:
|
|
122
122
|
minute: minuto
|
123
123
|
minutes: minutos
|
124
124
|
more_messages: Ver mensajes anteriores
|
125
|
+
moderator: Moderador
|
125
126
|
mumuki_catchphrase: Aprendé a programar
|
126
127
|
mumuki_short_description: Mumuki es la plataforma libre y gratuita para aprender a programar, de la práctica a la teoría y en tu idioma
|
127
128
|
name: Nombre
|
@@ -120,6 +120,7 @@ pt:
|
|
120
120
|
minute: minuto
|
121
121
|
minutes: minutos
|
122
122
|
more_messages: Ver as mensagens anteriores
|
123
|
+
moderator: Moderador
|
123
124
|
mumuki_catchphrase: Aprendi a programar
|
124
125
|
mumuki_short_description: Mumuki é a plataforma gratuita e gratuita para aprender a programar, desde a prática até a teoria e no seu idioma
|
125
126
|
name: Nome
|
@@ -150,4 +150,17 @@ describe Discussion, organization_workspace: :test do
|
|
150
150
|
it { expect(other_exercise.discussions.for_user(initiator)).to be_empty }
|
151
151
|
end
|
152
152
|
end
|
153
|
+
|
154
|
+
describe 'messages not being deleted' do
|
155
|
+
let(:user) { create(:user) }
|
156
|
+
let(:other_user) { create(:user) }
|
157
|
+
let(:problem) { create(:problem) }
|
158
|
+
let(:assignment) { problem.submit_solution! user }
|
159
|
+
let(:discussion) { problem.discuss!(user, {title: 'A discussion'})}
|
160
|
+
|
161
|
+
before { discussion.submit_message!({content: 'You should do this'}, user) }
|
162
|
+
before { problem.submit_solution! other_user }
|
163
|
+
|
164
|
+
it { expect(discussion.messages.count).to eq 1 }
|
165
|
+
end
|
153
166
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-laboratory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.6.
|
4
|
+
version: 5.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -309,7 +309,6 @@ files:
|
|
309
309
|
- app/assets/stylesheets/application/modules/_modal.scss
|
310
310
|
- app/assets/stylesheets/application/modules/_organization_chooser.scss
|
311
311
|
- app/assets/stylesheets/application/modules/_overlap.scss
|
312
|
-
- app/assets/stylesheets/application/modules/_pagination.scss
|
313
312
|
- app/assets/stylesheets/application/modules/_progress_bar.scss
|
314
313
|
- app/assets/stylesheets/application/modules/_progress_listing.scss
|
315
314
|
- app/assets/stylesheets/application/modules/_timer.scss
|