-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add report configuration tab to admission processes
- Loading branch information
1 parent
a44d319
commit bc959e0
Showing
22 changed files
with
311 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) Universidade Federal Fluminense (UFF). | ||
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file. | ||
|
||
# frozen_string_literal: true | ||
|
||
module Admissions::AdmissionReportColumnsHelper | ||
def name_form_column(record, options) | ||
form_field_name_widget(record, options, text: record.name, query_options: { | ||
in_letter: true | ||
}) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -648,7 +648,7 @@ def phase_name | |
end | ||
|
||
def identifier | ||
self.token[..6] | ||
self.token[..5] | ||
end | ||
|
||
def can_edit_itself | ||
|
2 changes: 1 addition & 1 deletion
2
app/views/admissions/admission_processes/_admission_applications_show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/views/admissions/admission_processes/_custom_report_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<% | ||
|
||
form_action ||= :custom_report_generate | ||
|
||
scope ||= nil | ||
url_options ||= params_for(:action => form_action) | ||
xhr = request.xhr? if xhr.nil? | ||
|
||
report_action_config = Admissions::AdmissionReportConfigsController.active_scaffold_config.create | ||
multipart ||= report_action_config.multipart? | ||
report_columns ||= report_action_config.columns | ||
report_columns.constraint_columns << :name | ||
|
||
persistent ||= false | ||
floating_footer ||= false | ||
method ||= :post | ||
cancel_link = true if cancel_link.nil? | ||
submit_text ||= form_action | ||
apply_text ||= :"#{form_action}_apply" | ||
body_partial ||= 'form' | ||
form_id = element_form_id(action: form_action, id: "custom_report_definition") | ||
%> | ||
<%= | ||
options = {:id => form_id, | ||
:multipart => multipart, | ||
:class => "as_form #{form_action.to_s}", | ||
:method => :post, | ||
'data-loading' => defined?(loading) ? loading : true} | ||
cancel_options = {:class => 'as_cancel'} | ||
options[:class] << ' floating-footer' if floating_footer | ||
cancel_options[:remote] = true if xhr #cancel link does nt have to care about multipart forms | ||
if xhr && multipart # file_uploads | ||
form_remote_upload_tag url_options.merge({:iframe => true}), options | ||
else | ||
options[:remote] = true if xhr && !multipart | ||
form_tag url_options, options | ||
end | ||
-%> | ||
<h4> <%= t("active_scaffold.admissions/admission_process.custom_report.title") %> </h4> | ||
<div id="<%= element_messages_id(:action => form_action) %>" class="messages-container"> | ||
<% unless xhr %> | ||
<p class="error-message message server-error" style="display:none;"> | ||
<%= as_(:internal_error).html_safe %> | ||
<a href="#" class="close" title="<%= as_(:close).html_safe %>"><%= as_(:close).html_safe %></a> | ||
</p> | ||
<% end %> | ||
<%= render :partial => 'form_messages' %> | ||
</div> | ||
|
||
|
||
<% @record = @admission_report_config %> | ||
<%= render :partial => body_partial, :locals => { :columns => report_columns, :form_action => form_action, :scope => nil } %> | ||
|
||
<p class="form-footer"> | ||
<%= submit_tag "Usar configuração", name: "dont_close", :class => "submit" %> | ||
<%= submit_tag "Resetar", name: "dont_close", formaction: url_for(params_for(action: :reset_report)), :class => "submit" %> | ||
<%= link_to(as_(:cancel), main_path_to_return, cancel_options) if cancel_link %> | ||
<%= loading_indicator_tag(action: form_action, id: "custom_report_definition") %> | ||
</p> | ||
|
||
</form> |
39 changes: 39 additions & 0 deletions
39
app/views/admissions/admission_processes/_list_messages.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<% column_count ||= columns.length + (grouped_search? ? 0 : 1) -%> | ||
<tbody class="messages"> | ||
<tr class="record even-record"> | ||
<td colspan="<%= column_count -%>" class="messages-container"> | ||
<% unless active_scaffold_config.list.messages_above_header %> | ||
<p class="error-message message server-error" style="display:none;"> | ||
<%= as_(:internal_error).html_safe %> | ||
<span class="error-500"><%= as_(:error_500).html_safe %></span> | ||
<a href="#" class="close" title="<%= as_(:close).html_safe %>"><%= as_(:close).html_safe %></a> | ||
</p> | ||
<div id="<%= active_scaffold_messages_id -%>" class="action-messages"> | ||
<%= render :partial => 'messages' %> | ||
</div> | ||
<% end %> | ||
<%= content_tag :div, class: 'filtered-message', | ||
style: ('display:none;' unless @filtered), | ||
data: ({search: search_params || ''} if active_scaffold_config.store_user_settings && respond_to?(:search_params)) do %> | ||
<%= @filtered.is_a?(Array) ? render(:partial => 'human_conditions', :locals => {:columns => @filtered}) : as_(active_scaffold_config.list.filtered_message) %> | ||
<% if active_scaffold_config.list.show_search_reset && @filtered -%> | ||
<div class="reset"> | ||
<%= loading_indicator_tag(:action => :record, :id => nil) %> | ||
<%= render_action_link(active_scaffold_config.list.reset_link) %> | ||
</div> | ||
<% end -%> | ||
<% end %> | ||
<div class="filtered-message" id="admission-report-config-notice" | ||
style="<%= "display:none" if !session.include? :admission_report_config %>"> | ||
<div class="reset"> | ||
<%= loading_indicator_tag(:action => :record, :id => nil) %> | ||
<%= link_to t("active_scaffold.admissions/admission_process.custom_report.notice"), | ||
url_for(params_for(action: :reset_report).merge({ dont_close: true })), data: { remote: true } %> | ||
</div> | ||
</div> | ||
<p id="<%= empty_message_id %>" class="empty-message" <%= ' style="display:none;" '.html_safe unless @page.empty? %>> | ||
<%= as_(active_scaffold_config.list.no_entries_message) %> | ||
</p> | ||
</td> | ||
</tr> | ||
</tbody> |
Oops, something went wrong.