Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
85cd87f
added title option, fixed images without light resizer, small sequel …
Feb 20, 2018
3085735
fixed template service
Feb 22, 2018
4d81e3c
reverted error
Feb 22, 2018
dc313c9
fixed bug with other forms
Feb 22, 2018
85e63c8
updated url host options
Feb 27, 2018
a7fe057
another possible route fix
Feb 27, 2018
03ed63f
fixed header without url
Jul 25, 2018
fe231c4
sequel pagination and search fixes
Sep 13, 2018
acf9833
fixed pagination
Sep 20, 2018
5aa50b9
fixed save for sequel with many_to_many
Sep 21, 2018
5a367b3
removed buttons from form, added empty wrapper
Sep 28, 2018
ad7b178
fix spaces bug
Oct 3, 2018
c9ced0b
fix email and password autocomplete
Oct 4, 2018
9101937
added loader
Oct 9, 2018
96503c4
fixed bug with loader
Oct 11, 2018
04dfb9f
fix gallery bug
Oct 16, 2018
5c399b7
fix error message
Oct 18, 2018
823af34
feature: added opportunity to add url params to links
Oct 24, 2018
9fd3bb8
fixed success popup
Oct 26, 2018
7a30f87
fix generate params to additional attrs
Oct 30, 2018
3e1659a
fixed with work and validation
Nov 13, 2018
9732dbc
added functionality for sort images
Nov 30, 2018
7f4dc51
fixed bug with gallery
Nov 30, 2018
83cd080
Add forgot password functionality
andrey-abramow Dec 3, 2018
947a49b
fixed styles priorities
Dec 4, 2018
db424ba
added can can implimintation
Dec 5, 2018
fde414c
Add reset password redirects
andrey-abramow Dec 6, 2018
dfd3c75
Refactor: remove deprecations
andrey-abramow Dec 6, 2018
97150d4
Add translations, refactoring
andrey-abramow Dec 7, 2018
06ecc37
Refactor: remove logs, slight style fixes
andrey-abramow Dec 7, 2018
f1e1a8a
Refactor: remove depr TODO
andrey-abramow Dec 7, 2018
310a084
Add mail_from to config
andrey-abramow Dec 7, 2018
216dd5b
Merge pull request #77 from Rademade/feature/forgot_password
Praffesor Dec 7, 2018
eca14ca
Refactor: rename password token
andrey-abramow Dec 7, 2018
e6162fb
Merge pull request #78 from Rademade/feature/forgot_password
Praffesor Dec 7, 2018
f2463d0
added ability duplication variants
Dec 12, 2018
ee2c209
fixed autoloading
Dec 13, 2018
1c243de
fixed route reloading
Dec 13, 2018
c45254b
fix module names
Dec 17, 2018
fb2d1dc
moved lib to services for autoloading, gallery relation fix
Dec 17, 2018
d853016
admin panel fix
Dec 18, 2018
f1027f6
fixed mailer
Dec 18, 2018
2a39bcb
fixed abilities
Dec 20, 2018
f5c605f
renamed version file and increased version to 0.4
Dec 26, 2018
991a523
fixed autocomplete routing
Dec 26, 2018
5bd5df9
added hint for duplication button
Dec 26, 2018
b995f8d
updated inputs for editable and destroyable
Jan 23, 2019
429dcff
fixed validation errors
Feb 1, 2019
4f7e723
added stable version jquery-flot
Feb 2, 2019
51d4328
Revert "added stable version jquery-flot"
Feb 2, 2019
c0cedab
/sequel: Auto stash before revert of "added stable version jquery-flot"
Feb 2, 2019
a4e824c
renamed gallery manager service
Feb 5, 2019
21ec768
fixed related select
Feb 5, 2019
102647c
fixed bugs
Feb 7, 2019
f9735b8
fixes for ability
Feb 11, 2019
491232a
fixes for abilities
Feb 12, 2019
18cc284
fixed add new(abilities)
Feb 13, 2019
4e0399c
added more info for links in header of page
Mar 5, 2019
43bfbb8
changed limit
Mar 14, 2019
50f5d4e
added availabilty to hide index tab for form
Apr 9, 2019
37c745e
updated content cancel behaviour
Apr 10, 2019
d60d7a6
fixed bug with delete icon
May 9, 2019
a757f9e
fixed versions
May 30, 2019
44131b4
fixed bug for disabling field
Jun 5, 2019
98eae60
fixed sortable
Jun 7, 2019
7d6c6e1
added redirect url for logged out users
Jun 12, 2019
f151d59
fixed bug with object checking
Jun 12, 2019
67126ce
fix bug with relation
Aug 6, 2019
48a1e3a
fixed picture upload
Aug 8, 2019
e0804a5
Add search_params for autocomplete field
andrey-abramow Aug 21, 2019
35df5cc
Merge remote-tracking branch 'origin/feature/sequel-autocomplete-quer…
Nov 28, 2019
cdd30a9
added event select2:select
Nov 28, 2019
21725e6
fixed event select2:select
Feb 6, 2020
57b9eea
fixed sequel validation
Feb 24, 2020
573cfd8
fixed sequel validation
Feb 24, 2020
e3ed8f6
Added ability to hide buttons on bottom
Jul 17, 2020
5799c20
Added clean validation after change value
Sep 24, 2020
f49fde4
Add regex escape for regex filter
Oct 7, 2020
d90d58d
Fixed destroyable for relation
Oct 21, 2020
f1c46cb
Fix save for to many relations
Nov 13, 2020
5860630
fixed validation scroll
Nov 17, 2020
6857b7a
Added loader
Jan 4, 2021
c54a0fe
Possible fix of ancestors for string
Jan 4, 2021
7314ef0
improved file upload
Feb 9, 2021
a14bdb9
added simple styling for files
Feb 11, 2021
33a6217
added error display for gallery image upload
Mar 16, 2021
646bf39
fixed file size error for file uploader
Mar 23, 2021
8a70f63
added rerender for empty content items
Mar 29, 2021
64a105f
added additional class names to list
Apr 19, 2021
ffdfaa9
removed turbolinks
Apr 20, 2021
0ca8f4d
save gallery only on save
Apr 22, 2021
ac25512
removed gallery routes
Apr 22, 2021
8108596
removed crop
Apr 22, 2021
02b7034
fixed empty gallery
Apr 23, 2021
6a72330
fixed validation of gallery images
May 14, 2021
7020c1d
Merge pull request #81 from Rademade/feature/sequel-gallery
Praffesor May 26, 2021
126bc5b
added option to disable sort on index
May 26, 2021
b6eaccb
fixed input html options, added mini toolbar to ckeditor
Jun 7, 2021
7d06c64
fixed link urls
Jun 25, 2021
33b9559
fixed ckeditor for not created records
Jun 29, 2021
15db5f4
added access field checks to list
Jul 6, 2021
45be11a
added correct options to file preview
Jul 9, 2021
bf65363
fixed sort on the list after edit
Jul 15, 2021
5c16b0d
fixed styles for discard button
Aug 3, 2021
c56164f
added additional form params
Aug 9, 2021
ab8c9ca
added model to delete button
Aug 11, 2021
2d3a23c
added id to remove button
Aug 11, 2021
b0bb65a
added menu link params
Aug 11, 2021
6ffb652
fixed xss attacks in selects and notifications
Sep 2, 2021
3aab7c0
added gallery error image configuration
Sep 7, 2021
9759ce8
fixed extra error messages
Dec 13, 2021
e188765
added conditional store for gallery image
Jan 5, 2022
ddef22a
fixed bowerfile paths
Jan 11, 2022
854311c
removed extra base64
Jan 11, 2022
404fc07
small fix
Jan 12, 2022
58173b3
fixed empty full url
Jan 14, 2022
19b3726
fixed to many setter
Jan 14, 2022
5cf5853
fix gallery sortable
Praffesor May 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions Bowerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
assets_path 'assets/javascript'

