source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20241206070707_create_team_enrollments.rb | Ruby | mit | 19 | main | 268 | class CreateTeamEnrollments < ActiveRecord::Migration[7.2]
def change
create_table :team_enrollments do |t|
t.references :team, null: false, foreign_key: true
t.references :course, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240719083708_add_lesson_order_to_course_modules.rb | Ruby | mit | 19 | main | 206 | # frozen_string_literal: true
class AddLessonOrderToCourseModules < ActiveRecord::Migration[7.1]
def change
add_column :course_modules, :lessons_in_order, :bigint, array: true, default: []
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240325131125_create_course_modules.rb | Ruby | mit | 19 | main | 286 | # frozen_string_literal: true
class CreateCourseModules < ActiveRecord::Migration[7.1]
def change
create_table :course_modules do |t|
t.string :title
t.text :description
t.references :course, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250328101009_add_active_users_count_to_learning_partners.rb | Ruby | mit | 19 | main | 390 | class AddActiveUsersCountToLearningPartners < ActiveRecord::Migration[7.2]
def up
add_column :learning_partners, :active_users_count, :integer, default: 0, null: false
LearningPartner.find_each do |learning_partner|
active_users = learning_partner.users.where(state: "active")
learning_partner.upd... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250718112742_create_program_users.rb | Ruby | mit | 19 | main | 315 | class CreateProgramUsers < ActiveRecord::Migration[8.0]
def change
create_table :program_users do |t|
t.references :user, null: false, foreign_key: true
t.references :program, null: false, foreign_key: true
t.timestamps
t.index [:user_id, :program_id], unique: true
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240507115807_add_logo_and_bannner_to_learning_partners.rb | Ruby | mit | 19 | main | 229 | # frozen_string_literal: true
class AddLogoAndBannnerToLearningPartners < ActiveRecord::Migration[7.1]
def change
add_column :learning_partners, :logo, :string
add_column :learning_partners, :banner, :string
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250822122835_data_fill_in_country_codes.rb | Ruby | mit | 19 | main | 224 | class DataFillInCountryCodes < ActiveRecord::Migration[8.0]
def up
User.where.not(phone: nil).update_all(country_code: "+91")
LearningPartner.update_all(supported_countries: ["india"])
end
def down
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250718105104_create_program_courses.rb | Ruby | mit | 19 | main | 324 | class CreateProgramCourses < ActiveRecord::Migration[8.0]
def change
create_table :program_courses do |t|
t.references :program, null: false, foreign_key: true
t.references :course, null: false, foreign_key: true
t.timestamps
t.index [:program_id, :course_id], unique: true
end
end
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240516064405_create_enrollments.rb | Ruby | mit | 19 | main | 290 | # frozen_string_literal: true
class CreateEnrollments < ActiveRecord::Migration[7.1]
def change
create_table :enrollments do |t|
t.references :user, null: false, foreign_key: true
t.references :course, null: false, foreign_key: true
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250604102048_add_fields_to_users.rb | Ruby | mit | 19 | main | 313 | class AddFieldsToUsers < ActiveRecord::Migration[7.2]
def change
add_column :users, :phone_confirmation_token, :string
add_index :users, :phone_confirmation_token, unique: true
add_column :users, :phone_confirmation_sent_at, :datetime
add_column :users, :phone_confirmed_at, :datetime
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250909133618_create_course_certificates.rb | Ruby | mit | 19 | main | 603 | class CreateCourseCertificates < ActiveRecord::Migration[8.0]
def change
create_table :course_certificates do |t|
t.datetime :issued_at, null: false
t.string :file_hash, null: false
t.string :certificate_uuid, null: false
t.references :user, null: false, foreign_key: true
t.referenc... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250902092230_create_contact_leads.rb | Ruby | mit | 19 | main | 257 | class CreateContactLeads < ActiveRecord::Migration[8.0]
def change
create_table :contact_leads do |t|
t.string :phone, null: false
t.string :country_code, null: false
t.string :name, null: false
t.timestamps
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250128174201_create_scorm.rb | Ruby | mit | 19 | main | 326 | class CreateScorm < ActiveRecord::Migration[7.2]
def change
create_table :scorms do |t|
t.string :token, null: false, index: { unique: true }
t.boolean :is_valid, default: true
t.references :learning_partner, index: { unique: true }, foreign_key: true, null: false
t.timestamps
end
en... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240723061654_move_course_description_to_action_text.rb | Ruby | mit | 19 | main | 228 | # frozen_string_literal: true
class MoveCourseDescriptionToActionText < ActiveRecord::Migration[7.1]
def change
Course.all.find_each do |course|
course.update(rich_description: course.description)
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20250718100524_create_programs.rb | Ruby | mit | 19 | main | 351 | class CreatePrograms < ActiveRecord::Migration[8.0]
def change
create_table :programs do |t|
t.string :name, null: false
t.integer :courses_count, default: 0, null: false
t.integer :users_count, default: 0, null: false
t.references :learning_partner, null: false, foreign_key: true
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240621062049_add_enrollment_count.rb | Ruby | mit | 19 | main | 240 | # frozen_string_literal: true
class AddEnrollmentCount < ActiveRecord::Migration[7.1]
def change
add_column :users, :enrollments_count, :integer, default: 0
add_column :courses, :enrollments_count, :integer, default: 0
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240320140523_add_devise_to_users.rb | Ruby | mit | 19 | main | 1,735 | # frozen_string_literal: true
class AddDeviseToUsers < ActiveRecord::Migration[7.1]
def self.up
change_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ''
t.string :encrypted_password, null: false, default: ''
## Recoverable
t.stri... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | db/migrate/20240719134232_add_quiz_order_to_course_module.rb | Ruby | mit | 19 | main | 203 | # frozen_string_literal: true
class AddQuizOrderToCourseModule < ActiveRecord::Migration[7.1]
def change
add_column :course_modules, :quizzes_in_order, :bigint, array: true, default: []
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/neo_components.gemspec | Ruby | mit | 19 | main | 1,020 | # frozen_string_literal: true
require_relative 'lib/neo_components/version'
Gem::Specification.new do |spec|
spec.name = 'neo_components'
spec.version = NeoComponents::VERSION
spec.authors = ['Deepak']
spec.email = ['deepakkumarnd@gmail.com']
spec.homepage = 'https://rubygems.org/gem... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/config/routes.rb | Ruby | mit | 19 | main | 1,342 | # frozen_string_literal: true
NeoComponents::Engine.routes.draw do
namespace :ui do
get :components, to: 'components#index'
get :typography, to: 'typography#index'
get :buttons, to: 'buttons#index'
get :icons, to: 'icons#index'
get :inputs, to: 'inputs#index'
get 'inputs/text_field', to: 'inp... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/config/importmap.rb | Ruby | mit | 19 | main | 282 | # frozen_string_literal: true
pin_all_from File.expand_path('../app/javascript/neo_components/controllers', __dir__),
under: 'controllers',
to: 'neo_components/controllers'
pin 'swiper', to: 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs' |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/ui_helper.rb | Ruby | mit | 19 | main | 1,451 | # frozen_string_literal: true
module UiHelper
def arrange_tags(left_tag, right_tag, position)
ordered = position == 'left' ? [left_tag, right_tag] : [right_tag, left_tag]
safe_join(ordered.compact)
end
include ViewComponent::TypographyComponent
include ViewComponent::IconComponent
include ViewCompon... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/neo_components/sample_menu_helper.rb | Ruby | mit | 19 | main | 516 | # frozen_string_literal: true
module NeoComponents
module SampleMenuHelper
def sample_menu_items
[
ViewComponent::MenuComponent::MenuItem.new(
label: 'Edit',
type: :link
),
ViewComponent::MenuComponent::MenuItem.new(
label: 'Change team',
type... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/button_component.rb | Ruby | mit | 19 | main | 5,040 | # frozen_string_literal: true
module ViewComponent
module ButtonComponent
class ButtonComponent
BUTTON_TYPES = %w[solid outline].freeze
BUTTON_SIZES = %w[sm md lg].freeze
COLOR_SCHEMES = %w[primary secondary danger].freeze
ICON_POSITIONS = %w[left right].freeze
TOOLTIP_POSITIONS = %... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/profile_icon_component.rb | Ruby | mit | 19 | main | 1,168 | # frozen_string_literal: true
module ViewComponent
module ProfileIconComponent
class ProfileIconComponent
include ViewComponent::ComponentHelper
PROFILE_ICON_SIZES = %w[sm md lg].freeze
PROFILE_ICON_SIZE_STYLES = {
sm: 'profile-icon-sm',
md: 'profile-icon-md',
lg: 'pro... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/component_helper.rb | Ruby | mit | 19 | main | 603 | # frozen_string_literal: true
module ViewComponent
# To be used only within a component class such as ButtonComponent
module ComponentHelper
def class_list(base, *styles)
base.concat(styles.compact)
base.join(' ')
end
def resolve_error(form, name, explicit_error)
return explicit_erro... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/progress_component.rb | Ruby | mit | 19 | main | 432 | # frozen_string_literal: true
module ViewComponent
module ProgressComponent
def progressbar_component(numerator:, denominator:)
numerator = 0 if numerator.blank?
denominator = 0 if denominator.blank?
fill = denominator.zero? ? 0 : (numerator / denominator.to_f * 100).to_i
render partial: ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/menu_component.rb | Ruby | mit | 19 | main | 839 | # frozen_string_literal: true
module ViewComponent
module MenuComponent
MenuItem = ViewComponent::MenuItem
MENU_POSITIONS = {
left: 'menu-component-left',
right: 'menu-component-right',
center: 'menu-component-center'
}.freeze
def menu_component(menu_items:, position: 'right', htm... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/paginator_component.rb | Ruby | mit | 19 | main | 248 | # frozen_string_literal: true
module ViewComponent
module PaginatorComponent
def paginator_component(collection:, path:)
render partial: 'view_components/paginator/paginator_component', locals: { collection:, path: }
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/icon_component.rb | Ruby | mit | 19 | main | 883 | # frozen_string_literal: true
module ViewComponent
module IconComponent
ICONS_PATH = NeoComponents::Engine.gem_root.join('app', 'assets', 'icons')
def icon(icon_name, css: nil, span_css: nil, stroke_width: nil)
file = Rails.cache.fetch("neo_components:icon:#{icon_name}") do
ICONS_PATH.join("#{... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_textarea_component.rb | Ruby | mit | 19 | main | 532 | # frozen_string_literal: true
module ViewComponent
module InputTextareaComponent
def input_textarea_component(
form:,
field_name:,
label:,
placeholder:,
value: nil,
rows: 5,
html_options: {}
)
html_options = html_options.merge(
placeholder: placeholder,... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/doc_section_component.rb | Ruby | mit | 19 | main | 308 | # frozen_string_literal: true
module ViewComponent
module DocSectionComponent
def doc_section_component(title: '', &)
block_content = capture(&) if block_given?
render partial: 'view_components/doc_section/doc_section_component', locals: { title:, block: block_content }
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/modal_component.rb | Ruby | mit | 19 | main | 341 | # frozen_string_literal: true
module ViewComponent
module ModalComponent
# modal box component
# @param title - modal title
def modal_component(title:, &)
block_content = capture(&) if block_given?
render partial: 'view_components/modals/modal_component', locals: { title:, body: block_content... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/member_list_component.rb | Ruby | mit | 19 | main | 668 | # frozen_string_literal: true
module ViewComponent
module MemberListComponent
def member_list_component(team:, members:, all_members: false, term: '')
render partial: 'view_components/member_list/member_list', locals: { team:, members:, all_members:, term: }
end
def _member_list_member_search_comp... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component.rb | Ruby | mit | 19 | main | 8,081 | # frozen_string_literal: true
module ViewComponent
module InputComponent
def input_field(form: nil, field_name: nil, label: nil,
placeholder: nil, width: 'w-56', height: nil, left_icon: nil, right_icon: nil, type: 'text',
options: [], value: nil, rows: '5', option: nil, ht... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/modal_box_component.rb | Ruby | mit | 19 | main | 798 | # frozen_string_literal: true
module ViewComponent
module ModalBoxComponent
class ModalBoxComponent
attr_accessor :title, :variant
def initialize(title: nil, variant: nil)
self.title = title
self.variant = variant
end
end
def modal_box_component(title: nil, variant: ni... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/notification_bar_component.rb | Ruby | mit | 19 | main | 459 | # frozen_string_literal: true
module ViewComponent
module NotificationBarComponent
def notification_bar(
text: nil,
text_color: 'text-letter-color',
bg_color: 'bg-white',
icon_color: 'bg-letter-color'
)
render(
partial: 'view_components/notification_bar/notification_bar'... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/accordion_component.rb | Ruby | mit | 19 | main | 492 | # frozen_string_literal: true
module ViewComponent
module AccordionComponent
def accordion_component(header:, icon_position: 'right', open: false, wrapper_class: '', &)
content = capture(&)
icon_position_style = icon_position == 'right' ? 'justify-between' : 'flex-row-reverse justify-end gap-2'
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/course_select_component.rb | Ruby | mit | 19 | main | 1,305 | # frozen_string_literal: true
module ViewComponent
module CourseSelectComponent
def course_select_component(search_context:, submit_path:, courses: [], tags: [], cancel_link: nil,
show_duration: false)
render partial: 'view_components/course_select/course_select_component',
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/carousel_component.rb | Ruby | mit | 19 | main | 331 | # frozen_string_literal: true
module ViewComponent
module CarouselComponent
def carousel_component(cards:, loop: false, enable_in_small_devices: true)
partial_path = 'view_components/carousel_component/carousel'
render partial: partial_path, locals: { cards:, loop:, enable_in_small_devices: }
end... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/course_carousal_component.rb | Ruby | mit | 19 | main | 487 | # frozen_string_literal: true
module ViewComponent
module CourseCarousalComponent
def course_carousal_component(courses:, title:, count:, load_path:)
render partial: 'view_components/course_carousal/course_carousal_component',
locals: { courses:, title:, count:, load_path: }
end
def c... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/menu_component_helper.rb | Ruby | mit | 19 | main | 537 | # frozen_string_literal: true
module ViewComponent
module MenuComponentHelper
MenuItem = ViewComponent::MenuItem
def menu_component_old(menu_items:, icon_class: '', html_options: {})
menu_items_with_options = menu_items.map do |item|
item.options ||= {}
item.url = item.url.presence || ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/typography_component.rb | Ruby | mit | 19 | main | 2,755 | # frozen_string_literal: true
module ViewComponent
module TypographyComponent
HEADING_SIZE = {
'xs' => 'text-base font-semibold',
'sm' => 'text-lg font-semibold',
'md' => 'text-xl font-semibold',
'lg' => 'text-2xl font-semibold',
'xl' => 'text-3xl font-semibold'
}.freeze
de... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/breadcrumbs_component.rb | Ruby | mit | 19 | main | 607 | # frozen_string_literal: true
module ViewComponent
module BreadcrumbsComponent
class BreadcrumbsComponent
attr_accessor :links
def initialize(links: [])
self.links = links
end
def all_links
links || []
end
def last_link
all_links.last
end
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/table_component.rb | Ruby | mit | 19 | main | 655 | # frozen_string_literal: true
module ViewComponent
module TableComponent
def table_cell_name(row_data, avatar: false)
{ partial: 'shared/components/table_cell_name', locals: { row_data:, avatar: } }
end
def table_cell_role(row_data)
{ partial: 'shared/components/table_cell_role', locals: { r... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/chip_component.rb | Ruby | mit | 19 | main | 1,247 | # frozen_string_literal: true
module ViewComponent
module ChipComponent
COLOR_SCHEMES = {
'primary' => %w[
bg-primary-light-100
text-primary-dark
text-primary
text-primary
border-0
],
'primary_lite' => %w[
bg-primary-light-50
text-primary-... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/card/long_course_card_component.rb | Ruby | mit | 19 | main | 950 | # frozen_string_literal: true
module ViewComponent
module Card
module LongCourseCardComponent
def long_course_card_component(
title:,
banner_url:,
duration:,
modules_count:,
enroll_count:,
categories: [],
rating: nil,
progress: nil,
ba... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/card/certificate_card_component.rb | Ruby | mit | 19 | main | 1,496 | # frozen_string_literal: true
module ViewComponent
module Card
module CertificateCardComponent
def certificate_card_component(certificate:, thumbnail_url: nil)
render partial: 'view_components/cards/certificate_card_component', locals: {
has_thumbnail: resolve_has_thumbnail(certificate, t... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/card/course_card_component.rb | Ruby | mit | 19 | main | 837 | # frozen_string_literal: true
module ViewComponent
module Card
module CourseCardComponent
def course_card_component(
title:,
banner_url:,
duration:,
modules_count:,
enroll_count:,
categories: [],
rating: nil,
progress: nil,
badge: nil,... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/card/long_program_card_component.rb | Ruby | mit | 19 | main | 570 | # frozen_string_literal: true
module ViewComponent
module Card
module LongProgramCardComponent
def long_program_card_component(program:, enrolled_program_ids:)
name = program.name
courses_count = program.courses.count
enroll_count = program.users.count
is_enrolled = enrolled... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/card/program_card_component.rb | Ruby | mit | 19 | main | 488 | # frozen_string_literal: true
module ViewComponent
module Card
module ProgramCardComponent
def program_card_component(program:, enrolled_program_ids:)
name = program.name
courses_count = program.courses_count
is_enrolled = enrolled_program_ids.include?(program.id)
render par... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/dropdown_component.rb | Ruby | mit | 19 | main | 2,893 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class DropdownComponent
include ViewComponent::ComponentHelper
DROPDOWN_SIZES = %w[md lg].freeze
DROPDOWN_SIZE_STYLE = {
md: 'dropdown-component-md main-text-md-normal',
lg: 'dropdown-component-lg main-te... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/input_mobile_component.rb | Ruby | mit | 19 | main | 2,364 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class InputMobileComponent < InputTextComponent
CODE_WIDTH = {
md: 'w-16',
lg: 'w-20'
}.freeze
CODE_SELECT_WIDTH = {
md: 'w-20',
lg: 'w-24'
}.freeze
CODE_TEXT = {
md: '... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/file_selector_component.rb | Ruby | mit | 19 | main | 3,085 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class FileSelectorComponent
include ViewComponent::ComponentHelper
FILE_SELECTOR_TYPES = %w[image document video].freeze
attr_accessor :form, :name, :label, :support_text,
:support_text_two, :error, :... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/date_picker_component.rb | Ruby | mit | 19 | main | 3,558 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class DatePickerComponent
include ViewComponent::ComponentHelper
DATE_PICKER_SIZES = %w[md lg].freeze
DATE_PICKER_SIZE_STYLE = {
md: 'input-text-div-base-md main-text-md-normal',
lg: 'input-text-div-base-... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/input_radio_component.rb | Ruby | mit | 19 | main | 1,514 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class InputRadioComponent
include ViewComponent::ComponentHelper
attr_accessor :form, :name, :label, :value, :disabled, :error, :label_position, :html_options
def initialize(form:, name:, label:, value:, disabled:, error... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/input_text_component.rb | Ruby | mit | 19 | main | 4,225 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class InputTextComponent
include ViewComponent::ComponentHelper
INPUT_SIZE_STYLE = {
md: 'input-text-md',
lg: 'input-text-lg'
}.freeze
ICON_SIZE = {
md: 'input-text-icon-md',
lg: 'in... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/input_checkbox_component.rb | Ruby | mit | 19 | main | 1,587 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class InputCheckboxComponent
include ViewComponent::ComponentHelper
attr_accessor :form, :name, :label, :value, :disabled, :error, :label_position, :html_options
def initialize(form:, name:, label:, value:, disabled:, er... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/helpers/view_component/input_component/textarea_component.rb | Ruby | mit | 19 | main | 2,860 | # frozen_string_literal: true
module ViewComponent
module InputComponent
class TextareaComponent
include ViewComponent::ComponentHelper
TEXTAREA_SIZES = %w[md lg].freeze
TEXTAREA_SIZE_STYLE = {
md: 'textarea-component-md main-text-md-normal',
lg: 'textarea-component-lg main-te... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/application_controller.rb | Ruby | mit | 19 | main | 619 | # frozen_string_literal: true
module NeoComponents
class ApplicationController < ::ApplicationController
before_action -> { @active_nav = 'settings' }
helper NeoComponents::Engine.routes.url_helpers
helper do
def method_missing(method_name, *args, **kwargs, &block)
if main_app.respond_to?... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/base_controller.rb | Ruby | mit | 19 | main | 534 | # frozen_string_literal: true
module NeoComponents
module Ui
class BaseController < NeoComponents::ApplicationController
before_action :authenticate_if_configured
private
# Delegates authentication to whatever filter the host app configures.
# Configure in a Rails initializer:
# ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/modal_controller.rb | Ruby | mit | 19 | main | 439 | # frozen_string_literal: true
module NeoComponents
module Ui
class ModalController < BaseController
def index
end
def preview
render partial: "neo_components/ui/modal/sample_modal"
end
def success_modal
render partial: "neo_components/ui/modal/success_modal"
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/notification_bars_controller.rb | Ruby | mit | 19 | main | 200 | # frozen_string_literal: true
module NeoComponents
module Ui
class NotificationBarsController < BaseController
def index
@show_notification_bar = true
end
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/icons_controller.rb | Ruby | mit | 19 | main | 388 | # frozen_string_literal: true
module NeoComponents
module Ui
class IconsController < BaseController
def index
icons_path = NeoComponents::Engine.gem_root.join("app/assets/icons")
@icons = Dir.entries(icons_path)
.select { |name| name.end_with?('.svg') }
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/inputs_controller.rb | Ruby | mit | 19 | main | 411 | # frozen_string_literal: true
module NeoComponents
module Ui
class InputsController < BaseController
def index
end
def text_field
end
def radio_button
end
def checkbox
end
def file_selector
end
def mobile_inputs
end
def textarea
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/app/controllers/neo_components/ui/tables_controller.rb | Ruby | mit | 19 | main | 583 | # frozen_string_literal: true
module NeoComponents
module Ui
class TablesController < BaseController
# Sample data for demonstration — no host-app models required
SampleRow = Data.define(:id, :name, :type)
def index
@sample_rows = [
SampleRow.new(id: 1, name: "Housekeeping", ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/lib/neo_components.rb | Ruby | mit | 19 | main | 358 | # frozen_string_literal: true
require 'neo_components/version'
require 'neo_components/engine'
module NeoComponents
# Optional symbol/proc for authentication used by the UI showcase controllers.
# Example in a Rails initializer:
# NeoComponents.authentication_filter = :authenticate_admin!
mattr_accessor :au... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | engines/neo_component/lib/neo_components/engine.rb | Ruby | mit | 19 | main | 1,979 | # frozen_string_literal: true
module NeoComponents
class Engine < ::Rails::Engine
isolate_namespace NeoComponents
def self.gem_root
Pathname.new(File.expand_path('../..', __dir__))
end
# Register Sprockets asset paths (icons, stylesheets, and javascript)
initializer 'neo_components.assets... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/seed_notification.rake | Ruby | mit | 19 | main | 664 | # frozen_string_literal: true
namespace :testing do
desc 'Seed notifications for a given user'
task seed_notifications: :environment do
raise 'It is not safe to run this in non development environment' unless Rails.env.development?
email = ENV.fetch('email', nil)
if email.blank?
puts "Pass user... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/one_timer/generate_certificate_for_completed_courses.rake | Ruby | mit | 19 | main | 710 | # frozen_string_literal: true
namespace :one_timer do
desc 'Generate certificate for completed courses for sayaji learners'
task generate_certificate_for_completed_courses: :environment do
sayaji = LearningPartner.find(13)
certificate_template = sayaji.certificate_templates.find_by(active: true)
retur... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/one_timer/generate_transcripts_for_existing_videos.rake | Ruby | mit | 19 | main | 1,111 | # frozen_string_literal: true
namespace :one_timer do
desc 'Generate transcripts for existing videos'
task generate_transcripts_for_existing_videos: :environment do
Rails.logger.info 'Generating transcripts for existing videos'
# Process coursewise so that if LLM rate limits, we can resume from the last c... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/one_timer/generate_course_rating.rake | Ruby | mit | 19 | main | 281 | # frozen_string_literal: true
namespace :one_timer do
desc 'Generate course ratings based on lesson ratings'
task generate_course_ratings: :environment do
service = Lessons::RatingService.instance
service.calculate_ratings
CourseRatingJob.perform_async
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/one_timer/upload_from_s3_to_vimeo.rake | Ruby | mit | 19 | main | 390 | # frozen_string_literal: true
namespace :one_timer do
desc 'Upload videos from s3 bucket to vimeo account'
task upload_from_s3_to_vimeo: :environment do
Rails.logger.info 'Uploading videos to vimeo'
LocalContent.includes(:video_attachment).find_each do |local_content|
UploadVideoToVimeoJob.perform_a... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/tasks/one_timer/backfill_total_members_count.rake | Ruby | mit | 19 | main | 367 | # frozen_string_literal: true
namespace :one_timer do
desc 'Recalculate total_members_count for all teams'
task backfill_total_members_count: :environment do
leaf_teams = Team.includes(:sub_teams).select { |team| team.sub_teams.empty? }
leaf_teams.each do |team|
Teams::UpdateTotalMembersCountService... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/communication_channels/whatsapp/messaging_channel.rb | Ruby | mit | 19 | main | 1,830 | # frozen_string_literal: true
module CommunicationChannels
module Whatsapp
class MessagingChannel < CommunicationChannels::MessagingChannelBase
def send_message(mobile_number, template, parameters = nil)
response = send_request(mobile_number, template, parameters)
return response if respon... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/communication_channels/sms/msg91_messaging_channel.rb | Ruby | mit | 19 | main | 2,042 | # frozen_string_literal: true
module CommunicationChannels
module Sms
class Msg91MessagingChannel < CommunicationChannels::MessagingChannelBase
def send_message(mobile_number, variables_values, template_id)
return if template_id.blank?
response = dispatch_sms_request(mobile_number, variabl... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/communication_channels/sms/fast2_sms_messaging_channel.rb | Ruby | mit | 19 | main | 2,218 | # frozen_string_literal: true
module CommunicationChannels
module Sms
class Fast2SmsMessagingChannel < CommunicationChannels::MessagingChannelBase
def send_message(mobile_number, variables_values, template_id)
return if template_id.blank?
response = dispatch_sms_request(mobile_number, vari... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/utilities/tracing.rb | Ruby | mit | 19 | main | 1,183 | # frozen_string_literal: true
# Trading module to track a sequence of operations
module Utilities
# Utility module to trace specific sections of code
module Tracing
# Data class for storing trace data
class TraceData
attr_reader :name, :trace_id, :start_time
def initialize(name)
@name ... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/utilities/queue_client.rb | Ruby | mit | 19 | main | 1,074 | # frozen_string_literal: true
module Utilities
# A simple queue backed by redis
class QueueClient
attr_reader :redis_client
def initialize(redis_client)
@redis_client = redis_client
end
def enqueue(queue_name, message)
@redis_client.with do |redis|
redis.call('LPUSH', queue_na... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/api.rb | Ruby | mit | 19 | main | 909 | # frozen_string_literal: true
module Integrations
module Llm
class Api
def self.supported_llms
{
ollama: Integrations::Llm::Ollama,
gemini: Integrations::Llm::Gemini,
openai: Integrations::Llm::Openai
}
end
def self.llm_instance(provider:, model: n... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/openai.rb | Ruby | mit | 19 | main | 2,076 | # frozen_string_literal: true
module Integrations
module Llm
class Openai < Api
include CommonsHelper
attr_accessor :model
SUPPORTED_MODELS = %w[gpt-4.1-nano gpt-4.1-mini gpt-5-mini whisper-1].freeze
DEFAULT_MODEL = 'gpt-4.1-nano'
def initialize(model)
super()
va... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/ollama.rb | Ruby | mit | 19 | main | 932 | # frozen_string_literal: true
module Integrations
module Llm
class Ollama < Api
include CommonsHelper
attr_accessor :model
SUPPORTED_MODELS = %w[gemma3:latest].freeze
DEFAULT_MODEL = 'gemma3:latest'
def initialize(model)
super()
validate_llm_model(model, SUPPORTE... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/gemini.rb | Ruby | mit | 19 | main | 3,228 | # frozen_string_literal: true
module Integrations
module Llm
class Gemini < Api
include CommonsHelper
include JsonSchema
attr_accessor :model
SUPPORTED_MODELS = %w[gemini-2.5-pro gemini-2.5-flash gemini-2.5-flash-lite].freeze
DEFAULT_MODEL = 'gemini-2.5-flash'
TRANSCRIPTION_... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/instructions/chatbot.rb | Ruby | mit | 19 | main | 2,631 | # frozen_string_literal: true
module Integrations
module Llm
module Instructions
module Chatbot
INSTRUCTION = <<~INSTRUCTION
You are a Hospitality Knowledge Assistant.
SCOPE:
- You exist ONLY to answer hospitality-related questions.
- Hospitality includes h... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/json_schema/question_schema.rb | Ruby | mit | 19 | main | 342 | # frozen_string_literal: true
module Integrations
module Llm
module JsonSchema
class QuestionSchema < RubyLLM::Schema
array :questions do
object do
string :question
array :options, of: :string
array :answers, of: :string
end
end
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/json_schema/quiz_schema.rb | Ruby | mit | 19 | main | 458 | # frozen_string_literal: true
module Integrations
module Llm
module JsonSchema
class QuizSchema < RubyLLM::Schema
array :quizzes do
object do
string :question
array :options do
object do
string :option_label_letter
stri... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | lib/integrations/llm/json_schema/transcript_schema.rb | Ruby | mit | 19 | main | 317 | # frozen_string_literal: true
module Integrations
module Llm
module JsonSchema
class TranscriptSchema < RubyLLM::Schema
array :segments do
object do
integer :start_ms
integer :end_ms
string :text
end
end
end
end
end
end |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/questions_bank.rb | Ruby | mit | 19 | main | 505 | # frozen_string_literal: true
# PORO class for Questions Bank
class QuestionsBank
TABS = { all: 'All', verified: 'Verified', unverified: 'Unverified', reported: 'Reported' }.freeze
TABS.each_key { |key| attr_reader key.to_sym }
def initialize(questions)
@all = questions
@verified = questions.verified
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/search_context.rb | Ruby | mit | 19 | main | 2,861 | # frozen_string_literal: true
class SearchContext
include ActiveModel::API
# Search contexts, ie, from where the search is initiated
HOME_PAGE = :home_page
COURSE_LISTING = :course_listing
PROGRAM = :program
TEAM_ASSIGN = :team_assign
USER_ASSIGN = :user_assign
VALID_CONTEXTS = [HOME_PAGE, COURSE_LIST... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/notification.rb | Ruby | mit | 19 | main | 760 | # frozen_string_literal: true
# PORO class for Notification
class Notification
VALID_TYPES = %w[info error].freeze
attr_accessor :user, :title, :text, :ntype, :timestamp, :link
def initialize(user, title, text, link: nil, ntype: 'info', timestamp: Time.zone.now.to_i)
@user = user
@title = title
@te... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/assessment_question.rb | Ruby | mit | 19 | main | 720 | # frozen_string_literal: true
class AssessmentQuestion
attr_reader :id, :content, :options, :answers, :status, :responses
def initialize(question, selected_options)
@id = question['id']
@content = question['content']
@options = question['options']
@answers = question['answers'].to_set
@respons... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/dashboard.rb | Ruby | mit | 19 | main | 4,744 | # frozen_string_literal: true
# PORO class for Dashboard
class Dashboard
VALID_DURATIONS = {
last_7_days: 'Last 7 days',
last_14_days: 'Last 14 days',
last_30_days: 'Last 30 days',
last_month: 'Last month'
}.freeze
attr_reader :team, :duration
def initialize(team, duration)
@team = team
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/partner_metrics.rb | Ruby | mit | 19 | main | 2,704 | # frozen_string_literal: true
# PORO class for partner metrics
# naming use _value for any resulting single value such as counts
# for multiple items in the results use _values
class PartnerMetrics
attr_reader :partner
COUNTS = %i[
onboarding_initiated_count
user_login_count
user_logout_count
firs... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/mobile_number.rb | Ruby | mit | 19 | main | 629 | # frozen_string_literal: true
class MobileNumber
include ActiveModel::API
attr_accessor :value, :country_code
validates :value, numericality: true
validate :validate_phone_number
private
def valid_phone?(phone, country)
Phonelib.valid_for_country? phone, country
end
def validate_phone_number
... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/channel_message_templates.rb | Ruby | mit | 19 | main | 1,285 | # frozen_string_literal: true
class ChannelMessageTemplates
include Singleton
def course_assigned_template
{
sms: {
fast2_sms: Rails.application.credentials.dig(:fast2sms, :template, :course_assigned),
msg91: Rails.application.credentials.dig(:msg91, :template, :course_assigned)
},... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/result.rb | Ruby | mit | 19 | main | 323 | # frozen_string_literal: true
class Result < BaseResult
attr_reader :status, :data
def initialize(status, data)
super()
@status = status
@data = data
end
def ok?
status == :ok
end
def self.ok(data = nil)
new(:ok, data)
end
def self.error(data = nil)
new(:error, data)
end
e... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/base_result.rb | Ruby | mit | 19 | main | 545 | # frozen_string_literal: true
class BaseResult
attr_reader :status, :data
def initialize
raise 'Cannot initialize an abstract BaseResult class' if instance_of?(BaseResult)
end
def ok?
raise NotImplementedError, "#{self.class.name} must implement #{__method__} method."
end
def self.ok(data = nil)... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/scorm_service/course_module.rb | Ruby | mit | 19 | main | 473 | # frozen_string_literal: true
module ScormService
class CourseModule < ScormPackage::BaseCourseModule
attr_reader :course_module, :scorm_token
def initialize(course_module, scorm_token)
super()
@course_module = course_module
@scorm_token = scorm_token
end
delegate :title, to: :cou... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/scorm_service/course.rb | Ruby | mit | 19 | main | 529 | # frozen_string_literal: true
module ScormService
class Course < ScormPackage::BaseCourse
attr_reader :course, :scorm_token
def initialize(course, scorm_token)
super()
@course = course
@scorm_token = scorm_token
end
delegate :title, to: :course
delegate :description, to: :cou... |
github | openvitae-tech/blackboard-lms | https://github.com/openvitae-tech/blackboard-lms | app/value_objects/scorm_service/video.rb | Ruby | mit | 19 | main | 282 | # frozen_string_literal: true
module ScormService
class Video < ScormPackage::BaseVideo
attr_reader :id, :language, :video_url
def initialize(id, language, video_url)
super()
@id = id
@language = language
@video_url = video_url
end
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.