From 457dd8e2019630089eb7997b18d1610674f8b325 Mon Sep 17 00:00:00 2001 From: matbgn Date: Wed, 12 Apr 2017 16:26:34 +0200 Subject: [PATCH 1/6] Modified the docker-compose.yml position due to insertion $PWD/config --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index d4f8ec1d4..8433946a5 100644 --- a/docker/README.md +++ b/docker/README.md @@ -332,7 +332,7 @@ OR Copy the previously customized `nginx.conf.example` as `/home/core/fabmanager/config/nginx/fabmanager.conf` if you do not want ssl support (not recommended !). -#### copy docker-compose.yml to /home/core/ +#### copy docker-compose.yml to /home/core/fabmanager #### pull images From 36d7cfe7014d5af7b0febc04ab58187a67cd0e38 Mon Sep 17 00:00:00 2001 From: matbgn Date: Wed, 12 Apr 2017 16:52:41 +0200 Subject: [PATCH 2/6] Fix the way CL are displayed (inline instead of l/l) for db creation --- docker/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/README.md b/docker/README.md index 8433946a5..0454ab43e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -340,9 +340,11 @@ Copy the previously customized `nginx.conf.example` as `/home/core/fabmanager/co #### create/migrate/seed db -`docker-compose run --rm fabmanager bundle exec rake db:create` -`docker-compose run --rm fabmanager bundle exec rake db:migrate` -`docker-compose run --rm fabmanager bundle exec rake db:seed` +```bash +docker-compose run --rm fabmanager bundle exec rake db:create +docker-compose run --rm fabmanager bundle exec rake db:migrate +docker-compose run --rm fabmanager bundle exec rake db:seed +``` #### build assets From 54154b17133e69cb37e328b0dd24082233da3a17 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 16 May 2017 10:23:25 +0200 Subject: [PATCH 3/6] [feature] ability for admins to create users or organizations --- .fabmanager-version | 2 +- CHANGELOG.md | 4 ++++ .../controllers/admin/members.coffee.erb | 9 ++++++++ .../templates/admin/members/new.html.erb | 21 ++++++++++++++++--- config/locales/app.admin.en.yml | 4 +++- config/locales/app.admin.fr.yml | 4 +++- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.fabmanager-version b/.fabmanager-version index 0cadbc1e3..a8758d5c7 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.5.5 +2.5.6-dev diff --git a/CHANGELOG.md b/CHANGELOG.md index c00b1b210..0fdac6d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog Fab Manager +## next release + +- Ability for admins to create users as organizations + ## v2.5.5 2017 May 15 - Fix a bug: New groups does not have their spaces prices initialized diff --git a/app/assets/javascripts/controllers/admin/members.coffee.erb b/app/assets/javascripts/controllers/admin/members.coffee.erb index 14b2c42a9..6e0d2f016 100644 --- a/app/assets/javascripts/controllers/admin/members.coffee.erb +++ b/app/assets/javascripts/controllers/admin/members.coffee.erb @@ -535,6 +535,15 @@ Application.Controllers.controller "NewMemberController", ["$scope", "$state", " $scope.user = plan_interval: '' + ## Callback when the admin check/unckeck the box telling that the new user is an organization. + ## Disable or enable the organization fields in the form, accordingly + $scope.toggleOrganization = -> + if $scope.user.organization + $scope.user.profile = {} unless $scope.user.profile + $scope.user.profile.organization = {} + else + $scope.user.profile.organization = undefined + ## Using the MembersController diff --git a/app/assets/templates/admin/members/new.html.erb b/app/assets/templates/admin/members/new.html.erb index 30c049de1..a4b233c19 100644 --- a/app/assets/templates/admin/members/new.html.erb +++ b/app/assets/templates/admin/members/new.html.erb @@ -9,7 +9,7 @@
-

{{ 'add_a_member' }}

+

{{ 'members_new.add_a_member' }}