asset 'underscore'
asset 'backbone'
asset 'backbone-notifier', :github => 'ewebdev/backbone.notifier#v0.2.4'
asset 'underscore', '1.9.1'
asset 'backbone', '1.4.0'
asset 'backbone-notifier', 'https://github.com/ewebdev/backbone.notifier.git#v0.2.4'

asset 'wysihtml5', :github => 'xing/wysihtml5'
asset 'leaflet'
asset 'wysihtml5', 'https://github.com/xing/wysihtml5.git'
asset 'leaflet', '1.0.0'

# jQuery
asset 'data-tables', :github => 'DataTables/DataTables'
asset 'flot', :github => 'flot/flot'
asset 'knob', :github => 'aterrien/jQuery-Knob'
asset 'uniform', :github => 'AudithSoftworks/Uniform'
asset 'jquery-ui', :github => 'jquery/jquery-ui#1.11.4'
asset 'jquery-filthypillow', :github => 'Rademade/jquery.filthypillow#master'
asset 'magnific-popup', :github => 'dimsemenov/Magnific-Popup'
asset 'touch-punch', :github => 'furf/jquery-ui-touch-punch'
asset 'data-tables', 'https://github.com/DataTables/DataTables.git#1.10.19'
asset 'flot', '0.8.3'
asset 'knob', 'https://github.com/aterrien/jQuery-Knob.git#1.2.13'
asset 'uniform', 'https://github.com/AudithSoftworks/Uniform.git'
asset 'jquery-ui', 'https://github.com/jquery/jquery-ui.git#1.11.4'
asset 'jquery-filthypillow', 'https://github.com/Rademade/jquery.filthypillow.git#master'
asset 'magnific-popup', 'https://github.com/dimsemenov/Magnific-Popup.git'
asset 'touch-punch', 'https://github.com/furf/jquery-ui-touch-punch.git'
asset 'jquery-ujs'

# Images
asset 'jcrop', :github => 'tapmodo/Jcrop#v0.9.12'
asset 'jquery-fileupload', :github => 'blueimp/jQuery-File-Upload'
asset 'jcrop', 'https://github.com/tapmodo/Jcrop.git#v0.9.12'
asset 'jquery-fileupload', 'https://github.com/blueimp/jQuery-File-Upload.git#v9.12.6'

# List
asset 'TableDnD'
asset 'TableDnD', '0.9.2'

# Form
asset 'moment'
asset 'jquery-form', :github => 'malsup/form'
asset 'jquery-serialize', :github => 'macek/jquery-serialize-object'
asset 'jquery-formrestrict', :github => 'treyhunner/jquery-formrestrict'
asset 'jquery-validation', :github => 'jzaefferer/jquery-validation#v1.13.1'
asset 'moment', '2.24.0'
asset 'jquery-form', 'https://github.com/malsup/form.git#v4.0.0'
asset 'jquery-serialize', 'https://github.com/macek/jquery-serialize-object.git'
asset 'jquery-formrestrict', 'https://github.com/treyhunner/jquery-formrestrict.git'
asset 'jquery-validation', 'https://github.com/jzaefferer/jquery-validation.git#v1.13.1'

#Thead
asset 'floatThead', :github => 'mkoryak/floatThead'
asset 'floatThead', 'https://github.com/mkoryak/floatThead.git'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

group :test do
gem 'coveralls', :require => false
gem 'ckeditor', '~> 4.0'

# Uploaders
gem 'carrierwave'
Expand Down
12 changes: 12 additions & 0 deletions app/assets/javascripts/app/common/helpers.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
window.RademadeAdmin = {
helpers: {
stripScripts: (string) ->
div = document.createElement('div')
div.innerHTML = string
scripts = div.getElementsByTagName('script')
i = scripts.length
while i--
scripts[i].parentNode.removeChild scripts[i]
div.innerHTML
}
}
8 changes: 0 additions & 8 deletions app/assets/javascripts/app/common/turboform.coffee

This file was deleted.

7 changes: 6 additions & 1 deletion app/assets/javascripts/app/common/uploader.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ class @Uploader extends Backbone.View
@showLoader()
$form.submit().done @updateUploader
always : @hideLoader
fail : (event, data) ->
errorMessage = data?._response?.jqXHR?.responseJSON?.error
window.notifier.notify(errorMessage) if errorMessage

