Skip to content

Commit

Permalink
Merge pull request #57 from portabilis/portabilis-patch-2020-06-02
Browse files Browse the repository at this point in the history
Portabilis patch 2020 06 02
  • Loading branch information
Eliezer authored Jun 4, 2020
2 parents 00becc3 + 2954552 commit f1ce824
Show file tree
Hide file tree
Showing 287 changed files with 6,434 additions and 7,250 deletions.
5 changes: 5 additions & 0 deletions .reek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
detectors:
Attribute:
enabled: false
NilCheck:
enabled: false
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
AllCops:
TargetRailsVersion: 4.2

Metrics/AbcSize:
Enabled: false

Expand Down
2 changes: 2 additions & 0 deletions .sourcelevel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ exclude_paths:
- script
- spec
- vendor
- **/*.js
- **/*.css
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ ruby '2.3.7'

gem 'active_model_serializers', '0.9.3'
gem 'activerecord-connections', git: 'https://github.com/ricardohsd/activerecord-connections.git'
gem 'activerecord-session_store', '1.1.1'
gem 'activerecord-tableless', '2.0.0'
gem 'angular_rails_csrf', '1.0.4'
gem 'audited-activerecord', '4.0.0.rc1', git: 'https://github.com/portabilis/audited.git'
gem 'aws-sdk', '2.9.7'
gem 'backbone-nested-attributes', '0.3.0', git: 'https://github.com/samuelsimoes/backbone-nested-attributes.git'
gem 'binding_of_caller', '0.8.0'
gem 'bootbox-rails', '~>0.4'
gem 'browser', '~> 4.1.0'
gem 'bulk_insert', '1.1.0'
gem 'carrierwave', '0.11.2'
gem 'cocoon', '1.2.6'
Expand Down Expand Up @@ -54,6 +54,7 @@ gem 'rack-protection', '1.5.5'
gem 'rails', '4.2.11.1'
gem 'rake', '11.1.2'
gem 'redis', '3.3.5'
gem 'redis-session-store', '0.11.1'
gem 'responders', '2.1.0'
gem 'rest-client', '2.0.2'
gem 'route_translator', git: 'https://github.com/enriclluelles/route_translator.git', tag: 'v4.1.0'
Expand All @@ -63,6 +64,7 @@ gem 'sidekiq', '5.0.3'
gem 'sidekiq-unique-jobs', '4.0.18'
gem 'simple_form', '3.1.0'
gem 'sinatra', '1.4.6', require: nil
gem 'skylight'
gem 'therubyracer', '0.12.2'
gem 'twitter-bootstrap-rails', '3.2.0'
gem 'uglifier', '4.1.20'
Expand All @@ -80,7 +82,7 @@ gem 'signet', '0.11.0'
instance_eval File.read('Gemfile.plugins') if File.exists?('Gemfile.plugins')

group :development do
gem 'meta_request', '0.6.0'
gem 'meta_request', '0.7.2'
gem 'pry-byebug', '3.4.2'
gem 'pry-remote', '0.1.8'
gem 'quiet_assets', '1.1.0'
Expand Down
2 changes: 0 additions & 2 deletions app/assets/javascripts/application.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
//= require jquery-file-upload/jquery.fileupload-process
//= require jquery-file-upload/jquery.fileupload-image
//= require jquery-file-upload/jquery.fileupload-validate
//= require summernote
//= require summernote/pt-BR
//= require system_notifications
//= require add_tags
//= require strip_value
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/educacao.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(function () {
deleteButton: false,
editButton : false,
colorButton : false,
fullscreenButton : true,
fullscreenButton : !window.fullscreen_disabled,
fullscreenClass : 'fa fa-expand | fa fa-compress',
fullscreenDiff : 3,
onFullscreen : function() {
Expand Down
14 changes: 14 additions & 0 deletions app/assets/javascripts/list-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ function removeContent(id) {
hideContent(content);
}

function editObjective(id) {
var objective = $('#' + id);
var inputAddObjective = $('.objectives-select2-container .select2-input');
inputAddObjective.val(objective.find("input[type=checkbox]").data('objective_description'));
inputAddObjective.trigger('click');
inputAddObjective.focus();
hideContent(objective);
}

function removeObjective(id) {
var objective = $('#' + id);
hideContent(objective);
}

$(function () {
$('.list-group.checked-list-box .list-group-item').each(initializeListEvents);

Expand Down
20 changes: 20 additions & 0 deletions app/assets/javascripts/resources/school_calendar_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $(function () {
window.disciplines = [];

var $legendContainer = $('[data-event-legend-container]'),
$checkboxContainer = $('[data-event-checkbox-container]'),
$eventType = $('#school_calendar_event_event_type'),
$unity = $('#school_calendar_event_unity_id'),
$course = $('#school_calendar_event_course_id'),
Expand Down Expand Up @@ -166,6 +167,10 @@ $(function () {
return isEventTypeEqualTo('extra_school');
}

var eventTypeIsExtraSchool = function() {
return isEventTypeEqualTo('extra_school');
}

var eventTypeIsNoSchoolWithFrequency = function() {
return isEventTypeEqualTo('no_school_with_frequency');
}
Expand All @@ -174,6 +179,10 @@ $(function () {
return eventTypeIsBlank() || eventTypeIsExtraSchool() || eventTypeIsNoSchoolWithFrequency();
}

var shouldShowCheckbox = function() {
return eventTypeIsExtraSchool();
}

var togleLegendContainerVisibility = function() {
if (shouldHideLegend()) {
$legendContainer.addClass('hidden');
Expand All @@ -182,9 +191,20 @@ $(function () {
}
}

var togleCheckboxContainerVisibility = function() {
if (shouldShowCheckbox()) {
$checkboxContainer.removeClass('hidden');
} else {
$checkboxContainer.addClass('hidden');
}
}

$eventType.on('change', togleLegendContainerVisibility);
togleLegendContainerVisibility();

$eventType.on('change', togleCheckboxContainerVisibility);
togleCheckboxContainerVisibility();

if(!_.isEmpty($classroom.val())){
checkExamRule({ classroom_id: $classroom.val() });
}
Expand Down
20 changes: 20 additions & 0 deletions app/assets/javascripts/select2-content-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,24 @@ $(function() {
}
}).select2('data', $(element).data('data'));
});

_.each($('.select2-tags'), function(element) {
$(element).select2({
tags: true,
tokenSeparators: [],
createSearchChoice: function (term, _data) {
const type = $(element).data('content-type');

return {
id: $.trim(term),
text: $.trim(term) + ' (Novo ' + type + ')'
};
},
minimumInputLength: 3,
formatInputTooShort: function () {
return "Digite no mínimo 3 caracteres";
},
data: []
});
});
});
6 changes: 5 additions & 1 deletion app/assets/javascripts/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ $(document).ready(function(){
return "<div class='select2-user-result'>" + el.name + "</div>";
},
formatSelection: function(el) {
return el.name;
if(el.text) {
return "<div class='select2-user-result'>" + el.text + "</div>";
} else {
return "<div class='select2-user-result'>" + el.name + "</div>";
}
},
data: $(element).data('elements'),
multiple: $(element).data('multiple'),
Expand Down
Loading

0 comments on commit f1ce824

Please sign in to comment.