From d5cdb45812c88ba4dda04bd0087f942d060ae52f Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 00:02:39 +0200 Subject: [PATCH 01/38] Deployment: remove shellycloud config --- Cloudfile | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 Cloudfile diff --git a/Cloudfile b/Cloudfile deleted file mode 100644 index c259b7a..0000000 --- a/Cloudfile +++ /dev/null @@ -1,20 +0,0 @@ -timeoverflow: - ruby_version: 2.2.2 - environment: production # RAILS_ENV - monitoring_email: saverio.trioni@gmail.com - domains: - - timeoverflow.shellyapp.com - - www.timeoverflow.org - servers: - app1: - size: small - thin: 4 - # delayed_job: 1 - # sidekiq: 1 - # clockwork: on - whenever: on - # elasticsearch: on - databases: - - postgresql - # - mongodb - # - redis From 1d9f1cf1aa27715eb5e254bfd7be97fc97e0b7b0 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 00:04:52 +0200 Subject: [PATCH 02/38] Deployment: update server config --- config/deploy.rb | 20 ++++++++++---------- config/deploy/production.rb | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index e8a80c7..f7943b6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,8 +1,8 @@ # config valid only for current version of Capistrano -lock "3.4.0" +lock '3.4.0' -set :application, "timeoverflow" -set :repo_url, "git@github.com:coopdevs/timeoverflow.git" +set :application, 'timeoverflow' +set :repo_url, 'git@github.com:coopdevs/timeoverflow.git' # Default branch is :master # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp @@ -26,17 +26,17 @@ set :repo_url, "git@github.com:coopdevs/timeoverflow.git" set :linked_files, fetch(:linked_files, []).push( # "config/database.yml", # "config/secrets.yml", - ".env", + # ".env", ) # Default value for linked_dirs is [] set :linked_dirs, fetch(:linked_dirs, []).push( - "log", - "tmp/pids", - "tmp/cache", - "tmp/sockets", - "vendor/bundle", - "public/system" + 'log', + 'tmp/pids', + 'tmp/cache', + 'tmp/sockets', + 'vendor/bundle', + 'public/system' ) # Default value for default_env is {} diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 13da887..a740b3a 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1 +1 @@ -server "metal.timeoverflow.org", user: "deploy", roles: %w{app db web} +server 'metal.timeoverflow.org', user: 'timeoverflow', roles: %w(app db web) From 0fecd89edefb27b6a3fde9b795f0efbbcc0f4c4c Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 01:36:08 +0200 Subject: [PATCH 03/38] Templates: rewrite some templates in eRB --- app/assets/javascripts/app/app.js.coffee | 4 - app/views/admin/csv/upload_csv.html.erb | 23 +++ app/views/admin/csv/upload_csv.html.haml | 15 -- app/views/application/_navbar.html.erb | 39 +++++ app/views/application/_navbar.html.haml | 157 ------------------ .../application/_organization_list.html.erb | 31 ++++ .../application/_organization_list.html.haml | 33 ---- .../menus/_inquiries_list_link.html.erb | 6 + .../menus/_language_switcher.html.erb | 17 ++ .../menus/_offers_by_tag_link.html.erb | 6 + .../menus/_offers_dashboard_link.html.erb | 6 + .../_organization_listings_menu.html.erb | 29 ++++ .../menus/_organization_reports_menu.html.erb | 27 +++ .../_organization_statistics_menu.html.erb | 51 ++++++ .../menus/_organization_switcher.html.erb | 11 ++ .../menus/_user_admin_menu.html.erb | 42 +++++ .../menus/_user_list_link.html.erb | 6 + 17 files changed, 294 insertions(+), 209 deletions(-) create mode 100644 app/views/admin/csv/upload_csv.html.erb delete mode 100644 app/views/admin/csv/upload_csv.html.haml create mode 100644 app/views/application/_navbar.html.erb delete mode 100644 app/views/application/_navbar.html.haml create mode 100644 app/views/application/_organization_list.html.erb delete mode 100644 app/views/application/_organization_list.html.haml create mode 100644 app/views/application/menus/_inquiries_list_link.html.erb create mode 100644 app/views/application/menus/_language_switcher.html.erb create mode 100644 app/views/application/menus/_offers_by_tag_link.html.erb create mode 100644 app/views/application/menus/_offers_dashboard_link.html.erb create mode 100644 app/views/application/menus/_organization_listings_menu.html.erb create mode 100644 app/views/application/menus/_organization_reports_menu.html.erb create mode 100644 app/views/application/menus/_organization_statistics_menu.html.erb create mode 100644 app/views/application/menus/_organization_switcher.html.erb create mode 100644 app/views/application/menus/_user_admin_menu.html.erb create mode 100644 app/views/application/menus/_user_list_link.html.erb diff --git a/app/assets/javascripts/app/app.js.coffee b/app/assets/javascripts/app/app.js.coffee index 4771fd0..bee55ff 100644 --- a/app/assets/javascripts/app/app.js.coffee +++ b/app/assets/javascripts/app/app.js.coffee @@ -39,10 +39,6 @@ angular.module('timeoverflow').controller 'UserListCtrl', ["$scope", "$modal", " # override this in a view where the organizations are needed angular.module('timeoverflow').value 'Organizations', [] -angular.module('timeoverflow').controller 'OrganizationListCtrl', ["$scope", "Organizations", ($scope, Organizations) -> - $scope.organizations = Organizations -] - angular.module('timeoverflow').filter 'timeBalance', -> (seconds) -> if seconds isnt 0 diff --git a/app/views/admin/csv/upload_csv.html.erb b/app/views/admin/csv/upload_csv.html.erb new file mode 100644 index 0000000..619fab9 --- /dev/null +++ b/app/views/admin/csv/upload_csv.html.erb @@ -0,0 +1,23 @@ +<%= form_for :dump, url: { action: "import_csv" }, html: { multipart: true, class: "formtastic user" } do |f| %> +
+
    +
  1. + <%= label_tag I18n.t("active_admin.users.upload_csv") %> + <%= f.file_field :file %> +
  2. +
+
    +
  1. + <%= label_tag I18n.t("active_admin.users.organization") %> + <%= f.select :organization_id, options_for_select(Organization.all.map{ |org| [org.name, org.id] }), include_blank: true %> +
  2. +
+
+
+
    +
  1. + <%= f.submit I18n.t("global.save") %> +
  2. +
+
+<% end %> diff --git a/app/views/admin/csv/upload_csv.html.haml b/app/views/admin/csv/upload_csv.html.haml deleted file mode 100644 index 64f6063..0000000 --- a/app/views/admin/csv/upload_csv.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -= form_for :dump, url: {action: "import_csv"}, html: { :multipart => true, class: "formtastic user"} do |f| - %fieldset.inputs - %ol - %li.string.input.optional.stringish - = label_tag I18n.t("active_admin.users.upload_csv") - = f.file_field :file - %ol - %li.string.input.optional.stringish - = label_tag I18n.t("active_admin.users.organization") - = f.select :organization_id, options_for_select(Organization.all.map{ |org| [org.name, org.id] }), include_blank: true - - %fieldset.actions - %ol - %li.action.input_action - = f.submit I18n.t("global.save") diff --git a/app/views/application/_navbar.html.erb b/app/views/application/_navbar.html.erb new file mode 100644 index 0000000..8e25240 --- /dev/null +++ b/app/views/application/_navbar.html.erb @@ -0,0 +1,39 @@ + diff --git a/app/views/application/_navbar.html.haml b/app/views/application/_navbar.html.haml deleted file mode 100644 index c5a2fec..0000000 --- a/app/views/application/_navbar.html.haml +++ /dev/null @@ -1,157 +0,0 @@ -%nav.navbar.navbar-static-top.navbar-inverse{role: :navigation} - .container - .navbar-header - %a.navbar-brand(href="/") TimeOverflow - - %ul.nav.navbar-nav - - if current_user && current_organization - - [User, Offer, Inquiry].each do |item| - - path = item == Offer ? dashboard_offers_path : - - send("#{item.to_s.downcase.pluralize}_path") - %li{class: current_page?(path) && "active"} - %a{href: path} - = glyph(item) - = item.model_name.human(count: :many) - - - if current_user.manages? current_organization - %li.dropdown - %a.dropdown-toggle{ href: "#"} - = glyph("paperclip") - = t ".reports" - %b.caret - %ul.dropdown-menu{role: :menu} - %li - %a{ href: "/report/user_list", data: { popup: true } } - %span.glyphicon.glyphicon-list-alt - = User.model_name.human(count: :many) - %li - %a{ href: "/report/offer_list", data: { popup: true } } - %span.glyphicon.glyphicon-list-alt - = Offer.model_name.human(count: :many) - %li - %a{ href: "/report/inquiry_list", data: { popup: true } } - %span.glyphicon.glyphicon-list-alt - = Inquiry.model_name.human(count: :many) - %li.dropdown - %a.dropdown-toggle{href: "#"} - = glyph("stats") - = t ".statistics" - %b.caret - %ul.dropdown-menu{role: :menu} - %li - %a{href: "/statistics/statistics_global_activity"} - %span.glyphicon.glyphicon-stats - = t ".global_activity" - %li - %a{href: "/statistics/statistics_inactive_users"} - %span.glyphicon.glyphicon-stats - = t ".inactive_users" - %li - %a{href: "/statistics/statistics_demographics"} - %span.glyphicon.glyphicon-stats - = t ".demographics" - %li - %a{href: "/statistics/statistics_last_login"} - %span.glyphicon.glyphicon-stats - = t ".last_login" - %li - %a{href: "/statistics/statistics_without_offers"} - %span.glyphicon.glyphicon-stats - = t ".without_offers" - %li - %a{:href => "/statistics/statistics_type_swaps"} - %span.glyphicon.glyphicon-stats - = t ".type_of_swaps" - %li - %a{:href => "/statistics/statistics_all_transfers"} - %span.glyphicon.glyphicon-stats - = t ".statistics_all_transfers" - %li.dropdown - %a.dropdown-toggle{ href: "#"} - = glyph("wrench") - = t ".admin" - %b.caret - %ul.dropdown-menu{role: :menu} - %li - - path = alpha_grouped_index_tags_path(post_type: "offer") - %a{href: path } - = glyph("tags") - = t ".tags" - %li - - path = offers_path(org: current_organization) - %a{href: path } - = glyph("link") - = glyph("eye-open") - = t ".offer_public_link" - %li - - path = inquiries_path(org: current_organization) - %a{href: path } - = glyph("link") - = glyph("eye-open") - = t ".inquiry_public_link" - - else - - path = alpha_grouped_index_tags_path(post_type: "offer") - %li{class: current_page?(path) && "active"} - %a{href: path} - = glyph("tags") - = t ".tags" - - %ul.nav.navbar-nav.navbar-right - - if current_user - %li.dropdown - %a.dropdown-toggle{href: "#"} - = image_tag avatar_url(current_user), style: "margin: -8px auto" - = current_user.email - %b.caret - %ul.dropdown-menu{role: :menu} - - if superadmin? - %li{role: :presentation} - = link_to admin_root_path do - = glyph(:cog) - = t ".adminshort" - - %li{role: :presentation} - = link_to destroy_user_session_path, method: :delete do - = glyph("log-out") - = t ".sign_out" - %li.divider{role: :presentation} - - if current_user.organizations.count > 1 - - current_user.organizations.each do |org| - - if current_organization == org - %li.disabled - = link_to org.name, "#" - - else - %li - = link_to set_current_organization_path(org), method: :post do - = glyph(:retweet) - = org.name - %li.divider{role: :presentation} - %li{role: :presentation} - = link_to current_user do - = glyph(:user) - = t "layouts.application.edit_profile" - - current_user.members.where(manager: true).each do |m| - %li{role: :presentation} - = link_to m.organization do - = glyph(:pencil) - = t "layouts.application.edit_org", - organization: m.organization - - else - %li - = link_to page_path("about") do - = t "layouts.application.about" - %li - %a{href: new_user_session_path} - = t "layouts.application.login" - - %li.divider{role: :presentation} - - %li.dropdown - %a.dropdown-toggle{ href: "#"} - = glyph("globe") - %b.caret - %ul.dropdown-menu{role: :menu} - %li.disabled - = link_to t("global.locales_header"), "#" - %li.divider - - languages_list diff --git a/app/views/application/_organization_list.html.erb b/app/views/application/_organization_list.html.erb new file mode 100644 index 0000000..22a2ff8 --- /dev/null +++ b/app/views/application/_organization_list.html.erb @@ -0,0 +1,31 @@ +
+

+ <%= t("application.organization_list.welcome", user: current_user.to_s) %> +
+ <%= t("application.organization_list.not_member") %> +

