Skip to content

Commit

Permalink
Merge branch 'release/v1.9.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
İsmail Akbudak committed Aug 3, 2016
2 parents 6d65d0a + 214a3f5 commit 7f9b8a5
Show file tree
Hide file tree
Showing 32 changed files with 107 additions and 57 deletions.
1 change: 0 additions & 1 deletion dump.rdb

This file was deleted.

6 changes: 5 additions & 1 deletion lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,14 @@ def setup_capistrano_settings
end
end

# Nor using
def setup_recipes
generate 'recipes_matic:install'
end

def setup_client_side_validations
generate 'client_side_validations:install'
end

def update_secret_token
remove_file 'config/initializers/secret_token.rb', force: true
template 'config/initializers/secret_token.erb', 'config/initializers/secret_token.rb'
Expand Down Expand Up @@ -440,6 +443,7 @@ def copy_files
template '.env.production.erb', '.env.production', force: true
template '.env.staging.erb', '.env.staging', force: true
template 'env.sample.erb', 'env.sample', force: true
template 'Procfile.erb', 'Procfile', force: true

# Library files
directory 'lib/tasks', 'lib/tasks'
Expand Down
5 changes: 5 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ def setup_recipes
build :setup_recipes
end

def setup_client_side_validations
say 'Setup client_side_validations'
build :setup_client_side_validations
end

def setup_secret_token
say 'Setup secret token'
build :update_secret_token
Expand Down
2 changes: 1 addition & 1 deletion lib/cybele/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Cybele
RAILS_VERSION = '~> 4.2.6'
RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
VERSION = '1.9.1'
VERSION = '1.9.2'
end
4 changes: 2 additions & 2 deletions templates/.env.production.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SMTP_USER_NAME=admin@<%= app_name %>.com
SMTP_ADDRESS=smtp.sendgrid.net

BASIC_AUTH_IS_ACTIVE=no
S3_BUCKET_NAME=<%= app_name %>-v3
AWS_RAW_URL=<%= app_name %>-v3.s3.amazonaws.com
S3_BUCKET_NAME=<%= app_name %>
AWS_RAW_URL=<%= app_name %>.s3.amazonaws.com
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
4 changes: 2 additions & 2 deletions templates/.env.staging.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SMTP_USER_NAME=admin@<%= app_name %>.com
SMTP_ADDRESS=smtp.sendgrid.net

BASIC_AUTH_IS_ACTIVE=yes
S3_BUCKET_NAME=<%= app_name %>-v3-staging
AWS_RAW_URL=<%= app_name %>-v3-staging.s3.amazonaws.com
S3_BUCKET_NAME=<%= app_name %>-staging
AWS_RAW_URL=<%= app_name %>-staging.s3.amazonaws.com
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
2 changes: 2 additions & 0 deletions templates/Procfile.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: bin/rails server -p $PORT -e $RAILS_ENV
worker: bundle exec sidekiq -C config/sidekiq.yml
2 changes: 2 additions & 0 deletions templates/app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#= require jquery.datetimepicker
#= require nprogress
#= require trix
#= require rails.validations
#= require rails.validations.simple_form

class @App

Expand Down
3 changes: 2 additions & 1 deletion templates/app/assets/javascripts/hq/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#= require trix
#= require jquery.datetimepicker
#= require nprogress

#= require rails.validations
#= require rails.validations.simple_form

class @App
@tooltip = ->
Expand Down
4 changes: 2 additions & 2 deletions templates/app/controllers/application_controller.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base

# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
before_filter :set_audit_user
before_filter :set_audit_user, :set_user_time_zone
protect_from_forgery with: :exception

def server_error(exception)
Expand All @@ -27,7 +27,7 @@ class ApplicationController < ActionController::Base
protected

def set_user_time_zone
Time.zone = current_user.time_zone if student_signed_in? && current_student.time_zone.present?
Time.zone = current_user.time_zone if user_signed_in? && current_user.time_zone.present?
end

def devise_parameter_sanitizer
Expand Down
2 changes: 1 addition & 1 deletion templates/app/controllers/concerns/basic_authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module BasicAuthentication
private

def authenticate
if Rails.env.staging? and ENV['BASIC_AUTH_IS_ACTIVE'] == 'yes'
if ENV['BASIC_AUTH_IS_ACTIVE'] == 'yes'
authenticate_or_request_with_http_basic do |username, password|
username == Settings.basic_auth.username && password == Settings.basic_auth.password
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class User::ProfilesController < User::UserApplicationController
class User::ProfileController < User::UserApplicationController