updateUploader : (result) =>
@$el.find('[data-preview-item]').replaceWith(result.html)
@$el.find('.upload-holder.hide').removeClass('hide')
@$hidden.val(result.file.url)
@$hidden.change()
ImagePreview.initPlugin()

showLoader : () ->
Expand All @@ -38,6 +42,7 @@ class @Uploader extends Backbone.View
@$el.find('.upload-holder:has([data-preview-item])').fadeOut 300, () ->
$(this).addClass('hide').show()
@$hidden.val('')
@$hidden.change()

_getUploaderData : () ->
uploaderData = _.pick @$uploader.data(), 'id', 'model', 'column', 'uploader'
Expand All @@ -63,4 +68,4 @@ class @Uploader extends Backbone.View
@initAll()

$ ->
$(document).on 'page:load ready init-plugins', Uploader.initPlugin
$(document).on 'page:load ready init-plugins', Uploader.initPlugin
4 changes: 2 additions & 2 deletions app/assets/javascripts/app/common/url-visitor.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
initUrlVisit = () ->
$('[data-link-url]').click () ->
Turbolinks.visit $(this).data('linkUrl')
window.location.href = $(this).data('linkUrl')

$ ->
$(document).on 'ready page:load init-plugins', initUrlVisit
$(document).on 'ready page:load init-plugins', initUrlVisit
30 changes: 0 additions & 30 deletions app/assets/javascripts/app/compatibility/turbolinks.coffee

This file was deleted.

55 changes: 37 additions & 18 deletions app/assets/javascripts/app/content/view.coffee
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
class @Content extends Backbone.View

renderItemFromUrl : (url, cb) ->
isLoadingContentItem = false

renderItemFromUrl : (url, cb, urlData = {}) ->
return if isLoadingContentItem
return if url == ''
$(document).trigger 'before-content-render'
@_updateHistory(url)
$.get url, layout : false, (html) =>
$('#loader').removeClass('hide')
isLoadingContentItem = true
$.get url, _.extend(urlData, layout : false), (html) =>
$contentItem = $(html)
$('[data-content]').append $contentItem
$(window).scrollTop(0)
$(document).trigger 'init-plugins'
@bindClick $contentItem
cb($contentItem) if cb
isLoadingContentItem = false
$('#loader').addClass('hide')

renderModel : (model) ->
renderModel : (model, urlData = {}) ->
@renderItemFromUrl model.get('editurl'), ($contentItem) =>
$contentItem.find('form').on 'ajax-submit-done', (e, response) =>
model.update response.data
$contentItem.remove()
, urlData

moveToPreviousContentItem : () ->
@moveToContentItem $('[data-content-item]:nth-last-child(2)')

moveToContentItem : ($contentItem) ->
return if $contentItem.is(':last-child')
$contentItem.nextAll('[data-content-item]').remove()
if $contentItem.is(':first-child')
@renderItemFromUrl $contentItem.data('contentItem'), () ->
$contentItem.remove()
if $contentItem.length is 0
window.history.back() if window.history.length > 2
else
$contentItem.nextAll('[data-content-item]').remove()
if $contentItem.is(':first-child') || !$contentItem.has('.content-data').length
@renderItemFromUrl $contentItem.data('contentItem'), () ->
$contentItem.remove()

bindClick : ($el) ->
$el.find('[data-content-header]').bind 'click', (e) =>
Expand All @@ -34,27 +45,35 @@ class @Content extends Backbone.View
@renderItemFromUrl $(e.currentTarget).data('contentUrl')
false
$el.find('[data-content-close]').bind 'click', (e) =>
@moveToContentItem $(e.currentTarget).closest('[data-content-item]').prev()
$contentItem = $(e.currentTarget).closest('[data-content-item]')
$prevContentItem = $contentItem.prev()
if $prevContentItem.length is 0
@moveToContentItem $contentItem
else
@moveToContentItem $prevContentItem

bindDocumentClick : () =>
@bindClick($(document))

