Skip to content

Commit

Permalink
Merge branch 'release/0.2.4'
Browse files Browse the repository at this point in the history
* 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
kalashnikovisme committed Jun 3, 2015
2 parents 7e82ca6 + 76bc4f0 commit c6871fa
Show file tree
Hide file tree
Showing 54 changed files with 2,421 additions and 170 deletions.
3 changes: 2 additions & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ require 'capistrano/rails'
require 'capistrano3/unicorn'
require 'capistrano/rails/console'
require 'capistrano/rails_tail_log'
#require 'capistrano/sidekiq'
require 'capistrano/rails/collection'
require 'capistrano/sidekiq'
#require 'capistrano/sidekiq/monit'
require 'capistrano/rails/assets'
require 'capistrano/faster_assets'
Expand Down
27 changes: 2 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'libv8', '3.16.14.7'
gem 'therubyracer'

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'haml-rails'
gem 'enumerize'
Expand Down Expand Up @@ -55,33 +46,18 @@ gem 'foundation-rails', github: 'zurb/foundation-rails'
gem "autoprefixer-rails"
gem 'select2-rails'
gem 'jasny_bootstrap_extension_rails'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'sinatra', '>= 1.3.0', require: nil

group :production do
gem 'unicorn-rails'
end

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'

gem 'foreman'

gem 'guard-livereload', '~> 2.4', require: false
gem "rack-livereload"

# Access an IRB console on exception pages or by using <%= console %> in viewr
gem 'web-console', '2.0.0.beta2'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '1.3.4'
gem 'factory_girl_rails'
gem 'pry-rails'
Expand All @@ -97,6 +73,7 @@ group :development, :test do
gem 'capistrano-rails-console'
gem 'capistrano-rails-tail-log'
gem 'capistrano-faster-assets', '~> 1.0'
gem 'capistrano-rails-collection'
gem 'quiet_assets'
gem 'colorize', '0.6.0'
gem 'better_errors'
Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ GEM
capistrano-rails (1.1.3)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rails-collection (0.0.3)
capistrano-rails (~> 1.1.0)
capistrano-rails-console (0.5.2)
capistrano (>= 3.0.0, < 4.0.0)
capistrano-rails-tail-log (0.0.1)
Expand Down Expand Up @@ -335,6 +337,8 @@ GEM
rack (1.6.1)
rack-livereload (0.3.15)
rack
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
railroady (1.3.0)
Expand Down Expand Up @@ -415,6 +419,10 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
spring (1.3.4)
sprockets (3.1.0)
Expand Down Expand Up @@ -478,6 +486,7 @@ DEPENDENCIES
capistrano-bundler
capistrano-faster-assets (~> 1.0)
capistrano-rails (= 1.1.3)
capistrano-rails-collection
capistrano-rails-console
capistrano-rails-tail-log
capistrano-rvm
Expand Down Expand Up @@ -529,6 +538,7 @@ DEPENDENCIES
sidekiq
simple_form
simplecov
sinatra (>= 1.3.0)
spring (= 1.3.4)
state_machine!
tconsole!
Expand Down
79 changes: 0 additions & 79 deletions app/assets/javascripts/application.js

This file was deleted.

48 changes: 48 additions & 0 deletions app/assets/javascripts/application.js.coffee
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
117 changes: 114 additions & 3 deletions app/assets/javascripts/web/welcome.coffee
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
21 changes: 21 additions & 0 deletions app/assets/stylesheets/web/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,24 @@ input[type=checkbox] {
width: auto;
}
}

.panel {
&.alert {
background-color: #f04124;
h1, h2, h3, h4, h5, h6, li {
color: white;
}
}
}

.new-slider-item {
span.spin {
position: absolute;
width: 32px;
height: 32px;
background-size: 100% 100%;
background-image: image-url('spinner.gif');
top: 40px;
margin-left: 100px;
}
}
Loading

0 comments on commit c6871fa

Please sign in to comment.