You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some refactors could be had here. We basically got 5 places where thumbnail generation happens (communities, items, theses, draft items and draft theses). Some are done in the model, others done in the view. Lots of repeated code across the application.
Be nice if we could DRY up a lot of this duplicated code (maybe move it into a concern/helper etc?). Or just reevaluating what this code does and why we need it in the model etc? Maybe we can all share the same thumbnail partial everywhere?
The text was updated successfully, but these errors were encountered:
Noticed this when working on this issue: #982.
Some refactors could be had here. We basically got 5 places where thumbnail generation happens (communities, items, theses, draft items and draft theses). Some are done in the model, others done in the view. Lots of repeated code across the application.
These two views for example are exactly the same:
https://github.com/ualbertalib/jupiter/blob/c88f89cabb034deac19f0872c1d41e4d2ea4103b/app/views/admin/theses/draft/_thumbnail.html.erb
https://github.com/ualbertalib/jupiter/blob/c88f89cabb034deac19f0872c1d41e4d2ea4103b/app/views/items/draft/_thumbnail.html.erb
These code blocks are pretty similar:
jupiter/app/models/community.rb
Lines 32 to 37 in c88f89c
jupiter/app/models/concerns/draft_properties.rb
Lines 48 to 59 in c88f89c
jupiter/app/models/concerns/item_properties.rb
Lines 62 to 73 in c88f89c
Be nice if we could DRY up a lot of this duplicated code (maybe move it into a concern/helper etc?). Or just reevaluating what this code does and why we need it in the model etc? Maybe we can all share the same thumbnail partial everywhere?
The text was updated successfully, but these errors were encountered: