Skip to content

Commit

Permalink
Merge pull request #447 from coopdevs/develop
Browse files Browse the repository at this point in the history
Release v1.10.0
  • Loading branch information
enricostano authored Oct 22, 2018
2 parents 99edf4b + a056b6c commit a645342
Show file tree
Hide file tree
Showing 31 changed files with 120 additions and 329 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: ruby
cache: bundler
bundler_args: '--without production development'
rvm:
- 2.3.0
env: DATABASE_URL=postgres://postgres@localhost/timeoverflow_test
before_script:
- bundle exec rake db:setup
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gem 'pundit', '~> 2.0.0'
gem 'pg', '0.17.1'
gem 'hstore_translate'
gem 'dalli'
gem 'devise', '~> 4.4.1'
gem 'devise', '~> 4.5.0'
gem "http_accept_language", '~> 2.1.1'
gem 'unicorn'
gem 'kaminari', '~> 1.1.1'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GEM
dalli (2.7.2)
database_cleaner (1.6.2)
debug_inspector (0.0.3)
devise (4.4.3)
devise (4.5.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 6.0)
Expand Down Expand Up @@ -412,7 +412,7 @@ DEPENDENCIES
coffee-rails
dalli
database_cleaner (= 1.6.2)
devise (~> 4.4.1)
devise (~> 4.5.0)
dotenv-rails (= 2.5.0)
elasticsearch-model
elasticsearch-rails
Expand Down
3 changes: 1 addition & 2 deletions app/admin/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def destroy
resource.destroy

if resource == current_organization
sign_out(current_user)
redirect_to root_path
sign_out_and_redirect(current_user)
else
redirect_to admin_organizations_path
end
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ label[required]::after{
}

.panel-body h2 {
font-size: 1.9rem;
font-size: 2.24rem;
font-weight: 500;
margin: 0;
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def destroy
find_member
toggle_active_posts
@member.destroy
redirect_to users_path
redirect_to manage_users_path
end

def toggle_manager
Expand Down
14 changes: 0 additions & 14 deletions app/controllers/offers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ def model
Offer
end

def dashboard
initial_scope =
if current_organization
current_organization.offers.active.of_active_members
else
Offer.all.active.of_active_members
end
@offers = Category.all.sort_by { |a| a.name.downcase }.
each_with_object({}) do |category, offers|
list = initial_scope.merge(category.posts).limit(5)
offers[category] = list if list.present?
end
end

def show
super

Expand Down
14 changes: 5 additions & 9 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ class UsersController < ApplicationController
before_filter :authenticate_user!

def index
search_and_load_members current_organization.members.active
search_and_load_members current_organization.members.active, {s: 'member_uid asc'}
end

def manage
search_and_load_members current_organization.members
search_and_load_members current_organization.members, {s: 'member_uid asc'}
end

def show
Expand Down Expand Up @@ -57,20 +57,16 @@ def update

private

def search_and_load_members(members_scope)
@search = members_scope.ransack(search_params)
def search_and_load_members(members_scope, default_search_params)
@search = members_scope.ransack(default_search_params.merge(params.fetch(:q, {})))

@members =
@search.result.eager_load(:account, :user).page(params[:page]).per(25)
@search.result.eager_load(:account, :user).page(params[:page]).per(20)

@member_view_models =
@members.map { |m| MemberDecorator.new(m, self.class.helpers) }
end

def search_params
{s: 'member_uid asc'}.merge(params.fetch(:q, {}))
end

def scoped_users
current_organization.users
end
Expand Down
13 changes: 0 additions & 13 deletions app/helpers/posts_helper.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/application/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<ul class="nav nav-pills actions-menu">
<%= render 'application/menus/user_list_link' %>
<%= render 'application/menus/offers_dashboard_link' %>
<%= render 'application/menus/offers_list_link' %>
<%= render 'application/menus/inquiries_list_link' %>
<% if current_user.manages? current_organization %>
<%= render 'application/menus/offers_by_tag_link' %>
Expand Down
6 changes: 0 additions & 6 deletions app/views/application/menus/_offers_dashboard_link.html.erb

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/application/menus/_offers_list_link.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<li class="<%= "active" if current_page?(offers_path) %>">
<%= link_to offers_path do %>
<%= glyph :offer %>
<%= Offer.model_name.human(count: :many) %>
<% end %>
</li>
34 changes: 16 additions & 18 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<div class="row">
<div class="col-sm-4">
<%= render "devise/shared/links" %>
</div>
<div class="col-sm-8">
<div class="panel panel-primary">
<div class="panel-heading">
<h2 class="panel-title">
<%= t(".change_password") %>
</h2>
</div>
<div class="col-sm-6 col-sm-offset-3">
<div class="panel panel-primary" id="login-box">
<div class="panel-body">
<h2><%= t(".change_password") %></h2>
<%= render 'layouts/messages' %>
<%= show_error_messages!(resource) %>
<%= form_for resource, url: password_path(resource_name), html: { method: :put } do |f| %>
<%= f.hidden_field :reset_password_token %>
<div class="form-group">
<%= f.label :password, t(".new_password"), class: "control-label" %>
<%= f.password_field :password, required: true, autofocus: true, class: "form-control", ng_model: "password" %>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock</i>
</span>
<%= f.password_field :password, required: true, autofocus: true, placeholder: t(".new_password"), class: "form-control input-lg" %>
</div>
</div>
<div class="form-group" ng_class="{ 'has-error': password != password_confirmation %>">
<%= f.label :password_confirmation, t(".confirm_password"), class: "control-label" %>
<%= f.password_field :password_confirmation, required: true, class: "form-control", ng_model: "password_confirmation" %>
<div class="help-block" ng_if="password && password_confirmation && password != password_confirmation">
<%= t ".passwords_not_match" %>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock</i>
</span>
<%= f.password_field :password_confirmation, required: true, placeholder: t(".confirm_password"), oninput: "this.setCustomValidity(this.value != form.user_password.value ? '#{t(".passwords_not_match")}' : '')", class: "form-control input-lg" %>
</div>
</div>
<div class="form-group">
<%= f.submit t(".change_password"), class: "btn btn-primary", ng_disabled: "!password || password != password_confirmation" %>
<%= f.submit t(".change_password"), class: "btn btn-primary btn-lg col-xs-12" %>
</div>
<% end %>
</div>
Expand Down
61 changes: 0 additions & 61 deletions app/views/devise/registrations/edit.html.erb

This file was deleted.

39 changes: 0 additions & 39 deletions app/views/devise/registrations/new.html.erb

This file was deleted.

78 changes: 0 additions & 78 deletions app/views/offers/dashboard.html.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/offers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<%= link_to #{t 'global.all'}", dashboard_offers_path %>
<%= link_to #{t 'global.all'}", offers_path %>
</li>
<% Category.all.sort_by { |a| a.name.downcase }.each do |c| %>
<% next if c == @category %>
Expand Down
Loading

0 comments on commit a645342

Please sign in to comment.