app/helpers/administration_helper.rb
# Provide the list of courses together with information on whether or not
# they can be edited by current user.
# Used for dropdown menu in admin navbar.
Provide the list of courses together with information on whether or not
they can be edited by current user.
Used for dropdown menu in admin navbar.
Provide the list of courses together with information on whether or not they can be edited by current user . Used for dropdown menu in admin navbar .
def editable_courses_dropdown
    editable = current_user.editable_courses_with_inheritance
                           .natural_sort_by(&:title)
    non_editable = (Course.all - editable).natural_sort_by(&:title)
    return editable if non_editable.blank?
    return non_editable if editable.blank?
    editable + ['divider'] + non_editable
  end
def editable_courses_dropdown editable = current_user . editable_courses_with_inheritance . natural_sort_by ( & :title ) non_editable = ( Course . all - editable ) . natural_sort_by ( & :title ) return editable if non_editable . blank? return non_editable if editable . blank? editable + [ 'divider' ] + non_editable end
Provide the list of courses together with information on whether or not
they can be edited by current user.
Provide the list of courses together with information on whether or not they can be edited by current user .
# Provide dropdown divider if both editable and non-editable courses are # present.