before_action :set_profile, only: [:show, :edit, :update]
add_breadcrumb I18n.t('dock.profile'), :user_profile_path

def show
add_breadcrumb @profile.full_name, user_profile_path
respond_with([:user, @profile])
respond_with(:user, @profile)
end

def edit
Expand All @@ -14,7 +14,7 @@ def edit

def update
@profile.update(profile_params)
respond_with([:user, @profile], location: user_profile_path)
respond_with(:user, @profile, location: user_profile_path)
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ class User::UserApplicationController < ActionController::Base

# layout 'user/application'
layout 'application'
before_filter :set_audit_user
before_filter :set_audit_user, :set_user_time_zone
before_action :authenticate_user!

self.responder = ApplicationResponder
respond_to :html, :json

protected

def set_user_time_zone
Time.zone = current_user.time_zone if current_user.time_zone.present?
end

private

def set_audit_user
Expand Down
2 changes: 1 addition & 1 deletion templates/app/views/devise/registrations/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%h2
= t('devise.registration.title', model: resource.class.model_name.human )
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }, validate: true) do |f|
= f.error_notification
.form-inputs
= f.input :email, required: true, autofocus: true
Expand Down
2 changes: 1 addition & 1 deletion templates/app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%h3.text-center
= t('view.or')
%hr/
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), validate: true) do |f|
= f.error_notification
.form-inputs
= f.input :email
Expand Down
2 changes: 1 addition & 1 deletion templates/app/views/hq/admins/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%i.icon-edit.icon-large
= yield :form_title
.panel-body
= simple_form_for([:hq, @admin]) do |f|
= simple_form_for([:hq, @admin], validate: true) do |f|
= f.error_notification