bindHistoryBack : () ->
$(window).bind 'popstate', (e) ->
state = e.originalEvent.state
window.location.href = state.url if state.url
window.location.reload()

_updateHistory : (url) ->
if history.pushState isnt undefined and $('[data-content-header]').length < 2
history.pushState url : url, document.title, url

@init : () ->
content = new Content()
content = new this()
content.bindHistoryBack()
content.bindDocumentClick()
content

@initInstance : () =>
window.ContentInstance = @init()

@getInstance : () ->
instance = null
do () ->
instance ||= Content.init()
window.ContentInstance

$ ->
$(document).on 'page:load ready', () ->
Content.getInstance().bindClick $(document)
$ ->
$(document).on 'page:load ready', Content.initInstance
5 changes: 5 additions & 0 deletions app/assets/javascripts/app/forms/forgot-password-form.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(document).on 'ready page:load', ->

$('#forgot-password-form').on
'ajax-submit-done': (e, data) ->
$(e.currentTarget).html(data.template)
6 changes: 5 additions & 1 deletion app/assets/javascripts/app/forms/login.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
$(document).on 'ready page:load', ->

$('#login-form').on
'ajax-submit-done': -> window.location.reload()
'ajax-submit-done': (event, data) ->
if data.redirect_url && typeof data.redirect_url is 'string'
window.location.href = data.redirect_url
else
window.location.reload()
5 changes: 5 additions & 0 deletions app/assets/javascripts/app/forms/reset-password-form.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(document).on 'ready page:load init-plugins', ->

$('#reset-password-form').on
'ajax-submit-done': (e) ->
window.location.reload()
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ class @GalleryImageCollectionView extends Backbone.View
@_initImage $(image)

initSort : () ->
sortUrl = @$el.data('sortableUrl')
if sortUrl
@images.setSortUrl sortUrl
@$el.sortable
stop : () =>
@images.sort @_getSortedImages()
@$el.sortable() if @$el.data('sortable') && @$el.sortable

addImage : ($image) ->
@_initImage $image
Expand All @@ -32,4 +27,4 @@ class @GalleryImageCollectionView extends Backbone.View
el : $el
collectionView.initImages className
collectionView.initSort()
collectionView
collectionView
12 changes: 0 additions & 12 deletions app/assets/javascripts/app/gallery/image/collection.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,3 @@ class @GalleryImageCollection extends Backbone.Collection

getClassName : () ->
@className

setSortUrl : (sortUrl) ->
@sortUrl = sortUrl

sort : (images) ->
$.ajax
type : 'patch'
url : @sortUrl
data :
class_name : @className
images : images
dataType : 'json'
15 changes: 3 additions & 12 deletions app/assets/javascripts/app/gallery/image/model.coffee
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
class @GalleryImageModel extends ImageModel

remove : () ->
$.ajax
type : 'delete'
url : @get 'removeUrl'
data :
class_name : @collection.getClassName()
dataType : 'json'
success : () =>
@collection.remove this
@trigger 'image-removed'
error : (data) =>
window.notifier.notify data.error
@collection.remove this
@trigger 'image-removed'

_getData : () ->
data = super
data.class_name = @collection.getClassName()
data
data
7 changes: 3 additions & 4 deletions app/assets/javascripts/app/gallery/image/view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ class @GalleryImageView extends Backbone.View

events :
'click' : 'showPopup'
'click [data-remove-url]' : 'remove'
'click [data-remove]' : 'remove'

initialize : () ->
@model.on 'image-removed', @_onImageRemove
@model.on 'change:resizedUrl', @_updateImageUrl

remove : () ->
@model.remove() if confirm I18n.t('rademade_admin.remove_confirm.image')
@model.remove()
false

showPopup : () ->
Expand All @@ -27,8 +27,7 @@ class @GalleryImageView extends Backbone.View

@init : ($el) ->
model = new GalleryImageModel $el.data()
model.set 'removeUrl', $el.find('[data-remove-url]').data('removeUrl')
new GalleryImageView
model : model
el : $el
model
model
Loading