-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/0.2.4: fix spinner hiding spinner while loading create lazy loading news add warning label fix sidekiq hide one test fix tests many fixes some fixes mailing something like notification system some fixes add capistrano collection fix member_form
- Loading branch information
Showing
54 changed files
with
2,421 additions
and
170 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 was deleted.
Oops, something went wrong.
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,48 @@ | ||
# Plugins | ||
#= require jquery | ||
#= require slick | ||
#= require bootstrap-sprockets | ||
#= require jquery_ujs | ||
#= require moment | ||
#= require moment/ru | ||
#= require bootstrap-datetimepicker | ||
#= require pickers | ||
#= require js-routes | ||
#= require active_form | ||
#= require i18n_setup | ||
#= require placeholders | ||
#= require localities | ||
#= require events | ||
#= require news | ||
#= require foundation | ||
#= require select2 | ||
#= require web/users/account | ||
#= require jasny-bootstrap | ||
#= require jasny_file_uploader | ||
# Views logic | ||
#= require web/members | ||
#= require web/events | ||
#= require web/welcome | ||
|
||
$(document).foundation() | ||
|
||
$ -> | ||
$(document).foundation('tab', 'reflow') | ||
|
||
init_link_class = -> | ||
$('.link').click -> | ||
location.href = $(this).data('href') | ||
$('.slider-link').click -> | ||
if $(this).hasClass 'slick-active' | ||
location.href = $(this).data('href') | ||
|
||
init_select2 = -> | ||
$('select.select2').select2() | ||
|
||
init_blank_adding = -> | ||
$('.blank').prop('target', '_blank') | ||
|
||
init_select2() | ||
init_link_class() | ||
init_blank_adding() | ||
return |
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,3 +1,114 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ | ||
$ -> | ||
$news_slider = $('.news-slider') | ||
options = { | ||
infinite: false | ||
slidesToShow: 5 | ||
slidesToScroll: 5 | ||
prevArrow: $('.news .slider-arrows>.left-arrow') | ||
nextArrow: $('.news .slider-arrows>.right-arrow') | ||
} | ||
|
||
init_slider = -> | ||
$('.main-slider .slider-items').slick { | ||
centerMode: true | ||
autoplay: true | ||
autoplaySpeed: 6000 | ||
speed: 800 | ||
centerPadding: '22%' | ||
slidesToShow: 1 | ||
responsive: [ | ||
{ | ||
breakpoint: 1100 | ||
settings: { | ||
centerPadding: '20%' | ||
} | ||
} | ||
] | ||
prevArrow: $('.main-slider .left-arrow') | ||
nextArrow: $('.main-slider .right-arrow') | ||
} | ||
$news_slider.slick options | ||
return | ||
|
||
text_news_template = -> | ||
" | ||
<a class='new-slider-item slick-slide' href='/news/33'> | ||
<p class='date'> | ||
</p> | ||
<p class='content title'> | ||
</p> | ||
<p class='content text'> | ||
</p> | ||
</a> | ||
" | ||
|
||
append_news = -> | ||
index = $('.news-slider .slick-track a').last().data('slick-index') | ||
$news_slider.slick 'slickAdd', text_news_template() | ||
|
||
append_empty_items = -> | ||
for i in [0..4] | ||
append_news() | ||
|
||
fill_news = (news) -> | ||
$news_slider_item = $('.news-slider .slick-track a').slice -5 | ||
$news_slider_item.each -> | ||
$(this).children('span.spin').remove() | ||
$news_slider_item.each (index) -> | ||
current_news = news[index] | ||
$(this).prop 'href', Routes.news_path current_news.id | ||
$date = $(this).children('p.date').first() | ||
$title = $(this).children('p.content.title').first() | ||
$text = $(this).children('p.content.text').first() | ||
|
||
$date.html current_news.publish_date_time | ||
$title.html current_news.title | ||
$text.html current_news.text | ||
return | ||
return | ||
|
||
load_news = -> | ||
count = 5 | ||
offset = parseInt($('.news-slider .slick-track a').length) - count | ||
$.ajax { | ||
url: Routes.api_news_index_path(), | ||
method: 'GET' | ||
data: { | ||
count: count | ||
offset: offset | ||
} | ||
dataType: 'json' | ||
success: (response) -> | ||
fill_news response | ||
append_empty_items() | ||
error: -> | ||
alert 'error' | ||
} | ||
|
||
$left_arrow = $('.news a.arrow.left-arrow') | ||
$right_arrow = $('.news a.arrow.right-arrow') | ||
|
||
load = -> | ||
num = parseInt $right_arrow.data('load') | ||
|
||
crease = -> | ||
parseInt $left_arrow.data('crease') | ||
|
||
$left_arrow.click -> | ||
if crease() > 0 | ||
$right_arrow.data('load', load() + 1) | ||
$left_arrow.data('crease', crease() - 1) | ||
return | ||
|
||
$right_arrow.click -> | ||
if load() == 0 | ||
$left_arrow.data('crease', crease() + 1) | ||
$('.news-slider .slick-track a').slice(-5).each -> | ||
$(this).append('<span class = "spin"></span>') | ||
load_news() | ||
else | ||
$right_arrow.data('load', load() - 1) | ||
return | ||
|
||
init_slider() | ||
return |
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.