This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: app/assets/stylesheets/custom/_areas.scss app/assets/stylesheets/custom/_main.scss app/controllers/web/admin/events_controller.rb app/views/layouts/web/shared/_navigation.html.haml app/views/web/accounts/_form.html.haml
- Loading branch information
Showing
181 changed files
with
2,217 additions
and
813 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,6 @@ | |
|
||
/public/system/* | ||
/coverage | ||
# Ignore schema | ||
schema.rb | ||
|
||
#ignore idea project files | ||
.idea |
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
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# enable chosen js | ||
$('.chosen-select').chosen | ||
allow_single_deselect: true | ||
no_results_text: 'Ничего не найдено по запросу' | ||
#enable chosen js | ||
$('.chosen-select').each -> | ||
$(@).select2 | ||
allowClear: true | ||
placeholder: $(@).data('placeholder') |
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,5 @@ | ||
window.onload = -> | ||
delay = (ms, func) -> setTimeout func, ms | ||
delay 4000, -> $('.alert').fadeOut('slow') | ||
|
||
$('.color-picker').colorpicker() |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
$('.datetimepicker').datetimepicker | ||
format: "yyyy-MM-dd hh:mm:ss" | ||
# format: "dd-MM-yyyy hh:mm" |
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,47 @@ | ||
class Helpers | ||
@setSelectOptions: (selectElement, values, valueKey, textKey) -> | ||
selectElement.empty() | ||
if values.length > 0 | ||
html = ("<option value='#{item[valueKey]}'>#{item[textKey]}</option>" for item in values) | ||
selectElement.append(html) | ||
|
||
class TimeSlotEditWidget | ||
defaults: | ||
event_type_select_class: 'select.event-type-select' | ||
event_id_select_class: 'select.event-id-select' | ||
select2_options: | ||
placeholder: 'Выберите...' | ||
allowClear: true | ||
|
||
constructor: (options) -> | ||
@item = options.item | ||
@event_type_select_class = options.event_type_select_class || @defaults.event_type_select_class | ||
@event_id_select_class = options.event_id_select_class || @defaults.event_id_select_class | ||
@init() | ||
@bind() | ||
|
||
init: -> | ||
@event_id_dropdown = @item.find @event_id_select_class | ||
@event_type_dropdown = @item.find @event_type_select_class | ||
@event_type_dropdown.select2 @select2_options | ||
@event_id_dropdown.select2 @select2_options | ||
@item.find('.datetimepicker').datetimepicker format: "yyyy-MM-dd hh:mm:ss" | ||
|
||
bind: -> | ||
@event_type_dropdown.on 'change', (e) => | ||
val = e.val | ||
if val is '' | ||
@reload_select @event_id_dropdown, [] | ||
else | ||
$.get Routes.api_events_path(type: val), (data) => | ||
@reload_select @event_id_dropdown, data.root.events | ||
|
||
reload_select: (obj, data)-> | ||
obj.select2("destroy") | ||
Helpers.setSelectOptions(obj, data, 'id', 'title') | ||
obj.select2 @select2_options | ||
|
||
|
||
|
||
$('.hall-form .well').each -> new TimeSlotEditWidget item: $(@) | ||
$('.hall-form').bind 'cocoon:after-insert', (e, inserted_item) -> new TimeSlotEditWidget item: $(inserted_item) |
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 |
---|---|---|
@@ -1,4 +1,65 @@ | ||
window.onload = -> | ||
delay = (ms, func) -> setTimeout func, ms | ||
delay 4000, -> $('.alert').fadeOut('slow') | ||
|
||
|
||
# side bar | ||
affixTop = $("#nav_top").outerHeight() + $("#nav_main").outerHeight() + $("header").outerHeight() + $(".content h1:first").outerHeight() + parseInt($(".content h1:first").css('marginTop')) + parseInt($(".content h1:first").css('marginBottom')) | ||
affixBottom = $(".sponsors").outerHeight() + parseInt($("#main_container").css("padding-bottom"))+ parseInt($(".border").css('marginTop')) | ||
affixHeight = $(".b-affix:first").outerHeight() | ||
docHeight = $(document).height() | ||
bottomLimit = docHeight - affixBottom - affixHeight | ||
|
||
setInterval (-> | ||
b_affix() | ||
), 1 | ||
|
||
b_affix = -> | ||
curPos = $(window).scrollTop() | ||
if curPos > affixTop and curPos < bottomLimit | ||
$(".b-affix").addClass("top") | ||
else | ||
$(".b-affix").removeClass("top") | ||
|
||
if curPos > bottomLimit | ||
$(".b-affix").addClass("bottom") | ||
else | ||
$(".b-affix").removeClass("bottom") | ||
|
||
$(document).ready -> | ||
|
||
# timetable long events hover | ||
$('.event').mouseenter -> | ||
heightSummary = $(this).find('.summary').outerHeight() | ||
heightEvent = $(this).outerHeight() | ||
if heightSummary > heightEvent | ||
$(this).addClass('expand') | ||
.mouseleave -> | ||
$(this).removeClass('expand') | ||
|
||
# events editing table | ||
$('table').delegate 'a.edit-event', 'click', -> | ||
parent_row = $(this).closest('tr') | ||
parent_row.next().toggleClass('hidden') | ||
|
||
$('#my_events a.edit-event').click() | ||
|
||
$('table').delegate 'form.edit-event[data-remote]', 'ajax:success', (evt, data, status, xhr) -> | ||
row = $(this).closest('tr') | ||
row.after(data) | ||
row.prev().remove() | ||
row.remove() | ||
delay 4000, -> $('.alert').fadeOut('slow') | ||
|
||
# Twitter Bootstrap tabs hashes | ||
|
||
# Automagically jump on good tab based on anchor; for page reloads or links | ||
$("a[href=" + location.hash + "]").tab "show" if location.hash | ||
|
||
# Update hash based on tab, basically restores browser default behavior to fix bootstrap tabs | ||
$(document.body).on "click", "a[data-toggle=tab]", (event) -> | ||
location.hash = @getAttribute("href") | ||
|
||
# on history back activate the tab of the location hash if exists or the default tab if no hash exists | ||
$(window).on "popstate", -> | ||
anchor = location.hash or $("a[data-toggle=tab]").first().attr("href") | ||
$("a[href=" + anchor + "]").tab "show" |
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
Oops, something went wrong.