Skip to content

Commit

Permalink
cleanup exports
Browse files Browse the repository at this point in the history
  • Loading branch information
SepsiLaszlo committed Dec 29, 2024
1 parent eb734df commit 5d48522
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def require_pek_admin
forbidden_page unless current_user.roles.pek_admin?
end

def require_off_season
forbidden_page unless SystemAttribute.offseason?
end

def require_application_or_evaluation_season
redirect_to root_url if SystemAttribute.offseason?
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/season_admin_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class SeasonAdminController < ApplicationController
before_action :require_rvt_leader
before_action :require_off_season, only: [:export_point_history, :export_active_users, :export_users_with_ab]

def index
@season = SystemAttribute.season
Expand Down
5 changes: 2 additions & 3 deletions app/services/export_active_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ def self.call(semester)
def call
result = []
result << ["Név","Email"]
users = User.includes(point_requests: :evaluation)
.where("evaluations.semester": [SystemAttribute.semester.previous.to_s, SystemAttribute.semester.to_s])
.where("point_requests.point > 0")
users = User.joins(:point_history).where("point_histories.point > 0")
.where("point_histories.semester": [SystemAttribute.semester.previous.to_s, SystemAttribute.semester.to_s])
.order(:lastname).distinct

users.each do |user|
Expand Down
5 changes: 3 additions & 2 deletions app/views/season_admin/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<div>
<h2>Közösségi Pont Export </h2>
<ul class="uk-list uk-list-striped">
<li>Az aktuálisan kiválasztott félévre vonatkozik.</li>
<li>Ez a lehetőség csak Nyugalmi Időszakban érhető el, amikor a pontozások nem szerkeszthetőek.</li>
<li>Az aktuálisan kiválasztott félévre vonatkozik.</li>
<li>Csak az elfogadott pontozásokból származó pontok kerülnek figyelembevételre.</li>
<li>Az exportban szereplő felvételi pont megegyezik a felhasználó profiljában szereplő felvételi ponttal.</li>
</ul>
Expand All @@ -57,9 +57,9 @@
<div class="uk-margin-large-top">
<h2>Általános Belépőt Kapott Felhasználók Export</h2>
<ul class="uk-list uk-list-striped">
<li>Ez a lehetőség csak Nyugalmi Időszakban érhető el, amikor a belépők már elbírálásra kerültek.</li>
<li>Az aktuálisan kiválasztott félévre vonatkozik.</li>
<li>Ha egy felhasználó több körből is kapott színesbelépőt, akkor több sorban is megjelenik.</li>
<li>A színes belépők véglegesítése után és a következő félév beállítása előtt célszerű elkészíteni.</li>
<li>Az ÁB Osztó meghívó email-ek kiküldésekor hasznos.</li>
</ul>
<% if SystemAttribute.offseason? && PointHistory.exists?(semester: @semester.to_s) %>
Expand All @@ -72,6 +72,7 @@
<div class="uk-margin-large-top">
<h2>Aktív Felhasználók Export</h2>
<ul class="uk-list uk-list-striped">
<li>Ez a lehetőség csak Nyugalmi Időszakban érhető el, amikor a pontozások már véglegesek.</li>
<li>Az aktuális és előző félév valamelyikében közösségi pontot szerző felhasználók exportja.</li>
<li>A színes belépők véglegesítése után és a következő félév beállítása előtt célszerű elkészíteni.</li>
<li>A [email protected] levelző list frissentartásához készült.</li>
Expand Down

0 comments on commit 5d48522

Please sign in to comment.