.form-inputs
Expand Down
6 changes: 3 additions & 3 deletions templates/app/views/hq/cities/_city.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
%td= city.country.name
%td=l city.created_at
%td.action
= link_to([:hq, city], class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
= link_to([:hq, city], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do
%i.icon-eye-open
= link_to(edit_hq_city_path(city) , class: 'btn btn-info') do
= link_to(edit_hq_city_path(city) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do
%i.icon-edit
= link_to([:hq, city], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure') }) do
= link_to([:hq, city], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do
%i.icon-trash
2 changes: 1 addition & 1 deletion templates/app/views/hq/cities/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%i.icon-edit.icon-large
= yield :form_title
.panel-body
= simple_form_for([:hq, @city]) do |f|
= simple_form_for([:hq, @city], validate: true) do |f|
= f.error_notification

.form-inputs
Expand Down
6 changes: 3 additions & 3 deletions templates/app/views/hq/countries/_country.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
%td= country.name
%td=l country.created_at
%td.action
= link_to([:hq, country], class: 'btn btn-success', toogle: 'tooltip', title: t('tooltips.zoom')) do
= link_to([:hq, country], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do
%i.icon-eye-open
= link_to(edit_hq_country_path(country) , class: 'btn btn-info') do
= link_to(edit_hq_country_path(country) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do
%i.icon-edit
= link_to([:hq, country], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure') }) do
= link_to([:hq, country], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do
%i.icon-trash
2 changes: 1 addition & 1 deletion templates/app/views/hq/countries/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%i.icon-edit.icon-large
= yield :form_title
.panel-body
= simple_form_for([:hq, @country]) do |f|
= simple_form_for([:hq, @country], validate: true) do |f|
= f.error_notification

.form-inputs
Expand Down
2 changes: 1 addition & 1 deletion templates/app/views/hq/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%i.icon-edit.icon-large
= yield :form_title
.panel-body
= simple_form_for([:hq, @user]) do |f|
= simple_form_for([:hq, @user], validate: true) do |f|
= f.error_notification

.form-inputs
Expand Down
40 changes: 33 additions & 7 deletions templates/app/views/layouts/application.html.haml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,39 @@
%body
= render 'layouts/partials/warnings'
.container-narrow
.masthead
%ul.nav.nav-pills.pull-right
%li.active
%a{href: "/"}
= t('navbar.home_page')
%h3.muted= link_to "<%= app_name.capitalize %>", root_path
%hr/
%nav.navbar.navbar-default
.container-fluid
/ Brand and toggle get grouped for better mobile display
.navbar-header
%button.navbar-toggle.collapsed{"aria-expanded" => "false", "data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to root_path, class: 'navbar-brand' do
%i.fa.fa-home
= "<%= app_name.capitalize %>"
/ Collect the nav links, forms, and other content for toggling
#bs-example-navbar-collapse-1.collapse.navbar-collapse
%ul.nav.navbar-nav.navbar-right
- if user_signed_in?
%li
= link_to destroy_user_session_path, method: :delete do
%i.fa.fa-sign-out
= t('navbar.sign_out')
%li
= link_to user_profile_path(current_user) do
%i.fa.fa-user
= t('navbar.profile')
- else
%li
= link_to new_user_session_path do
%i.fa.fa-pencil-square-o{"aria-hidden" => "true"}
= t('navbar.signin')
%li
= link_to new_user_registration_path do
%i.fa.fa-user{"aria-hidden" => "true"}
= t('navbar.signup')
= render partial: 'layouts/partials/messages'
= yield
%hr/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%i.icon-edit.icon-large
= yield :form_title
.panel-body
= simple_form_for([:user, @profile], url: user_profile_path) do |f|
= simple_form_for([:user, @profile], url: user_profile_path, validate: true) do |f|
= f.error_notification

.form-inputs
Expand Down
3 changes: 3 additions & 0 deletions templates/app/views/user/profile/edit.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- content_for :form_title do
= t('tt.edit', resource_name: User.model_name.human)
= render 'form'
18 changes: 18 additions & 0 deletions templates/app/views/user/profile/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.panel.panel-default
.panel-heading
%i.icon-edit.icon-large
= t('tt.show', resource_name: User.model_name.human)
.panel-body
= show_for @profile do |s|
= s.attribute :name
= s.attribute :surname
= s.attribute :email
= s.attribute :created_at
= s.attribute :updated_at
.panel-footer
= link_to root_path, class: 'btn-link' do
%i.fa.fa-arrow-left
= t('btn.back')
= link_to edit_user_profile_path(@profile), class: 'btn btn-link' do
%i.fa.fa-pencil
= t('navbar.edit_profile_info')
3 changes: 0 additions & 3 deletions templates/app/views/user/profiles/edit.html.haml

This file was deleted.

15 changes: 0 additions & 15 deletions templates/app/views/user/profiles/show.html.haml

This file was deleted.

1 change: 1 addition & 0 deletions templates/app/views/welcome/index.html.haml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
%strong Email:
= current_user.email
= link_to t('navbar.edit_login_info'), edit_user_registration_path, class: 'btn btn-large'
= link_to t('navbar.profile'), user_profile_path(current_user), class: 'btn btn-link'
- else
= link_to t('navbar.signup'), new_user_registration_path, class: 'btn btn-large btn-success'
= link_to t('navbar.signin'), new_user_session_path, class: 'btn btn-large'
2 changes: 2 additions & 0 deletions templates/config/locales/view.tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ tr:
signin: Giriş Yap
sign_out: Çıkış yap
edit_login_info: Giriş bilgilerini güncelle
edit_profile_info: Profil bilgilerini güncelle
home_page: Anasayfa
admin_portal: Yönetici Portalı
profile: Profil
tooltips:
delete: Sil
are_you_sure: Devam etmek istedğinize emin misiniz?
Expand Down
2 changes: 1 addition & 1 deletion templates/config/routes.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Rails.application.routes.draw do
namespace :user do
root to: 'dashboard#index'
resources :dashboard, only: [:index]
resources :profile, only: [:index, :edit, :update]
resources :profile, only: [:show, :edit, :update]
end

# Common pages
Expand Down
2 changes: 1 addition & 1 deletion templates/cybele_Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ group :development, :test do
gem 'katip'
gem 'capybara'
gem 'bullet'
gem 'sinatra', require: nil
gem 'quiet_assets'
end

Expand All @@ -86,6 +85,7 @@ gem 'puma', '~> 3.4.0'
gem 'sidekiq', '~> 4.1'
gem 'devise-async', '~> 0.10.1'
gem 'sidekiq-cron', '~> 0.4.2'
gem 'sinatra', require: nil

# Comand line execution
gem 'cocaine', '~> 0.5.8'
Expand Down
3 changes: 1 addition & 2 deletions templates/lib/tasks/dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace :dev do
Rake::Task['db:drop'].execute
Rake::Task['db:create'].execute
Rake::Task['db:migrate'].execute
Rake::Task['dev:initial'].execute
Rake::Task['db:seed'].execute
Rake::Task['dev:seed'].execute
end

desc 'seed test data'
Expand Down

0 comments on commit 7f9b8a5

Please sign in to comment.