@@ -33,8 +33,23 @@
-
-
+
+
+ +
+
+
+ + +
+
+
+ diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 9619e9aa7..5d797a7f2 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -410,7 +410,9 @@ en: members_new: # add a member - add_a_member: "Add a member" + members_new: + add_a_member: "Add a member" + user_is_an_organization: "User is an organization" members_edit: # edit a member diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index fe99bd355..7a12737db 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -410,7 +410,9 @@ fr: members_new: # ajouter un membre - add_a_member: "Ajouter un membre" + members_new: + add_a_member: "Ajouter un membre" + user_is_an_organization: "L'utilisateur est une structure" members_edit: # modifier un membre From 7960964aed8d402d38cc3a385dce129ad08f8119 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 16 May 2017 10:44:52 +0200 Subject: [PATCH 4/6] set organization name in invoice object, if any (#64) --- CHANGELOG.md | 1 + app/pdfs/pdf/invoice.rb | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fdac6d99..06698da03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## next release - Ability for admins to create users as organizations +- Invoices object will contain the organization name if any (#64) ## v2.5.5 2017 May 15 diff --git a/app/pdfs/pdf/invoice.rb b/app/pdfs/pdf/invoice.rb index 9913d0b4c..0c6323985 100644 --- a/app/pdfs/pdf/invoice.rb +++ b/app/pdfs/pdf/invoice.rb @@ -53,8 +53,10 @@ module PDF # user/organization's information if invoice&.user&.profile&.organization name = invoice.user.profile.organization.name + full_name = "#{name} (#{invoice.user.profile.full_name})" else name = invoice.user.profile.full_name + full_name = name end if invoice&.user&.profile&.organization&.address @@ -66,6 +68,7 @@ module PDF end text_box "#{name}\n#{invoice.user.email}\n#{address}", :at => [bounds.width - 130, bounds.top - 49], :width => 130, :align => :right, :inline_format => true + name = full_name # object move_down 25 @@ -78,18 +81,18 @@ module PDF else case invoice.invoiced_type when 'Reservation' - object = I18n.t('invoices.reservation_of_USER_on_DATE_at_TIME', USER:invoice.user.profile.full_name, DATE:I18n.l(invoice.invoiced.slots[0].start_at.to_date), TIME:I18n.l(invoice.invoiced.slots[0].start_at, format: :hour_minute)) + object = I18n.t('invoices.reservation_of_USER_on_DATE_at_TIME', USER:name, DATE:I18n.l(invoice.invoiced.slots[0].start_at.to_date), TIME:I18n.l(invoice.invoiced.slots[0].start_at, format: :hour_minute)) invoice.invoice_items.each do |item| if item.subscription_id subscription = Subscription.find item.subscription_id - object = "\n- #{object}\n- #{(invoice.is_a?(Avoir) ? I18n.t('invoices.cancellation')+' - ' : '') + subscription_verbose(subscription, invoice.user)}" + object = "\n- #{object}\n- #{(invoice.is_a?(Avoir) ? I18n.t('invoices.cancellation')+' - ' : '') + subscription_verbose(subscription, name)}" break end end when 'Subscription' - object = subscription_verbose(invoice.invoiced, invoice.user) + object = subscription_verbose(invoice.invoiced, name) when 'OfferDay' - object = offer_day_verbose(invoice.invoiced, invoice.user) + object = offer_day_verbose(invoice.invoiced, name) else puts "ERROR : specified invoiced type (#{invoice.invoiced_type}) is unknown" end @@ -324,7 +327,7 @@ module PDF def subscription_verbose(subscription, user) subscription_start_at = subscription.expired_at - subscription.plan.duration duration_verbose = I18n.t("duration.#{subscription.plan.interval}", count: subscription.plan.interval_count) - I18n.t('invoices.subscription_of_NAME_for_DURATION_starting_from_DATE', NAME: user.profile.full_name, DURATION: duration_verbose, DATE: I18n.l(subscription_start_at.to_date)) + I18n.t('invoices.subscription_of_NAME_for_DURATION_starting_from_DATE', NAME: user, DURATION: duration_verbose, DATE: I18n.l(subscription_start_at.to_date)) end def offer_day_verbose(offer_day, user) From 8531168ba2e7a5f964919a25ac6aa8662496d288 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 17 May 2017 12:18:20 +0200 Subject: [PATCH 5/6] improve RSS with project author and image + event dates image and category --- CHANGELOG.md | 1 + app/views/rss/events/index.xml.builder | 12 ++++++++++-- app/views/rss/projects/index.xml.builder | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06698da03..23d6b7228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Ability for admins to create users as organizations - Invoices object will contain the organization name if any (#64) +- RSS feeds will return more data about events and projects, especially images ## v2.5.5 2017 May 15 diff --git a/app/views/rss/events/index.xml.builder b/app/views/rss/events/index.xml.builder index bb5653122..b0a1942c6 100644 --- a/app/views/rss/events/index.xml.builder +++ b/app/views/rss/events/index.xml.builder @@ -1,7 +1,7 @@ #encoding: UTF-8 xml.instruct! :xml, version: '1.0' -xml.rss version: '2.0' do +xml.rss version: '2.0', 'xmlns:xCal' => 'urn:ietf:params:xml:ns:xcal' do xml.channel do xml.title "#{t('app.public.events_list.the_fablab_s_events')} - #{@fab_name}" xml.description t('app.public.home.fablab_s_next_events') @@ -12,10 +12,18 @@ xml.rss version: '2.0' do @events.each do |event| xml.item do xml.guid event.id - xml.pubDate event.created_at.strftime('%F %T') + xml.pubDate event.created_at.strftime('%FT%T%:z') xml.title event.name xml.link root_url + '#!/events/' + event.id.to_s xml.description event.description + xml.xCal :dtstart do + xml.text! event.availability.start_at.strftime('%FT%T%:z') + end + xml.xCal :dtend do + xml.text! event.availability.end_at.strftime('%FT%T%:z') + end + xml.enclosure url: root_url + event.event_image.attachment.large.url, length: event.event_image.attachment.large.size, type: event.event_image.attachment.content_type if event.event_image + xml.category event.category.name end end end diff --git a/app/views/rss/projects/index.xml.builder b/app/views/rss/projects/index.xml.builder index bc7ac0c92..2854c4d5e 100644 --- a/app/views/rss/projects/index.xml.builder +++ b/app/views/rss/projects/index.xml.builder @@ -15,8 +15,9 @@ xml.rss version: '2.0' do xml.pubDate project.created_at.strftime('%F %T') xml.title project.name xml.link root_url + '#!/projects/' + project.slug - xml.author project.author.first_name + xml.author project.author.profile.full_name xml.description project.description + xml.enclosure url: root_url + project.project_image.attachment.large.url, length: project.project_image.attachment.large.size, type: project.project_image.attachment.content_type if project.project_image end end end From 9297376ad344fe876cffb703f7fafbc84b5201dc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 18 May 2017 10:37:41 +0200 Subject: [PATCH 6/6] Version 2.5.6 --- .fabmanager-version | 2 +- CHANGELOG.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.fabmanager-version b/.fabmanager-version index a8758d5c7..da6b0a8f1 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.5.6-dev +2.5.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 23d6b7228..d8c2c8ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # Changelog Fab Manager -## next release +## v2.5.6 2017 May 18 - Ability for admins to create users as organizations - Invoices object will contain the organization name if any (#64) - RSS feeds will return more data about events and projects, especially images +- Improved Docker documentation (#65) ## v2.5.5 2017 May 15