aboutsummaryrefslogtreecommitdiffstats
path: root/app/decorators
AgeCommit message (Collapse)Author
2018-06-01Refs #6955 Small update on some decorators to fix data-confirm display bug6955-translations-fixescedricnjanga
2018-06-01Refs #6955 Add some new translationscedricnjanga
2018-05-28Refs #6955; Fix I18n in decorators.Zog
2018-05-28Refs #6955 Add new translation + custom delete confirmation modalcedricnjanga
2018-05-23Merge pull request #544 from af83/6860-stop-point-show-linkLuc Donnet
Refs #6860 Change StopPoint show link to stop_area_referential_stop_a…
2018-05-03Refs #6921; Show "Unarchive" action in referentials listZog
2018-04-30Refs #6860 Change StopPoint show link to stop_area_referential_stop_area_pathcedricnjanga
2018-04-27Refs #6572; Fix referentials policiesZog
2018-04-19Refs #6574 Create decorators to handle sync actions for stop area ↵6574-sync-actions-in-decoratorscedricnjanga
referential and line referential
2018-04-17Lines#index: Remove 'new' link in cog menu6506-lines-index--remove-new-line-link-from-cog-menu--rb2018Teddy Wing
We had been adding a 'new line' link in this menu below 'show' and 'edit'. But having this link here doesn't make any sense because the menu refers to a single object. Must have slipped through the cracks in the new decorator conversion. Refs #6506
2018-04-10Refs #6426; Disable "Create opposite route" action instead of hiding itZog
2018-04-04Refs 6226; Add a button to create opposite routesZog
2018-03-29Refs #6156 Update Referential english translationcedricnjanga
2018-03-12Refs #6133; First Crud for exportsZog
2018-03-12Refs #6133; Fix specsZog
2018-03-09Refs #5934 Remove destructive action links for route stop points in Routes#showcedricnjanga
2018-03-09Refs #5934 Only display stop point action links if user has policycedricnjanga
2018-02-20Refs #5863 @6h; Remove workbench id from the querystringZog
Infer it when possible, and use a nested otherwise
2018-02-14ImportResourcesDecorator: Fix `Draper::UninferrableDecoratorError`Teddy Wing
We were getting this error: Draper::UninferrableDecoratorError in ImportResources#index Showing .../stif-boiv/app/views/import_resources/index.html.slim where line #14 raised: Could not infer a decorator for ActiveRecord::Base. Extracted source (around line #14): span.status_icon = import_status(@import.status) span = t('.table_state', lines_imported: @import_resources.lines_imported , lines_in_zipfile: @import_resources.lines_in_zipfile ) - if @import_resources.present? .col-lg-12 h2 = t('.table_title') .col-lg-12 Rails.root: .../stif-boiv Application Trace | Framework Trace | Full Trace app/views/import_resources/index.html.slim:14:in `_app_views_import_resources_index_html_slim___3139942318249059519_70240694466080' when visiting this page: http://stif-boiv.dev:3000/workbenches/1/imports/18/import_resources Fix the error by inheriting from `AF83::Decorator` and having it take care of things. We don't have any other model decorators that don't inherit from `AF83::Decorator`, so this shouldn't be a problem any more. Refs #5926
2018-02-12Refs #5150; Update decoratorsZog
2018-02-12Merge pull request #292 from af83/5709_fix_ccset_sortingJohan Van Ryseghem
5709 fix ccset sorting
2018-02-07Refs #5709 Fix CCSet index table builder sorting & add show button in gear ↵5709_fix_ccset_sortingcedricnjanga
menu link
2018-02-06Refs #5830; Fix RouteDecorator's duplicate actionZog
2018-02-06Fix broken TimeTableDecoratorZog
2018-02-06Refs ##5370 Set network action_link to disabled if line doesn't have onecedricnjanga
2018-02-02Refs #5830; Fix RouteDecorator's duplicate action5830-fix-route-duplication-buttonZog
2018-02-01Fix broken TimeTableDecoratorZog
2018-01-31Fix calendar mailer urlcedricnjanga
2018-01-31First draft for including calendars into workgroup for having appropriate ↵cedricnjanga
scoping
2018-01-31Refs #5683 @2H; Fix specs and refactor action_linksZog
Note: Did not fix the missing workgroup in the calendar mailer
2018-01-30Refs ##5370 Set network action_link to disabled if line doesn't have onecedricnjanga
2018-01-25ComplianceControlSetDecorator: Remove unnecessary `href`sTeddy Wing
Johan pointed out (https://github.com/af83/stif-boiv/commit/cd2892277df0af1e1eaf2373adf0068a77f07a6e) that these `href`s aren't needed as the action links decorator will infer them automatically. Refs #5586
2018-01-25ImportResources#index: Get rid of `ImportResourceDecorator`Teddy Wing
Seems like the object decorator for `ImportResource` isn't needed here. It doesn't contain anything except for an empty `action_links` method, which I'm guessing was to appease the table builder which used to expect one. Get rid of that decorator because it doesn't seem to be needed. Also get rid of the `links` argument to the table builder because we don't need it any more with the new action links interface. Refs #5586
2018-01-25ComplianceCheckSets#executed: Don't decorate `ComplianceCheck`sTeddy Wing
No action links are used on these objects and the decorator isn't being used for anything else. Seems to me like this collection doesn't need to be decorated at all. Get rid of the decorator. Add a `decorates` to `ComplianceCheckSetDecorator` because http://stif-boiv.dev:3000/workbenches/1/compliance_check_sets/14/executed causes an uninferrable thing error. Refs #5586
2018-01-25ComplianceCheckSetDecorator: Convert to new action links interfaceTeddy Wing
Refs #5586
2018-01-25ComplianceControlDecorator: Convert to new action links interfaceTeddy Wing
* Decorate the `ComplianceControl` so we can show the action links from the decorator in the header. * Add a `decorates` to get `object_class` to work inside the decorator. * Define `AF83::Decorator.define_instance_class_method` in order to enable the `@compliance_control.class.METHOD` calls in the view to work. Thanks very much to Johan for figuring out a way to do that. Refs #5586
2018-01-25ComplianceControlDecorator: Convert to new action links interfaceTeddy Wing
I was getting this error: ActionView::Template::Error (undefined method `split' for nil:NilClass Did you mean? split_all): 16: 17: / compliance controls without block 18: = render_compliance_control_block 19: = render_compliance_controls(@direct_compliance_controls) 20: 21: / compliance controls with block 22: - if params[:q] && params[:q][:compliance_control_block_id_eq_any].try(:present?) app/helpers/table_builder_helper.rb:110:in `item_row_class_name' app/helpers/table_builder_helper.rb:290:in `tbody' app/helpers/table_builder_helper.rb:97:in `table_builder_2' app/helpers/compliance_control_sets_helper.rb:79:in `block in render_table_builder' app/helpers/compliance_control_sets_helper.rb:78:in `render_table_builder' app/helpers/compliance_control_sets_helper.rb:71:in `block (2 levels) in render_compliance_controls' app/helpers/compliance_control_sets_helper.rb:70:in `block in render_compliance_controls' app/helpers/compliance_control_sets_helper.rb:69:in `render_compliance_controls' app/views/compliance_control_sets/show.html.slim:19:in `_app_views_compliance_control_sets_show_html_slim___3528509151208629266_70279137561480' The model name wasn't accessible from the view because this collection is set up in an unorthodox way without a decorated collection. Got help from Johan, and we ended up using the `model` param passed into the table builder for this. It looks terrible with `model` all over the place, but at least it gets us past the problem. Refs #5586
2018-01-25ComplianceControlSetDecorator: Convert to new action links interfaceTeddy Wing
Refs #5586
2018-01-25ImportDecorator: Fix `#import_status_css_class`Teddy Wing
When I converted this decorator to use the new action links interface, I inadvertently broke this decorated method. This caused the http://stif-boiv.dev:3000/workbenches/1/imports/1 page to break. Fix it by using the `define_instance_method` in `AF83::Decorator`. Refs #5586
2018-01-25StopPointDecorator: Convert to new action links interfaceTeddy Wing
Subtleties were that the links need to reference `StopArea`s. In particular, the `edit` link goes to the `StopAreaReferential` path instead of the referential-StopArea path. Refs #5586
2018-01-25StopAreaDecorator: Convert to new action links interfaceTeddy Wing
Refs #5586
2018-01-25AF83::Decorator::Link: Delete `#default_class`Teddy Wing
This method was overriding classes that were added by `#add_class` in addition to those added by `#class`. Obviously, the argument to `#add_class` should be appended to the default. That seemed like a pain to do, so instead I'm getting rid of the concept of a default class. Instead, we're going to force all links to use the template-defined styles for now. That goes in line with Luc's desire to be more consistent in the links, as he stated yesterday. Refs #5586
2018-01-25ReferentialNetworkDecorator: Make 'edit' button primaryTeddy Wing
Move the "Edit" button on the ReferentialNetworks#show page to the top right and make it white (a "primary" link) to make it consistent with other pages. Refs #5586
2018-01-25PurchaseWindowDecorator: Convert to new action links interfaceTeddy Wing
Also add a new method `AF83::Decorator.define_instance_method`. Thanks to Johan for suggesting that and walking me through writing it. This new method allows us to define methods on the instance decorator. We need this to preserve the `#bounding_dates` method that was defined in `PurchaseWindowDecorator`. Refs #5586
2018-01-25RoutingConstraintZoneDecorator: Convert action links to new interfaceTeddy Wing
Refs #5586
2018-01-25ReferentialLineDecorator: Convert action links to new interfaceTeddy Wing
Refs #5586
2018-01-25RouteDecorator: Convert to new action links interfaceTeddy Wing
Important to add the `action: :index` argument on the table builder in the `ReferentialLines#show` page so that the gear menu links render correctly. Refs #5586
2018-01-25ReferentialNetworkDecorator: Convert to new action links interfaceTeddy Wing
Need to add a `collection_name` method to `ReferentialNetworksController` because `ApplicationController#decorated_collection` can't infer the `Network` model from the controller name. Refs #5586
2018-01-25NetworkDecorator: Convert to new action links interfaceTeddy Wing
And remove the "create" link from the gear menu and header links of the :show page because it didn't make sense there. Leave a "create" link on the index page though. Refs #5586
2018-01-25ImportDecorator: Convert to new action links interfaceTeddy Wing
Also remove the `delete` link because the policy disables it for everyone (3f5ac4764b859f97f776df565599e312b4584a03, 17e946771afcff10b6165dd3a97b38aa9c06b1f2). Refs #5586