mumuki-laboratory 5.6.2 → 5.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abf1e7ba469d8ee20ad2a43ef9f59b83d746c43d0a9ce388a7a5c4c6c0c1dbf6
4
- data.tar.gz: 976f739faaae534f9cb5a7a9cfb32683fddb6be42b8d5db37b458209b014a160
3
+ metadata.gz: 304a4ed4733a6f648ce0437780519c8c3f3fe874cf3b96ce96d2eea351a5b250
4
+ data.tar.gz: 295c271a9fff7056a7309fdcd9f07f7206abbc5cc8a8df44fb2cb9f9e0cc273d
5
5
  SHA512:
6
- metadata.gz: 94b3f5a4455054e596bd5800e7fd3638e425c0e041efb92b27124df292ecfd05b66086881dfa1d52a043f0f0249fce6a56b583dcccd8f23c227641feb0390829
7
- data.tar.gz: 9efb17c56cd9b95086e9d01e0b0a64851209d69244bf6e579b96cf427169126eb3c722628cc28b550bb96c1cdeb530996a1facfcd50c506f07e1ece5a698cd26
6
+ metadata.gz: be00363a9eb23b5797bc81ff39da5e11edb8a8d38bd0558b12b54ac03ac879c1b933f9cf990c03e427387039f16e569df9aaf3b619b28310149672a1f2d7cc19
7
+ data.tar.gz: 07bef8f427e030ddbf4c636d757836dddc95184e0856be511043f2d281c0d4ddecb60e6367cb3eec2112e4b44eb1650b1c2ce70b18c4e3296499c1d18f8a2571
@@ -20,4 +20,3 @@
20
20
  @import "modules/kids";
21
21
  @import "modules/kids_results";
22
22
  @import "modules/discussion";
23
- @import "modules/pagination";
@@ -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, :feedback_suggestions_enabled, :public, :immersive,
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] }
@@ -8,7 +8,7 @@ class DiscussionsMessagesController < AjaxController
8
8
 
9
9
  def destroy
10
10
  message = Message.find(params[:id])
11
- message.authorize!
11
+ message.authorize! current_user
12
12
  message.destroy!
13
13
  redirect_back(fallback_location: root_path)
14
14
  end
@@ -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!
@@ -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?(current_user)
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
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '5.6.2'
3
+ VERSION = '5.6.3'
4
4
  end
5
5
  end
@@ -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.2
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-25 00:00:00.000000000 Z
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
@@ -1,10 +0,0 @@
1
- .pagination li {
2
- a, span {
3
- background-color: lighten($brand-primary, 10%);
4
- }
5
- &:hover, &.active, &.active:hover {
6
- a, span {
7
- background-color: $brand-primary;
8
- }
9
- }
10
- }