+ + + + + + + + + + + + + <% Organization.find_each do |org| %> + + + + + + + + + <% end %> + +
<%= t("application.organization_list.time_bank") %><%= t("application.organization_list.email") %><%= t("application.organization_list.phone") %><%= t("application.organization_list.public_opening_times") %><%= t("application.organization_list.city") %><%= t("application.organization_list.neighborhood") %>
{{ org.name }}{{ org.email }}{{ org.phone }}{{ org.public_opening_times }}{{ org.city }}{{ org.neighborhood }}
+
diff --git a/app/views/application/_organization_list.html.haml b/app/views/application/_organization_list.html.haml deleted file mode 100644 index 623a78d..0000000 --- a/app/views/application/_organization_list.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -:javascript - angular.module('timeoverflow').value('Organizations', #{ raw Organization.all.to_json(only: [:name, :email, :phone, :public_opening_times, :city, :neighborhood]) }); - - -.jumbotron{"ng-controller" => "OrganizationListCtrl"} - %p.lead - = t(".welcome", user: current_user.to_s) - %br/ - = t(".not_member") - - %table.table - %thead - %tr - %th - =t(".time_bank") - %th - =t(".email") - %th - =t(".phone") - %th - =t(".public_opening_times") - %th - =t(".city") - %th - =t(".neighborhood") - %tbody - %tr{"ng-repeat" => "org in organizations"} - %td {{ org.name }} - %td {{ org.email }} - %td {{ org.phone }} - %td {{ org.public_opening_times }} - %td {{ org.city }} - %td {{ org.neighborhood }} diff --git a/app/views/application/menus/_inquiries_list_link.html.erb b/app/views/application/menus/_inquiries_list_link.html.erb new file mode 100644 index 0000000..d49ef02 --- /dev/null +++ b/app/views/application/menus/_inquiries_list_link.html.erb @@ -0,0 +1,6 @@ +
  • "> + + <%= glyph :inquiry %> + <%= item.model_name.human(count: :many) %> + +
  • diff --git a/app/views/application/menus/_language_switcher.html.erb b/app/views/application/menus/_language_switcher.html.erb new file mode 100644 index 0000000..a7dc08c --- /dev/null +++ b/app/views/application/menus/_language_switcher.html.erb @@ -0,0 +1,17 @@ + diff --git a/app/views/application/menus/_offers_by_tag_link.html.erb b/app/views/application/menus/_offers_by_tag_link.html.erb new file mode 100644 index 0000000..a61b1e2 --- /dev/null +++ b/app/views/application/menus/_offers_by_tag_link.html.erb @@ -0,0 +1,6 @@ +
  • "> + "> + <%= glyph :tags %> + <%= t ".tags" %> + +
  • diff --git a/app/views/application/menus/_offers_dashboard_link.html.erb b/app/views/application/menus/_offers_dashboard_link.html.erb new file mode 100644 index 0000000..1a6004e --- /dev/null +++ b/app/views/application/menus/_offers_dashboard_link.html.erb @@ -0,0 +1,6 @@ +
  • "> + + <%= glyph :offer %> + <%= item.model_name.human(count: :many) %> + +
  • diff --git a/app/views/application/menus/_organization_listings_menu.html.erb b/app/views/application/menus/_organization_listings_menu.html.erb new file mode 100644 index 0000000..97679b2 --- /dev/null +++ b/app/views/application/menus/_organization_listings_menu.html.erb @@ -0,0 +1,29 @@ + diff --git a/app/views/application/menus/_organization_reports_menu.html.erb b/app/views/application/menus/_organization_reports_menu.html.erb new file mode 100644 index 0000000..2c7800c --- /dev/null +++ b/app/views/application/menus/_organization_reports_menu.html.erb @@ -0,0 +1,27 @@ + diff --git a/app/views/application/menus/_organization_statistics_menu.html.erb b/app/views/application/menus/_organization_statistics_menu.html.erb new file mode 100644 index 0000000..7c3b8a9 --- /dev/null +++ b/app/views/application/menus/_organization_statistics_menu.html.erb @@ -0,0 +1,51 @@ + diff --git a/app/views/application/menus/_organization_switcher.html.erb b/app/views/application/menus/_organization_switcher.html.erb new file mode 100644 index 0000000..10d3ca0 --- /dev/null +++ b/app/views/application/menus/_organization_switcher.html.erb @@ -0,0 +1,11 @@ +
  • + <%= current_organization.name %> +
  • +<% (current_user.organizations - [current_organization]).each do |org| %> +
  • + <%= link_to set_current_organization_path(org), method: :post do %> + <%= glyph(:retweet) %> + <%= org.name %> + <% end %> +
  • +<% end %> diff --git a/app/views/application/menus/_user_admin_menu.html.erb b/app/views/application/menus/_user_admin_menu.html.erb new file mode 100644 index 0000000..79398c5 --- /dev/null +++ b/app/views/application/menus/_user_admin_menu.html.erb @@ -0,0 +1,42 @@ + diff --git a/app/views/application/menus/_user_list_link.html.erb b/app/views/application/menus/_user_list_link.html.erb new file mode 100644 index 0000000..b0cd43e --- /dev/null +++ b/app/views/application/menus/_user_list_link.html.erb @@ -0,0 +1,6 @@ +
  • "> + + <%= glyph :user %> + <%= item.model_name.human(count: :many) %> + +
  • From c40ea3aa01469ebb2de90916ad848b5c3c4212c6 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 02:09:15 +0200 Subject: [PATCH 04/38] Templates: even more templates converted to eRB --- app/views/devise/confirmations/new.html.erb | 26 ++++++++ app/views/devise/confirmations/new.html.haml | 17 ----- app/views/devise/passwords/edit.html.erb | 34 ++++++++++ app/views/devise/passwords/edit.html.haml | 23 ------- app/views/devise/passwords/new.html.erb | 26 ++++++++ app/views/devise/passwords/new.html.haml | 17 ----- app/views/devise/registrations/edit.html.erb | 60 ++++++++++++++++++ app/views/devise/registrations/edit.html.haml | 41 ------------ app/views/devise/registrations/new.html.erb | 38 +++++++++++ app/views/devise/registrations/new.html.haml | 26 -------- app/views/devise/sessions/new.html.erb | 55 ++++++++++++++++ app/views/devise/sessions/new.html.slim | 34 ---------- app/views/devise/unlocks/new.html.erb | 26 ++++++++ app/views/devise/unlocks/new.html.haml | 17 ----- app/views/documents/show+modal.html.erb | 10 +++ app/views/documents/show+modal.html.haml | 6 -- app/views/home/index.html.erb | 63 +++++++++++++++++++ app/views/home/index.html.slim | 34 ---------- 18 files changed, 338 insertions(+), 215 deletions(-) create mode 100644 app/views/devise/confirmations/new.html.erb delete mode 100644 app/views/devise/confirmations/new.html.haml create mode 100644 app/views/devise/passwords/edit.html.erb delete mode 100644 app/views/devise/passwords/edit.html.haml create mode 100644 app/views/devise/passwords/new.html.erb delete mode 100644 app/views/devise/passwords/new.html.haml create mode 100644 app/views/devise/registrations/edit.html.erb delete mode 100644 app/views/devise/registrations/edit.html.haml create mode 100644 app/views/devise/registrations/new.html.erb delete mode 100644 app/views/devise/registrations/new.html.haml create mode 100644 app/views/devise/sessions/new.html.erb delete mode 100644 app/views/devise/sessions/new.html.slim create mode 100644 app/views/devise/unlocks/new.html.erb delete mode 100644 app/views/devise/unlocks/new.html.haml create mode 100644 app/views/documents/show+modal.html.erb delete mode 100644 app/views/documents/show+modal.html.haml create mode 100644 app/views/home/index.html.erb delete mode 100644 app/views/home/index.html.slim diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 0000000..34c9f45 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,26 @@ +
    +
    + <%= render "devise/shared/links" %> +
    +
    +
    +
    +

    + <%= t(".resend_instructions") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: confirmation_path(resource_name), html: { method: :post } do |f| %> +
    + <%= f.label :email, class: "control-label" %> + <%= f.text_field :email, required: true, autofocus: true, class: "form-control" %> +
    +
    + <%= f.submit t(".resend_instructions"), class: "btn btn-primary" %> +
    + <% end %> +
    +
    +
    +
    diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml deleted file mode 100644 index 6c2a74c..0000000 --- a/app/views/devise/confirmations/new.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -.row - .col-sm-4 - = render "devise/shared/links" - .col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".resend_instructions") - - .panel-body - = show_error_messages!(resource) - = form_for resource, url: confirmation_path(resource_name), html: { method: :post } do |f| - .form-group - = f.label :email, class: "control-label" - = f.text_field :email, required: true, autofocus: true, class: "form-control" - .form-group - = f.submit t(".resend_instructions"), class: "btn btn-primary" diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000..288e3f6 --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,34 @@ +
    +
    + <%= render "devise/shared/links" %> +
    +
    +
    +
    +

    + <%= t(".change_password") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: password_path(resource_name), html: { method: :put } do |f| %> + <%= f.hidden_field :reset_password_token %> +
    + <%= f.label :password, t(".new_password"), class: "control-label" %> + <%= f.password_field :password, required: true, autofocus: true, class: "form-control", ng_model: "password" %> +
    +
    + <%= f.label :password_confirmation, t(".confirm_password"), class: "control-label" %> + <%= f.password_field :password_confirmation, required: true, class: "form-control", ng_model: "password_confirmation" %> +
    + <%= t ".passwords_not_match" %> +
    +
    +
    + <%= f.submit t(".change_password"), class: "btn btn-primary", ng_disabled: "!password || password != password_confirmation" %> +
    + <% end %> +
    +
    +
    +
    diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml deleted file mode 100644 index 7dbf69a..0000000 --- a/app/views/devise/passwords/edit.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -.row - .col-sm-4 - = render "devise/shared/links" - .col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".change_password") - - .panel-body - = show_error_messages!(resource) - = form_for resource, url: password_path(resource_name), html: { method: :put } do |f| - = f.hidden_field :reset_password_token - .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" - .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" - .help-block{ ng_if: "password && password_confirmation && password != password_confirmation" } - = t ".passwords_not_match" - .form-group - = f.submit t(".change_password"), class: "btn btn-primary", ng_disabled: "!password || password != password_confirmation" diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 0000000..977e6e1 --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,26 @@ +
    +
    + <%= render "devise/shared/links" %> +
    +
    +
    +
    +

    + <%= t(".forgot_question") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: password_path(resource_name), html: { method: :post } do |f| %> +
    + <%= f.label :email, class: "control-label" %> + <%= f.text_field :email, required: true, autofocus: true, class: "form-control" %> +
    +
    + <%= f.submit t(".send_instructions"), class: "btn btn-primary" %> +
    + <% end %> +
    +
    +
    +
    diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml deleted file mode 100644 index 455aede..0000000 --- a/app/views/devise/passwords/new.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -.row - .col-sm-4 - = render "devise/shared/links" - .col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".forgot_question") - - .panel-body - = show_error_messages!(resource) - = form_for resource, url: password_path(resource_name), html: { method: :post } do |f| - .form-group - = f.label :email, class: "control-label" - = f.text_field :email, required: true, autofocus: true, class: "form-control" - .form-group - = f.submit t(".send_instructions"), class: "btn btn-primary" diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 0000000..e94316c --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,60 @@ +
    +
    +
    +
    +

    + <%= t(".edit_user") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> +
    + <%= f.label :email, class: "control-label" %> + <%= f.text_field :email, required: true, autofocus: true, class: "form-control" %> + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +

    + Currently waiting confirmation for: + <%= resource.unconfirmed_email %> +

    + <% end %> +
    +
    + <%= f.label t(".password"), class: "control-label" %> + <%= f.password_field :password, required: true, autocomplete: "off", class: "form-control" %> +

    + <%= t(".help_password") %> +

    +
    +
    + <%= f.label t(".password_confirmation"), class: "control-label" %> + <%= f.password_field :password_confirmation, required: true, class: "form-control" %> +
    +
    + <%= f.label t(".current_password"), class: "control-label" %> + <%= f.password_field :current_password, required: true, class: "form-control" %> +

    + <%= t(".help_current_password") %> +

    +
    +
    + <%= f.submit t(".update"), class: "btn btn-primary" %> +
    + <% end %> +
    +
    +
    +
    +

    + <%= t(".cancel_account") %> +

    +
    +
    +

    + <%= t(".unhappy") %> + <%= link_to t(".cancel_account"), registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %> +

    +
    +
    +
    +
    diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml deleted file mode 100644 index 1613db2..0000000 --- a/app/views/devise/registrations/edit.html.haml +++ /dev/null @@ -1,41 +0,0 @@ -.row - .col-sm-offset-4.col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".edit_user") - .panel-body - = show_error_messages!(resource) - - = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| - .form-group - = f.label :email, class: "control-label" - = f.text_field :email, required: true, autofocus: true, class: "form-control" - - if devise_mapping.confirmable? && resource.pending_reconfirmation? - %p.help-block - Currently waiting confirmation for: - = resource.unconfirmed_email - .form-group - = f.label t(".password"), class: "control-label" - = f.password_field :password, required: true, autocomplete: "off", class: "form-control" - %p.help-block - = t(".help_password") - .form-group - = f.label t(".password_confirmation"), class: "control-label" - = f.password_field :password_confirmation, required: true, class: "form-control" - .form-group - = f.label t(".current_password"), class: "control-label" - = f.password_field :current_password, required: true, class: "form-control" - %p.help-block - = t(".help_current_password") - .form-group - = f.submit t(".update"), class: "btn btn-primary" - - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".cancel_account") - .panel-body - %p - = t(".unhappy") - = link_to t(".cancel_account"), registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000..d6fce85 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,38 @@ +
    +
    + <%= render "devise/shared/links" %> +
    +
    +
    +
    +

    + <%= t(".sign_up") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: registration_path(resource_name) do |f| %> +
    + <%= f.label :username, class: "control-label" %> + <%= f.text_field :username, required: true, autofocus: true, class: "form-control" %> +
    +
    + <%= f.label :email, class: "control-label" %> + <%= f.text_field :email, required: true, autofocus: true, class: "form-control" %> +
    +
    + <%= f.label t(".password"), class: "control-label" %> + <%= f.password_field :password, required: true, class: "form-control" %> +
    +
    + <%= f.label t(".password_confirmation"), class: "control-label" %> + <%= f.password_field :password_confirmation, required: true, class: "form-control" %> +
    +
    + <%= f.submit t(".sign_me_up"), class: "btn btn-primary" %> +
    + <% end %> +
    +
    +
    +
    diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml deleted file mode 100644 index 5acbf57..0000000 --- a/app/views/devise/registrations/new.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -.row - .col-sm-4 - = render "devise/shared/links" - .col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".sign_up") - - .panel-body - = show_error_messages!(resource) - = form_for resource, url: registration_path(resource_name) do |f| - .form-group - = f.label :username, class: "control-label" - = f.text_field :username, required: true, autofocus: true, class: "form-control" - .form-group - = f.label :email, class: "control-label" - = f.text_field :email, required: true, autofocus: true, class: "form-control" - .form-group - = f.label t(".password"), class: "control-label" - = f.password_field :password, required: true, class: "form-control" - .form-group - = f.label t(".password_confirmation"), class: "control-label" - = f.password_field :password_confirmation, required: true, class: "form-control" - .form-group - = f.submit t(".sign_me_up"), class: "btn btn-primary" diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000..f55235a --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,55 @@ +
    +
    +
    +
    +

    + <%= glyph :hourglass %> + TimeOverflow +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: session_path(resource_name) do |f| %> +
    +
    + + <%= glyph :user %> + + <%= f.text_field :email, required: false, autofocus: true, placeholder: "Email address", class: "form-control input-lg" %> +
    +
    +
    +
    + + <%= glyph :lock %> + + <%= f.password_field :password, required: false, autofocus: true, placeholder: "Password", class: "form-control input-lg" %> +
    +
    +
    +
    +
    +
    + <%= f.label :remember_me do |nada| %> + <%= f.check_box :remember_me %> + <%= t(".remember_me") %> + <% end %> +
    +
    +
    +
    +
    +
    +
    + <%= f.submit t(".sign_in"), class: "btn btn-primary btn-lg col-xs-12" %> +
    +
    +
    + <% end %> +
    + +
    +
    +
    diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim deleted file mode 100644 index 076435c..0000000 --- a/app/views/devise/sessions/new.html.slim +++ /dev/null @@ -1,34 +0,0 @@ -.row - .col-xs-12.col-sm-8.col-sm-offset-2.col-md-6.col-md-offset-3.col-lg-4.col-lg-offset-4 - .panel#login-box - .panel-heading - h1 - span.glyphicon.glyphicon-hourglass - | TimeOverflow - .panel-body - = show_error_messages!(resource) - = form_for resource, url: session_path(resource_name) do |f| - .form-group - .input-group - span.input-group-addon - span.glyphicon.glyphicon-user - = f.text_field :email, required: false, autofocus: true, placeholder: "Email address", class: "form-control input-lg" - .form-group - .input-group - span.input-group-addon - span.glyphicon.glyphicon-lock - = f.password_field :password, required: false, autofocus: true, placeholder: "Password", class: "form-control input-lg" - .form-group#remember-me-wrapper - .row - .col-xs-6 - .checkbox - = f.label :remember_me do |nada| - = f.check_box :remember_me - = t(".remember_me") - .form-group - .row - .col-xs-12 - = f.submit t(".sign_in"), class: "btn btn-primary btn-lg col-xs-12" - - .panel-footer - = render "devise/shared/links" diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 0000000..ff3d394 --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,26 @@ +
    +
    + <%= render "devise/shared/links" %> +
    +
    +
    +
    +

    + <%= t(".resend_instructions") %> +

    +
    +
    + <%= show_error_messages!(resource) %> + <%= form_for resource, url: unlock_path(resource_name), html: { method: :post } do |f| %> +
    + <%= f.label :email, class: "control-label" %> + <%= f.text_field :email, required: false, autofocus: true, class: "form-control" %> +
    +
    + <%= f.submit t(".resend_instructions"), class: "btn btn-primary" %> +
    + <% end %> +
    +
    +
    +
    diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml deleted file mode 100644 index f92055c..0000000 --- a/app/views/devise/unlocks/new.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -.row - .col-sm-4 - = render "devise/shared/links" - .col-sm-8 - .panel.panel-primary - .panel-heading - %h2.panel-title - = t(".resend_instructions") - - .panel-body - = show_error_messages!(resource) - = form_for resource, url: unlock_path(resource_name), html: { method: :post } do |f| - .form-group - = f.label :email, class: "control-label" - = f.text_field :email, required: false, autofocus: true, class: "form-control" - .form-group - = f.submit t(".resend_instructions"), class: "btn btn-primary" diff --git a/app/views/documents/show+modal.html.erb b/app/views/documents/show+modal.html.erb new file mode 100644 index 0000000..0f6ca73 --- /dev/null +++ b/app/views/documents/show+modal.html.erb @@ -0,0 +1,10 @@ + + diff --git a/app/views/documents/show+modal.html.haml b/app/views/documents/show+modal.html.haml deleted file mode 100644 index 7d99550..0000000 --- a/app/views/documents/show+modal.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -.modal-header - %button.close{type: "button", "data-dismiss" => "modal", "aria-hiden" => "true"} × - %h4.modal-title= @document.title -.modal-body - :markdown - #{@document.content} diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..ca5f424 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,63 @@ +
    +
    +
    +
    +

    + <%= glyph :hourglass %> + TimeOverflow +

    +
    +
    +
    +
    +
    + + <%= glyph :user %> + + +
    +
    +
    +
    + + <%= glyph :lock %> + + +
    +
    +
    +
    +
    +
    + + +
    +
    + + <%= t("devise.shared.links.forgot_your_password") %> + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    diff --git a/app/views/home/index.html.slim b/app/views/home/index.html.slim deleted file mode 100644 index 67be356..0000000 --- a/app/views/home/index.html.slim +++ /dev/null @@ -1,34 +0,0 @@ -.row - .col-xs-12.col-sm-8.col-sm-offset-2.col-md-6.col-md-offset-3.col-lg-4.col-lg-offset-4 - .panel#login-box - .panel-heading - h1 - span.glyphicon.glyphicon-hourglass - | TimeOverflow - .panel-body - form action="index.html" role="form" - .form-group - .input-group - span.input-group-addon - span.glyphicon.glyphicon-user - input.form-control.input-lg placeholder=("Email address") type="text" / - .form-group - .input-group - span.input-group-addon - span.glyphicon.glyphicon-lock - input.form-control.input-lg placeholder="Password" type="password" / - #remember-me-wrapper - .row - .col-xs-6 - .checkbox-nice - input#remember-me checked="checked" type="checkbox" / - label for="remember-me" - | Remember me - a#login-forget-link.col-xs-6 href="forgot-password-full.html" - | Forgot password? - .row - .col-xs-12 - button.btn.btn-success.btn-lg.col-xs-12 type="submit" Login - - .panel-footer - = render "devise/shared/links" From 200c58abc85f294a387046154001f982af323991 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 18:26:15 +0200 Subject: [PATCH 05/38] Deployment: remove shelly-dependencies gem --- Gemfile | 1 - Gemfile.lock | 4 ---- 2 files changed, 5 deletions(-) diff --git a/Gemfile b/Gemfile index 0881886..f2057ab 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,6 @@ gem "awesome_print" gem 'memcachier' gem 'rollbar', '2.8.3' gem 'travis-lint' -gem "shelly-dependencies" gem 'whenever', :require => false gem 'prawn' gem 'prawn-table' diff --git a/Gemfile.lock b/Gemfile.lock index 685eafa..f2c7fd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -310,9 +310,6 @@ GEM select2-rails (4.0.1) thor (~> 0.14) sexp_processor (4.4.4) - shelly-dependencies (0.2.4) - rake - thin shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) @@ -423,7 +420,6 @@ DEPENDENCIES rubocop sass-rails (~> 5.0.1) select2-rails - shelly-dependencies shoulda (>= 3.5) simple_form (>= 3.0.0) slim-rails From cfe3cd24f51c4e68b0d370b49909dfd8bb808509 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 18:28:52 +0200 Subject: [PATCH 06/38] Templates: leftover angular syntax --- .../application/_organization_list.html.erb | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/application/_organization_list.html.erb b/app/views/application/_organization_list.html.erb index 22a2ff8..e85c22b 100644 --- a/app/views/application/_organization_list.html.erb +++ b/app/views/application/_organization_list.html.erb @@ -1,29 +1,29 @@

    - <%= t("application.organization_list.welcome", user: current_user.to_s) %> + <%= t "application.organization_list.welcome", user: current_user.to_s %>
    - <%= t("application.organization_list.not_member") %> + <%= t "application.organization_list.not_member" %>

    - - - - - - + + + + + + <% Organization.find_each do |org| %> - - - - - - + + + + + + <% end %> From 34fec819d156649ccfdbc023ced82866138bdaa5 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 19:37:44 +0200 Subject: [PATCH 07/38] Templates: added `m` helper --- app/helpers/application_helper.rb | 9 +++++++++ app/views/documents/show+modal.html.erb | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index afcaca3..885ee9b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,6 +54,15 @@ module ApplicationHelper html.html_safe end + # Use as <%= markdown content %> or <%= m content %> + # Content can be nil, in that case + # it will be the same as an empty string. + def markdown(content) + RDiscount.new(content || ''.freeze).to_html.html_safe + end + + alias m markdown + private def locale_menu_item(locale) diff --git a/app/views/documents/show+modal.html.erb b/app/views/documents/show+modal.html.erb index 0f6ca73..c6cca66 100644 --- a/app/views/documents/show+modal.html.erb +++ b/app/views/documents/show+modal.html.erb @@ -5,6 +5,5 @@ From e94f1974f964907e700150555c36c6b2f328da8a Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 19:38:08 +0200 Subject: [PATCH 08/38] Templates: Used link helpers and url helpers on menus --- .../menus/_inquiries_list_link.html.erb | 4 +-- .../menus/_offers_by_tag_link.html.erb | 4 +-- .../menus/_offers_dashboard_link.html.erb | 4 +-- .../_organization_listings_menu.html.erb | 12 ++++---- .../menus/_organization_reports_menu.html.erb | 12 ++++---- .../_organization_statistics_menu.html.erb | 30 +++++++++---------- .../menus/_user_list_link.html.erb | 4 +-- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/views/application/menus/_inquiries_list_link.html.erb b/app/views/application/menus/_inquiries_list_link.html.erb index d49ef02..8b6163e 100644 --- a/app/views/application/menus/_inquiries_list_link.html.erb +++ b/app/views/application/menus/_inquiries_list_link.html.erb @@ -1,6 +1,6 @@
  • "> - + <%= link_to inquiries_path %> <%= glyph :inquiry %> <%= item.model_name.human(count: :many) %> - + <% end %>
  • diff --git a/app/views/application/menus/_offers_by_tag_link.html.erb b/app/views/application/menus/_offers_by_tag_link.html.erb index a61b1e2..2d1171c 100644 --- a/app/views/application/menus/_offers_by_tag_link.html.erb +++ b/app/views/application/menus/_offers_by_tag_link.html.erb @@ -1,6 +1,6 @@
  • "> - "> + <%= link_to alpha_grouped_index_tags_path(post_type: "offer") %> <%= glyph :tags %> <%= t ".tags" %> - + <% end %>
  • diff --git a/app/views/application/menus/_offers_dashboard_link.html.erb b/app/views/application/menus/_offers_dashboard_link.html.erb index 1a6004e..2136e06 100644 --- a/app/views/application/menus/_offers_dashboard_link.html.erb +++ b/app/views/application/menus/_offers_dashboard_link.html.erb @@ -1,6 +1,6 @@
  • "> - + <%= link_to dashboard_offers_path %> <%= glyph :offer %> <%= item.model_name.human(count: :many) %> - + <% end %>
  • diff --git a/app/views/application/menus/_organization_listings_menu.html.erb b/app/views/application/menus/_organization_listings_menu.html.erb index 97679b2..d52d5d2 100644 --- a/app/views/application/menus/_organization_listings_menu.html.erb +++ b/app/views/application/menus/_organization_listings_menu.html.erb @@ -6,24 +6,24 @@ diff --git a/app/views/application/menus/_organization_reports_menu.html.erb b/app/views/application/menus/_organization_reports_menu.html.erb index 2c7800c..720315f 100644 --- a/app/views/application/menus/_organization_reports_menu.html.erb +++ b/app/views/application/menus/_organization_reports_menu.html.erb @@ -6,22 +6,22 @@ diff --git a/app/views/application/menus/_organization_statistics_menu.html.erb b/app/views/application/menus/_organization_statistics_menu.html.erb index 7c3b8a9..8c30af2 100644 --- a/app/views/application/menus/_organization_statistics_menu.html.erb +++ b/app/views/application/menus/_organization_statistics_menu.html.erb @@ -6,46 +6,46 @@ diff --git a/app/views/application/menus/_user_list_link.html.erb b/app/views/application/menus/_user_list_link.html.erb index b0cd43e..f6ee3a7 100644 --- a/app/views/application/menus/_user_list_link.html.erb +++ b/app/views/application/menus/_user_list_link.html.erb @@ -1,6 +1,6 @@
  • "> - + <%= link_to users_path %> <%= glyph :user %> <%= item.model_name.human(count: :many) %> - + <% end %>
  • From 4b625222b43bd6c3406417544d7d0143ee68f155 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Sat, 14 May 2016 19:48:42 +0200 Subject: [PATCH 09/38] Templates: :scissors: Forgot to add blocks in link helpers --- .../menus/_inquiries_list_link.html.erb | 2 +- .../application/menus/_offers_by_tag_link.html.erb | 2 +- .../menus/_offers_dashboard_link.html.erb | 2 +- .../menus/_organization_listings_menu.html.erb | 6 +++--- .../menus/_organization_reports_menu.html.erb | 6 +++--- .../menus/_organization_statistics_menu.html.erb | 14 +++++++------- .../application/menus/_user_list_link.html.erb | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/application/menus/_inquiries_list_link.html.erb b/app/views/application/menus/_inquiries_list_link.html.erb index 8b6163e..bb2ed33 100644 --- a/app/views/application/menus/_inquiries_list_link.html.erb +++ b/app/views/application/menus/_inquiries_list_link.html.erb @@ -1,5 +1,5 @@
  • "> - <%= link_to inquiries_path %> + <%= link_to inquiries_path do %> <%= glyph :inquiry %> <%= item.model_name.human(count: :many) %> <% end %> diff --git a/app/views/application/menus/_offers_by_tag_link.html.erb b/app/views/application/menus/_offers_by_tag_link.html.erb index 2d1171c..99d6896 100644 --- a/app/views/application/menus/_offers_by_tag_link.html.erb +++ b/app/views/application/menus/_offers_by_tag_link.html.erb @@ -1,5 +1,5 @@
  • "> - <%= link_to alpha_grouped_index_tags_path(post_type: "offer") %> + <%= link_to alpha_grouped_index_tags_path(post_type: "offer") do %> <%= glyph :tags %> <%= t ".tags" %> <% end %> diff --git a/app/views/application/menus/_offers_dashboard_link.html.erb b/app/views/application/menus/_offers_dashboard_link.html.erb index 2136e06..97580c9 100644 --- a/app/views/application/menus/_offers_dashboard_link.html.erb +++ b/app/views/application/menus/_offers_dashboard_link.html.erb @@ -1,5 +1,5 @@
  • "> - <%= link_to dashboard_offers_path %> + <%= link_to dashboard_offers_path do %> <%= glyph :offer %> <%= item.model_name.human(count: :many) %> <% end %> diff --git a/app/views/application/menus/_organization_listings_menu.html.erb b/app/views/application/menus/_organization_listings_menu.html.erb index d52d5d2..6ea4ba6 100644 --- a/app/views/application/menus/_organization_listings_menu.html.erb +++ b/app/views/application/menus/_organization_listings_menu.html.erb @@ -6,20 +6,20 @@
  • <%= t("application.organization_list.time_bank") %><%= t("application.organization_list.email") %><%= t("application.organization_list.phone") %><%= t("application.organization_list.public_opening_times") %><%= t("application.organization_list.city") %><%= t("application.organization_list.neighborhood") %><%= t "application.organization_list.time_bank" %><%= t "application.organization_list.email" %><%= t "application.organization_list.phone" %><%= t "application.organization_list.public_opening_times" %><%= t "application.organization_list.city" %><%= t "application.organization_list.neighborhood" %>
    {{ org.name }}{{ org.email }}{{ org.phone }}{{ org.public_opening_times }}{{ org.city }}{{ org.neighborhood }}<%= org.name %><%= org.email %><%= org.phone %><%= org.public_opening_times %><%= org.city %><%= org.neighborhood %>
    + + + + + + + + + <% @organizations.each do |org| %> + + + + + + <% end %> + +
    <%= Organization.model_name.human(count: :one) %><%= t '.member_count' %><%= glyph :wrench %><%= t 'global.table.actions' %>
    <%= link_to org.name, org %><%= org.users.count %> + <% if current_user.admins?(org) %> + <%= link_to edit_organization_path(org), class: 'action' do %> + <%= glyph :pencil %> + <%= t 'global.edit' %> + <% end %> + <%= link_to organization_path(org), + data: { method: :delete }, + class: 'action' do %> + <%= glyph :trash %> + <%= t 'global.borrar' %> + <% end %> + <% end %> +
    diff --git a/app/views/organizations/index.html.haml b/app/views/organizations/index.html.haml deleted file mode 100644 index b8eb2df..0000000 --- a/app/views/organizations/index.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -%h1 - = Organization.model_name.human(count: :many) - -%ul.nav.nav-pills - - if superadmin? - %li - %a{href: new_organization_path} - %span.glyphicon.glyphicon-plus - = t 'global.add_new' - -%table.table.table-hover.table-condensed - %thead - %tr - %th= Organization.model_name.human(count: :one) - %th= t ".member_count" - %th - %span.glyphicon.glyphicon-wrench - = t "global.table.actions" - %tbody - - @organizations.each do |org| - %tr - %td - = link_to(org.name, org) - %td - = org.users.count - %td.hover-actions - - if current_user.admins?(org) - %a.action{href: edit_organization_path(org)} - %span.glyphicon.glyphicon-pencil - = t "global.edit" - %a.action{href: organization_path(org), data: {method: :delete}} - %span.glyphicon.glyphicon-trash - = t "global.borrar" - diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb new file mode 100644 index 0000000..bb6907b --- /dev/null +++ b/app/views/organizations/new.html.erb @@ -0,0 +1,4 @@ +

    + <%= t '.new' %> +

    +<%= render 'form' %> diff --git a/app/views/organizations/new.html.haml b/app/views/organizations/new.html.haml deleted file mode 100644 index 31feb49..0000000 --- a/app/views/organizations/new.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -%h1 - = t ".new" -= render partial: "form" diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb new file mode 100644 index 0000000..54d9dd5 --- /dev/null +++ b/app/views/organizations/show.html.erb @@ -0,0 +1,153 @@ +

    + <%= link_to @organization, organization_path(@organization) %> +

    +
    +
    +
    +
    +

    + <%= t '.contact_information' %> +

    +
    +
    +

    + + <%= Organization.human_attribute_name 'email' %> + + <%= @organization.email %> +
    + + <%= Organization.human_attribute_name 'phone' %> + + <%= @organization.phone %> +
    + Web + <%= link_to_if @organization.web.present?, + @organization.web, + @organization.web %> +
    + + <%= Organization.human_attribute_name 'public_opening_times' %> + +
    + <%= @organization.public_opening_times %> +
    + + <%= Organization.human_attribute_name 'address' %> + + <%= @organization.address %> +
    + + <%= Organization.human_attribute_name 'neighborhood' %> + + <%= @organization.neighborhood %> +
    + + <%= Organization.human_attribute_name 'city' %> + + <%= @organization.city %> +

    +
    +
    +
    +
    +
    +
    +

    + <%= t 'global.information' %> +

    +
    +
    +

    + + <%= Organization.human_attribute_name 'created_at' %> + + <%= l @organization.created_at, format: :long %> +
    + + <%= Organization.human_attribute_name 'updated_at' %> + + <%= l @organization.updated_at, format: :long %> +
    + + <%= t 'global.member_count' %> + + <%= @organization.members.count %> +
    + + <%= t 'global.balance' %> + + <%= seconds_to_hm(@organization.account.try(:balance) || '—') %> +

    +
    +
    +
    +
    + +
    +
    + + diff --git a/app/views/organizations/show.html.haml b/app/views/organizations/show.html.haml deleted file mode 100644 index ed6106b..0000000 --- a/app/views/organizations/show.html.haml +++ /dev/null @@ -1,90 +0,0 @@ -%h1 - = link_to @organization, organization_path(@organization) -.row - .col-sm-4 - .panel.panel-default - .panel-heading - %h3.panel-title= t ".contact_information" - .panel-body - %p - %strong= Organization.human_attribute_name("email") - = @organization.email - %br - %strong= Organization.human_attribute_name("phone") - = @organization.phone - %br - %strong Web - =link_to_if(@organization.web.present?,@organization.web,@organization.web) - %br - %strong= Organization.human_attribute_name("public_opening_times") - %br - = @organization.public_opening_times - %br - %strong= Organization.human_attribute_name("address") - = @organization.address - %br - %strong= Organization.human_attribute_name("neighborhood") - = @organization.neighborhood - %br - %strong= Organization.human_attribute_name("city") - = @organization.city - - .col-sm-3 - .panel.panel-default - .panel-heading - %h3.panel-title= t "global.information" - .panel-body - %p - %strong= Organization.human_attribute_name("created_at") - = l(@organization.created_at, format: :long) - %br - %strong= Organization.human_attribute_name("updated_at") - = l(@organization.updated_at, format: :long) - %br - %strong= t "global.member_count" - = @organization.members.count - %br - %strong= t "global.balance" - = seconds_to_hm(@organization.account.try(:balance) || mdash) - .col-sm-5 - %ul.nav.nav-pills.pull-right - - if superadmin? - %li - %a{href: organizations_path} - %span.glyphicon.glyphicon-hand-left - = t 'global.back' - - if admin? - %li - %a{href: edit_organization_path(@organization)} - %span.glyphicon.glyphicon-pencil - = t "global.edit" - - if superadmin? - %li - %a{href: organization_path(@organization), data: {method: :DELETE, confirm: t("are_you_sure") }} - %span.glyphicon.glyphicon-trash - = t "global.delete" - %li - %a{href: give_time_organization_path(@organization)} - %span.glyphicon.glyphicon-time - = t "global.give_time" - -.panel.user-profile - .panel-body - %h3 - = t "global.movements" - .transactions - %table.table.table-condensed - %thead - %tr - %th= t "global.date" - %th= t "global.source_destination" - %th= t "global.announcements" - %th= t "global.reason" - %th= t "global.amount" - - @organization.account.movements.order("created_at DESC").limit(10).each do |mv| - %tr - %td= l mv.created_at, format: :long - %td= mv.other_side.account - %td= mv.transfer.post - %td= mv.transfer.reason - %td= seconds_to_hm(mv.amount) \ No newline at end of file diff --git a/app/views/pages/about.ca.html.erb b/app/views/pages/about.ca.html.erb new file mode 100644 index 0000000..72c2896 --- /dev/null +++ b/app/views/pages/about.ca.html.erb @@ -0,0 +1,97 @@ +<%= content_for :window_title do %> + TimeOverflow - Gestió on-line de Bancs de Temps +<% end %> + +
    + <% if current_user and !current_organization %> + <%= render 'organization_list' %> + <% end %> +
    +
    +
    +

    TimeOverflow

    + <%= image_tag "sand-clock.png", width: 50 %> +

    El software disenyat per i per als Bancs de Temps

    + TimeOverflow és lliure, gratuït i col·laboratiu +
    + +
    +

    Funcionalitats de TimeOverflow:

    +
      +
    • + Gestió del Banc de Temps amb perfils d'administració +
        +
      • Altes/baixes/modificacions de membres
      • +
      • Publicar ofertes i demandes
      • +
      • Introduir xecs i gestionar la comptabilitat
      • +
      +
    • +
    • + Xarxa social i banca en línia accessible pels membres +
        +
      • Els membres d'un Banc de Temps poden accedir al sistema i + contactar amb altres membres
      • +
      • Publicar ofertes i demandes
      • +
      • Pagar hores a altres membres
      • +
      +
    • +
    +
    + +

    Ets un Banc de Temps?

    + +
    +

    + (ens posarem en contacte amb tu per posar-lo en marxa o fer-vos + una demostració) +

    +
    +
    + +
    +
    +

    Ja ets membre d'un Banc de Temps que fa servir TimeOverflow?

    + + Entra aquí + +
    +

    +

    Si ets una persona interessada a participar en un Banc de Temps, + busca el teu Banc de Temps més proper a + bdtonline.org. +

    +

    + + <%= image_tag "oferta.png", class: "img-responsive center-block" %> + +

    Internet potencia els Bancs de Temps

    +

    TimeOveflow està especialment dissenyat per i per als Bancs de Temps + que existeixen físicament(veure mapa), + la seva fi és potenciar gràcies a Internet. +

    +

    Gràcies al treball conjunt de CoopDevs + i la ADBdT + avui podem oferir el sofware TimeOverflow a tots els Bancs de + Temps que així ho desitgin de manera lliure i gratuïta. +

    + +

    El codi font de TimeOverflow està disponible sota una llicència + open source, ja es pot descarregar a + https://github.com/coopdevs/timeoverflow +

    +
    + <%= link_to image_tag("github.png", alt: "Github logo", height: 30), + "https://github.com/coopdevs/timeoverflow", + title: "TimeOverflow Github" %> +
    +
    +
    +
    diff --git a/app/views/pages/about.ca.html.haml b/app/views/pages/about.ca.html.haml deleted file mode 100644 index 926c6b6..0000000 --- a/app/views/pages/about.ca.html.haml +++ /dev/null @@ -1,66 +0,0 @@ -= content_for :window_title do - TimeOverflow - Gestió on-line de Bancs de Temps - -.container-inner - - if current_user and !current_organization - = render 'organization_list' - .row - .col-sm-6 - .text-center - %h1 TimeOverflow - = image_tag "sand-clock.png", width: 50 - %h2 El software disenyat per i per als Bancs de Temps - %em TimeOverflow és lliure, gratuït i col·laboratiu - - .text-left{style: "margin-top: 40px;"} - :markdown - Funcionalitats de **TimeOverflow**: - - * Gestió del Banc de Temps amb perfils d'administració - * Altes/baixes/modificacions de membres - * Publicar ofertes i demandes - * Introduir xecs i gestionar la comptabilitat - * Xarxa social i banca en línia accessible pels membres - * Els membres d'un Banc de Temps poden accedir al sistema i contactar amb altres membres - * Publicar ofertes i demandes - * Pagar hores a altres membres - - %h2 Ets un Banc de Temps? - .text-center - %a.btn.btn-primary.btn-large{href: "http://adbdt.org/ca/contacta/", style:"font-size:30px;margin-top:20px;"} - Sol·licita accés a TimeOverflow - .text-center - %p - %em (ens posarem en contacte amb tu per posar-lo en marxa o fer-vos una demostració) - - .col-sm-6 - .text-center - %h2 Ja ets membre d'un Banc de Temps que fa servir TimeOverflow? - %a.btn.btn-primary.btn-large{href: new_user_session_path, style:"font-size:30px;margin-top:20px;"} - Entra aquí - - %p - :markdown - Si ets una persona interessada a participar en un Banc de Temps, - busca el teu Banc de Temps més proper a - [bdtonline.org](http://www.bdtonline.org "Bancs de Temps"). - - = image_tag "oferta.png", class: "img-responsive center-block" - - %h2 Internet potencia els Bancs de Temps - :markdown - TimeOveflow està especialment dissenyat ** per i per als Bancs de Temps ** - que existeixen físicament([veure mapa](http://www.bdtonline.org "Bancs de Temps")), - la seva fi és potenciar gràcies a Internet. - - Gràcies al treball conjunt de [CoopDevs](https://github.com/coopdevs) - i la [ADBdT](http://adbdt.org/ca "Associació per al Desenvolupament dels Bancs de Temps") - avui podem oferir el sofware **TimeOverflow** a tots els Bancs de - Temps que així ho desitgin de manera lliure i gratuïta. - - El codi font de TimeOverflow està disponible sota una llicència - open source, ja es pot descarregar a [https://github.com/coopdevs/timeoverflow](https://github.com/coopdevs/timeoverflow) - - .text-center - = link_to "https://github.com/coopdevs/timeoverflow", title: "TimeOverflow Github" do - = image_tag("github.png", alt: "Github logo", height: 30) diff --git a/app/views/pages/about.en.html.erb b/app/views/pages/about.en.html.erb new file mode 100644 index 0000000..d9eb891 --- /dev/null +++ b/app/views/pages/about.en.html.erb @@ -0,0 +1,100 @@ +<%= content_for :window_title do %> +TimeOverflow - Time Bank on-line management +<% end %> + +
    +
    +
    +
    +

    TimeOverflow

    + <%= image_tag "sand-clock.png", width: 50 %> +

    The software designed by and for Time Banks

    + TimeOverflow is open source, free and collaborative +
    +
    +

    Features of + TimeOverflow:

    + +
      +
    • + Time Bank management with administration roles +
        +
      • Creation/deletion/updates of bank members
      • +
      • Posting of offers and inquiries
      • +
      • Enter checks and manage accounting
      • +
      +
    • +
    • + Social network and online banking accessible by members +
        +
      • Members of a Time Bank can access the system and connect with other members
      • +
      • Posting of offers and inquiries
      • +
      • Pay hours to other members
      • +
      +
    • +
    +
    + +

    Are you a Time Bank?

    + +
    +

    + (We will contact you to start it up or make you a demonstration) +

    +
    +
    + +
    +
    +

    Already a member of a Time Bank that uses TimeOverflow?

    + + Click here + +
    +

    +

    If you are a person interested in participating in a Time Bank, find your + closest Time Bank at + bdtonline.org. +

    +

    + <%= image_tag "oferta.png", class: "img-responsive center-block" %> + +

    Internet enhances Time Banks activity

    +

    TimeOveflow is specially designed + for and by Time Banks + that physically exist (see map), and its purpose is to boost them thanks to Internet. +

    + +

    Thanks to the joint job of + CoopDevs + and + ADBdT + today we can offer the software + TimeOverflow + to all Time Banks that want it, open and for free. +

    + +

    The source code of TimeOverflow is available based on an open source license + and you can download it at + https://github.com/coopdevs/timeoverflow +

    +
    + <%= link_to image_tag("github.png", alt: "Github logo", height: 30), + "https://github.com/coopdevs/timeoverflow", + title: "TimeOverflow Github" %> +
    +
    +
    +
    diff --git a/app/views/pages/about.en.html.haml b/app/views/pages/about.en.html.haml deleted file mode 100644 index fab9fe2..0000000 --- a/app/views/pages/about.en.html.haml +++ /dev/null @@ -1,66 +0,0 @@ -= content_for :window_title do - TimeOverflow - Time Bank on-line management - -.container-inner - - if current_user and !current_organization - = render 'organization_list' - .row - .col-sm-6 - .text-center - %h1 TimeOverflow - = image_tag "sand-clock.png", width: 50 - %h2 The software designed by and for Time Banks - %em TimeOverflow is open source, free and collaborative - - .text-left{style: "margin-top: 40px;"} - :markdown - Features of **TimeOverflow**: - - * Time Bank management with administration roles - * Creation/deletion/updates of bank members - * Posting of offers and inquiries - * Enter checks and manage accounting - * Social network and online banking accessible by members - * Members of a Time Bank can access the system and connect with other members - * Posting of offers and inquiries - * Pay hours to other members - - %h2 Are you a Time Bank? - .text-center - %a.btn.btn-primary.btn-large{href: "http://adbdt.org/contacta/", style:"font-size:30px;margin-top:20px;"} - Request access to TimeOverflow - .text-center - %p - %em (We will contact you to start it up or make you a demonstration) - - .col-sm-6 - .text-center - %h2 Already a member of a Time Bank that uses TimeOverflow? - %a.btn.btn-primary.btn-large{href: new_user_session_path, style:"font-size:30px;margin-top:20px;"} - Click here - - %p - :markdown - If you are a person interested in participating in a Time Bank, - find your closest Time Bank at - [bdtonline.org](http://www.bdtonline.org "Bancos de Tiempo"). - - = image_tag "oferta.png", class: "img-responsive center-block" - - %h2 Internet enhances Time Banks activity - :markdown - TimeOveflow is specially designed **for and by Time Banks** - that physically exist ([see map](http://www.bdtonline.org "Bancos de Tiempo")), - and its purpose is to boost them thanks to Internet. - - Thanks to the joint job of [CoopDevs](https://github.com/coopdevs) - and [ADBdT](http://adbdt.org "Association for the Development of Time Banks") - today que can offer the software **TimeOverflow** to all Time Banks - that want it, open and for free. - - The source code of TimeOverflow is available based on an open source - license and you can download it at [https://github.com/coopdevs/timeoverflow](https://github.com/coopdevs/timeoverflow) - - .text-center - = link_to "https://github.com/coopdevs/timeoverflow", title: "TimeOverflow Github" do - = image_tag("github.png", alt: "Github logo", height: 30) diff --git a/app/views/pages/about.html.erb b/app/views/pages/about.html.erb new file mode 100644 index 0000000..f719d19 --- /dev/null +++ b/app/views/pages/about.html.erb @@ -0,0 +1,91 @@ +
    +
    +
    +
    +

    TimeOverflow

    + <%= image_tag "sand-clock.png", width: 50 %> +

    El software diseñado por y para los Bancos de Tiempo

    + TimeOverflow es libre, gratuito y colaborativo +
    +
    +

    Funcionalidades de + TimeOverflow:

    + +
      +
    • + Gestión del Banco de Tiempo con perfiles de administración +
        +
      • Altas/bajas/modificaciones de miembros
      • +
      • Publicar ofertas y demandas
      • +
      • Introducir cheques y gestionar la contabilidad
      • +
      +
    • +
    • + Red social y banca on-line accesible por los miembros +
        +
      • Los miembros de un Banco de Tiempo pueden acceder al sistema + y contactar con otros miembros
      • +
      • Publicar ofertas y demandas
      • +
      • Pagar horas a otros miembros
      • +
      +
    • +
    +
    +

    ¿Eres un Banco de Tiempo?

    + +
    +

    + (nos pondremos en contacto contigo para ponerlo en marcha o haceros una + demostración) +

    +
    +
    +
    +
    +

    ¿Ya eres miembro de un Banco de Tiempo que usa TimeOverflow?

    + + Entra aquí + +
    +

    +

    Si eres una persona interesada en participar en un Banco de Tiempo, busca tu + Banco de Tiempo más cercano en + bdtonline.org.

    +

    + <%= image_tag "oferta.png", class: "img-responsive center-block" %> + +

    Internet potencia los Bancos de Tiempo

    +

    TimeOveflow está especialmente diseñado + por y para los Bancos de Tiempo + que existen físicamente (ver mapa), su fin es potenciarlos gracias a Internet.

    + +

    Gracias al trabajo conjunto de + CoopDevs + y la + ADBdT + hoy podemos ofrecer el sofware + TimeOverflow + a todos los Bancos de Tiempo que así lo deseen de manera libre y gratuita.

    + +

    El código fuente de TimeOverflow está disponible bajo una licencia open + source, ya se puede descargar en + https://github.com/coopdevs/timeoverflow +

    +
    + <%= link_to image_tag("github.png", alt: "Github logo", height: 30), + "https://github.com/coopdevs/timeoverflow", + title: "TimeOverflow Github" %> +
    +
    +
    +
    diff --git a/app/views/pages/about.html.haml b/app/views/pages/about.html.haml deleted file mode 100644 index d17c567..0000000 --- a/app/views/pages/about.html.haml +++ /dev/null @@ -1,66 +0,0 @@ -= content_for :window_title do - TimeOverflow - Gestión on-line de Bancos de Tiempo - -.container-inner - - if current_user and !current_organization - = render 'organization_list' - .row - .col-sm-6 - .text-center - %h1 TimeOverflow - = image_tag "sand-clock.png", width: 50 - %h2 El software diseñado por y para los Bancos de Tiempo - %em TimeOverflow es libre, gratuito y colaborativo - - .text-left{style: "margin-top: 40px;"} - :markdown - Funcionalidades de **TimeOverflow**: - - * Gestión del Banco de Tiempo con perfiles de administración - * Altas/bajas/modificaciones de miembros - * Publicar ofertas y demandas - * Introducir cheques y gestionar la contabilidad - * Red social y banca on-line accesible por los miembros - * Los miembros de un Banco de Tiempo pueden acceder al sistema y contactar con otros miembros - * Publicar ofertas y demandas - * Pagar horas a otros miembros - - %h2 ¿Eres un Banco de Tiempo? - .text-center - %a.btn.btn-primary.btn-large{href: "http://adbdt.org/contacta/", style:"font-size:30px;margin-top:20px;"} - Solicita acceso a TimeOverflow - .text-center - %p - %em (nos pondremos en contacto contigo para ponerlo en marcha o haceros una demostración) - - .col-sm-6 - .text-center - %h2 ¿Ya eres miembro de un Banco de Tiempo que usa TimeOverflow? - %a.btn.btn-primary.btn-large{href: new_user_session_path, style:"font-size:30px;margin-top:20px;"} - Entra aquí - - %p - :markdown - Si eres una persona interesada en participar en un Banco de Tiempo, - busca tu Banco de Tiempo más cercano en - [bdtonline.org](http://www.bdtonline.org "Bancos de Tiempo"). - - = image_tag "oferta.png", class: "img-responsive center-block" - - %h2 Internet potencia los Bancos de Tiempo - :markdown - TimeOveflow está especialmente diseñado **por y para los Bancos de Tiempo** - que existen físicamente ([ver mapa](http://www.bdtonline.org "Bancos de Tiempo")), - su fin es potenciarlos gracias a Internet. - - Gracias al trabajo conjunto de [CoopDevs](https://github.com/coopdevs) - y la [ADBdT](http://adbdt.org "Asociación para el Desarrollo de los Bancos de Tiempo") - hoy podemos ofrecer el sofware **TimeOverflow** a todos los Bancos de - Tiempo que así lo deseen de manera libre y gratuita. - - El código fuente de TimeOverflow está disponible bajo una licencia - open source, ya se puede descargar en [https://github.com/coopdevs/timeoverflow](https://github.com/coopdevs/timeoverflow) - - .text-center - = link_to "https://github.com/coopdevs/timeoverflow", title: "TimeOverflow Github" do - = image_tag("github.png", alt: "Github logo", height: 30) diff --git a/app/views/reports/post_list.html.erb b/app/views/reports/post_list.html.erb new file mode 100644 index 0000000..786bac8 --- /dev/null +++ b/app/views/reports/post_list.html.erb @@ -0,0 +1,27 @@ +
    + + + + + + + + + + + + + <% @posts.each do |cat, ps| %> + + + + <% ps.each do |post| %> + + + + + <% end %> + <% end %> + +
    <%= @post_type.model_name.human %><%= User.model_name.human %>

    <%= cat || '—' %>

    <%= post.title %><%= "#{post.user} (#{post.member_uid})" %>
    +
    diff --git a/app/views/reports/post_list.html.haml b/app/views/reports/post_list.html.haml deleted file mode 100644 index 06e5724..0000000 --- a/app/views/reports/post_list.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.row - %table.table.table-condensed.table-bordered - %colgroup - %col.col-sm-9 - %col.col-sm-3 - %thead - %tr - %th= @post_type.model_name.human - %th= User.model_name.human - %tbody - - @posts.each do |cat, ps| - %tr.success - %td{colspan: 2} - %h4= cat || raw("—") - - ps.each do |post| - %tr - %td - %strong= post.title - %td= "#{post.user} (#{post.member_uid})" diff --git a/app/views/reports/user_list.html.erb b/app/views/reports/user_list.html.erb new file mode 100644 index 0000000..9dca6fb --- /dev/null +++ b/app/views/reports/user_list.html.erb @@ -0,0 +1,27 @@ +
    + + + + + + + + + + + + + <% @members.each do |u| %> + + + + + + + + <% end %> + + +
    N<%= User.human_attribute_name :username %><%= User.human_attribute_name :email %><%= User.human_attribute_name :phone %><%= User.human_attribute_name :alt_phone %>
    <%= u.member_uid %><%= u.user.username %><%= u.user.email_if_real %><%= u.user.phone %><%= u.user.alt_phone %>
    +
    diff --git a/app/views/reports/user_list.html.haml b/app/views/reports/user_list.html.haml deleted file mode 100644 index 4ebbacb..0000000 --- a/app/views/reports/user_list.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.row - %table.table.table-condensed.table-bordered.table-striped - %thead - %tr - / %th= User.human_attribute_name(:registration_number) - %th N - %th= User.human_attribute_name(:username) - %th= User.human_attribute_name(:email) - %th= User.human_attribute_name(:phone) - %th= User.human_attribute_name(:alt_phone) - %tbody - - @members.each do |u| - %tr - %th= u.member_uid - %td= u.user.username - %td= u.user.email_if_real - %td= u.user.phone - %td= u.user.alt_phone - %tfoot diff --git a/app/views/tags/_grouped_index.html.erb b/app/views/tags/_grouped_index.html.erb new file mode 100644 index 0000000..3a0704d --- /dev/null +++ b/app/views/tags/_grouped_index.html.erb @@ -0,0 +1,24 @@ +
    + <% alpha_tags.each_slice(6) do |gr| %> +
    + <% gr.each do |kg, vg| %> +
    +

    + <%= kg %> +

    + <% vg.each do |tag, count| %> +

    +

    + <%= count %> +
    + <%= link_to get_index_path(post_type.pluralize, tag: tag) do %> + <%= glyph count == 1 ? :tag : :tags %> + <%= tag %> + <% end %> +

    + <% end %> +
    + <% end %> +
    + <% end %> +
    diff --git a/app/views/tags/_grouped_index.html.haml b/app/views/tags/_grouped_index.html.haml deleted file mode 100644 index 6bcaf12..0000000 --- a/app/views/tags/_grouped_index.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -.tag_list.container_fluid - - alpha_tags.each_slice(6) do |gr| - .row - - gr.each do |kg, vg| - .col-xs-2.col-md-2 - %h2.bg-info.text-center - = kg - - vg.each do |tag, count| - %p - .badge - = count - - path = get_index_path(post_type.pluralize, tag: tag) - = link_to path do - - gtag = (count == 1) ? "tag" : "tags" - = glyph(gtag) - = tag diff --git a/app/views/tags/alpha_grouped_index.html.erb b/app/views/tags/alpha_grouped_index.html.erb new file mode 100644 index 0000000..a9dc41d --- /dev/null +++ b/app/views/tags/alpha_grouped_index.html.erb @@ -0,0 +1,22 @@ +

    + <%= t '.maintitle' %> + <%= form_tag '/tags/alpha_grouped_index', method: :get do %> +
    + + +
    + <% end %> +

    +
    +
    + <%= render 'grouped_index', + alpha_tags: @alpha_tags, + post_type: params[:post_type] || 'offer' %> +
    +
    diff --git a/app/views/tags/alpha_grouped_index.html.haml b/app/views/tags/alpha_grouped_index.html.haml deleted file mode 100644 index 024c006..0000000 --- a/app/views/tags/alpha_grouped_index.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%h1 - =t(".maintitle") - =form_tag '/tags/alpha_grouped_index', method: :get do - .btn-group{"data-toggle" => "buttons"} - %label.btn.btn-primary.active.switch_offer-js - = radio_button_tag 'switch_offer', 'offer', true - = Offer.model_name.human(count: :many) - %label.btn.btn-primary.switch_inquiry-js - = radio_button_tag 'switch_inquiry', 'inquiry' - = Inquiry.model_name.human(count: :many) - -.tag_management - .alpha_tag_list.col-xs-12.col-md-12 - = render 'grouped_index', alpha_tags: @alpha_tags, post_type: params[:post_type] || "offer" diff --git a/app/views/terms/show.html.erb b/app/views/terms/show.html.erb new file mode 100644 index 0000000..eed77c8 --- /dev/null +++ b/app/views/terms/show.html.erb @@ -0,0 +1,13 @@ + + +<%= m @document.content %> + +<%= form_tag accept_terms_path, method: :post do %> + +<% end %> diff --git a/app/views/terms/show.html.haml b/app/views/terms/show.html.haml deleted file mode 100644 index 6e75e81..0000000 --- a/app/views/terms/show.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%header.page-header - %h1= @document.title - -:markdown - #{@document.content} - -= form_tag accept_terms_path, method: :post do - %button.btn{type: :submit} - =t(".accept") From 3d3bb60237db4cf540e92907d6619aeb23d8301e Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 05:08:00 +0200 Subject: [PATCH 15/38] Templates: Converted statistics to eRB --- .../statistics_all_transfers.html.erb | 65 ++++++++++++ .../statistics_all_transfers.html.haml | 40 -------- ....haml => statistics_demographics.html.erb} | 27 ++--- .../statistics_global_activity.html.erb | 98 +++++++++++++++++++ .../statistics_global_activity.html.haml | 74 -------------- .../statistics_inactive_users.html.erb | 31 ++++++ .../statistics_inactive_users.html.haml | 18 ---- .../statistics/statistics_last_login.html.erb | 25 +++++ .../statistics_last_login.html.haml | 15 --- .../statistics/statistics_type_swaps.html.erb | 28 ++++++ .../statistics_type_swaps.html.haml | 20 ---- .../statistics_without_offers.html.erb | 23 +++++ .../statistics_without_offers.html.haml | 14 --- 13 files changed, 286 insertions(+), 192 deletions(-) create mode 100644 app/views/statistics/statistics_all_transfers.html.erb delete mode 100644 app/views/statistics/statistics_all_transfers.html.haml rename app/views/statistics/{statistics_demographics.html.haml => statistics_demographics.html.erb} (65%) create mode 100644 app/views/statistics/statistics_global_activity.html.erb delete mode 100644 app/views/statistics/statistics_global_activity.html.haml create mode 100644 app/views/statistics/statistics_inactive_users.html.erb delete mode 100644 app/views/statistics/statistics_inactive_users.html.haml create mode 100644 app/views/statistics/statistics_last_login.html.erb delete mode 100644 app/views/statistics/statistics_last_login.html.haml create mode 100644 app/views/statistics/statistics_type_swaps.html.erb delete mode 100644 app/views/statistics/statistics_type_swaps.html.haml create mode 100644 app/views/statistics/statistics_without_offers.html.erb delete mode 100644 app/views/statistics/statistics_without_offers.html.haml diff --git a/app/views/statistics/statistics_all_transfers.html.erb b/app/views/statistics/statistics_all_transfers.html.erb new file mode 100644 index 0000000..5cb16c0 --- /dev/null +++ b/app/views/statistics/statistics_all_transfers.html.erb @@ -0,0 +1,65 @@ +

    + <%= t 'global.statistics' %>: <%= t '.transfers' %> +

    +
    +
    + + + + + + + + + + + + <% @transfers.each do |transfer| %> + + + <% transfer.movements.sort_by(&:amount).each do |mv| %> + + <% end %> + + + + + <% end %> +
    <%= t '.date' %><%= t '.from' %><%= t '.to' %><%= t '.post' %><%= t '.reason' %><%= t '.quantity' %>
    + <%= l transfer.created_at, format: :long %> + + <% mv.account.tap do |account| %> + <% if account.accountable.present? %> + <% if account.accountable_type == 'Organization' %> + <%= link_to account, + organization_path(account.accountable) %> + <% elsif account.accountable.active %> + <%= link_to account.accountable.display_name_with_uid, + user_path(account.accountable.user) %> + <% else %> + <%= t '.inactive_user' %> + <% end %> + <% else %> + <%= t '.deleted_user' %> + <% end %> + <% end %> + + <%= link_to_if transfer.try(:post).try(:active?), + transfer.post, + transfer.post %> + + <%= transfer.reason %> + <% if transfer.reason.present? && admin? %> + <%= link_to glyph(:trash), + delete_reason_transfer_path(transfer), + method: :put, + data: { confirm: t('.delete_reason') } %> + <% end %> + + <%= seconds_to_hm(transfer.movements.first.amount.abs) %> +
    +
    + <%= paginate @transfers %> +
    +
    +
    diff --git a/app/views/statistics/statistics_all_transfers.html.haml b/app/views/statistics/statistics_all_transfers.html.haml deleted file mode 100644 index a22aa50..0000000 --- a/app/views/statistics/statistics_all_transfers.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".transfers") -.panel.panel-default - .panel-body - %table.table.table-hover.table-condensed - - %thead - %tr - %th=t(".date") - %th=t(".from") - %th=t(".to") - %th=t(".post") - %th=t(".reason") - %th=t(".quantity") - - @transfers.each do |transfer| - %tr - %td= l transfer.created_at, format: :long - - transfer.movements.sort_by(&:amount).each do |mv| - %td - - mv.account.tap do |account| - - if account.accountable.present? - - if account.accountable_type == "Organization" - = link_to account, - organization_path(account.accountable) - - elsif account.accountable.active - = link_to account.accountable.display_name_with_uid, user_path(account.accountable.user) - - else - = t(".inactive_user") - - else - = t(".deleted_user") - %td - = link_to_if(transfer.try(:post).try(:active?), transfer.post, transfer.post) - %td - = transfer.reason - - if transfer.reason.present? && admin? - = link_to delete_reason_transfer_path(transfer), method: :put, data: { confirm: t(".delete_reason") } do - %span.glyphicon.glyphicon-trash - %td= seconds_to_hm(transfer.movements.first.amount.abs) - - .paginate-align - = paginate @transfers diff --git a/app/views/statistics/statistics_demographics.html.haml b/app/views/statistics/statistics_demographics.html.erb similarity index 65% rename from app/views/statistics/statistics_demographics.html.haml rename to app/views/statistics/statistics_demographics.html.erb index ed7c556..533f600 100644 --- a/app/views/statistics/statistics_demographics.html.haml +++ b/app/views/statistics/statistics_demographics.html.erb @@ -1,13 +1,18 @@ -%h1= t("global.statistics") + ": " + t(".demographics") -.panel.panel-default - .panel-body - #pie +

    + <%= t 'global.statistics' %>: <%= t '.demographics' %> +

    +
    +
    +
    +
    +
    -:javascript - window.onload = function () { + diff --git a/app/views/statistics/statistics_global_activity.html.erb b/app/views/statistics/statistics_global_activity.html.erb new file mode 100644 index 0000000..96a2f24 --- /dev/null +++ b/app/views/statistics/statistics_global_activity.html.erb @@ -0,0 +1,98 @@ +

    + <%= t 'global.statistics' %>: <%= t '.global_activity' %> +

    +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/app/views/statistics/statistics_global_activity.html.haml b/app/views/statistics/statistics_global_activity.html.haml deleted file mode 100644 index c6b0a0b..0000000 --- a/app/views/statistics/statistics_global_activity.html.haml +++ /dev/null @@ -1,74 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".global_activity") -%div{ ng_controller: "" } - .panel.panel-default - .panel-body - %ul.nav.nav-pills.statistics - %li - = t ".users_reg" - .badge - = @active_members.count - %li - = t ".num_swaps" - .badge - = @num_swaps - %li - = t ".total_hours" - .badge - = seconds_to_hm @total_hours - %form.navbar-form.navbar-right - .form-group - %input.form-control{id: "datepicker_from", placeholder: t(".ini_date"), name: "ini", value: params[:ini]} - %input.form-control{id: "datepicker_to", placeholder: t(".end_date"), name: "fin", value: params[:fin]} - %button.btn.btn-default{type: :submit}= t(".show") - #chart - -:javascript - window.onload = function () { - //globales - $('#chart').highcharts({ - chart: { - type: 'column' - }, - title: { - text: "#{t '.bank_activity'}" - }, - subtitle: { - text: "#{t '.per_month'}" - }, - xAxis: { - categories: #{@months_names.to_json} - }, - yAxis: { - min: 0, - title: { - text: '' - } - }, - tooltip: { - headerFormat: '{point.key}', - pointFormat: '' + - '', - footerFormat: '
    {series.name}: {point.y}
    ', - shared: true, - useHTML: true - }, - plotOptions: { - column: { - pointPadding: 0.2, - borderWidth: 0 - } - }, - series: [{ - name: "#{t '.users_reg'}", - data: #{@user_reg_months.to_json} - - }, { - name: "#{t ".num_swaps"}", - data: #{@num_swaps_months.to_json} - - }, { - name: "#{t ".total_hours"}", - data: #{@hours_swaps_months.to_json} - }] - }); - } diff --git a/app/views/statistics/statistics_inactive_users.html.erb b/app/views/statistics/statistics_inactive_users.html.erb new file mode 100644 index 0000000..16c61b2 --- /dev/null +++ b/app/views/statistics/statistics_inactive_users.html.erb @@ -0,0 +1,31 @@ +

    + <%= t 'global.statistics' %>: <%= t '.inactive_users' %> +

    +
    +
    + + + + + + + + + + + <%# Por días sin movimientos %> + <% @members.includes(:account) + .reject { |a| a.days_without_swaps.zero? } + .sort_by(&:days_without_swaps) + .reverse + .each do |mem| %> + + + + + + + <% end %> +
    ID<%= User.human_attribute_name :username %><%= t '.days_without_swaps' %><%= t '.last_movement' %>
    <%= mem.member_uid %><%= link_to mem.user.username, mem.user %><%= mem.days_without_swaps %><%= (mem.account.balance.blank? || mem.account.balance.zero?) ? t(".no_movements") : l(mem.account.updated_at, format: :long) %>
    +
    +
    diff --git a/app/views/statistics/statistics_inactive_users.html.haml b/app/views/statistics/statistics_inactive_users.html.haml deleted file mode 100644 index 923f370..0000000 --- a/app/views/statistics/statistics_inactive_users.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".inactive_users") -.panel.panel-default - .panel-body - %table.table.table-hover.table-condensed - %thead - %tr - %th ID - %th= User.human_attribute_name(:username) - %th= t ".days_without_swaps" - %th= t ".last_movement" - %tbody - / Por días sin movimientos - - @members.includes(:account).sort_by(&:days_without_swaps).reverse.map{ |a| a unless a.days_without_swaps.zero? }.compact.each do |mem| - %tr - %td= mem.member_uid - %td= link_to mem.user.username, mem.user - %td= mem.days_without_swaps - %td= (mem.account.balance.blank? || mem.account.balance.zero?) ? t(".no_movements") : l(mem.account.updated_at, format: :long) diff --git a/app/views/statistics/statistics_last_login.html.erb b/app/views/statistics/statistics_last_login.html.erb new file mode 100644 index 0000000..d2150e6 --- /dev/null +++ b/app/views/statistics/statistics_last_login.html.erb @@ -0,0 +1,25 @@ +

    + <%= t 'global.statistics' %>: <%= t '.last_login' %> +

    +
    +
    + + + + + + + + + + <% @members.each do |mem| %> + + + + + + <% end %> + +
    ID<%= User.human_attribute_name :username %><%= User.human_attribute_name :last_sign_in_at %>
    <%= mem.member_uid %><%= link_to mem.user.username, mem.user %><%= mem.user.current_sign_in_at.blank? ? t(".never_login") : l(mem.user.current_sign_in_at, format: :long) %>
    +
    +
    diff --git a/app/views/statistics/statistics_last_login.html.haml b/app/views/statistics/statistics_last_login.html.haml deleted file mode 100644 index a402202..0000000 --- a/app/views/statistics/statistics_last_login.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".last_login") -.panel.panel-default - .panel-body - %table.table.table-hover.table-condensed - %thead - %tr - %th ID - %th= User.human_attribute_name(:username) - %th= User.human_attribute_name(:last_sign_in_at) - %tbody - - @members.each do |mem| - %tr - %td= mem.member_uid - %td= link_to mem.user.username, mem.user - %td= mem.user.current_sign_in_at.blank? ? t(".never_login") : l(mem.user.current_sign_in_at, format: :long) diff --git a/app/views/statistics/statistics_type_swaps.html.erb b/app/views/statistics/statistics_type_swaps.html.erb new file mode 100644 index 0000000..cedb085 --- /dev/null +++ b/app/views/statistics/statistics_type_swaps.html.erb @@ -0,0 +1,28 @@ +

    + <%= t 'global.statistics' %>: <%= t '.type_of_swaps' %> +

    +
    +
    + + + + + + + + + + + <%# [["Clases", "clases", 13020, 3, 0.30], ["Domestic", "coche", 2220, 1, 0.1],...] %> + <% @offers.each do |offer| %> + + + + + + + <% end %> + +
    %<%= "#{Category.model_name.human} -> #{Offer.human_attribute_name(:tag_list)}" %><%= t 'statistics.statistics_global_activity.total_hours' %><%= t 'statistics.statistics_global_activity.num_swaps' %>
    <%= number_to_percentage offer.last * 100, precision: 2 %><%= "#{offer[0]} -> #{offer[1]}" %><%= seconds_to_hm offer[2] || '—' %><%= offer[3] %>
    +
    +
    diff --git a/app/views/statistics/statistics_type_swaps.html.haml b/app/views/statistics/statistics_type_swaps.html.haml deleted file mode 100644 index 902c016..0000000 --- a/app/views/statistics/statistics_type_swaps.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".type_of_swaps") -.panel.panel-default - .panel-body - %table.table.table-hover.table-condensed - %thead - %tr - %th % - %th - = "#{Category.model_name.human} -> #{Offer.human_attribute_name(:tag_list)}" - %th= t "statistics.statistics_global_activity.total_hours" - %th= t "statistics.statistics_global_activity.num_swaps" - - %tbody - / [["Clases", "clases", 13020, 3, 0.30], ["Domestic", "coche", 2220, 1, 0.1],...] - - @offers.each do |offer| - %tr - %td= number_to_percentage(offer.last*100, precision: 2) - %td= "#{offer[0]} -> #{offer[1]}" - %td= seconds_to_hm(offer[2] || mdash) - %td= offer[3] diff --git a/app/views/statistics/statistics_without_offers.html.erb b/app/views/statistics/statistics_without_offers.html.erb new file mode 100644 index 0000000..4b61a62 --- /dev/null +++ b/app/views/statistics/statistics_without_offers.html.erb @@ -0,0 +1,23 @@ +

    + <%= t 'global.statistics' %>: <%= t '.without_offers' %> +

    +
    +
    + + + + + + + + + <% @members.reject { |mem| mem.offers.present? }.each do |mem| %> + + + + + <% end %> + +
    ID<%= User.human_attribute_name(:username) %>
    <%= mem.member_uid %><%= link_to mem.user.username, mem.user %>
    +
    +
    diff --git a/app/views/statistics/statistics_without_offers.html.haml b/app/views/statistics/statistics_without_offers.html.haml deleted file mode 100644 index 62d3ff2..0000000 --- a/app/views/statistics/statistics_without_offers.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%h1= t("global.statistics") + ": " + t(".without_offers") -.panel.panel-default - .panel-body - %table.table.table-hover.table-condensed - %thead - %tr - %th ID - %th= User.human_attribute_name(:username) - %tbody - - @members.each do |mem| - - if mem.offers.blank? - %tr - %td= mem.member_uid - %td= link_to mem.user.username, mem.user From b8ea829f7a7c6fcf7e6922a5f2f04ba845ad707b Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 05:43:07 +0200 Subject: [PATCH 16/38] Templates: Converted users views to eRB --- app/views/users/_form.html.erb | 40 +++++ app/views/users/_form.html.haml | 35 ---- app/views/users/_user_rows.html.erb | 64 ++++++++ app/views/users/_user_rows.html.haml | 41 ----- app/views/users/edit.html.erb | 6 + app/views/users/edit.html.haml | 6 - app/views/users/give_time.html.erb | 66 ++++++++ app/views/users/give_time.html.haml | 33 ---- app/views/users/index.html.erb | 111 +++++++++++++ app/views/users/index.html.haml | 71 --------- app/views/users/index.js.erb | 2 + app/views/users/index.js.haml | 2 - app/views/users/new.html.erb | 4 + app/views/users/new.html.haml | 3 - app/views/users/show.html.erb | 229 +++++++++++++++++++++++++++ app/views/users/show.html.haml | 154 ------------------ 16 files changed, 522 insertions(+), 345 deletions(-) create mode 100644 app/views/users/_form.html.erb delete mode 100644 app/views/users/_form.html.haml create mode 100644 app/views/users/_user_rows.html.erb delete mode 100644 app/views/users/_user_rows.html.haml create mode 100644 app/views/users/edit.html.erb delete mode 100644 app/views/users/edit.html.haml create mode 100644 app/views/users/give_time.html.erb delete mode 100644 app/views/users/give_time.html.haml create mode 100644 app/views/users/index.html.erb delete mode 100644 app/views/users/index.html.haml create mode 100644 app/views/users/index.js.erb delete mode 100644 app/views/users/index.js.haml create mode 100644 app/views/users/new.html.erb delete mode 100644 app/views/users/new.html.haml create mode 100644 app/views/users/show.html.erb delete mode 100644 app/views/users/show.html.haml diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb new file mode 100644 index 0000000..12f13ba --- /dev/null +++ b/app/views/users/_form.html.erb @@ -0,0 +1,40 @@ +<%= show_error_messages!(@user) %> +<%= simple_form_for @user do |f| %> +
    + <%= f.input :username %> + <% if admin? %> + <%= f.input :email %> + <% if @user.unconfirmed_email.present? %> + <%= f.input :unconfirmed_email, readonly: true %> + <% end %> + <% else %> + <%= f.input :email, readonly: true %> + <% end %> + <%# if current_user.try :superadmin? %> + <%#= f.association :organization, include_blank: false %> + <%#= f.input :superadmin, as: :boolean, label: false, inline_label: true %> + <%# end %> + <%# if current_user.try :admin? %> + <%#= f.input :admin, as: :boolean, label: false, inline_label: true, hint: t(".admin_warning") %> + <%# end %> + <%= f.input :phone %> + <%= f.input :alt_phone %> + <%= f.input :date_of_birth, + start_year: Date.today.year - 90, + end_year: Date.today.year - 12, + include_blank: :true %> + <%= f.input :description, as: "text" %> + <%#= f.association :categories, label_method: :fqn, input_html: {style: 'width: 100%'} %> +
    + <%= f.label :notifications %> + <%= f.check_box :notifications %> +
    +
    +
    + <%= f.button :submit %> + <% if @user.new_record? %> + <%= f.button :submit, t('users.new.create_more_users_button'), name: 'more' %> + <% end %> + <%= link_to t('users.new.cancel'), users_path, class: "btn btn-default" %> +
    +<% end %> diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml deleted file mode 100644 index e3977cb..0000000 --- a/app/views/users/_form.html.haml +++ /dev/null @@ -1,35 +0,0 @@ -= show_error_messages!(@user) -= simple_form_for @user do |f| - .form-inputs - - = f.input :username - - - if admin? - = f.input :email - - if @user.unconfirmed_email.present? - = f.input :unconfirmed_email, readonly: true - - else - = f.input :email, readonly: true - - / - if current_user.try :superadmin? - / = f.association :organization, include_blank: false - / = f.input :superadmin, :as => :boolean, :label => false, :inline_label => true - / - if current_user.try :admin? - / = f.input :admin, :as => :boolean, :label => false, :inline_label => true, hint: t(".admin_warning") - - = f.input :phone - = f.input :alt_phone - = f.input :date_of_birth, start_year: Date.today.year - 90, end_year: Date.today.year - 12, include_blank: :true - - = f.input :description, as: "text" - / = f.association :categories, label_method: :fqn, input_html: {style: 'width: 100%'} - - .checkbox - = f.label :notifications - = f.check_box :notifications - - .form-actions - = f.button :submit - - if @user.new_record? - = f.button :submit, t('users.new.create_more_users_button'), name: 'more' - = link_to t('users.new.cancel'), users_path, class: "btn btn-default" diff --git a/app/views/users/_user_rows.html.erb b/app/views/users/_user_rows.html.erb new file mode 100644 index 0000000..90aa157 --- /dev/null +++ b/app/views/users/_user_rows.html.erb @@ -0,0 +1,64 @@ + + + + + {{user.member_id}} + + + {{user.username}} + + + + {{user.email}} + + + {{user.unconfirmed_email}} + + + {{user.phone}} + {{user.alt_phone}} + {{user.balance | timeBalance}} + <% if current_user.manages?(current_organization) %> + + + <%= glyph :pencil %> + <%= t "global.edit" %> + + "> + <%= glyph :ban_circle %> + <%= t "global.cancel_membership" %> + + + + <%= glyph :arrow_down %> + <%= t "global.demote" %> + + + <%= glyph :arrow_up %> + <%= t "global.promote" %> + + + + + <%= glyph :remove %> + <%= t ".deactivate" %> + + + <%= glyph :ok %> + <%= t ".activate" %> + + + + <% end %> + diff --git a/app/views/users/_user_rows.html.haml b/app/views/users/_user_rows.html.haml deleted file mode 100644 index dcf13d2..0000000 --- a/app/views/users/_user_rows.html.haml +++ /dev/null @@ -1,41 +0,0 @@ -%tr{ "ng-repeat" => "user in users | orderBy:sort | filter:filterTerm", "ng-class" => "{'bg-danger': !user.active}" } - %td - %img{ "ng-src" => "{{user.avatar}}", height: "32px", width: "32px" } - %td {{user.member_id}} - %td - %span.glyphicon.glyphicon-time{ "ng-if" => "!user.active" } - %a{ "ng-href" => "{{user.url}}" } - {{user.username}} - %td - %a{ "ng-href" => "mailto:{{user.email}}", ng_if: "!user.unconfirmed_email"} - {{user.email}} - %a{ng_href: "mailto:{{user.unconfirmed_email}}", ng_if: "user.unconfirmed_email"} - {{user.unconfirmed_email}} - %td {{user.phone}} - %td {{user.alt_phone}} - %td {{user.balance | timeBalance}} - - if current_user.manages? current_organization - %td.hover-actions - %a.action{ "ng-if" => "user.edit_link", "ng-href" => "{{user.edit_link}}"} - %span.glyphicon.glyphicon-pencil - = t "global.edit" - - %a.action{ "ng-if" => "user.cancel_link && !user.active", "ng-href" => "{{user.cancel_link}}", :data => {:method => :delete, :confirm => t('.cancel_warning', :user => "{{user.username}}")}} - %span.glyphicon.glyphicon-ban-circle - = t "global.cancel_membership" - - %a.action{ href: "", "ng-if" => "user.toggle_manager_link && user.active", "ng-click" => "toggle_manager(user)"} - %span{ "ng-if" => "user.manager" } - .glyphicon.glyphicon-arrow-down - = t "global.demote" - %span{ "ng-if" => "!user.manager" } - .glyphicon.glyphicon-arrow-up - = t "global.promote" - - %a.action{ href: "", "ng-if" => "user.toggle_active_link", "ng-click" => "toggle_active(user)"} - %span{ "ng-if" => "user.active" } - .glyphicon.glyphicon-remove - = t ".deactivate" - %span{ "ng-if" => "!user.active" } - .glyphicon.glyphicon-ok - = t ".activate" \ No newline at end of file diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 0000000..75e1c9a --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,6 @@ +

    + <%= @user.username %> + <%= t ".edit_user" %> +

    + +<%= render "form" %> diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml deleted file mode 100644 index 3ec9c3d..0000000 --- a/app/views/users/edit.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h1 - = @user.username - %small - = t ".edit_user" - -= render "form" diff --git a/app/views/users/give_time.html.erb b/app/views/users/give_time.html.erb new file mode 100644 index 0000000..2b5b143 --- /dev/null +++ b/app/views/users/give_time.html.erb @@ -0,0 +1,66 @@ +

    + + <%= t ".give_time" %> + + <%= link_to @user.member(current_organization).display_name_with_uid, user_path(@user) %> +

    +<% if @offer %> +

    + <%= @offer %> +

    +<% end %> +<%= simple_form_for @transfer do |f| %> +
    + <%= f.input :hours, + as: :integer, + input_html: { + min: 0, + max: 20, + "data-rule-either-hours-minutes-informed" => "true", + "data-rule-range" => "[0,20]" + } %> + <%= f.input :minutes, + as: :integer, + input_html: { + min: 0, + max: 59, + step: 15, + "data-rule-either-hours-minutes-informed" => "true", + "data-rule-range" => "[0,59]" + } %> + <%= f.input :amount, as: :hidden %> + <%= f.input :reason %> + <%= f.input :destination, as: :hidden %> + <% if admin? %> +
    + <%= f.label :source %> + <%= f.select :source, + options_for_select( + @sources.sort_by { |source| [source.accountable_type, source.accountable.try(:member_uid)] } + .map { |a| ["#{a.accountable_type == "Member" ? a.accountable.member_uid : ""} #{a.accountable_type} #{a.accountable.to_s}", a.id] }, + selected: current_user.member(current_organization).account.id + ), + {}, + id: "select2-time", + class: "form-control" %> +
    + <% end %> + <% if @offer %> + <%= f.input :post, readonly: true %> + <%= f.input :post_id, as: :hidden %> + <% else %> + <%= f.input :post_id, collection: @user.member(current_organization).offers.active %> + <% end %> +
    +
    + <%= f.button :submit, class: "btn btn-default", style: "margin-bottom: 20px;" %> +
    +<% end %> + + diff --git a/app/views/users/give_time.html.haml b/app/views/users/give_time.html.haml deleted file mode 100644 index 9c0e38d..0000000 --- a/app/views/users/give_time.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -%h1 - %small= t ".give_time" - = link_to @user.member(current_organization).display_name_with_uid, user_path(@user) - -- if @offer - %h3= @offer - -= simple_form_for @transfer do |f| - .form-inputs - = f.input :hours, as: :integer, input_html: { min: 0, max: 20, "data-rule-either-hours-minutes-informed" => "true", "data-rule-range" => "[0,20]"} - = f.input :minutes, as: :integer, input_html: { min: 0, max: 59, step: 15, "data-rule-either-hours-minutes-informed" => "true", "data-rule-range" => "[0,59]"} - = f.input :amount, as: :hidden - = f.input :reason - = f.input :destination, as: :hidden - - if admin? - .form-group - = f.label :source - = f.select :source, options_for_select(@sources.sort_by{ |source| [source.accountable_type, source.accountable.try(:member_uid)]}.map{ |a| ["#{a.accountable_type == "Member" ? a.accountable.member_uid : ""} #{a.accountable_type} #{a.accountable.to_s}", a.id]}, selected: current_user.member(current_organization).account.id), {}, { id: "select2-time", class: "form-control" } - - if @offer - = f.input :post, readonly: true - = f.input :post_id, as: :hidden - - else - = f.input :post_id, collection: @user.member(current_organization).offers.active - - .form-actions - = f.button :submit, class: "btn btn-default", style: "margin-bottom: 20px;" - -:javascript - $("#select2-time").select2({ - formatNoMatches: function() { - return "#{t 'application.tips.user_not_found'}"; - } - }) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000..09b94c0 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,111 @@ +
    +

    + <%= User.model_name.human.pluralize %> + — + <%= link_to current_organization.name, + organization_path(current_organization) %> + <% if params[:q].present? %> + + <%= glyph :search %> + <%= params[:q] %> + + <% end %> +

    + + + + + + + + + + + + + <% if current_user.manages? current_organization %> + + <% end %> + + + + <%= render "user_rows", users: @users %> + +
    + + ID + + + + + + <%= User.human_attribute_name(:username) %> + + + + + + <%= User.human_attribute_name(:email) %> + + + + + <%= User.human_attribute_name(:phone) %> + + <%= User.human_attribute_name(:alt_phone) %> + + + <%= Account.human_attribute_name(:balance) %> + + + + + + <%= t(".actions") %> +
    +
    + + + + + + diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml deleted file mode 100644 index 07855bc..0000000 --- a/app/views/users/index.html.haml +++ /dev/null @@ -1,71 +0,0 @@ -%div{"ng-controller" => "UserListCtrl"} - %h1 - = User.model_name.human.pluralize - — - = link_to current_organization.name, organization_path(current_organization) - - if params[:q].present? - %small - %span.glyphicon.glyphicon-search - = params[:q] - - .navbar - %form.navbar-form.navbar-left - %input.form-control{type: "text", placeholder: t("global.search"), "ng-model" => "filterTerm"} - %ul.nav.navbar-nav.pull-right - - if admin? - %li - %a{href: new_user_path} - %span.glyphicon.glyphicon-plus - = t "helpers.submit.create", model: User.model_name.human - - %table.table.table-hover.table-condensed.users.panel{"ng-cloak"=>""} - %thead - %tr - %tr - %th - %th - %a{ href: "", ng_click: "sortBy('member_id')" } - ID - %span.glyphicon.glyphicon-chevron-down{ ng_if: "sort == '-member_id'" } - %span.glyphicon.glyphicon-chevron-up{ ng_if: "sort == 'member_id'" } - %th - %a{ href: "", ng_click: "sortBy('username')" } - = User.human_attribute_name(:username) - %span.glyphicon.glyphicon-chevron-down{ ng_if: "sort == '-username'" } - %span.glyphicon.glyphicon-chevron-up{ ng_if: "sort == 'username'" } - %th - %a{ href: "", ng_click: "sortBy('email')" } - = User.human_attribute_name(:email) - %span.glyphicon.glyphicon-chevron-down{ ng_if: "sort == '-email'" } - %span.glyphicon.glyphicon-chevron-up{ ng_if: "sort == 'email'" } - %th= User.human_attribute_name(:phone) - %th= User.human_attribute_name(:alt_phone) - %th - %a{ href: "", ng_click: "sortBy('balance')" } - = Account.human_attribute_name(:balance) - %span.glyphicon.glyphicon-chevron-down{ ng_if: "sort == '-balance'" } - %span.glyphicon.glyphicon-chevron-up{ ng_if: "sort == 'balance'" } - - if current_user.manages? current_organization - %th - %span.glyphicon.glyphicon-hand-down - =t(".actions") - - %tbody - = render partial: "user_rows", locals: {users: @users} - -%script{type: "text/ng-template", id: "confirm_toggle_manager.html"} - .modal-body= t('.manage_warning_angular') - .modal-footer - %button.btn.btn-primary{"ng-click" => "$close(true)"} OK - %button.btn.btn-warning{"ng-click" => "$dismiss()"} NO - -%script{type: "text/ng-template", id: "confirm_toggle_active.html"} - .modal-body= t('.active_warning_angular') - .modal-footer - %button.btn.btn-primary{"ng-click" => "$close(true)"} OK - %button.btn.btn-warning{"ng-click" => "$dismiss()"} NO - -:javascript - angular.module("timeoverflow").run(function ($rootScope, $location, $http, $modal) { - $rootScope.users = #{ users_as_json }; - }); diff --git a/app/views/users/index.js.erb b/app/views/users/index.js.erb new file mode 100644 index 0000000..8652f5c --- /dev/null +++ b/app/views/users/index.js.erb @@ -0,0 +1,2 @@ +$('table.users tbody').append("<%= j(render 'users/user_rows', users: @users) %>"); +$('table.users a[rel=next]').replaceWith("<%= link_to_next_page @users, t('.more'), remote: true, class: 'btn btn-default', params: params %>"); diff --git a/app/views/users/index.js.haml b/app/views/users/index.js.haml deleted file mode 100644 index 4247293..0000000 --- a/app/views/users/index.js.haml +++ /dev/null @@ -1,2 +0,0 @@ -$('table.users tbody').append('#{escape_javascript(render partial: "users/user_rows", locals: { users: @users })}'); -$('table.users a[rel=next]').replaceWith('#{link_to_next_page @users, t('.more'), remote: true, class: "btn btn-default", params: params}'); diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb new file mode 100644 index 0000000..6f2b038 --- /dev/null +++ b/app/views/users/new.html.erb @@ -0,0 +1,4 @@ +

    + <%= t ".new_user" %> +

    +<%= render "form" %> diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml deleted file mode 100644 index 43d8a0e..0000000 --- a/app/views/users/new.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -%h1= t ".new_user" - -= render "form" \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 0000000..056eec1 --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,229 @@ + +
    +
    +
    +
    +

    + <%= Offer.model_name.human(count: :many) %> + <% if @user == current_user %> + + <%= glyph :plus %> + + <% end %> +

    +
    + + <% @member.offers.active.each do |post| %> + + + + + + <% end %> +
    + <%= link_to post, post %> + + <%= post.description %> + + <%= link_to glyph(:time), + give_time_user_path(@user, offer: post.id) + title: t("global.give_time") %> +
    +
    +
    +
    +
    +
    +

    + <%= Inquiry.model_name.human(count: :many) %> + <% if @user == current_user %> + + <%= glyph :plus %> + + <% end %> +

    +
    + + <% @member.inquiries.active.each do |post| %> + + + + + <% end %> +
    + <%= link_to post, post %> + + <%= post.description %> +
    +
    +
    +
    +
    +
    +
    +
    +

    + <%= t(".accounts") %> +

    +
    +
    + <% if @member.manager %> +

    + ADMIN +

    + <% end %> +

    + + <%= t(".created_at") %> + + <%= @member.entry_date ? l(@member.entry_date, format: :long) : mdash %> +
    + + <%= t(".user_no") %> + + <%= @member.member_uid || mdash %> +
    + + <%= t(".balance") %> + + <%= seconds_to_hm(@member.account.try(:balance) || mdash) %> +

    +
    +
    +
    +
    + diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml deleted file mode 100644 index 9f23d4f..0000000 --- a/app/views/users/show.html.haml +++ /dev/null @@ -1,154 +0,0 @@ -.panel.user-profile - .panel-body - %h1 - %small - - unless @member.active - = t ".inactive" - = @member.display_name_with_uid - %small - - if @user.superadmin? - %span.label.label-important= t ".superadmin" - - .row - .col-sm-3.col-xs-5.text-center - - if @user == current_user - %a{href: "https://www.gravatar.com", target: "_blank"} - = image_tag avatar_url(@user, 160) - - else - = image_tag avatar_url(@user, 160) - - .col-sm-9.col-xs-7 - :markdown - #{@user.description} - - %ul.nav.nav-pills.pull-right - - if @user == current_user - %li - %a{href: edit_user_path(@user)} - %span.glyphicon.glyphicon-pencil - = t "global.edit" - - if admin? || @user != current_user - %li - %a{href: give_time_user_path(@user)} - %span.glyphicon.glyphicon-time - = t "global.give_time" - - - %dl.dl-horizontal - %h3 - = t "global.contact_details" - - if @user.email_if_real != "" - %dt= User.human_attribute_name(:email) - %dd= @user.email_if_real - - phones = [@user.phone, @user.alt_phone].map(&:presence).compact - - if phones.present? - %dt= t(".phone", count: phones.size) - %dd - - phones.each_with_index do |ph, idx| - - unless idx.zero? - — - = ph - -.row - .col-sm-6.offers - .panel.panel-default - .panel-heading - %h2.panel-title - = Offer.model_name.human(count: :many) - - if @user == current_user - %a.pull-right{href: new_offer_path} - %span.glyphicon.glyphicon-plus - - - %table.table.table-condensed.offers - - @member.offers.active.each do |post| - %tr - %td= link_to post, post - %td= post.description - %td - %a{href: give_time_user_path(@user, offer: post.id), title: t("global.give_time")} - %span.glyphicon.glyphicon-time - - .col-sm-6.inquiries - .panel.panel-default - .panel-heading - %h2.panel-title - = Inquiry.model_name.human(count: :many) - - if @user == current_user - %a.pull-right{href: new_inquiry_path} - %span.glyphicon.glyphicon-plus - - %table.table.table-condensed.offers - - @member.inquiries.active.each do |post| - %tr - %td= link_to post, post - %td= post.description - -.row - .col-sm-4 - .panel.panel-default - .panel-heading - %h3.panel-title - = t(".accounts") - .panel-body - - if @member.manager - %p.danger - ADMIN - %p - %strong - = t(".created_at") - = @member.entry_date ? l(@member.entry_date, format: :long) : mdash - %br - %strong - = t(".user_no") - = @member.member_uid || mdash - %br - %strong - = t(".balance") - = seconds_to_hm(@member.account.try(:balance) || mdash) - -.panel.user-profile - .panel-body - %h3 - =t(".movements") - .transactions - %table.table.table-condensed - %thead - %tr - %th - =t(".date") - %th - =t(".from_to") - %th - =t(".post") - %th - =t(".reason") - %th - =t(".quantity") - - @movements.each do |mv| - %tr - %td= l mv.created_at.to_date, format: :long - %td - - mv.other_side.account.tap do |account| - - if account.accountable.present? - - if account.accountable_type == "Organization" - = link_to account, - organization_path(account.accountable) - - elsif account.accountable.active - = link_to account.accountable.display_name_with_uid, - user_path(account.accountable.user) - - else - = t(".inactive_user") - - else - = t(".deleted_user") - %td - = mv.transfer.try(:post).try(:active?) ? link_to(mv.transfer.post, offer_path(mv.transfer.post)) : mv.transfer.post - %td - = mv.transfer.reason - - if mv.transfer.reason.present? && admin? - = link_to delete_reason_transfer_path(mv.transfer), method: :put, data: { confirm: t(".delete_reason") } do - %span.glyphicon.glyphicon-trash - %td= seconds_to_hm(mv.amount) - - .paginate-align - = paginate @movements From 55b62cd0e33c499b711909fdefb33f38ebb49228 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 05:48:42 +0200 Subject: [PATCH 17/38] Templates: Removed generated scaffold for simple_form --- lib/templates/haml/scaffold/_form.html.haml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 lib/templates/haml/scaffold/_form.html.haml diff --git a/lib/templates/haml/scaffold/_form.html.haml b/lib/templates/haml/scaffold/_form.html.haml deleted file mode 100644 index ac3aa7b..0000000 --- a/lib/templates/haml/scaffold/_form.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -= simple_form_for(@<%= singular_table_name %>) do |f| - = f.error_notification - - .form-inputs - <%- attributes.each do |attribute| -%> - = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> - <%- end -%> - - .form-actions - = f.button :submit From 7f4a293bf7cdc6c8900b2d9ed7c8c904855dcc08 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 05:49:02 +0200 Subject: [PATCH 18/38] Templates: Removed haml and slim gems --- Gemfile | 2 -- Gemfile.lock | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/Gemfile b/Gemfile index 0881886..e9a0ca1 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,6 @@ gem 'pundit' gem 'pg', '0.17.1' gem 'hstore_translate' gem 'dalli' -gem 'slim-rails' # much better than haml gem 'devise', '3.5.6' gem "http_accept_language" gem 'thin' @@ -19,7 +18,6 @@ gem 'unicorn' gem 'foreman' gem 'dotenv-rails' gem 'kaminari' -gem "haml-rails" gem "simple_form", ">= 3.0.0" gem "awesome_print" gem 'memcachier' diff --git a/Gemfile.lock b/Gemfile.lock index 685eafa..c78c2a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -153,27 +153,13 @@ GEM formtastic_i18n (0.1.1) globalid (0.3.6) activesupport (>= 4.1.0) - haml (4.1.0.beta.1) - tilt - haml-rails (0.6.0) - actionpack (>= 4.0.1) - activesupport (>= 4.0.1) - haml (>= 3.1, < 5.0) - html2haml (>= 1.0.1) - railties (>= 4.0.1) has_scope (0.6.0) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) hashie (3.4.1) high_voltage (2.1.0) - hpricot (0.8.6) hstore_translate (1.0.0) activerecord (>= 3.1.0) - html2haml (1.0.1) - erubis (~> 2.7.0) - haml (>= 4.0.0.rc.1) - hpricot (~> 0.8.6) - ruby_parser (~> 3.1.1) http_accept_language (2.0.2) i18n (0.7.0) inherited_resources (1.6.0) @@ -298,8 +284,6 @@ GEM rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.4) ruby-progressbar (1.7.1) - ruby_parser (3.1.3) - sexp_processor (~> 4.1) sass (3.4.21) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -309,7 +293,6 @@ GEM tilt (>= 1.1, < 3) select2-rails (4.0.1) thor (~> 0.14) - sexp_processor (4.4.4) shelly-dependencies (0.2.4) rake thin @@ -322,15 +305,6 @@ GEM simple_form (3.1.0) actionpack (~> 4.0) activemodel (~> 4.0) - slim (3.0.3) - temple (~> 0.7.3) - tilt (>= 1.3.3, < 2.1) - slim-rails (3.0.1) - actionmailer (>= 3.1, < 5.0) - actionpack (>= 3.1, < 5.0) - activesupport (>= 3.1, < 5.0) - railties (>= 3.1, < 5.0) - slim (~> 3.0) sprockets (3.5.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -341,7 +315,6 @@ GEM sshkit (1.8.1) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - temple (0.7.5) thin (1.6.3) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0) @@ -398,7 +371,6 @@ DEPENDENCIES fabrication faker foreman - haml-rails has_scope high_voltage (~> 2.1.0) hstore_translate @@ -426,7 +398,6 @@ DEPENDENCIES shelly-dependencies shoulda (>= 3.5) simple_form (>= 3.0.0) - slim-rails thin travis-lint uglifier (= 2.7.2) From ae3cfe6573ab7c4aae48163027f12f5e1b56dcd8 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 13:09:02 +0200 Subject: [PATCH 19/38] Templates: fix missing `_path` in url helpers in menu --- .../menus/_organization_statistics_menu.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/application/menus/_organization_statistics_menu.html.erb b/app/views/application/menus/_organization_statistics_menu.html.erb index d94df63..c7ec518 100644 --- a/app/views/application/menus/_organization_statistics_menu.html.erb +++ b/app/views/application/menus/_organization_statistics_menu.html.erb @@ -12,37 +12,37 @@ <% end %>
  • - <%= link_to statistics_inactive_users_statistics do %> + <%= link_to statistics_inactive_users_statistics_path do %> <%= glyph :stats %> <%= t "application.navbar.inactive_users" %> <% end %>
  • - <%= link_to statistics_demographics_statistics do %> + <%= link_to statistics_demographics_statistics_path do %> <%= glyph :stats %> <%= t "application.navbar.demographics" %> <% end %>
  • - <%= link_to statistics_last_login_statistics do %> + <%= link_to statistics_last_login_statistics_path do %> <%= glyph :stats %> <%= t "application.navbar.last_login" %> <% end %>
  • - <%= link_to statistics_without_offers_statistics do %> + <%= link_to statistics_without_offers_statistics_path do %> <%= glyph :stats %> <%= t "application.navbar.without_offers" %> <% end %>
  • - <%= link_to statistics_type_swaps_statistics do %> + <%= link_to statistics_type_swaps_statistics_path do %> <%= glyph :stats %> <%= t ".type_of_swaps" %> <% end %>
  • - <%= link_to statistics_all_transfers_statistics do %> + <%= link_to statistics_all_transfers_statistics_path do %> <%= glyph :stats %> <%= t ".statistics_all_transfers" %> <% end %> From 7b8e12ffa123cf10250f42efaebad31f7712c768 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 13:29:28 +0200 Subject: [PATCH 20/38] Templates: fix translations and partial paths --- .../application/menus/_organization_statistics_menu.html.erb | 4 ++-- app/views/application/menus/_user_admin_menu.html.erb | 2 +- app/views/inquiries/index.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/application/menus/_organization_statistics_menu.html.erb b/app/views/application/menus/_organization_statistics_menu.html.erb index c7ec518..72857f3 100644 --- a/app/views/application/menus/_organization_statistics_menu.html.erb +++ b/app/views/application/menus/_organization_statistics_menu.html.erb @@ -38,13 +38,13 @@
  • <%= link_to statistics_type_swaps_statistics_path do %> <%= glyph :stats %> - <%= t ".type_of_swaps" %> + <%= t "application.navbar.type_of_swaps" %> <% end %>
  • <%= link_to statistics_all_transfers_statistics_path do %> <%= glyph :stats %> - <%= t ".statistics_all_transfers" %> + <%= t "application.navbar.statistics_all_transfers" %> <% end %>
  • diff --git a/app/views/application/menus/_user_admin_menu.html.erb b/app/views/application/menus/_user_admin_menu.html.erb index 79398c5..58f3940 100644 --- a/app/views/application/menus/_user_admin_menu.html.erb +++ b/app/views/application/menus/_user_admin_menu.html.erb @@ -21,7 +21,7 @@ <% if current_user.organizations.count > 1 %> - <%= render 'organization_switcher' %> + <%= render 'application/menus/organization_switcher' %> <% end %>
  • diff --git a/app/views/inquiries/index.html.erb b/app/views/inquiries/index.html.erb index 5e05506..4475ff7 100644 --- a/app/views/inquiries/index.html.erb +++ b/app/views/inquiries/index.html.erb @@ -1,7 +1,7 @@ <% @category = Category.where(id: params[:cat]).first %>

    <%= Inquiry.model_name.human(count: :many) %> - <%= render "/shared/show_filter_hint.html.haml" %> + <%= render "shared/show_filter_hint" %>

  • "> +
  • "> <%= link_to alpha_grouped_index_tags_path(post_type: "offer") do %> <%= glyph :tags %> <%= t ".tags" %> From b6ce411c66b95260b48015a266db882c52eb8c39 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Mon, 16 May 2016 13:45:18 +0200 Subject: [PATCH 22/38] Templates: syntax error --- app/views/shared/_posts.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_posts.html.erb b/app/views/shared/_posts.html.erb index 3c84814..d25aea0 100644 --- a/app/views/shared/_posts.html.erb +++ b/app/views/shared/_posts.html.erb @@ -11,12 +11,12 @@ <% if post.category %> <%= glyph :folder_open %> - <%= link_to post.category, get_index_path(post, cat: post.category)%> + <%= link_to post.category, get_index_path(post, cat: post.category) %> <% end %> <% (post.tags || []).each do |tag| %> <%= glyph :tag %> - <%= link_to tag, get_index_path(post,tag: tag) do %> + <%= link_to tag, get_index_path(post,tag: tag) %> <% end %> <%= l post.created_at.to_date, format: :long %> From 5e52b5aa12abb9d9efe3afdf85ed7d2c77ef7d05 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:35:41 +0200 Subject: [PATCH 23/38] Templates: use `<%= raw array.to_json %>` to output arrays in JS --- app/views/statistics/statistics_demographics.html.erb | 2 +- app/views/statistics/statistics_global_activity.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/statistics/statistics_demographics.html.erb b/app/views/statistics/statistics_demographics.html.erb index 533f600..eb5d6a1 100644 --- a/app/views/statistics/statistics_demographics.html.erb +++ b/app/views/statistics/statistics_demographics.html.erb @@ -12,7 +12,7 @@ $(function () { // Demograficos // Por edades - var ages = <%= j @age_counts.to_a.to_json %>; + var ages = <%= raw @age_counts.to_a.to_json %>; $('#pie').highcharts({ chart: { plotBackgroundColor: null, diff --git a/app/views/statistics/statistics_global_activity.html.erb b/app/views/statistics/statistics_global_activity.html.erb index 96a2f24..9d8cf7c 100644 --- a/app/views/statistics/statistics_global_activity.html.erb +++ b/app/views/statistics/statistics_global_activity.html.erb @@ -60,7 +60,7 @@ text: "<%= j t('.per_month') %>" }, xAxis: { - categories: <%= @months_names.to_json %> + categories: <%= raw @months_names.to_json %> }, yAxis: { min: 0, From 771b60f6fe151805d2365e89560e0408468569c8 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:36:37 +0200 Subject: [PATCH 24/38] Angular: avoid FOUC in user list --- app/assets/stylesheets/application.css.scss | 5 ++++- app/views/layouts/application.html.erb | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 5da07f0..19b50f0 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -7,6 +7,10 @@ $navs-bg-color: #080808; $white: #ffffff; $border: #e1e8ed; +[ng\:cloak], [ng-cloak], .ng-cloak { + visibility: hidden!important; +} + body[data-action="devise/sessions-new"], body[data-action="devise/sessions-create"] { background: image-url('red.jpg') no-repeat center center fixed; background-size: cover; @@ -213,4 +217,3 @@ label[required]::after{ .navbar-form { padding: 0; } - diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 450be29..c3689f9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,7 +22,8 @@ <%= javascript_include_tag 'application' %> + ng-app="timeoverflow" + ng-cloak> <%= render 'navbar' %>
    <%= render 'layouts/messages' %> From c7c3c77972763832c0fb8707d013d74f9b5655a0 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:37:02 +0200 Subject: [PATCH 25/38] Heroku: please use ruby 2.3.0 --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 72e4c19..853c586 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' +ruby '2.3.0' gem 'rails', '4.2.5.2' gem 'rails-i18n' From 8ab2a7658a97dbecabb8ef0a8ca872b664ac35e0 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:40:14 +0200 Subject: [PATCH 26/38] Hound: fix css style --- app/assets/stylesheets/application.css.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 19b50f0..3967c14 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -7,8 +7,9 @@ $navs-bg-color: #080808; $white: #ffffff; $border: #e1e8ed; -[ng\:cloak], [ng-cloak], .ng-cloak { - visibility: hidden!important; +[ng-cloak], +.ng-cloak { + visibility: hidden !important; } body[data-action="devise/sessions-new"], body[data-action="devise/sessions-create"] { From d257ca3c1a70000c019a10ad003df80789067736 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:46:52 +0200 Subject: [PATCH 27/38] Templates: syntax error (missing comma) --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4ef9c7c..0f7501d 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -95,7 +95,7 @@ <%= link_to glyph(:time), - give_time_user_path(@user, offer: post.id) + give_time_user_path(@user, offer: post.id), title: t("global.give_time") %> From dbebf7554d35e64d2227cb1cf9d0e6f49c2071a0 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 07:52:53 +0200 Subject: [PATCH 28/38] Templates: systax errors in movements - wrong conversion to eRB --- app/views/shared/_movements.html.erb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/app/views/shared/_movements.html.erb b/app/views/shared/_movements.html.erb index bbb287e..bdf1cc9 100644 --- a/app/views/shared/_movements.html.erb +++ b/app/views/shared/_movements.html.erb @@ -23,13 +23,11 @@ <% mv.other_side.account.tap do |account| %> <% if account.accountable.present? %> <% if account.accountable_type == "Organization" %> - <%= link_to account, %> - organization_path(account.accountable) - <% end %> + <%= link_to account, + organization_path(account.accountable) %> <% elsif account.accountable.active %> - <%= link_to account.accountable.display_name_with_uid, %> - user_path(account.accountable.user) - <% end %> + <%= link_to account.accountable.display_name_with_uid, + user_path(account.accountable.user) %> <% else %> <%= t(".inactive_user") %> <% end %> @@ -39,8 +37,8 @@ <% end %> - <% if mv.transfer.try(:post).try(:active?) %> - <%= link_to(mv.transfer.post, offer_path(mv.transfer.post)) %> + <% if mv.transfer&.post&.active? %> + <%= link_to mv.transfer.post, offer_path(mv.transfer.post) %> <% else %> <%= mv.transfer.post %> <% end %> @@ -48,11 +46,10 @@ <%= mv.transfer.reason %> <% if mv.transfer.reason.present? && admin? %> - <%= link_to delete_reason_transfer_path(mv.transfer), + <%= link_to glyph(:trash), + delete_reason_transfer_path(mv.transfer), method: :put, - data: { confirm: t(".delete_reason") } do %> - - <% end %> + data: { confirm: t(".delete_reason") } %> <% end %> From d576afd7e2b4f3b1db8e3babcf7edb9f028ddc06 Mon Sep 17 00:00:00 2001 From: Saverio Trioni Date: Tue, 17 May 2016 08:01:01 +0200 Subject: [PATCH 29/38] Templates: syntax error (missing `do`) --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 0f7501d..1318fc0 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -38,7 +38,7 @@ <% end %> <% if admin? || @user != current_user %>
  • - <%= link_to give_time_user_path(@user) %> + <%= link_to give_time_user_path(@user) do %> <%= glyph :time %> <%= t "global.give_time" %> <% end %> From 16356b4a321c347d8b7603791f366a5bef8422f9 Mon Sep 17 00:00:00 2001 From: Sergi Date: Fri, 13 May 2016 16:30:56 +0200 Subject: [PATCH 30/38] css for text wrap --- app/assets/stylesheets/application.css.scss | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 3967c14..d90210e 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -12,6 +12,8 @@ $border: #e1e8ed; visibility: hidden !important; } +*{word-wrap:break-word;} + body[data-action="devise/sessions-new"], body[data-action="devise/sessions-create"] { background: image-url('red.jpg') no-repeat center center fixed; background-size: cover; @@ -50,8 +52,13 @@ body[data-action="devise/sessions-new"], body[data-action="devise/sessions-creat } -.post-description { - white-space: pre-line; +.break-word { + word-wrap:break-word; +} + +.post-description img { + max-width: 60%; + float:left; } #new_transfer { @@ -125,6 +132,10 @@ table.users { margin-bottom: 20px; margin-top: 0; } + + img { + max-width: 100%; + } } } @@ -217,4 +228,11 @@ label[required]::after{ .navbar-form { padding: 0; + background-color:transparent; +} + +form .checkbox input[type="checkbox"] +{ + position:relative; + margin-left:5px; } From 77541a705f5867014b463fdaa292887f709725f1 Mon Sep 17 00:00:00 2001 From: Sergi Date: Fri, 17 Jun 2016 20:02:21 +0200 Subject: [PATCH 31/38] fix text wrap and responsive issues --- app/assets/stylesheets/application.css.scss | 2 - app/views/application/_navbar.html.erb | 61 +++++++----- app/views/inquiries/show.html.erb | 4 +- app/views/offers/show.html.erb | 4 +- app/views/shared/_movements.html.erb | 2 +- app/views/shared/_post.html.erb | 6 +- app/views/users/index.html.erb | 100 ++++++++++---------- app/views/users/show.html.erb | 40 ++++---- 8 files changed, 115 insertions(+), 104 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index d90210e..31127ee 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -12,8 +12,6 @@ $border: #e1e8ed; visibility: hidden !important; } -*{word-wrap:break-word;} - body[data-action="devise/sessions-new"], body[data-action="devise/sessions-create"] { background: image-url('red.jpg') no-repeat center center fixed; background-size: cover; diff --git a/app/views/application/_navbar.html.erb b/app/views/application/_navbar.html.erb index 8e25240..9355c22 100644 --- a/app/views/application/_navbar.html.erb +++ b/app/views/application/_navbar.html.erb @@ -1,39 +1,48 @@
  • diff --git a/app/views/inquiries/show.html.erb b/app/views/inquiries/show.html.erb index ed1551e..7c1bb7a 100644 --- a/app/views/inquiries/show.html.erb +++ b/app/views/inquiries/show.html.erb @@ -1,5 +1,4 @@ -<%= render "shared/post", post: @inquiry %> -

    +

    <% if admin? || @inquiry.user == current_user %> <%= link_to edit_inquiry_path(@inquiry), class: "btn btn-warning" do %> <%= glyph :pencil %> @@ -13,3 +12,4 @@ <% end %> <% end %>

    +<%= render "shared/post", post: @inquiry %> diff --git a/app/views/offers/show.html.erb b/app/views/offers/show.html.erb index 0e858dc..95d9e3a 100644 --- a/app/views/offers/show.html.erb +++ b/app/views/offers/show.html.erb @@ -1,5 +1,4 @@ -<%= render "shared/post", post: @offer %> -

    +

    <% if admin? or @offer.user == current_user %> <%= link_to edit_offer_path(@offer), class: "btn btn-warning" do %> <%= glyph :pencil %> @@ -20,3 +19,4 @@ <% end %> <% end %>

    +<%= render "shared/post", post: @offer %> diff --git a/app/views/shared/_movements.html.erb b/app/views/shared/_movements.html.erb index bdf1cc9..e5a786d 100644 --- a/app/views/shared/_movements.html.erb +++ b/app/views/shared/_movements.html.erb @@ -3,7 +3,7 @@

    <%= t(".movements") %>

    -
    +
    diff --git a/app/views/shared/_post.html.erb b/app/views/shared/_post.html.erb index 1323550..b2d17dd 100644 --- a/app/views/shared/_post.html.erb +++ b/app/views/shared/_post.html.erb @@ -53,7 +53,11 @@ <% end %>
    - <%= m post.description %> +
    +
    + <%= m post.description %> +
    +
    <% unless current_user %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 09b94c0..546e630 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -29,57 +29,59 @@ <% end %> -
    - - - - - - - - - - - <% if current_user.manages? current_organization %> +
    +
    - - ID - - - - - - <%= User.human_attribute_name(:username) %> - - - - - - <%= User.human_attribute_name(:email) %> - - - - - <%= User.human_attribute_name(:phone) %> - - <%= User.human_attribute_name(:alt_phone) %> - - - <%= Account.human_attribute_name(:balance) %> - - - -
    + + + + - <% end %> - - - - <%= render "user_rows", users: @users %> - -
    - - <%= t(".actions") %> + + ID + + +
    + + + <%= User.human_attribute_name(:username) %> + + + + + + + <%= User.human_attribute_name(:email) %> + + + + + + <%= User.human_attribute_name(:phone) %> + + + <%= User.human_attribute_name(:alt_phone) %> + + + + <%= Account.human_attribute_name(:balance) %> + + + + + <% if current_user.manages? current_organization %> + + + <%= t(".actions") %> + + <% end %> + + + + <%= render "user_rows", users: @users %> + + +