From 292e420fe68e8b68023ec217278e2a7dc68aaa58 Mon Sep 17 00:00:00 2001 From: shakeelanjum Date: Wed, 15 Oct 2014 17:11:53 +0500 Subject: [PATCH] Revert commit 5b4d102b8b296ecebff0dfa7c52324afbde960f8 (Fixed error coming up when Next/Prev clicked on Recorders) (resolved commit manually) Conflicts: app/controllers/models_controller.rb app/views/models/show.html.erb app/views/recorders/show.html.erb --- .gitignore | 48 +- app/assets/javascripts/application.coffee | 270 +- app/assets/javascripts/cameras.js.coffee | 6 +- .../javascripts/manufacturers.js.coffee | 6 +- app/assets/javascripts/pages.js.coffee | 6 +- app/assets/stylesheets/application.css.scss | 84 +- app/assets/stylesheets/base.css.scss.erb | 314 +- app/assets/stylesheets/camera_index.css.scss | 246 +- .../stylesheets/camera_show.css.scss.erb | 436 +- app/assets/stylesheets/footer.css.scss | 66 +- app/assets/stylesheets/header.css.scss | 204 +- app/assets/stylesheets/main.css.scss.erb | 126 +- app/assets/stylesheets/modals.css.scss | 268 +- app/assets/stylesheets/model_index.css.scss | 242 +- app/assets/stylesheets/pages.css.scss | 6 +- app/assets/stylesheets/scaffolds.css.scss | 136 +- app/assets/stylesheets/search.css.scss | 188 +- app/assets/stylesheets/settings.css.scss.erb | 102 +- app/assets/stylesheets/sidebar.css.scss.erb | 64 +- app/controllers/api/v1/changes_controller.rb | 68 +- app/controllers/api/v1/models_controller.rb | 268 +- .../api/v1/recorders_controller.rb | 273 +- app/controllers/api/v1/vendors_controller.rb | 154 +- app/controllers/api_controller.rb | 12 +- app/controllers/application_controller.rb | 70 +- app/controllers/models_controller.rb | 240 +- app/controllers/pages_controller.rb | 32 +- app/controllers/recorders_controller.rb | 242 +- app/controllers/users_controller.rb | 94 +- app/controllers/vendors_controller.rb | 188 +- app/controllers/versions_controller.rb | 26 +- app/helpers/application_helper.rb | 102 +- app/helpers/models_helper.rb | 4 +- app/helpers/pages_helper.rb | 10 +- app/helpers/recorders_helper.rb | 4 +- app/helpers/vendors_helper.rb | 4 +- app/models/document.rb | 12 +- app/models/image.rb | 38 +- app/models/model.rb | 96 +- app/models/recorder.rb | 74 +- app/models/user.rb | 34 +- app/models/vendor.rb | 30 +- app/views/api/v1/_image.json.jbuilder | 2 +- app/views/api/v1/_metadata.json.jbuilder | 10 +- app/views/api/v1/_paging.json.jbuilder | 24 +- .../api/v1/changes/_change.json.jbuilder | 24 +- app/views/api/v1/changes/index.json.jbuilder | 12 +- app/views/api/v1/changes/show.json.jbuilder | 38 +- app/views/api/v1/models/_model.json.jbuilder | 66 +- app/views/api/v1/models/index.json.jbuilder | 20 +- app/views/api/v1/models/show.json.jbuilder | 8 +- .../api/v1/recorders/_recorder.json.jbuilder | 66 +- .../api/v1/recorders/index.json.jbuilder | 20 +- app/views/api/v1/recorders/show.json.jbuilder | 8 +- .../api/v1/vendors/_vendor.json.jbuilder | 22 +- app/views/api/v1/vendors/index.json.jbuilder | 12 +- app/views/api/v1/vendors/show.json.jbuilder | 18 +- app/views/devise/confirmations/new.html.erb | 24 +- .../mailer/confirmation_instructions.html.erb | 10 +- .../reset_password_instructions.html.erb | 16 +- .../mailer/unlock_instructions.html.erb | 14 +- app/views/devise/passwords/edit.html.erb | 32 +- app/views/devise/passwords/new.html.erb | 20 +- app/views/devise/registrations/edit.html.erb | 84 +- app/views/devise/registrations/new.html.erb | 34 +- app/views/devise/sessions/new.html.erb | 34 +- app/views/devise/shared/_links.erb | 50 +- app/views/devise/unlocks/new.html.erb | 24 +- app/views/layouts/application.html.erb | 68 +- app/views/models/_form.html.erb | 182 +- app/views/models/edit.html.erb | 12 +- app/views/models/index.html.erb | 2 +- app/views/models/new.html.erb | 6 +- app/views/models/search.html.erb | 2 +- app/views/models/show.html.erb | 530 +- app/views/pages/about_cambase.html.erb | 2 +- app/views/pages/about_evercam.html.erb | 2 +- app/views/pages/api_docs.html.erb | 96 +- app/views/pages/contact.html.erb | 2 +- app/views/pages/index.html.erb | 94 +- app/views/pages/terms.html.erb | 204 +- app/views/rails_admin/main/history.html.haml | 108 +- app/views/recorders/_form.html.erb | 182 +- app/views/recorders/edit.html.erb | 12 +- app/views/recorders/index.html.erb | 2 +- app/views/recorders/new.html.erb | 6 +- app/views/recorders/search.html.erb | 2 +- app/views/recorders/show.html.erb | 464 +- app/views/shared/_add_model_modal.erb | 154 +- app/views/shared/_add_recorder_modal.erb | 154 +- app/views/shared/_add_vendor_modal.erb | 78 +- app/views/shared/_filters.html.erb | 108 +- app/views/shared/_footer.html.erb | 66 +- app/views/shared/_header.html.erb | 84 +- app/views/shared/_models.html.erb | 124 +- app/views/shared/_recorders.html.erb | 230 +- app/views/shared/_search.html.erb | 8 +- app/views/shared/_sidebar.html.erb | 36 +- app/views/shared/_signin_modal.html.erb | 32 +- app/views/vendors/_form.html.erb | 54 +- app/views/vendors/edit.html.erb | 12 +- app/views/vendors/index.html.erb | 60 +- app/views/vendors/new.html.erb | 10 +- app/views/vendors/show.html.erb | 2 +- config/routes.rb | 110 +- .../20140409085613_create_manufacturers.rb | 20 +- db/migrate/20140409085621_create_cameras.rb | 50 +- .../20140411084224_devise_create_users.rb | 84 +- .../20140414135226_add_username_to_users.rb | 12 +- db/migrate/20140504145250_create_images.rb | 20 +- db/migrate/20140506103202_create_documents.rb | 18 +- ...4_add_slug_to_cameras_and_manufacturers.rb | 16 +- db/migrate/20140512121824_create_versions.rb | 26 +- ...12121825_add_object_changes_to_versions.rb | 10 +- ...2_add_audio_in_and_audio_out_to_cameras.rb | 12 +- ...20140521111524_add_url_to_manufacturers.rb | 10 +- ...efault_username_and_password_to_cameras.rb | 14 +- ...23131253_add_file_fingerprint_to_images.rb | 10 +- ...44051_add_file_fingerprint_to_documents.rb | 10 +- .../20140606132639_enable_hstore_extension.rb | 10 +- ...2_add_additional_information_to_cameras.rb | 10 +- ...90235_make_camera_slug_index_non_unique.rb | 12 +- ...fi_and_poe_and_official_page_to_cameras.rb | 16 +- .../20140915134811_rename_camera_to_model.rb | 10 +- ...917112012_rename_manufacturer_to_vendor.rb | 10 +- .../20140917142022_modify_models_vendors.rb | 14 +- db/migrate/20140924124928_create_recorder.rb | 58 +- .../20140929150902_rename_recoder_type.rb | 10 +- db/schema.rb | 308 +- db/seeds.rb | 42 +- lib/import_data.rb | 432 +- lib/rails_admin_approve_change.rb | 30 +- lib/rails_admin_import_data.rb | 104 +- lib/tasks/alter_data.rake | 158 +- .../javascripts/swagger/lib/backbone-min.js | 1404 ++-- .../swagger/lib/handlebars-1.0.0.js | 6446 ++++++++--------- .../swagger/lib/highlight.7.3.pack.js | 1370 ++-- .../swagger/lib/jquery.ba-bbq.min.js | 590 +- .../swagger/lib/jquery.slideto.min.js | 40 +- .../swagger/lib/jquery.wiggle.min.js | 74 +- .../javascripts/swagger/lib/shred.bundle.js | 5596 +++++++------- .../javascripts/swagger/lib/shred/content.js | 384 +- .../javascripts/swagger/lib/swagger-oauth.js | 416 +- .../javascripts/swagger/lib/swagger-ui.js | 6372 ++++++++-------- .../assets/javascripts/swagger/lib/swagger.js | 3038 ++++---- .../javascripts/swagger/lib/underscore-min.js | 1382 ++-- .../assets/javascripts/swagger/swagger-ui.js | 6372 ++++++++-------- 147 files changed, 21950 insertions(+), 21955 deletions(-) diff --git a/.gitignore b/.gitignore index 7a23e7d..dac9c6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,24 @@ -# See https://help.github.com/articles/ignoring-files for more about ignoring files. -# -# If you find yourself ignoring temporary files generated by your text editor -# or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile '~/.gitignore_global' - -# Ignore bundler config. -/.bundle - -# Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal - -# Ignore all logfiles and tempfiles. -/log/*.log -/tmp -.DS_Store -/public/assets/ -/public/system/ -.env - -# IDE -.idea -/*.env +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/*.log +/tmp +.DS_Store +/public/assets/ +/public/system/ +.env + +# IDE +.idea +/*.env diff --git a/app/assets/javascripts/application.coffee b/app/assets/javascripts/application.coffee index edf3e57..dabd9e0 100644 --- a/app/assets/javascripts/application.coffee +++ b/app/assets/javascripts/application.coffee @@ -1,135 +1,135 @@ -#= require jquery -#= require jquery.turbolinks -#= require jquery_ujs -#= require_tree . -#= require bootstrap -#= require editable/bootstrap-editable -#= require editable/rails -#= require get-style-property -#= require get-size -#= require matches-selector -#= require eventEmitter -#= require eventie -#= require doc-ready -#= require classie -#= require jquery-bridget -#= require matches-selector -#= require outlayer/item -#= require outlayer -#= require packery/rect -#= require packery/packer -#= require packery/item -#= require packery - -# called from a bootstrap dropdown, this closes the dropdown -$('a[data-toggle=modal]').on 'click', -> - $('.dropdown').removeClass('open') - -# this sets up the ajax loader, and it will stay until the method specific js removes it -$('a[data-target=#signin-modal]').on 'click', -> - e.preventDefault() - e.stopPropagation() - $('body').modalmanager('loading') - $.rails.handleRemote( $(this) ) - -#removes whatever is in the modal body content div upon clicking close/outside modal -$(document).on 'click', '[data-dismiss=modal], .modal-scrollable', -> - $('.modal-body-content').empty() -$(document).on 'click', '#signin-modal', (e) -> - e.stopPropagation() - -$ -> - $fullsize_image_wrap = $(".fullsize-image") - $('.clickable a').each -> - target = $(this) - target.attr('href', target.attr('data-href')) - if target.attr('data-target') == "_blank" - target.attr('target', "_blank") - - $container = $('#masonry-container') - $container.packery - itemSelector: '.tile', - gutter: 0 - - $('#search_dropdown').on 'click', -> - $('.search-dropdown').slideToggle() - - $(".features span").on 'click', -> - feature_id = $(this).attr("id").replace('_icon', '') - $("#{feature_id}").trigger "click" - $(this).toggleClass "selected" - - $(".features input[type=checkbox]").each -> - if ( $(this).attr('checked') == 'checked' ) - image = "##{ $(this).attr('id') }_icon" - $(image).addClass("selected") - - $('.module-images').on 'click', ".thumbnails img", (e) -> - e.preventDefault() - if $(this).hasClass "add-new-image" - return - clicked_image = $(this).attr('src') - $('.module-image-main').attr('src', clicked_image) - - $('.module-information .editable:not(.additional_information)').editable - emptytext: 'Unknown' - toggle: 'manual' - mode: 'inline' - ajaxOptions: - type: 'PUT' - - $('.module-information .editable.additional_information').editable - emptytext: 'Unknown' - toggle: 'manual' - mode: 'inline' - ajaxOptions: - type: 'PUT' - params: (params) -> - $('.module-information .editable.additional_information').each -> - target = $(this) - attribute = target.attr('data-model') - name = target.attr('data-name') - value = target.attr('data-value') - params["#{attribute}[#{name}]"] = value - return params - - $('.module-manufacturer .editable').editable - emptytext: 'Unknown' - toggle: 'manual' - ajaxOptions: - type: 'PUT' - - $('.visitor-signed_in .module-table td.icon-edit').on "click", (e) -> - e.preventDefault() - e.stopPropagation() - $(this).closest('tr').find('.editable').editable('toggle') - - $('.visitor-signed_out .add-new-image, .visitor-signed_out .icon-edit').on 'click', (e) -> - e.preventDefault() - e.stopPropagation() - $('#signin-modal').modal() - - $('.visitor-signed_in .add-new-image').on "click", (e) -> - e.preventDefault() - $(this).closest('.module').find('input[type="file"]').trigger('click') - - $('.module input[type="file"]').change -> - $(this).closest('.module').find('form').submit() - - $(".table-cameras a > img").on "mouseenter", -> - img = this - fullsize_image_url = $(img).attr('data-fullsize') - $fullsize_image = $("") - offset = $(img).offset() - $fullsize_image_wrap.css( - top: offset.top - 50 - left: offset.left + 50 - ).append($fullsize_image).removeClass "hidden" - - $fullsize_image_wrap.add(".table-cameras a > img").on "mouseleave", -> - $fullsize_image_wrap.empty().addClass "hidden" - - if $('#manufacturers-show').length - slug = window.location.pathname.replace('/','') - manufacturer = $('.manufacturer-name').first().text() - $("#q_manufacturer_id_eq option:contains('#{manufacturer}')").attr('selected', 'selected') +#= require jquery +#= require jquery.turbolinks +#= require jquery_ujs +#= require_tree . +#= require bootstrap +#= require editable/bootstrap-editable +#= require editable/rails +#= require get-style-property +#= require get-size +#= require matches-selector +#= require eventEmitter +#= require eventie +#= require doc-ready +#= require classie +#= require jquery-bridget +#= require matches-selector +#= require outlayer/item +#= require outlayer +#= require packery/rect +#= require packery/packer +#= require packery/item +#= require packery + +# called from a bootstrap dropdown, this closes the dropdown +$('a[data-toggle=modal]').on 'click', -> + $('.dropdown').removeClass('open') + +# this sets up the ajax loader, and it will stay until the method specific js removes it +$('a[data-target=#signin-modal]').on 'click', -> + e.preventDefault() + e.stopPropagation() + $('body').modalmanager('loading') + $.rails.handleRemote( $(this) ) + +#removes whatever is in the modal body content div upon clicking close/outside modal +$(document).on 'click', '[data-dismiss=modal], .modal-scrollable', -> + $('.modal-body-content').empty() +$(document).on 'click', '#signin-modal', (e) -> + e.stopPropagation() + +$ -> + $fullsize_image_wrap = $(".fullsize-image") + $('.clickable a').each -> + target = $(this) + target.attr('href', target.attr('data-href')) + if target.attr('data-target') == "_blank" + target.attr('target', "_blank") + + $container = $('#masonry-container') + $container.packery + itemSelector: '.tile', + gutter: 0 + + $('#search_dropdown').on 'click', -> + $('.search-dropdown').slideToggle() + + $(".features span").on 'click', -> + feature_id = $(this).attr("id").replace('_icon', '') + $("#{feature_id}").trigger "click" + $(this).toggleClass "selected" + + $(".features input[type=checkbox]").each -> + if ( $(this).attr('checked') == 'checked' ) + image = "##{ $(this).attr('id') }_icon" + $(image).addClass("selected") + + $('.module-images').on 'click', ".thumbnails img", (e) -> + e.preventDefault() + if $(this).hasClass "add-new-image" + return + clicked_image = $(this).attr('src') + $('.module-image-main').attr('src', clicked_image) + + $('.module-information .editable:not(.additional_information)').editable + emptytext: 'Unknown' + toggle: 'manual' + mode: 'inline' + ajaxOptions: + type: 'PUT' + + $('.module-information .editable.additional_information').editable + emptytext: 'Unknown' + toggle: 'manual' + mode: 'inline' + ajaxOptions: + type: 'PUT' + params: (params) -> + $('.module-information .editable.additional_information').each -> + target = $(this) + attribute = target.attr('data-model') + name = target.attr('data-name') + value = target.attr('data-value') + params["#{attribute}[#{name}]"] = value + return params + + $('.module-manufacturer .editable').editable + emptytext: 'Unknown' + toggle: 'manual' + ajaxOptions: + type: 'PUT' + + $('.visitor-signed_in .module-table td.icon-edit').on "click", (e) -> + e.preventDefault() + e.stopPropagation() + $(this).closest('tr').find('.editable').editable('toggle') + + $('.visitor-signed_out .add-new-image, .visitor-signed_out .icon-edit').on 'click', (e) -> + e.preventDefault() + e.stopPropagation() + $('#signin-modal').modal() + + $('.visitor-signed_in .add-new-image').on "click", (e) -> + e.preventDefault() + $(this).closest('.module').find('input[type="file"]').trigger('click') + + $('.module input[type="file"]').change -> + $(this).closest('.module').find('form').submit() + + $(".table-cameras a > img").on "mouseenter", -> + img = this + fullsize_image_url = $(img).attr('data-fullsize') + $fullsize_image = $("") + offset = $(img).offset() + $fullsize_image_wrap.css( + top: offset.top - 50 + left: offset.left + 50 + ).append($fullsize_image).removeClass "hidden" + + $fullsize_image_wrap.add(".table-cameras a > img").on "mouseleave", -> + $fullsize_image_wrap.empty().addClass "hidden" + + if $('#manufacturers-show').length + slug = window.location.pathname.replace('/','') + manufacturer = $('.manufacturer-name').first().text() + $("#q_manufacturer_id_eq option:contains('#{manufacturer}')").attr('selected', 'selected') diff --git a/app/assets/javascripts/cameras.js.coffee b/app/assets/javascripts/cameras.js.coffee index ce1bf98..24f83d1 100644 --- a/app/assets/javascripts/cameras.js.coffee +++ b/app/assets/javascripts/cameras.js.coffee @@ -1,3 +1,3 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/manufacturers.js.coffee b/app/assets/javascripts/manufacturers.js.coffee index ce1bf98..24f83d1 100644 --- a/app/assets/javascripts/manufacturers.js.coffee +++ b/app/assets/javascripts/manufacturers.js.coffee @@ -1,3 +1,3 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/pages.js.coffee b/app/assets/javascripts/pages.js.coffee index ce1bf98..24f83d1 100644 --- a/app/assets/javascripts/pages.js.coffee +++ b/app/assets/javascripts/pages.js.coffee @@ -1,3 +1,3 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index aaf721b..a259447 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,43 +1,43 @@ -// -// This is a manifest file that'll be compiled into application.css, which will include all the files -// listed below. -// -// Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, -// or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. -// -// You're free to add application-wide styles to this file and they'll appear at the bottom of the -// compiled file so the styles you add here take precedence over styles defined in any styles -// defined in the other CSS/SCSS files in this directory. It is generally better to create a new -// file per style scope. -// -//= require swagger-ui -//= require_self -//= require editable/bootstrap-editable - -$border-radius-base: 0; -$lightgreen: #b8c7c2; -$mediumgreen: #98ada6; -$darkgreen: #647d75; -$offwhite: #f5f5f5; -$grayborder: #eaeaea; -$input-border-focus: $darkgreen; - -@import "compass"; -@import "compass/typography/text/replacement"; -@import "compass/utilities/sprites/sprite-img"; -@import "compass/utilities/sprites"; -// @import "icons/*.png"; -// @include all-icons-sprites; -// $icons: sprite-map('icons/*.png'); - -@import "bootstrap"; -@import "base"; -@import "header"; -@import "sidebar"; -@import "main"; -@import "footer"; -@import "camera_show"; -@import "camera_index"; -@import "search"; -@import "modals"; +// +// This is a manifest file that'll be compiled into application.css, which will include all the files +// listed below. +// +// Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, +// or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. +// +// You're free to add application-wide styles to this file and they'll appear at the bottom of the +// compiled file so the styles you add here take precedence over styles defined in any styles +// defined in the other CSS/SCSS files in this directory. It is generally better to create a new +// file per style scope. +// +//= require swagger-ui +//= require_self +//= require editable/bootstrap-editable + +$border-radius-base: 0; +$lightgreen: #b8c7c2; +$mediumgreen: #98ada6; +$darkgreen: #647d75; +$offwhite: #f5f5f5; +$grayborder: #eaeaea; +$input-border-focus: $darkgreen; + +@import "compass"; +@import "compass/typography/text/replacement"; +@import "compass/utilities/sprites/sprite-img"; +@import "compass/utilities/sprites"; +// @import "icons/*.png"; +// @include all-icons-sprites; +// $icons: sprite-map('icons/*.png'); + +@import "bootstrap"; +@import "base"; +@import "header"; +@import "sidebar"; +@import "main"; +@import "footer"; +@import "camera_show"; +@import "camera_index"; +@import "search"; +@import "modals"; @import "settings"; \ No newline at end of file diff --git a/app/assets/stylesheets/base.css.scss.erb b/app/assets/stylesheets/base.css.scss.erb index 080979c..e6ea92f 100644 --- a/app/assets/stylesheets/base.css.scss.erb +++ b/app/assets/stylesheets/base.css.scss.erb @@ -1,157 +1,157 @@ -html { - position: relative; - min-height: 100%; -} - -body { - margin-bottom: 160px; - background: $offwhite; - font-family: 'Open Sans'; -} - -.main .swagger-ui-wrap{ - max-width: 1920px; -} - -a{ - color: #000; -} - -a:active, -a:focus { - outline: none; -} - -*{ - border-radius: 0; -} - -.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{ - position: relative; - min-height: 1px; - padding-left: 5px; - padding-right: 5px; -} - -@mixin col-sm-x-8($width){ - float: left; - position: relative; - min-height: 1px; - padding-left: 5px; - padding-right: 5px; - width: $width; -} - -.col-sm-1-8{ - @include col-sm-x-8(12.5%); -} - -.col-sm-2-8{ - @include col-sm-x-8(25%); -} - -.col-sm-5-8{ - @include col-sm-x-8(62.5%); -} - -.col-sm-6-8{ - @include col-sm-x-8(75%); -} - -.container{ - padding-left: 5px; - padding-right: 5px; -} - -.row { - margin-left: -5px; - margin-right: -5px; -} - -[class*='icon-']{ - display: block; -} - -@mixin icon($image){ - font: 0px/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0px none; - background-position: 0px 0px; - height: 42px; - width: 42px; - background-repeat: no-repeat; - background-image: asset-url("icons/#{$image}.png"); - user-select: none; -} - -.icon-document{ - @include icon('document'); -} - -.icon-eye{ - @include icon('eye'); -} - -.icon-link{ - @include icon('link'); - background-position: 0px -7px; - width: 32px; - height: 20px; - float: left; -} - -<% Model::FEATURES.each do |feature| %> -<%= ".icon-camera_feature_#{feature}" %>{ - @include icon(<%= "camera_feature_#{feature.parameterize.underscore}" %>); - background-position: 5px 5px; - border-radius: 42px; - float: left; -} -<% end %> - -<% Model::SHAPES.each do |shape| %> -<%= ".icon-camera_shape_#{shape.downcase}" %>{ - @include icon(<%= "camera_shape_#{shape.downcase}" %>); - background-position: 5px 5px; - border-radius: 42px; - display: inline-block; -} -<% end %> - -.button{ - padding: 8px 32px; - background: $darkgreen; - border: none; - border-radius: 0; - color: #fff; -} - -.alert-info { - background-color: #fff; - border: none; - color: $darkgreen; - .close{ - color: $darkgreen; - opacity: 0.6; - } -} - -.alert .close{ - line-height: 0.8; -} - -.close{ - font-weight: normal; - opacity: 1; - color: #fff; -} - -.align-left{ - float: left; -} - -.align-right{ - float: right; -} +html { + position: relative; + min-height: 100%; +} + +body { + margin-bottom: 160px; + background: $offwhite; + font-family: 'Open Sans'; +} + +.main .swagger-ui-wrap{ + max-width: 1920px; +} + +a{ + color: #000; +} + +a:active, +a:focus { + outline: none; +} + +*{ + border-radius: 0; +} + +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{ + position: relative; + min-height: 1px; + padding-left: 5px; + padding-right: 5px; +} + +@mixin col-sm-x-8($width){ + float: left; + position: relative; + min-height: 1px; + padding-left: 5px; + padding-right: 5px; + width: $width; +} + +.col-sm-1-8{ + @include col-sm-x-8(12.5%); +} + +.col-sm-2-8{ + @include col-sm-x-8(25%); +} + +.col-sm-5-8{ + @include col-sm-x-8(62.5%); +} + +.col-sm-6-8{ + @include col-sm-x-8(75%); +} + +.container{ + padding-left: 5px; + padding-right: 5px; +} + +.row { + margin-left: -5px; + margin-right: -5px; +} + +[class*='icon-']{ + display: block; +} + +@mixin icon($image){ + font: 0px/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0px none; + background-position: 0px 0px; + height: 42px; + width: 42px; + background-repeat: no-repeat; + background-image: asset-url("icons/#{$image}.png"); + user-select: none; +} + +.icon-document{ + @include icon('document'); +} + +.icon-eye{ + @include icon('eye'); +} + +.icon-link{ + @include icon('link'); + background-position: 0px -7px; + width: 32px; + height: 20px; + float: left; +} + +<% Model::FEATURES.each do |feature| %> +<%= ".icon-camera_feature_#{feature}" %>{ + @include icon(<%= "camera_feature_#{feature.parameterize.underscore}" %>); + background-position: 5px 5px; + border-radius: 42px; + float: left; +} +<% end %> + +<% Model::SHAPES.each do |shape| %> +<%= ".icon-camera_shape_#{shape.downcase}" %>{ + @include icon(<%= "camera_shape_#{shape.downcase}" %>); + background-position: 5px 5px; + border-radius: 42px; + display: inline-block; +} +<% end %> + +.button{ + padding: 8px 32px; + background: $darkgreen; + border: none; + border-radius: 0; + color: #fff; +} + +.alert-info { + background-color: #fff; + border: none; + color: $darkgreen; + .close{ + color: $darkgreen; + opacity: 0.6; + } +} + +.alert .close{ + line-height: 0.8; +} + +.close{ + font-weight: normal; + opacity: 1; + color: #fff; +} + +.align-left{ + float: left; +} + +.align-right{ + float: right; +} diff --git a/app/assets/stylesheets/camera_index.css.scss b/app/assets/stylesheets/camera_index.css.scss index 696f044..e7ea072 100644 --- a/app/assets/stylesheets/camera_index.css.scss +++ b/app/assets/stylesheets/camera_index.css.scss @@ -1,123 +1,123 @@ -.table-list{ - border: 4px solid $grayborder; - margin-bottom: 0; - border-collapse: inherit; - thead, tbody{ - tr{ - min-width: 100%; - max-width: 100%; - th, td{ - border-right: 4px solid $grayborder; - background-color: #fff; - &:last-child{ - border-right: none; - } - } - th{ - border-top: 4px solid $grayborder; - border-bottom: 4px solid $grayborder; - a{ - font-size: 14px; - color: $darkgreen; - } - } - th.shape{ - text-align: center; - } - th.rotate { - height: 95px; - width: 31px; - white-space: nowrap; - font-style: normal; - border-left: none; - border-right: none; - } - - th.rotate > div { - transform: translate(-7px, 13px) rotate(-45deg); - width: 0px; - } - th.rotate > div > span { - padding: 5px 9px; - } - td{ - border-top: none; - border-bottom: none; - vertical-align: middle; - &.feature{ - text-align: center; - border-width: 1px; - padding: 0; - .dot{ - display: inline-block; - background: $mediumgreen; - width: 10px; - height: 10px; - border-radius: 15px; - } - } - &:first-child{ - a{ - display: block; - line-height: 3.5; - } - } - img{ - max-height: 50px; - } - } - } - } - &.table-cameras{ - tr td:nth-child(4){ - text-align: center; - width: 80px; - } - } - &.table-manufacturers{ - td{ - height: 50px; - } - tr td:nth-child(3), - tr th:nth-child(3){ - text-align: center; - width: 42px; - } - } -} - -.pagination{ - margin-top: 0; - padding: 8px; - width: 100%; - border: 4px solid $grayborder; - border-top: none; - background: #fff; - span{ - &.current{ - font-weight: bold; - } - padding: 4px; - background: $offwhite; - &:first-child{ - padding-left: 8px; - } - &:last-child{ - padding-right: 8px; - } - a{ - color: $darkgreen; - } - } -} - -.clear-f{clear: both;} - -.fullsize-image{ - position: absolute; - z-index: 10; - border: 4px solid #eaeaea; - &.hidden { - display: none; - } -} +.table-list{ + border: 4px solid $grayborder; + margin-bottom: 0; + border-collapse: inherit; + thead, tbody{ + tr{ + min-width: 100%; + max-width: 100%; + th, td{ + border-right: 4px solid $grayborder; + background-color: #fff; + &:last-child{ + border-right: none; + } + } + th{ + border-top: 4px solid $grayborder; + border-bottom: 4px solid $grayborder; + a{ + font-size: 14px; + color: $darkgreen; + } + } + th.shape{ + text-align: center; + } + th.rotate { + height: 95px; + width: 31px; + white-space: nowrap; + font-style: normal; + border-left: none; + border-right: none; + } + + th.rotate > div { + transform: translate(-7px, 13px) rotate(-45deg); + width: 0px; + } + th.rotate > div > span { + padding: 5px 9px; + } + td{ + border-top: none; + border-bottom: none; + vertical-align: middle; + &.feature{ + text-align: center; + border-width: 1px; + padding: 0; + .dot{ + display: inline-block; + background: $mediumgreen; + width: 10px; + height: 10px; + border-radius: 15px; + } + } + &:first-child{ + a{ + display: block; + line-height: 3.5; + } + } + img{ + max-height: 50px; + } + } + } + } + &.table-cameras{ + tr td:nth-child(4){ + text-align: center; + width: 80px; + } + } + &.table-manufacturers{ + td{ + height: 50px; + } + tr td:nth-child(3), + tr th:nth-child(3){ + text-align: center; + width: 42px; + } + } +} + +.pagination{ + margin-top: 0; + padding: 8px; + width: 100%; + border: 4px solid $grayborder; + border-top: none; + background: #fff; + span{ + &.current{ + font-weight: bold; + } + padding: 4px; + background: $offwhite; + &:first-child{ + padding-left: 8px; + } + &:last-child{ + padding-right: 8px; + } + a{ + color: $darkgreen; + } + } +} + +.clear-f{clear: both;} + +.fullsize-image{ + position: absolute; + z-index: 10; + border: 4px solid #eaeaea; + &.hidden { + display: none; + } +} diff --git a/app/assets/stylesheets/camera_show.css.scss.erb b/app/assets/stylesheets/camera_show.css.scss.erb index 7efc429..99e55e3 100644 --- a/app/assets/stylesheets/camera_show.css.scss.erb +++ b/app/assets/stylesheets/camera_show.css.scss.erb @@ -1,218 +1,218 @@ -.camera-heading{ - padding: 0 5px; - h1{ - font-size: 24px; - margin-top: 10px; - margin-bottom: 20px; - margin-right: 20px; - float: left; - } - .col-sm-2{ - text-align: right; - margin-top: 16px; - } - a{ - border-radius: 4px; - border: 1px solid $mediumgreen; - color: $mediumgreen; - font-size: 16px; - font-weight: bold; - font-family: 'Titillium Web', 'sans-serif'; - padding: 0px 7px; - margin-top: 12px; - margin-bottom: 20px; - text-decoration: none; - text-transform: uppercase; - &:hover{ - background-color: $mediumgreen; - color: #fff; - } - &.align-left{ - margin-right: 5px; - } - &.align-right{ - margin-left: 5px; - } - } -} - -.module{ - background: #fff; -} - -.module-header{ - background: $mediumgreen; - color: #fff; - text-align: center; - h4{ - font-size: 14px; - padding: 8px 0; - margin: 0; - } -} - -.module-body{ - padding: 10px; - & > img{ - width: 100%; - height: auto; - } -} - -.module-images{ - h4{ - background-repeat: no-repeat; - background-position: right center; - } - margin-bottom: 10px; - .module-body{ - padding: 0; - } - li{ - a{ - width: 100%; - height: 100%; - display: block; - img{ - width: 100%; - height: auto; - } - } - } - form{ - display: none; - } - & > a .add-new-image{ - width: 100%; - height: auto; - } - .add-new-image{ - } - .thumbnails .add-new-image{ - background-color: $mediumgreen; - } -} - -.module-documents{ - a{ - display: block; - clear: both; - line-height: 2.2; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - span{ - float: left; - } - } -} - -.module-manufacturer{ - .module-body{ - padding: 0; - } - img{ - width: 100%; - height: auto; - padding: 10px; - } - form{ - display: none; - } - .add-logo{ - padding: 8px; - display: block; - text-align: center; - } -} - -.module-table{ - &.module-information{ - h4{ - text-align: left; - padding-left: 160px; - } - } - .module-body{ - padding: 0; - } - .table-striped > tbody > tr:nth-child(2n+1){ - &, > td, > .editable-container{ - background-color: #eeeeee; - } - } - .clickable{ - .editable:hover{ - text-decoration: underline; - cursor: pointer; - } - } - tr{ - border-top: 1px solid #dddddd; - } - td{ - border: none; - word-wrap: break-word; - max-width: 100px; - &:focus{ - outline: none; - } - &:first-child{ - text-align: right; - } - &:last-child{ - &:hover{ - } - } - &.icon-edit{ - border-top: 1px solid #dddddd; - min-width: 37px; - width: 4%; - height: 37px; - display: table-cell; - background-image: none; - background-repeat: no-repeat; - &:hover{ - background-image: asset-url("icons/edit.png"); - } - } - &.editable-empty, - .editable-empty:hover, - .editable-empty:focus{ - color: gray; - } - } - tr > .editable-container.editable-inline{ - padding-top: 3px; - padding-bottom: 3px; - padding-left: 5px; - } - .editable-container.editable-inline{ - width: 100%; - .editable-buttons{ - padding-top: 3px; - } - .editable-submit{ - background-color: $darkgreen; - border-color: $darkgreen; - } - } - .manufacturer-website > a{ - float: left; - } - .shapes{ - td, select{ - text-transform: capitalize; - } - } -} - -#cameras-index, -#cameras-search, -#manufacturers-show{ - .navbar-form{ - .icon-dropdown{ - display: none; - } - } -} +.camera-heading{ + padding: 0 5px; + h1{ + font-size: 24px; + margin-top: 10px; + margin-bottom: 20px; + margin-right: 20px; + float: left; + } + .col-sm-2{ + text-align: right; + margin-top: 16px; + } + a{ + border-radius: 4px; + border: 1px solid $mediumgreen; + color: $mediumgreen; + font-size: 16px; + font-weight: bold; + font-family: 'Titillium Web', 'sans-serif'; + padding: 0px 7px; + margin-top: 12px; + margin-bottom: 20px; + text-decoration: none; + text-transform: uppercase; + &:hover{ + background-color: $mediumgreen; + color: #fff; + } + &.align-left{ + margin-right: 5px; + } + &.align-right{ + margin-left: 5px; + } + } +} + +.module{ + background: #fff; +} + +.module-header{ + background: $mediumgreen; + color: #fff; + text-align: center; + h4{ + font-size: 14px; + padding: 8px 0; + margin: 0; + } +} + +.module-body{ + padding: 10px; + & > img{ + width: 100%; + height: auto; + } +} + +.module-images{ + h4{ + background-repeat: no-repeat; + background-position: right center; + } + margin-bottom: 10px; + .module-body{ + padding: 0; + } + li{ + a{ + width: 100%; + height: 100%; + display: block; + img{ + width: 100%; + height: auto; + } + } + } + form{ + display: none; + } + & > a .add-new-image{ + width: 100%; + height: auto; + } + .add-new-image{ + } + .thumbnails .add-new-image{ + background-color: $mediumgreen; + } +} + +.module-documents{ + a{ + display: block; + clear: both; + line-height: 2.2; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + span{ + float: left; + } + } +} + +.module-manufacturer{ + .module-body{ + padding: 0; + } + img{ + width: 100%; + height: auto; + padding: 10px; + } + form{ + display: none; + } + .add-logo{ + padding: 8px; + display: block; + text-align: center; + } +} + +.module-table{ + &.module-information{ + h4{ + text-align: left; + padding-left: 160px; + } + } + .module-body{ + padding: 0; + } + .table-striped > tbody > tr:nth-child(2n+1){ + &, > td, > .editable-container{ + background-color: #eeeeee; + } + } + .clickable{ + .editable:hover{ + text-decoration: underline; + cursor: pointer; + } + } + tr{ + border-top: 1px solid #dddddd; + } + td{ + border: none; + word-wrap: break-word; + max-width: 100px; + &:focus{ + outline: none; + } + &:first-child{ + text-align: right; + } + &:last-child{ + &:hover{ + } + } + &.icon-edit{ + border-top: 1px solid #dddddd; + min-width: 37px; + width: 4%; + height: 37px; + display: table-cell; + background-image: none; + background-repeat: no-repeat; + &:hover{ + background-image: asset-url("icons/edit.png"); + } + } + &.editable-empty, + .editable-empty:hover, + .editable-empty:focus{ + color: gray; + } + } + tr > .editable-container.editable-inline{ + padding-top: 3px; + padding-bottom: 3px; + padding-left: 5px; + } + .editable-container.editable-inline{ + width: 100%; + .editable-buttons{ + padding-top: 3px; + } + .editable-submit{ + background-color: $darkgreen; + border-color: $darkgreen; + } + } + .manufacturer-website > a{ + float: left; + } + .shapes{ + td, select{ + text-transform: capitalize; + } + } +} + +#cameras-index, +#cameras-search, +#manufacturers-show{ + .navbar-form{ + .icon-dropdown{ + display: none; + } + } +} diff --git a/app/assets/stylesheets/footer.css.scss b/app/assets/stylesheets/footer.css.scss index defa37d..282628b 100644 --- a/app/assets/stylesheets/footer.css.scss +++ b/app/assets/stylesheets/footer.css.scss @@ -1,33 +1,33 @@ -body > .footer { - position: absolute; - bottom: 0; - width: 100%; - height: 160px; - background-color: $darkgreen; - padding-top: 50px; - .icons{ - margin-left: -10px; - } - a{ - color: #fff; - font-family: 'Titillium Web', 'sans-serif'; - font-size: 16px; - } - small{ - color: $lightgreen; - font-family: 'Titillium Web', 'sans-serif'; - font-size: 10px; - } - .list-inline{ - margin-bottom: 0; - } - .icon-rss{ - @include icon('rss'); - } - .icon-github{ - @include icon('github'); - } - .icon-twitter{ - @include icon('twitter'); - } -} +body > .footer { + position: absolute; + bottom: 0; + width: 100%; + height: 160px; + background-color: $darkgreen; + padding-top: 50px; + .icons{ + margin-left: -10px; + } + a{ + color: #fff; + font-family: 'Titillium Web', 'sans-serif'; + font-size: 16px; + } + small{ + color: $lightgreen; + font-family: 'Titillium Web', 'sans-serif'; + font-size: 10px; + } + .list-inline{ + margin-bottom: 0; + } + .icon-rss{ + @include icon('rss'); + } + .icon-github{ + @include icon('github'); + } + .icon-twitter{ + @include icon('twitter'); + } +} diff --git a/app/assets/stylesheets/header.css.scss b/app/assets/stylesheets/header.css.scss index 259f008..4728ea5 100644 --- a/app/assets/stylesheets/header.css.scss +++ b/app/assets/stylesheets/header.css.scss @@ -1,102 +1,102 @@ -.navbar-brand { - padding: 8px 15px 0; - height: auto; - h1{ - background: image-url("logo.jpg"); - width: 189px; - height: 49px; - text-indent: -100%; - white-space: nowrap; - overflow: hidden; - margin: 0; - } -} - -.navbar.navbar-top{ - margin-bottom: 0; - box-shadow: 0 1px 12px 2px lightgray; - background-color: #fff; - z-index: 1; -} - -.navbar-toggle{ - background: grey !important; - margin-top:11px; -} - -.icon-bar{ - width:18px; - height:2px; - background-color: #fff !important; - box-shadow: none !important; -} - -.navbar-default { - background-color: transparent; - border: none; -} - -.navbar-nav { - padding: 0; - padding-top: 15px; - - li{ - &.col-sm-4{ - padding-left: 5px; - padding-right: 5px; - } - } - a{ - font-size: 14px; - padding: 15px 0; - text-align: center; - background: #fff; - color: #000; - } - -} - -.nav > li > a { - color: #333; -} - -.nav > li > a:hover, -.nav > li > a:focus, -.navbar-default .nav > li > a:hover, -.navbar-default .nav > li > a:focus { - background-color: #fff; -} - -.nav > li > a.username{ - &:hover{ - background-color: transparent; - } - img{ - border-radius: 2px; - } -} - -.nav .open > a.username, -.nav .open > a.username:hover, -.nav .open > a.username:focus, -.nav > li > a.username:hover, -.nav > li > a.username:focus{ - background-color: transparent; - border-color: #428bca; -} - - -.navbar-nav > li > .dropdown-menu { - margin-top: 5px; -} - -.navbar-nav.navbar-right:last-child { - margin-right: 0; -} - -@media (min-width: 768px){ - .navbar-right .dropdown-menu { - // right: 15px; - left: auto; - } -} +.navbar-brand { + padding: 8px 15px 0; + height: auto; + h1{ + background: image-url("logo.jpg"); + width: 189px; + height: 49px; + text-indent: -100%; + white-space: nowrap; + overflow: hidden; + margin: 0; + } +} + +.navbar.navbar-top{ + margin-bottom: 0; + box-shadow: 0 1px 12px 2px lightgray; + background-color: #fff; + z-index: 1; +} + +.navbar-toggle{ + background: grey !important; + margin-top:11px; +} + +.icon-bar{ + width:18px; + height:2px; + background-color: #fff !important; + box-shadow: none !important; +} + +.navbar-default { + background-color: transparent; + border: none; +} + +.navbar-nav { + padding: 0; + padding-top: 15px; + + li{ + &.col-sm-4{ + padding-left: 5px; + padding-right: 5px; + } + } + a{ + font-size: 14px; + padding: 15px 0; + text-align: center; + background: #fff; + color: #000; + } + +} + +.nav > li > a { + color: #333; +} + +.nav > li > a:hover, +.nav > li > a:focus, +.navbar-default .nav > li > a:hover, +.navbar-default .nav > li > a:focus { + background-color: #fff; +} + +.nav > li > a.username{ + &:hover{ + background-color: transparent; + } + img{ + border-radius: 2px; + } +} + +.nav .open > a.username, +.nav .open > a.username:hover, +.nav .open > a.username:focus, +.nav > li > a.username:hover, +.nav > li > a.username:focus{ + background-color: transparent; + border-color: #428bca; +} + + +.navbar-nav > li > .dropdown-menu { + margin-top: 5px; +} + +.navbar-nav.navbar-right:last-child { + margin-right: 0; +} + +@media (min-width: 768px){ + .navbar-right .dropdown-menu { + // right: 15px; + left: auto; + } +} diff --git a/app/assets/stylesheets/main.css.scss.erb b/app/assets/stylesheets/main.css.scss.erb index a4101f9..ebb62ae 100644 --- a/app/assets/stylesheets/main.css.scss.erb +++ b/app/assets/stylesheets/main.css.scss.erb @@ -1,63 +1,63 @@ -.main{ - padding-top: 20px; - padding-bottom: 20px; -} - -#masonry-container{ - margin: 0 -5px; -} - -.tile{ - box-sizing:border-box !important; - margin-bottom: 10px; - position: relative; - .tile-content{ - background: #fff; - padding: 30px 10px; - a{ - width: 100%; - height: 100%; - display: block; - text-align: center; - } - img{ - max-width: 100%; - max-height: 100%; - height: auto; - width: auto; - display: inline-block; - } - } -} - -.tile-image{ - .tile-content{ - background-image: asset-url("icons/eye.png"); - background-position: right top; - background-repeat: no-repeat; - } -} - -.tile-small .tile-content{ - height: 136px; -} - -.tile-big{ - .tile-content{ - height: 282px; - width: 100%; - display: table; - text-align: center; - table-layout: fixed; - a{ - display: table-cell; - vertical-align: middle; - min-height: 100%; - height: auto; - width: auto; - img{ - max-height: 220px; - } - } - } -} +.main{ + padding-top: 20px; + padding-bottom: 20px; +} + +#masonry-container{ + margin: 0 -5px; +} + +.tile{ + box-sizing:border-box !important; + margin-bottom: 10px; + position: relative; + .tile-content{ + background: #fff; + padding: 30px 10px; + a{ + width: 100%; + height: 100%; + display: block; + text-align: center; + } + img{ + max-width: 100%; + max-height: 100%; + height: auto; + width: auto; + display: inline-block; + } + } +} + +.tile-image{ + .tile-content{ + background-image: asset-url("icons/eye.png"); + background-position: right top; + background-repeat: no-repeat; + } +} + +.tile-small .tile-content{ + height: 136px; +} + +.tile-big{ + .tile-content{ + height: 282px; + width: 100%; + display: table; + text-align: center; + table-layout: fixed; + a{ + display: table-cell; + vertical-align: middle; + min-height: 100%; + height: auto; + width: auto; + img{ + max-height: 220px; + } + } + } +} diff --git a/app/assets/stylesheets/modals.css.scss b/app/assets/stylesheets/modals.css.scss index 11271a2..fe88492 100644 --- a/app/assets/stylesheets/modals.css.scss +++ b/app/assets/stylesheets/modals.css.scss @@ -1,134 +1,134 @@ -.modal-header { - padding: 10px; - border-bottom: none; - min-height: 16.428571429px; - background: $darkgreen; - h4{ - font-size: 14px; - color: #fff; - } -} - -.modal-body{ - h3{ - margin-top: 20px; - margin-bottom: 30px; - font-size: 22px; - color: $darkgreen; - } - h4{ - font-style: italic; - font-size: 14px; - text-decoration: underline; - margin-bottom: 20px; - a{ - color: $darkgreen; - } - } - .col-md-6{ - padding-bottom: 50px; - min-height: 280px; - } - input{ - width: 100%; - background: $offwhite; - border: none; - padding: 10px; - font-style: italic; - color: $darkgreen; - } - .modal-button{ - text-transform: lowercase; - background: $darkgreen; - color: #fff; - font-style: normal; - width: 50%; - position: absolute; - bottom: 0; - &.absolute-right{ - right: 5px; - } - &.absolute-left{ - left: 5px; - } - } - .forgot-password{ - font-style: italic; - color: $lightgreen; - text-decoration: underline; - padding: 10px; - display: block; - } - #camera_shape{ - text-transform: capitalize; - } - select{ - width: 100%; - } - button.close{ - background-color: transparent; - color: $darkgreen; - float: right; - font-size: 14px; - font-style: normal; - margin-top: 49px; - opacity: 1; - padding: 10px; - text-decoration: underline; - text-shadow: none; - text-transform: lowercase; - width: 50%; - } -} - -#add-manufacturer-modal, -#add-camera-modal{ - input[type=submit]{ - float: left; - } -} - -#add-camera-modal{ - .col-md-6:last-child{ - min-height: 715px; - } - .features{ - display: block; - width: 100%; - float: none; - padding-top: 75px; - p{ - text-align: left; - } - span{ - display: block; - float: none; - margin: 0 5px; - } - label{ - font-weight: normal; - } - input{ - width: auto; - } - } -} - -#add-manufacturer-modal{ - .col-md-6:last-child{ - padding-top: 109px; - min-height: 300px; - } - input[type=submit]{ - margin: 56px 0 16px; - } -} - -#manufacturer_image_attributes_file{ - // visibility: hidden; -} - -#signin-modal .modal-body .text-center{ - display: block; - margin: 10px; -} +.modal-header { + padding: 10px; + border-bottom: none; + min-height: 16.428571429px; + background: $darkgreen; + h4{ + font-size: 14px; + color: #fff; + } +} + +.modal-body{ + h3{ + margin-top: 20px; + margin-bottom: 30px; + font-size: 22px; + color: $darkgreen; + } + h4{ + font-style: italic; + font-size: 14px; + text-decoration: underline; + margin-bottom: 20px; + a{ + color: $darkgreen; + } + } + .col-md-6{ + padding-bottom: 50px; + min-height: 280px; + } + input{ + width: 100%; + background: $offwhite; + border: none; + padding: 10px; + font-style: italic; + color: $darkgreen; + } + .modal-button{ + text-transform: lowercase; + background: $darkgreen; + color: #fff; + font-style: normal; + width: 50%; + position: absolute; + bottom: 0; + &.absolute-right{ + right: 5px; + } + &.absolute-left{ + left: 5px; + } + } + .forgot-password{ + font-style: italic; + color: $lightgreen; + text-decoration: underline; + padding: 10px; + display: block; + } + #camera_shape{ + text-transform: capitalize; + } + select{ + width: 100%; + } + button.close{ + background-color: transparent; + color: $darkgreen; + float: right; + font-size: 14px; + font-style: normal; + margin-top: 49px; + opacity: 1; + padding: 10px; + text-decoration: underline; + text-shadow: none; + text-transform: lowercase; + width: 50%; + } +} + +#add-manufacturer-modal, +#add-camera-modal{ + input[type=submit]{ + float: left; + } +} + +#add-camera-modal{ + .col-md-6:last-child{ + min-height: 715px; + } + .features{ + display: block; + width: 100%; + float: none; + padding-top: 75px; + p{ + text-align: left; + } + span{ + display: block; + float: none; + margin: 0 5px; + } + label{ + font-weight: normal; + } + input{ + width: auto; + } + } +} + +#add-manufacturer-modal{ + .col-md-6:last-child{ + padding-top: 109px; + min-height: 300px; + } + input[type=submit]{ + margin: 56px 0 16px; + } +} + +#manufacturer_image_attributes_file{ + // visibility: hidden; +} + +#signin-modal .modal-body .text-center{ + display: block; + margin: 10px; +} diff --git a/app/assets/stylesheets/model_index.css.scss b/app/assets/stylesheets/model_index.css.scss index 69ff525..e2e46ec 100644 --- a/app/assets/stylesheets/model_index.css.scss +++ b/app/assets/stylesheets/model_index.css.scss @@ -1,121 +1,121 @@ -.table-list{ - border: 4px solid $grayborder; - margin-bottom: 0; - border-collapse: inherit; - thead, tbody{ - tr{ - min-width: 100%; - max-width: 100%; - th, td{ - border-right: 4px solid $grayborder; - background-color: #fff; - &:last-child{ - border-right: none; - } - } - th{ - border-top: 4px solid $grayborder; - border-bottom: 4px solid $grayborder; - a{ - font-size: 14px; - color: $darkgreen; - } - } - th.shape{ - text-align: center; - } - th.rotate { - height: 95px; - width: 31px; - white-space: nowrap; - font-style: normal; - border-left: none; - border-right: none; - } - - th.rotate > div { - transform: translate(-7px, 13px) rotate(-45deg); - width: 0px; - } - th.rotate > div > span { - padding: 5px 9px; - } - td{ - border-top: none; - border-bottom: none; - vertical-align: middle; - &.feature{ - text-align: center; - border-width: 1px; - padding: 0; - .dot{ - display: inline-block; - background: $mediumgreen; - width: 10px; - height: 10px; - border-radius: 15px; - } - } - &:first-child{ - a{ - display: block; - line-height: 3.5; - } - } - img{ - max-height: 50px; - } - } - } - } - &.table-models{ - tr td:nth-child(4){ - text-align: center; - width: 80px; - } - } - &.table-vendors{ - td{ - height: 50px; - } - tr td:nth-child(3), - tr th:nth-child(3){ - text-align: center; - width: 42px; - } - } -} - -.pagination{ - margin-top: 0; - padding: 8px; - width: 100%; - border: 4px solid $grayborder; - border-top: none; - background: #fff; - span{ - &.current{ - font-weight: bold; - } - padding: 4px; - background: $offwhite; - &:first-child{ - padding-left: 8px; - } - &:last-child{ - padding-right: 8px; - } - a{ - color: $darkgreen; - } - } -} - -.fullsize-image{ - position: absolute; - z-index: 10; - border: 4px solid #eaeaea; - &.hidden { - display: none; - } -} +.table-list{ + border: 4px solid $grayborder; + margin-bottom: 0; + border-collapse: inherit; + thead, tbody{ + tr{ + min-width: 100%; + max-width: 100%; + th, td{ + border-right: 4px solid $grayborder; + background-color: #fff; + &:last-child{ + border-right: none; + } + } + th{ + border-top: 4px solid $grayborder; + border-bottom: 4px solid $grayborder; + a{ + font-size: 14px; + color: $darkgreen; + } + } + th.shape{ + text-align: center; + } + th.rotate { + height: 95px; + width: 31px; + white-space: nowrap; + font-style: normal; + border-left: none; + border-right: none; + } + + th.rotate > div { + transform: translate(-7px, 13px) rotate(-45deg); + width: 0px; + } + th.rotate > div > span { + padding: 5px 9px; + } + td{ + border-top: none; + border-bottom: none; + vertical-align: middle; + &.feature{ + text-align: center; + border-width: 1px; + padding: 0; + .dot{ + display: inline-block; + background: $mediumgreen; + width: 10px; + height: 10px; + border-radius: 15px; + } + } + &:first-child{ + a{ + display: block; + line-height: 3.5; + } + } + img{ + max-height: 50px; + } + } + } + } + &.table-models{ + tr td:nth-child(4){ + text-align: center; + width: 80px; + } + } + &.table-vendors{ + td{ + height: 50px; + } + tr td:nth-child(3), + tr th:nth-child(3){ + text-align: center; + width: 42px; + } + } +} + +.pagination{ + margin-top: 0; + padding: 8px; + width: 100%; + border: 4px solid $grayborder; + border-top: none; + background: #fff; + span{ + &.current{ + font-weight: bold; + } + padding: 4px; + background: $offwhite; + &:first-child{ + padding-left: 8px; + } + &:last-child{ + padding-right: 8px; + } + a{ + color: $darkgreen; + } + } +} + +.fullsize-image{ + position: absolute; + z-index: 10; + border: 4px solid #eaeaea; + &.hidden { + display: none; + } +} diff --git a/app/assets/stylesheets/pages.css.scss b/app/assets/stylesheets/pages.css.scss index 951acea..31cb8fb 100644 --- a/app/assets/stylesheets/pages.css.scss +++ b/app/assets/stylesheets/pages.css.scss @@ -1,3 +1,3 @@ -// Place all the styles related to the Pages controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ +// Place all the styles related to the Pages controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index 960929d..f892e08 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -1,68 +1,68 @@ -body { - color: #333; - font-family: verdana, arial, helvetica, sans-serif; - font-size: 13px; - line-height: 18px; -} - -p, ol, ul, td { - font-family: verdana, arial, helvetica, sans-serif; - font-size: 13px; - line-height: 18px; -} - -pre { - background-color: #eee; - padding: 10px; - font-size: 11px; -} - -a { - color: #000; - &:visited { - color: #666; - } - &:hover { - color: #fff; - // background-color: #000; - } -} - -div { - &.field, &.actions { - margin-bottom: 10px; - } -} - -#notice { - color: green; -} - -.field_with_errors { - padding: 2px; - background-color: red; - display: table; -} - -#error_explanation { - width: 450px; - border: 2px solid red; - padding: 7px; - padding-bottom: 0; - margin-bottom: 20px; - background-color: #f0f0f0; - h2 { - text-align: left; - font-weight: bold; - padding: 5px 5px 5px 15px; - font-size: 12px; - margin: -7px; - margin-bottom: 0px; - background-color: #c00; - color: #fff; - } - ul li { - font-size: 12px; - list-style: square; - } -} +body { + color: #333; + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { + color: #000; + &:visited { + color: #666; + } + &:hover { + color: #fff; + // background-color: #000; + } +} + +div { + &.field, &.actions { + margin-bottom: 10px; + } +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; + h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0px; + background-color: #c00; + color: #fff; + } + ul li { + font-size: 12px; + list-style: square; + } +} diff --git a/app/assets/stylesheets/search.css.scss b/app/assets/stylesheets/search.css.scss index 08fa195..8eaf61f 100644 --- a/app/assets/stylesheets/search.css.scss +++ b/app/assets/stylesheets/search.css.scss @@ -1,94 +1,94 @@ -.navbar-form{ - background: #fff; - padding: 7px 10px 1px; - margin: 0; - width: 100%; - .form-group{ - width: 100%; - .search_model{ - background: #f5f5f5; - padding: 8px 10px; - border: none; - font-style: italic; - border-radius: 0; - width: 100%; - float: left; - margin-bottom: 10px; - } - a.icon-dropdown{ - float: right; - @include icon('drop_arrow'); - } - input.icon-search{ - float: right; - @include icon('search'); - } - } -} - -.search-dropdown{ - display: none; - float: left; - margin-top: 10px; - width: 100%; - select{ - width: 100%; - margin: 5px 0; - } - .actions{ - clear: both; - .button{ - &.right{ - float: right; - margin-right: 15px; - margin-bottom: 10px; - } - margin: 5px 0; - } - } -} - -.search-filters{ - @extend .search-dropdown; - display: block; - .actions .button{ - margin: 5px 0 15px; - } - .features p{ - text-align: right; - padding-right: 235px; - } - .col-sm-12{ - margin-top: 5px; - &:first-child{ - margin-top: 0; - } - } - label{ - font-weight: normal; - margin-bottom: 0; - } - .feature-filters{ - span label{ - padding: 3px 9px 3px 0; - } - } -} - -.features{ - span{ - float: right; - margin: 0 3px; - cursor: pointer; - } - p{ - font-style: italic; - font-size: 14px; - color: $darkgreen; - padding: 0 10px; - } -} - -#q_shape_eq, select[name="q[shape_eq]"]{ - text-transform: capitalize; -} +.navbar-form{ + background: #fff; + padding: 7px 10px 1px; + margin: 0; + width: 100%; + .form-group{ + width: 100%; + .search_model{ + background: #f5f5f5; + padding: 8px 10px; + border: none; + font-style: italic; + border-radius: 0; + width: 100%; + float: left; + margin-bottom: 10px; + } + a.icon-dropdown{ + float: right; + @include icon('drop_arrow'); + } + input.icon-search{ + float: right; + @include icon('search'); + } + } +} + +.search-dropdown{ + display: none; + float: left; + margin-top: 10px; + width: 100%; + select{ + width: 100%; + margin: 5px 0; + } + .actions{ + clear: both; + .button{ + &.right{ + float: right; + margin-right: 15px; + margin-bottom: 10px; + } + margin: 5px 0; + } + } +} + +.search-filters{ + @extend .search-dropdown; + display: block; + .actions .button{ + margin: 5px 0 15px; + } + .features p{ + text-align: right; + padding-right: 235px; + } + .col-sm-12{ + margin-top: 5px; + &:first-child{ + margin-top: 0; + } + } + label{ + font-weight: normal; + margin-bottom: 0; + } + .feature-filters{ + span label{ + padding: 3px 9px 3px 0; + } + } +} + +.features{ + span{ + float: right; + margin: 0 3px; + cursor: pointer; + } + p{ + font-style: italic; + font-size: 14px; + color: $darkgreen; + padding: 0 10px; + } +} + +#q_shape_eq, select[name="q[shape_eq]"]{ + text-transform: capitalize; +} diff --git a/app/assets/stylesheets/settings.css.scss.erb b/app/assets/stylesheets/settings.css.scss.erb index 0a9ced9..bf3f19d 100644 --- a/app/assets/stylesheets/settings.css.scss.erb +++ b/app/assets/stylesheets/settings.css.scss.erb @@ -1,51 +1,51 @@ -.settings{ - h2{ - margin-top: 10px; - margin-bottom: 20px; - } - .settings-wrap{ - background: #fff url() 0 0 no-repeat; - width: 100%; - padding: 60px 0; - } - .col-sm-9{ - display: block; - float: none; - margin: 0 auto; - } - h3{ - margin-bottom: 30px; - color: $mediumgreen; - } - label{ - padding: 10px 0; - margin: 0; - font-weight: normal; - font-style: italic; - color: $mediumgreen; - } - input{ - float: right; - border: none; - background: $offwhite; - padding: 10px; - } - .avatar{ - float: right; - margin-right: 0; - img{ - width: 40px; - height: 40px; - } - } - input[type=submit]{ - text-transform: lowercase; - background: $mediumgreen; - color: #fff; - font-style: normal; - float: right; - border: none; - padding: 10px 50px; - margin-top: 40px; - } -} +.settings{ + h2{ + margin-top: 10px; + margin-bottom: 20px; + } + .settings-wrap{ + background: #fff url() 0 0 no-repeat; + width: 100%; + padding: 60px 0; + } + .col-sm-9{ + display: block; + float: none; + margin: 0 auto; + } + h3{ + margin-bottom: 30px; + color: $mediumgreen; + } + label{ + padding: 10px 0; + margin: 0; + font-weight: normal; + font-style: italic; + color: $mediumgreen; + } + input{ + float: right; + border: none; + background: $offwhite; + padding: 10px; + } + .avatar{ + float: right; + margin-right: 0; + img{ + width: 40px; + height: 40px; + } + } + input[type=submit]{ + text-transform: lowercase; + background: $mediumgreen; + color: #fff; + font-style: normal; + float: right; + border: none; + padding: 10px 50px; + margin-top: 40px; + } +} diff --git a/app/assets/stylesheets/sidebar.css.scss.erb b/app/assets/stylesheets/sidebar.css.scss.erb index 704f42e..d859c9b 100644 --- a/app/assets/stylesheets/sidebar.css.scss.erb +++ b/app/assets/stylesheets/sidebar.css.scss.erb @@ -1,32 +1,32 @@ -.sidebar-content{ - background: $lightgreen; - padding: 0px 15px; - h2{ - color: #fff; - font-size: 17px; - font-weight: 400; - } - p{ - text-indent: 30px; - } - .sidebar-stats{ - background-repeat: no-repeat; - background-position: center left; - padding: 5px 20px; - font-size: 17px; - &.icon-cameras{ - background-image: asset-url("icons/camera_white.png"); - margin-top: 20px; - } - &.icon-recorders{ - background-image: asset-url("icons/recorder.png"); - margin-top: 20px; - } - &.icon-manufacturers{ - background-image: asset-url("icons/man_white.png"); - } - &.icon-images{ - background-image: asset-url("icons/eye_white.png"); - } - } -} +.sidebar-content{ + background: $lightgreen; + padding: 0px 15px; + h2{ + color: #fff; + font-size: 17px; + font-weight: 400; + } + p{ + text-indent: 30px; + } + .sidebar-stats{ + background-repeat: no-repeat; + background-position: center left; + padding: 5px 20px; + font-size: 17px; + &.icon-cameras{ + background-image: asset-url("icons/camera_white.png"); + margin-top: 20px; + } + &.icon-recorders{ + background-image: asset-url("icons/recorder.png"); + margin-top: 20px; + } + &.icon-manufacturers{ + background-image: asset-url("icons/man_white.png"); + } + &.icon-images{ + background-image: asset-url("icons/eye_white.png"); + } + } +} diff --git a/app/controllers/api/v1/changes_controller.rb b/app/controllers/api/v1/changes_controller.rb index 80c43aa..f124649 100644 --- a/app/controllers/api/v1/changes_controller.rb +++ b/app/controllers/api/v1/changes_controller.rb @@ -1,34 +1,34 @@ -class Api::V1::ChangesController < ApplicationController - - swagger_controller :changes, "Changes" - - swagger_api :index do - summary "Fetches all Changes" - param :query, :page, :integer, :optional, "Page number" - param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - swagger_api :show do - summary "Fetches a single Change" - param :path, :id, :string, :required, "Change ID" - response :unauthorized - response :not_acceptable - response :not_found - end - - def index - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @changes = PaperTrail::Version.order(order).page params[:page] - end - - def show - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @change = PaperTrail::Version.find(params[:id]) - end - -end +class Api::V1::ChangesController < ApplicationController + + swagger_controller :changes, "Changes" + + swagger_api :index do + summary "Fetches all Changes" + param :query, :page, :integer, :optional, "Page number" + param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + swagger_api :show do + summary "Fetches a single Change" + param :path, :id, :string, :required, "Change ID" + response :unauthorized + response :not_acceptable + response :not_found + end + + def index + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @changes = PaperTrail::Version.order(order).page params[:page] + end + + def show + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @change = PaperTrail::Version.find(params[:id]) + end + +end diff --git a/app/controllers/api/v1/models_controller.rb b/app/controllers/api/v1/models_controller.rb index 077cdeb..963d3a4 100644 --- a/app/controllers/api/v1/models_controller.rb +++ b/app/controllers/api/v1/models_controller.rb @@ -1,134 +1,134 @@ -class Api::V1::ModelsController < ApplicationController - skip_before_filter :verify_authenticity_token - - swagger_controller :models, "Models Management" - - swagger_api :index do - summary "Fetches all Models" - param :query, :page, :integer, :optional, "Page number" - param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - swagger_api :show do - summary "Fetches a single Model" - param :path, :id, :integer, :required, "Model ID" - response :unauthorized - response :not_acceptable - response :not_found - end - - swagger_api :create do - summary "Creates a new Model" - param :form, :vendor_id, :string, :required, "Vendor ID" - param :form, 'model[model]', :string, :required, "Model" - param_list :form, 'model[shape]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort - param_list :form, 'model[resolution]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort - param_list :form, 'model[onvif]', :string, :optional, "ONVIF", [true, false] - param_list :form, 'model[psia]', :string, :optional, "PSIA", [true, false] - param_list :form, 'model[ptz]', :string, :optional, "PTZ", [true, false] - param_list :form, 'model[infrared]', :string, :optional, "Infrared", [true, false] - param_list :form, 'model[varifocal]', :string, :optional, "Varifocal", [true, false] - param_list :form, 'model[sd_card]', :string, :optional, "SD Card", [true, false] - param_list :form, 'model[upnp]', :string, :optional, "UPnP", [true, false] - param_list :form, 'model[audio_in]', :string, :optional, "UPnP", [true, false] - param_list :form, 'model[audio_out]', :string, :optional, "UPnP", [true, false] - param :form, 'model[default_username]', :string, :optional, "Default Username" - param :form, 'model[default_password]', :string, :optional, "Default Password" - param :form, 'model[jpeg_url]', :string, :optional, "JPEG URL" - param :form, 'model[h264_url]', :string, :optional, "H264 URL" - param :form, 'model[mjpeg_url]', :string, :optional, "MJPEG URL" - response :unauthorized - response :not_acceptable - end - - swagger_api :update do - summary "Updates an existing Model" - param :path, :id, :string, :required, "Model ID" - param :form, :vendor_id, :string, :required, "Vendor ID" - param :form, 'model[name]', :string, :optional, "Model" - param_list :form, 'model[shape]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort - param_list :form, 'model[resolution]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort - param_list :form, 'model[onvif]', :string, :optional, "ONVIF", [true, false] - param_list :form, 'model[psia]', :string, :optional, "PSIA", [true, false] - param_list :form, 'model[ptz]', :string, :optional, "PTZ", [true, false] - param_list :form, 'model[infrared]', :string, :optional, "Infrared", [true, false] - param_list :form, 'model[varifocal]', :string, :optional, "Varifocal", [true, false] - param_list :form, 'model[sd_card]', :string, :optional, "SD Card", [true, false] - param_list :form, 'model[upnp]', :string, :optional, "UPnP", [true, false] - param_list :form, 'model[audio_in]', :string, :optional, "Audio In", [true, false] - param_list :form, 'model[audio_out]', :string, :optional, "Audio Out", [true, false] - param :form, 'model[default_username]', :string, :optional, "Default Username" - param :form, 'model[default_password]', :string, :optional, "Default Password" - param :form, 'model[jpeg_url]', :string, :optional, "JPEG URL" - param :form, 'model[h264_url]', :string, :optional, "H264 URL" - param :form, 'model[mjpeg_url]', :string, :optional, "MJPEG URL" - response :unauthorized - response :not_found - response :not_acceptable - end - - swagger_api :search do - summary "Searches all Models" - param :query, :page, :integer, :optional, "Page number" - param :query, 'q[model_cont]', :string, :optional, "Model" - param :query, 'q[vendor_name_cont]', :string, :optional, "Vendor" - param_list :query, 'q[shape_eq]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort - param_list :query, 'q[resolution_eq]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort - param_list :query, 'q[onvif_true]', :string, :optional, "ONVIF", [true, false] - param_list :query, 'q[psia_true]', :string, :optional, "PSIA", [true, false] - param_list :query, 'q[ptz_true]', :string, :optional, "PTZ", [true, false] - param_list :query, 'q[infrared_true]', :string, :optional, "Infrared", [true, false] - param_list :query, 'q[varifocal_true]', :string, :optional, "Varifocal", [true, false] - param_list :query, 'q[sd_card_true]', :string, :optional, "SD Card", [true, false] - param_list :query, 'q[upnp_true]', :string, :optional, "UPnP", [true, false] - param_list :query, 'q[audio_in_true]', :string, :optional, "Audio In", [true, false] - param_list :query, 'q[audio_out_true]', :string, :optional, "Audio Out", [true, false] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - def index - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @models = Model.order(order).page params[:page] - end - - def show - @model = Model.find_by_model_slug(params[:id]) - end - - def search - @search = Model.search(params[:q]) - @models = @search.result.page params[:page] - render :index - end - - def create - params[:model][:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id - @model = Model.new(model_params) - if @model.save - render :show, status: :created - else - render json: @model.errors, status: :unprocessable_entity - end - end - - def update - params[:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id - @model = Model.find_by_model_slug(params[:id]) - if @model.update(model_params) - render :show, status: :created - else - render json: @model.errors, status: :unprocessable_entity - end - end - - def model_params - params.require(:model).permit! - end - -end +class Api::V1::ModelsController < ApplicationController + skip_before_filter :verify_authenticity_token + + swagger_controller :models, "Models Management" + + swagger_api :index do + summary "Fetches all Models" + param :query, :page, :integer, :optional, "Page number" + param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + swagger_api :show do + summary "Fetches a single Model" + param :path, :id, :integer, :required, "Model ID" + response :unauthorized + response :not_acceptable + response :not_found + end + + swagger_api :create do + summary "Creates a new Model" + param :form, :manufacturer_id, :string, :required, "Manufacturer ID" + param :form, 'model[model]', :string, :required, "Model" + param_list :form, 'model[shape]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort + param_list :form, 'model[resolution]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort + param_list :form, 'model[onvif]', :string, :optional, "ONVIF", [true, false] + param_list :form, 'model[psia]', :string, :optional, "PSIA", [true, false] + param_list :form, 'model[ptz]', :string, :optional, "PTZ", [true, false] + param_list :form, 'model[infrared]', :string, :optional, "Infrared", [true, false] + param_list :form, 'model[varifocal]', :string, :optional, "Varifocal", [true, false] + param_list :form, 'model[sd_card]', :string, :optional, "SD Card", [true, false] + param_list :form, 'model[upnp]', :string, :optional, "UPnP", [true, false] + param_list :form, 'model[audio_in]', :string, :optional, "UPnP", [true, false] + param_list :form, 'model[audio_out]', :string, :optional, "UPnP", [true, false] + param :form, 'model[default_username]', :string, :optional, "Default Username" + param :form, 'model[default_password]', :string, :optional, "Default Password" + param :form, 'model[jpeg_url]', :string, :optional, "JPEG URL" + param :form, 'model[h264_url]', :string, :optional, "H264 URL" + param :form, 'model[mjpeg_url]', :string, :optional, "MJPEG URL" + response :unauthorized + response :not_acceptable + end + + swagger_api :update do + summary "Updates an existing Model" + param :path, :id, :string, :required, "Model ID" + param :form, :manufacturer_id, :string, :required, "Manufacturer ID" + param :form, 'model[name]', :string, :optional, "Model" + param_list :form, 'model[shape]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort + param_list :form, 'model[resolution]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort + param_list :form, 'model[onvif]', :string, :optional, "ONVIF", [true, false] + param_list :form, 'model[psia]', :string, :optional, "PSIA", [true, false] + param_list :form, 'model[ptz]', :string, :optional, "PTZ", [true, false] + param_list :form, 'model[infrared]', :string, :optional, "Infrared", [true, false] + param_list :form, 'model[varifocal]', :string, :optional, "Varifocal", [true, false] + param_list :form, 'model[sd_card]', :string, :optional, "SD Card", [true, false] + param_list :form, 'model[upnp]', :string, :optional, "UPnP", [true, false] + param_list :form, 'model[audio_in]', :string, :optional, "Audio In", [true, false] + param_list :form, 'model[audio_out]', :string, :optional, "Audio Out", [true, false] + param :form, 'model[default_username]', :string, :optional, "Default Username" + param :form, 'model[default_password]', :string, :optional, "Default Password" + param :form, 'model[jpeg_url]', :string, :optional, "JPEG URL" + param :form, 'model[h264_url]', :string, :optional, "H264 URL" + param :form, 'model[mjpeg_url]', :string, :optional, "MJPEG URL" + response :unauthorized + response :not_found + response :not_acceptable + end + + swagger_api :search do + summary "Searches all Models" + param :query, :page, :integer, :optional, "Page number" + param :query, 'q[model_cont]', :string, :optional, "Model" + param :query, 'q[manufacturer_name_cont]', :string, :optional, "Manufacturer" + param_list :query, 'q[shape_eq]', :string, :optional, "Shape", Model.uniq.pluck(:resolution).compact.sort + param_list :query, 'q[resolution_eq]', :string, :optional, "Resolution", Model.uniq.pluck(:resolution).compact.sort + param_list :query, 'q[onvif_true]', :string, :optional, "ONVIF", [true, false] + param_list :query, 'q[psia_true]', :string, :optional, "PSIA", [true, false] + param_list :query, 'q[ptz_true]', :string, :optional, "PTZ", [true, false] + param_list :query, 'q[infrared_true]', :string, :optional, "Infrared", [true, false] + param_list :query, 'q[varifocal_true]', :string, :optional, "Varifocal", [true, false] + param_list :query, 'q[sd_card_true]', :string, :optional, "SD Card", [true, false] + param_list :query, 'q[upnp_true]', :string, :optional, "UPnP", [true, false] + param_list :query, 'q[audio_in_true]', :string, :optional, "Audio In", [true, false] + param_list :query, 'q[audio_out_true]', :string, :optional, "Audio Out", [true, false] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + def index + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @models = Model.order(order).page params[:page] + end + + def show + @model = Model.find_by_model_slug(params[:id]) + end + + def search + @search = Model.search(params[:q]) + @models = @search.result.page params[:page] + render :index + end + + def create + params[:model][:manufacturer_id] = Manufacturer.find_by_manufacturer_slug(params[:manufacturer_id].to_url).id + @model = Model.new(model_params) + if @model.save + render :show, status: :created + else + render json: @model.errors, status: :unprocessable_entity + end + end + + def update + params[:manufacturer_id] = Manufacturer.find_by_manufacturer_slug(params[:manufacturer_id].to_url).id + @model = Model.find_by_model_slug(params[:id]) + if @model.update(model_params) + render :show, status: :created + else + render json: @model.errors, status: :unprocessable_entity + end + end + + def model_params + params.require(:model).permit! + end + +end diff --git a/app/controllers/api/v1/recorders_controller.rb b/app/controllers/api/v1/recorders_controller.rb index 7184573..0cef5be 100644 --- a/app/controllers/api/v1/recorders_controller.rb +++ b/app/controllers/api/v1/recorders_controller.rb @@ -1,139 +1,134 @@ -class Api::V1::RecordersController < ApplicationController - skip_before_filter :verify_authenticity_token - - swagger_controller :recorders, "Recorders Management" - - swagger_api :index do - summary "Fetches all Recorders" - param :query, :page, :integer, :optional, "Page number" - param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - swagger_api :show do - summary "Fetches a single Recorder" - param :path, :id, :integer, :required, "Recorder ID" - response :unauthorized - response :not_acceptable - response :not_found - end - - swagger_api :create do - summary "Creates a new Recorder" - param :form, :vendor_id, :string, :required, "Vendor ID" - param :form, 'recorder[name]', :string, :required, "Name" - param :form, 'recorder[model]', :string, :required, "Model" - param_list :form, 'recorder[recorder_type]', :string, :optional, "Type", Recorder.uniq.pluck(:recorder_type).compact.sort - param_list :form, 'recorder[resolution]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort - param_list :form, 'recorder[onvif]', :string, :optional, "ONVIF", [true, false] - param_list :form, 'recorder[psia]', :string, :optional, "PSIA", [true, false] - param_list :form, 'recorder[infrared]', :string, :optional, "Infrared", [true, false] - param_list :form, 'recorder[playback_channels]', :integer, :optional, "Playback Channels" - param_list :form, 'recorder[input_channels]', :integer, :optional, "Input Channels" - param_list :form, 'recorder[upnp]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[audio_in]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[audio_out]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[discontinued]', :string, :optional, "Discontinued", [true, false] - param_list :form, 'recorder[support_3rdparty]', :string, :optional, "3rd Party Cameras Support", [true, false] - param :form, 'recorder[default_username]', :string, :optional, "Default Username" - param :form, 'recorder[default_password]', :string, :optional, "Default Password" - param :form, 'recorder[jpeg_url]', :string, :optional, "JPEG URL" - param :form, 'recorder[h264_url]', :string, :optional, "H264 URL" - param :form, 'recorder[mjpeg_url]', :string, :optional, "MJPEG URL" - param :form, 'recorder[official_url]', :string, :optional, "Official URL" - response :unauthorized - response :not_acceptable - end - - swagger_api :update do - summary "Updates an existing Recorder" - param :form, :vendor_id, :string, :required, "Vendor ID" - param :form, 'recorder[name]', :string, :required, "Name" - param :form, 'recorder[model]', :string, :required, "Model" - param_list :form, 'recorder[recorder_type]', :string, :optional, "Type", Recorder.uniq.pluck(:recorder_type).compact.sort - param_list :form, 'recorder[resolution]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort - param_list :form, 'recorder[onvif]', :string, :optional, "ONVIF", [true, false] - param_list :form, 'recorder[psia]', :string, :optional, "PSIA", [true, false] - param_list :form, 'recorder[ptz]', :string, :optional, "PTZ", [true, false] - param_list :form, 'recorder[playback_channels]', :integer, :optional, "Playback Channels" - param_list :form, 'recorder[input_channels]', :integer, :optional, "Input Channels" - param_list :form, 'recorder[upnp]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[audio_in]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[audio_out]', :string, :optional, "UPnP", [true, false] - param_list :form, 'recorder[discontinued]', :string, :optional, "Discontinued", [true, false] - param_list :form, 'recorder[support_3rdparty]', :string, :optional, "3rd Party Support", [true, false] - param :form, 'recorder[default_username]', :string, :optional, "Default Username" - param :form, 'recorder[default_password]', :string, :optional, "Default Password" - param :form, 'recorder[jpeg_url]', :string, :optional, "JPEG URL" - param :form, 'recorder[h264_url]', :string, :optional, "H264 URL" - param :form, 'recorder[mjpeg_url]', :string, :optional, "MJPEG URL" - param :form, 'recorder[official_url]', :string, :optional, "Official URL" - response :unauthorized - response :not_found - response :not_acceptable - end - - swagger_api :search do - summary "Searches all Recorders" - param :query, :page, :integer, :optional, "Page number" - param :query, 'q[recorder_cont]', :string, :optional, "Recorder" - param :query, 'q[vendor_name_cont]', :string, :optional, "Vendor" - param_list :query, 'q[recorder_type_eq]', :string, :optional, "Type", Recorder.uniq.pluck(:resolution).compact.sort - param_list :query, 'q[resolution_eq]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort - param_list :query, 'q[onvif_true]', :string, :optional, "ONVIF", [true, false] - param_list :query, 'q[psia_true]', :string, :optional, "PSIA", [true, false] - param_list :query, 'q[ptz_true]', :string, :optional, "PTZ", [true, false] - param_list :query, 'q[support_3rdparty_true]', :string, :optional, "3rd Party Support", [true, false] - param_list :query, 'q[discontinued_true]', :string, :optional, "Discontinued", [true, false] - param_list :query, 'q[sd_card_true]', :string, :optional, "SD Card", [true, false] - param_list :query, 'q[upnp_true]', :string, :optional, "UPnP", [true, false] - param_list :query, 'q[audio_in_true]', :string, :optional, "Audio In", [true, false] - param_list :query, 'q[audio_out_true]', :string, :optional, "Audio Out", [true, false] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - def index - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @recorders = Recorder.order(order).page params[:page] - end - - def show - @recorder = Recorder.find_by_recorder_slug(params[:id]) - end - - def search - @search = Recorder.search(params[:q]) - @recorders = @search.result.page params[:page] - render :index - end - - def create - params[:recorder][:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id - @recorder = Recorder.new(recorder_params) - if @recorder.save - render :show, status: :created - else - render json: @recorder.errors, status: :unprocessable_entity - end - end - - def update - params[:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id - @recorder = Recorder.find_by_recorder_slug(params[:id]) - if @recorder.update(recorder_params) - render :show, status: :created - else - render json: @recorder.errors, status: :unprocessable_entity - end - end - - def recorder_params - params.require(:recorder).permit! - end - -end +class Api::V1::RecordersController < ApplicationController + skip_before_filter :verify_authenticity_token + + swagger_controller :recorders, "Recorders Management" + + swagger_api :index do + summary "Fetches all Recorders" + param :query, :page, :integer, :optional, "Page number" + param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + swagger_api :show do + summary "Fetches a single Recorder" + param :path, :id, :integer, :required, "Recorder ID" + response :unauthorized + response :not_acceptable + response :not_found + end + + swagger_api :create do + summary "Creates a new Recorder" + param :form, :vendor_id, :string, :required, "Vendor ID" + param :form, 'recorder[model]', :string, :required, "Recorder" + param_list :form, 'recorder[shape]', :string, :optional, "Shape", Recorder.uniq.pluck(:resolution).compact.sort + param_list :form, 'recorder[resolution]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort + param_list :form, 'recorder[onvif]', :string, :optional, "ONVIF", [true, false] + param_list :form, 'recorder[psia]', :string, :optional, "PSIA", [true, false] + param_list :form, 'recorder[ptz]', :string, :optional, "PTZ", [true, false] + param_list :form, 'recorder[infrared]', :string, :optional, "Infrared", [true, false] + param_list :form, 'recorder[varifocal]', :string, :optional, "Varifocal", [true, false] + param_list :form, 'recorder[sd_card]', :string, :optional, "SD Card", [true, false] + param_list :form, 'recorder[upnp]', :string, :optional, "UPnP", [true, false] + param_list :form, 'recorder[audio_in]', :string, :optional, "UPnP", [true, false] + param_list :form, 'recorder[audio_out]', :string, :optional, "UPnP", [true, false] + param :form, 'recorder[default_username]', :string, :optional, "Default Username" + param :form, 'recorder[default_password]', :string, :optional, "Default Password" + param :form, 'recorder[jpeg_url]', :string, :optional, "JPEG URL" + param :form, 'recorder[h264_url]', :string, :optional, "H264 URL" + param :form, 'recorder[mjpeg_url]', :string, :optional, "MJPEG URL" + response :unauthorized + response :not_acceptable + end + + swagger_api :update do + summary "Updates an existing Recorder" + param :path, :id, :string, :required, "Recorder ID" + param :form, :vendor_id, :string, :required, "Vendor ID" + param :form, 'recorder[name]', :string, :optional, "Recorder" + param_list :form, 'recorder[shape]', :string, :optional, "Shape", Recorder.uniq.pluck(:resolution).compact.sort + param_list :form, 'recorder[resolution]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort + param_list :form, 'recorder[onvif]', :string, :optional, "ONVIF", [true, false] + param_list :form, 'recorder[psia]', :string, :optional, "PSIA", [true, false] + param_list :form, 'recorder[ptz]', :string, :optional, "PTZ", [true, false] + param_list :form, 'recorder[infrared]', :string, :optional, "Infrared", [true, false] + param_list :form, 'recorder[varifocal]', :string, :optional, "Varifocal", [true, false] + param_list :form, 'recorder[sd_card]', :string, :optional, "SD Card", [true, false] + param_list :form, 'recorder[upnp]', :string, :optional, "UPnP", [true, false] + param_list :form, 'recorder[audio_in]', :string, :optional, "Audio In", [true, false] + param_list :form, 'recorder[audio_out]', :string, :optional, "Audio Out", [true, false] + param :form, 'recorder[default_username]', :string, :optional, "Default Username" + param :form, 'recorder[default_password]', :string, :optional, "Default Password" + param :form, 'recorder[jpeg_url]', :string, :optional, "JPEG URL" + param :form, 'recorder[h264_url]', :string, :optional, "H264 URL" + param :form, 'recorder[mjpeg_url]', :string, :optional, "MJPEG URL" + response :unauthorized + response :not_found + response :not_acceptable + end + + swagger_api :search do + summary "Searches all Recorders" + param :query, :page, :integer, :optional, "Page number" + param :query, 'q[recorder_cont]', :string, :optional, "Recorder" + param :query, 'q[vendor_name_cont]', :string, :optional, "Vendor" + param_list :query, 'q[shape_eq]', :string, :optional, "Shape", Recorder.uniq.pluck(:resolution).compact.sort + param_list :query, 'q[resolution_eq]', :string, :optional, "Resolution", Recorder.uniq.pluck(:resolution).compact.sort + param_list :query, 'q[onvif_true]', :string, :optional, "ONVIF", [true, false] + param_list :query, 'q[psia_true]', :string, :optional, "PSIA", [true, false] + param_list :query, 'q[ptz_true]', :string, :optional, "PTZ", [true, false] + param_list :query, 'q[infrared_true]', :string, :optional, "Infrared", [true, false] + param_list :query, 'q[varifocal_true]', :string, :optional, "Varifocal", [true, false] + param_list :query, 'q[sd_card_true]', :string, :optional, "SD Card", [true, false] + param_list :query, 'q[upnp_true]', :string, :optional, "UPnP", [true, false] + param_list :query, 'q[audio_in_true]', :string, :optional, "Audio In", [true, false] + param_list :query, 'q[audio_out_true]', :string, :optional, "Audio Out", [true, false] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + def index + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @recorders = Recorder.order(order).page params[:page] + end + + def show + @recorder = Recorder.find_by_recorder_slug(params[:id]) + end + + def search + @search = Recorder.search(params[:q]) + @recorders = @search.result.page params[:page] + render :index + end + + def create + params[:recorder][:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id + @recorder = Recorder.new(recorder_params) + if @recorder.save + render :show, status: :created + else + render json: @recorder.errors, status: :unprocessable_entity + end + end + + def update + params[:vendor_id] = Vendor.find_by_vendor_slug(params[:vendor_id].to_url).id + @recorder = Recorder.find_by_recorder_slug(params[:id]) + if @recorder.update(recorder_params) + render :show, status: :created + else + render json: @recorder.errors, status: :unprocessable_entity + end + end + + def recorder_params + params.require(:recorder).permit! + end + +end diff --git a/app/controllers/api/v1/vendors_controller.rb b/app/controllers/api/v1/vendors_controller.rb index 6a5b23d..ee35a63 100644 --- a/app/controllers/api/v1/vendors_controller.rb +++ b/app/controllers/api/v1/vendors_controller.rb @@ -1,77 +1,77 @@ -class Api::V1::VendorsController < ApplicationController - skip_before_filter :verify_authenticity_token - - swagger_controller :vendors, "Vendors" - - swagger_api :index do - summary "Fetches all Vendors" - param :query, :page, :integer, :optional, "Page number" - param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - response :unauthorized - response :not_acceptable, "The request you made is not acceptable" - response :requested_range_not_satisfiable - end - - swagger_api :show do - summary "Fetches a single Vendor" - param :path, :id, :string, :required, "Vendor ID" - param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - response :unauthorized - response :not_acceptable - response :not_found - end - - swagger_api :create do - summary "Creates a new Vendor" - param :form, 'vendor[name]', :string, :required, "Name" - param :form, 'vendor[url]', :string, :required, "Website" - response :unauthorized - response :not_acceptable - end - - swagger_api :update do - summary "Updates an existing Vendor" - param :path, :id, :string, :required, "Vendor ID" - param :form, 'vendor[name]', :string, :optional, "Name" - param :form, 'vendor[url]', :string, :optional, "Website" - response :unauthorized - response :not_found - response :not_acceptable - end - - def index - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @vendors = Vendor.order(order).page params[:page] - end - - def show - valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] - order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' - @vendor = Vendor.find_by_vendor_slug(params[:id]) - @models = @vendor.models.order(order).page params[:page] - end - - def create - @vendor = Vendor.new(vendor_params) - if @vendor.save - render json: @vendor - else - render json: @vendor.errors, status: :unprocessable_entity - end - end - - def update - @vendor = Vendor.find_by_vendor_slug(params[:id]) - if @vendor.update(vendor_params) - render json: @vendor - else - render json: @vendor.errors, status: :unprocessable_entity - end - end - - def vendor_params - params.require(:vendor).permit! - end - -end +class Api::V1::VendorsController < ApplicationController + skip_before_filter :verify_authenticity_token + + swagger_controller :vendors, "Vendors" + + swagger_api :index do + summary "Fetches all Vendors" + param :query, :page, :integer, :optional, "Page number" + param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + response :unauthorized + response :not_acceptable, "The request you made is not acceptable" + response :requested_range_not_satisfiable + end + + swagger_api :show do + summary "Fetches a single Vendor" + param :path, :id, :string, :required, "Vendor ID" + param_list :query, :order, :string, :optional, "Sort order", ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + response :unauthorized + response :not_acceptable + response :not_found + end + + swagger_api :create do + summary "Creates a new Vendor" + param :form, 'vendor[name]', :string, :required, "Name" + param :form, 'vendor[url]', :string, :required, "Website" + response :unauthorized + response :not_acceptable + end + + swagger_api :update do + summary "Updates an existing Vendor" + param :path, :id, :string, :required, "Vendor ID" + param :form, 'vendor[name]', :string, :optional, "Name" + param :form, 'vendor[url]', :string, :optional, "Website" + response :unauthorized + response :not_found + response :not_acceptable + end + + def index + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @vendors = Vendor.order(order).page params[:page] + end + + def show + valid_sort = ['created_at DESC', 'created_at ASC', 'updated_at DESC', 'updated_at ASC'] + order = valid_sort.include?(params[:order]) ? params[:order] : 'created_at DESC' + @vendor = Vendor.find_by_vendor_slug(params[:id]) + @models = @vendor.models.order(order).page params[:page] + end + + def create + @vendor = Vendor.new(vendor_params) + if @vendor.save + render json: @vendor + else + render json: @vendor.errors, status: :unprocessable_entity + end + end + + def update + @vendor = Vendor.find_by_vendor_slug(params[:id]) + if @vendor.update(vendor_params) + render json: @vendor + else + render json: @vendor.errors, status: :unprocessable_entity + end + end + + def vendor_params + params.require(:vendor).permit! + end + +end diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 45db118..42ea73c 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -1,6 +1,6 @@ -class ApiController < ApplicationController - def index - render :inline => "No rule matched" - end - -end +class ApiController < ApplicationController + def index + render :inline => "No rule matched" + end + +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 26e04b8..b739acf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,35 +1,35 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception - before_filter :configure_permitted_parameters, if: :devise_controller? - before_filter :set_global_search_variable - after_filter :store_location - - def set_global_search_variable - @search = Model.search() - end - - protected - - def configure_permitted_parameters - devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation) } - devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :email, :password, :remember_me) } - end - - def store_location - # store last url - this is needed for post-login redirect to whatever the user last visited. - if (request.fullpath != "/users/sign_in" && - request.fullpath != "/users/sign_up" && - request.fullpath != "/users" && - request.fullpath != "/users/password" && - request.fullpath != "/users/sign_out" && - !request.xhr?) # don't store ajax calls - session[:previous_url] = request.fullpath - end - end - - def after_sign_in_path_for(resource) - session[:previous_url] || root_path - end -end +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception + before_filter :configure_permitted_parameters, if: :devise_controller? + before_filter :set_global_search_variable + after_filter :store_location + + def set_global_search_variable + @search = Model.search() + end + + protected + + def configure_permitted_parameters + devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation) } + devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :email, :password, :remember_me) } + end + + def store_location + # store last url - this is needed for post-login redirect to whatever the user last visited. + if (request.fullpath != "/users/sign_in" && + request.fullpath != "/users/sign_up" && + request.fullpath != "/users" && + request.fullpath != "/users/password" && + request.fullpath != "/users/sign_out" && + !request.xhr?) # don't store ajax calls + session[:previous_url] = request.fullpath + end + end + + def after_sign_in_path_for(resource) + session[:previous_url] || root_path + end +end diff --git a/app/controllers/models_controller.rb b/app/controllers/models_controller.rb index fa31f8a..7573be5 100644 --- a/app/controllers/models_controller.rb +++ b/app/controllers/models_controller.rb @@ -1,120 +1,120 @@ -class ModelsController < ApplicationController - before_action :set_model, only: [:show, :edit, :update, :destroy] - - # GET /models - # GET /models.json - def index - if params[:q].blank? - @search = Model.search() - @models = Model.page params[:page] - - unless params[:vendor_slug].blank? - @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) - @models = @models.where(:vendor_id => @vendor.id) - end - else - @search = Model.search(params[:q]) - @models = @search.result.page params[:page] - end - respond_to do |format| - format.html - format.json { render :json => @models, :except => [:created_at, :updated_at] } - end - end - - def search - index - # render :index - end - - # GET /models/1 - # GET /models/1.json - def show - unless params[:vendor_slug].blank? - @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) - @model = Model.where(:model_slug => params[:id]).where(:vendor_id => @vendor.id).first - end - respond_to do |format| - format.html - format.json { - render :json => - @model - } - end - end - - # GET /models/new - def new - @model = Model.new - end - - # GET /models/1/edit - def edit - end - - # POST /models - # POST /models.json - def create - @model = Model.new(model_params) - respond_to do |format| - if @model.save - format.html { - redirect_to vendor_model_path(@model.vendor.vendor_slug, @model.model_slug), - notice: 'Model was successfully created.' - } - format.json { render :show, status: :created, location: @model } - else - format.html { redirect_to models_path, notice: @model.errors.full_messages.to_sentence } - format.json { render json: @model.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /models/1 - # PATCH/PUT /models/1.json - def update - @model = Model.find(params[:id]) - if params[:model][:images_attributes] - @model.images.build(:file => params['model']['images_attributes']['0'][:file]).save - params['model']['images_attributes'] = nil - end - respond_to do |format| - if @model.update(model_params) - format.html { - redirect_to vendor_model_path(@model.vendor.vendor_slug, @model.model_slug), - notice: 'Model was successfully updated.' - } - format.json { render json: @model } - else - format.html { redirect_to models_path, notice: @model.errors.full_messages.to_sentence } - format.json { render json: @model.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /models/1 - # DELETE /models/1.json - def destroy - @model.destroy - respond_to do |format| - format.html { redirect_to models_url } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_model - @model = Model.find_by_model_slug(params[:id]) - end - - def rollback_to_previous_version - @model.versions.last.reify.save! - flash[:notice] = "Your changes will be reflected once an admin has reviewed them" - end - - # Never trust parameters from the scary internet, only allow the white list through. - def model_params - params.require(:model).permit!.except(:id, :created_at, :updated_at) - end -end +class ModelsController < ApplicationController + before_action :set_model, only: [:show, :edit, :update, :destroy] + + # GET /models + # GET /models.json + def index + if params[:q].blank? + @search = Model.search() + @models = Model.page params[:page] + + unless params[:vendor_slug].blank? + @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) + @models = @models.where(:vendor_id => @vendor.id) + end + else + @search = Model.search(params[:q]) + @models = @search.result.page params[:page] + end + respond_to do |format| + format.html + format.json { render :json => @models, :except => [:created_at, :updated_at] } + end + end + + def search + index + # render :index + end + + # GET /models/1 + # GET /models/1.json + def show + unless params[:vendor_slug].blank? + @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) + @model = Model.where(:model_slug => params[:id]).where(:vendor_id => @vendor.id).first + end + respond_to do |format| + format.html + format.json { + render :json => + @model + } + end + end + + # GET /models/new + def new + @model = Model.new + end + + # GET /models/1/edit + def edit + end + + # POST /models + # POST /models.json + def create + @model = Model.new(model_params) + respond_to do |format| + if @model.save + format.html { + redirect_to vendor_model_path(@model.vendor.vendor_slug, @model.model_slug), + notice: 'Model was successfully created.' + } + format.json { render :show, status: :created, location: @model } + else + format.html { redirect_to models_path, notice: @model.errors.full_messages.to_sentence } + format.json { render json: @model.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /models/1 + # PATCH/PUT /models/1.json + def update + @model = Model.find(params[:id]) + if params[:model][:images_attributes] + @model.images.build(:file => params['model']['images_attributes']['0'][:file]).save + params['model']['images_attributes'] = nil + end + respond_to do |format| + if @model.update(model_params) + format.html { + redirect_to vendor_model_path(@model.vendor.vendor_slug, @model.model_slug), + notice: 'Model was successfully updated.' + } + format.json { render json: @model } + else + format.html { redirect_to models_path, notice: @model.errors.full_messages.to_sentence } + format.json { render json: @model.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /models/1 + # DELETE /models/1.json + def destroy + @model.destroy + respond_to do |format| + format.html { redirect_to models_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_model + @model = Model.find_by_model_slug(params[:id]) + end + + def rollback_to_previous_version + @model.versions.last.reify.save! + flash[:notice] = "Your changes will be reflected once an admin has reviewed them" + end + + # Never trust parameters from the scary internet, only allow the white list through. + def model_params + params.require(:model).permit!.except(:id, :created_at, :updated_at) + end +end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index ebe63f6..33f474f 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,16 +1,16 @@ -class PagesController < ApplicationController - def index - @images = Image.where(owner_type: ["Vendor"]).all.reverse - end - def about_cambase - end - def about_evercam - end - def terms_of_service - end - def contact - end - def settings - render 'devise/registrations/edit' - end -end +class PagesController < ApplicationController + def index + @images = Image.where(owner_type: ["Vendor"]).all.reverse + end + def about_cambase + end + def about_evercam + end + def terms_of_service + end + def contact + end + def settings + render 'devise/registrations/edit' + end +end diff --git a/app/controllers/recorders_controller.rb b/app/controllers/recorders_controller.rb index c9a98a4..6675bba 100644 --- a/app/controllers/recorders_controller.rb +++ b/app/controllers/recorders_controller.rb @@ -1,121 +1,121 @@ -class RecordersController < ApplicationController - before_action :set_recorder, only: [:show, :edit, :update, :destroy] - - # GET /recorders - # GET /recorders.json - def index - if params[:q].blank? - @search = Recorder.search() - @recorders = Recorder.page params[:page] - - unless params[:vendor_slug].blank? - @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) - @recorders = @recorders.where(:vendor_id => @vendor.id) - end - else - @search = Recorder.search(params[:q]) - @recorders = @search.result.page params[:page] - end - - respond_to do |format| - format.html - format.json { render :json => @recorders, :except => [:created_at, :updated_at] } - end - end - - def search - index - # render :index - end - - # GET /recorders/1 - # GET /recorders/1.json - def show - unless params[:vendor_slug].blank? - @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) - @recorder = Recorder.where(:recorder_slug => params[:id]).where(:vendor_id => @vendor.id).first - end - respond_to do |format| - format.html - format.json { - render :json => - @recorder - } - end - end - - # GET /recorders/new - def new - @recorder = Recorder.new - end - - # GET /recorders/1/edit - def edit - end - - # POST /recorders - # POST /recorders.json - def create - @recorder = Recorder.new(recorder_params) - respond_to do |format| - if @recorder.save - format.html { - redirect_to vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug), - notice: 'Recorder was successfully created.' - } - format.json { render :show, status: :created, location: @recorder } - else - format.html { redirect_to recorders_path, notice: @recorder.errors.full_messages.to_sentence } - format.json { render json: @recorder.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /recorders/1 - # PATCH/PUT /recorders/1.json - def update - @recorder = Recorder.find(params[:id]) - if params[:model][:images_attributes] - @recorder.images.build(:file => params['model']['images_attributes']['0'][:file]).save - params['model']['images_attributes'] = nil - end - respond_to do |format| - if @recorder.update(recorder_params) - format.html { - redirect_to vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug), - notice: 'Recorder was successfully updated.' - } - format.json { render json: @recorder } - else - format.html { redirect_to recorders_path, notice: @recorder.errors.full_messages.to_sentence } - format.json { render json: @recorder.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /recorders/1 - # DELETE /recorders/1.json - def destroy - @recorder.destroy - respond_to do |format| - format.html { redirect_to recorders_url } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_recorder - @recorder = Recorder.find_by_recorder_slug(params[:id]) - end - - def rollback_to_previous_version - @recorder.versions.last.reify.save! - flash[:notice] = "Your changes will be reflected once an admin has reviewed them" - end - - # Never trust parameters from the scary internet, only allow the white list through. - def recorder_params - params.require(:recorder).permit!.except(:id, :created_at, :updated_at) - end -end +class RecordersController < ApplicationController + before_action :set_recorder, only: [:show, :edit, :update, :destroy] + + # GET /recorders + # GET /recorders.json + def index + if params[:q].blank? + @search = Recorder.search() + @recorders = Recorder.page params[:page] + + unless params[:vendor_slug].blank? + @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) + @recorders = @recorders.where(:vendor_id => @vendor.id) + end + else + @search = Recorder.search(params[:q]) + @recorders = @search.result.page params[:page] + end + + respond_to do |format| + format.html + format.json { render :json => @recorders, :except => [:created_at, :updated_at] } + end + end + + def search + index + # render :index + end + + # GET /recorders/1 + # GET /recorders/1.json + def show + unless params[:vendor_slug].blank? + @vendor = Vendor.find_by_vendor_slug(params[:vendor_slug]) + @recorder = Recorder.where(:recorder_slug => params[:id]).where(:vendor_id => @vendor.id).first + end + respond_to do |format| + format.html + format.json { + render :json => + @recorder + } + end + end + + # GET /recorders/new + def new + @recorder = Recorder.new + end + + # GET /recorders/1/edit + def edit + end + + # POST /recorders + # POST /recorders.json + def create + @recorder = Recorder.new(recorder_params) + respond_to do |format| + if @recorder.save + format.html { + redirect_to vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug), + notice: 'Recorder was successfully created.' + } + format.json { render :show, status: :created, location: @recorder } + else + format.html { redirect_to recorders_path, notice: @recorder.errors.full_messages.to_sentence } + format.json { render json: @recorder.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /recorders/1 + # PATCH/PUT /recorders/1.json + def update + @recorder = Recorder.find(params[:id]) + if params[:model][:images_attributes] + @recorder.images.build(:file => params['model']['images_attributes']['0'][:file]).save + params['model']['images_attributes'] = nil + end + respond_to do |format| + if @recorder.update(recorder_params) + format.html { + redirect_to vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug), + notice: 'Recorder was successfully updated.' + } + format.json { render json: @recorder } + else + format.html { redirect_to recorders_path, notice: @recorder.errors.full_messages.to_sentence } + format.json { render json: @recorder.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /recorders/1 + # DELETE /recorders/1.json + def destroy + @recorder.destroy + respond_to do |format| + format.html { redirect_to recorders_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_recorder + @recorder = Recorder.find_by_recorder_slug(params[:id]) + end + + def rollback_to_previous_version + @recorder.versions.last.reify.save! + flash[:notice] = "Your changes will be reflected once an admin has reviewed them" + end + + # Never trust parameters from the scary internet, only allow the white list through. + def recorder_params + params.require(:recorder).permit!.except(:id, :created_at, :updated_at) + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dd134e0..7127589 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,47 +1,47 @@ -class UsersController < ApplicationController - - def auth - code = params[:code] - - evercam_dashboard = Faraday.new(url: 'https://dashboard.evercam.io/') do |faraday| - faraday.request :url_encoded - faraday.adapter Faraday.default_adapter - end - - evercam_api = Faraday.new(url: 'https://api.evercam.io/') do |faraday| - faraday.request :url_encoded - faraday.adapter Faraday.default_adapter - end - - parameters = { - redirect_uri: "#{root_url}users/auth", - code: code, - client_id: '3d0e289b', - client_secret: ENV['EVERCAM_KEY'], - grant_type: 'authorization_code' - } - - # binding.pry - - response = evercam_dashboard.post '/oauth2/authorize', parameters - - access_token = JSON.parse(response.body)['access_token'] - - response = evercam_dashboard.get "/oauth2/tokeninfo?access_token=#{access_token}" - - user_id = JSON.parse(response.body)['userid'] - - response = evercam_api.get do |request| - request.url "/v1/users/#{user_id}" - request.headers['Authorization'] = "bearer #{access_token}" - end - - evercam_user = JSON.parse(response.body)['users'][0] - - user = User.where(username: evercam_user['id']).first_or_initialize - user.update_attributes(email: evercam_user['email']) - sign_in(user) - redirect_to after_sign_in_path_for(user) - end - -end +class UsersController < ApplicationController + + def auth + code = params[:code] + + evercam_dashboard = Faraday.new(url: 'https://dashboard.evercam.io/') do |faraday| + faraday.request :url_encoded + faraday.adapter Faraday.default_adapter + end + + evercam_api = Faraday.new(url: 'https://api.evercam.io/') do |faraday| + faraday.request :url_encoded + faraday.adapter Faraday.default_adapter + end + + parameters = { + redirect_uri: "#{root_url}users/auth", + code: code, + client_id: '3d0e289b', + client_secret: ENV['EVERCAM_KEY'], + grant_type: 'authorization_code' + } + + # binding.pry + + response = evercam_dashboard.post '/oauth2/authorize', parameters + + access_token = JSON.parse(response.body)['access_token'] + + response = evercam_dashboard.get "/oauth2/tokeninfo?access_token=#{access_token}" + + user_id = JSON.parse(response.body)['userid'] + + response = evercam_api.get do |request| + request.url "/v1/users/#{user_id}" + request.headers['Authorization'] = "bearer #{access_token}" + end + + evercam_user = JSON.parse(response.body)['users'][0] + + user = User.where(username: evercam_user['id']).first_or_initialize + user.update_attributes(email: evercam_user['email']) + sign_in(user) + redirect_to after_sign_in_path_for(user) + end + +end diff --git a/app/controllers/vendors_controller.rb b/app/controllers/vendors_controller.rb index 3652666..72532f6 100644 --- a/app/controllers/vendors_controller.rb +++ b/app/controllers/vendors_controller.rb @@ -1,94 +1,94 @@ -class VendorsController < ApplicationController - before_action :set_vendor, only: [:show, :edit, :update, :destroy] - - # GET /vendors - # GET /vendors.json - def index - @vendors = Vendor.order(:name).page params[:page] - respond_to do |format| - format.html - format.json { - render :json => - @vendors, - :include => {:models => { :except => [:created_at, :updated_at] }}, - :except => [:created_at, :updated_at] - } - end - end - - # GET /vendors/1 - # GET /vendors/1.json - def show - @vendors = Vendor.find_by_vendor_slug(params[:id]) - @models = Vendor.find_by_vendor_slug(params[:id]).models.order(:model).page params[:page] - respond_to do |format| - format.html - format.json { render :json => @models, :except => [:created_at, :updated_at] } - end - end - - # GET /vendors/new - def new - @vendor = Vendor.new - @vendor.build_image - end - - # GET /vendors/1/edit - def edit - end - - # POST /vendors - # POST /vendors.json - def create - @vendor = Vendor.new(vendor_params) - respond_to do |format| - if @vendor.save - format.html { redirect_to "/#{@vendor.vendor_slug}", notice: 'Vendor was successfully created.' } - format.json { render :show, status: :created, location: @vendor } - else - format.html { redirect_to vendors_path, notice: @vendor.errors.full_messages.to_sentence } - - format.json { render json: @vendor.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /vendors/1 - # PATCH/PUT /vendors/1.json - def update - @vendor = Vendor.find(params[:id]) - if params[:vendor][:image_attributes] - params[:vendor][:image_attributes][:id] = nil - end - respond_to do |format| - if @vendor.update(vendor_params) - format.html { redirect_to "/#{@vendor.vendor_slug}", notice: 'Vendor was successfully updated.' } - format.json { render json: @vendor } - else - format.html { redirect_to vendors_path, notice: @vendor.errors.full_messages.to_sentence } - format.json { render json: @vendor.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /vendors/1 - # DELETE /vendors/1.json - def destroy - @vendor.destroy - respond_to do |format| - format.html { redirect_to vendors_url } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_vendor - @vendor = Vendor.find_by_vendor_slug(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def vendor_params - params.require(:vendor).permit(:name, :image, :url, image_attributes: [:id, :file, :_destroy]) - end -end +class VendorsController < ApplicationController + before_action :set_vendor, only: [:show, :edit, :update, :destroy] + + # GET /vendors + # GET /vendors.json + def index + @vendors = Vendor.order(:name).page params[:page] + respond_to do |format| + format.html + format.json { + render :json => + @vendors, + :include => {:models => { :except => [:created_at, :updated_at] }}, + :except => [:created_at, :updated_at] + } + end + end + + # GET /vendors/1 + # GET /vendors/1.json + def show + @vendors = Vendor.find_by_vendor_slug(params[:id]) + @models = Vendor.find_by_vendor_slug(params[:id]).models.order(:model).page params[:page] + respond_to do |format| + format.html + format.json { render :json => @models, :except => [:created_at, :updated_at] } + end + end + + # GET /vendors/new + def new + @vendor = Vendor.new + @vendor.build_image + end + + # GET /vendors/1/edit + def edit + end + + # POST /vendors + # POST /vendors.json + def create + @vendor = Vendor.new(vendor_params) + respond_to do |format| + if @vendor.save + format.html { redirect_to "/#{@vendor.vendor_slug}", notice: 'Vendor was successfully created.' } + format.json { render :show, status: :created, location: @vendor } + else + format.html { redirect_to vendors_path, notice: @vendor.errors.full_messages.to_sentence } + + format.json { render json: @vendor.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /vendors/1 + # PATCH/PUT /vendors/1.json + def update + @vendor = Vendor.find(params[:id]) + if params[:vendor][:image_attributes] + params[:vendor][:image_attributes][:id] = nil + end + respond_to do |format| + if @vendor.update(vendor_params) + format.html { redirect_to "/#{@vendor.vendor_slug}", notice: 'Vendor was successfully updated.' } + format.json { render json: @vendor } + else + format.html { redirect_to vendors_path, notice: @vendor.errors.full_messages.to_sentence } + format.json { render json: @vendor.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /vendors/1 + # DELETE /vendors/1.json + def destroy + @vendor.destroy + respond_to do |format| + format.html { redirect_to vendors_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_vendor + @vendor = Vendor.find_by_vendor_slug(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def vendor_params + params.require(:vendor).permit(:name, :image, :url, image_attributes: [:id, :file, :_destroy]) + end +end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 4d65ba6..ec52701 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -1,13 +1,13 @@ -class VersionsController < ApplicationController - - def change - @version = PaperTrail::Version.find(params[:version_id]).next - if @version.reify - @version.reify.save! - else - @version.item.destroy - end - render :inline => "Success" - end - -end +class VersionsController < ApplicationController + + def change + @version = PaperTrail::Version.find(params[:version_id]).next + if @version.reify + @version.reify.save! + else + @version.item.destroy + end + render :inline => "Success" + end + +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4ba1364..8142dba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,51 +1,51 @@ -module ApplicationHelper - def resource_name - :user - end - - def resource - @resource ||= User.new - end - - def model - @model ||= Model.new - end - - def devise_mapping - @devise_mapping ||= Devise.mappings[:user] - end - - def bootstrap_class_for flash_type - { success: "alert-success", error: "alert-error", alert: "alert-warning", notice: "alert-info" }[flash_type.to_sym] || flash_type.to_s - end - - def flash_messages(opts = {}) - flash.each do |msg_type, message| - concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} fade in") do - concat content_tag(:button, 'x', class: "close", data: { dismiss: 'alert' }) - concat message - end) - end - nil - end - - def human_boolean(boolean) - boolean ? 'Yes' : 'No' - end - - def avatar_url(user) - gravatar_id = Digest::MD5::hexdigest(user.email).downcase - "http://gravatar.com/avatar/#{gravatar_id}.png?s=16&d=mm&f=y" - end - - def xeditable? object = nil - true - end - - def combine_features - any_feature = Model::FEATURES.map { |n| n.parameterize.underscore } - any_feature = any_feature.inject { |x, y| "#{x}_or_#{y}" } - any_feature = "#{any_feature}_true" - end -end - +module ApplicationHelper + def resource_name + :user + end + + def resource + @resource ||= User.new + end + + def model + @model ||= Model.new + end + + def devise_mapping + @devise_mapping ||= Devise.mappings[:user] + end + + def bootstrap_class_for flash_type + { success: "alert-success", error: "alert-error", alert: "alert-warning", notice: "alert-info" }[flash_type.to_sym] || flash_type.to_s + end + + def flash_messages(opts = {}) + flash.each do |msg_type, message| + concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} fade in") do + concat content_tag(:button, 'x', class: "close", data: { dismiss: 'alert' }) + concat message + end) + end + nil + end + + def human_boolean(boolean) + boolean ? 'Yes' : 'No' + end + + def avatar_url(user) + gravatar_id = Digest::MD5::hexdigest(user.email).downcase + "http://gravatar.com/avatar/#{gravatar_id}.png?s=16&d=mm&f=y" + end + + def xeditable? object = nil + true + end + + def combine_features + any_feature = Model::FEATURES.map { |n| n.parameterize.underscore } + any_feature = any_feature.inject { |x, y| "#{x}_or_#{y}" } + any_feature = "#{any_feature}_true" + end +end + diff --git a/app/helpers/models_helper.rb b/app/helpers/models_helper.rb index 2d507d0..d90a580 100644 --- a/app/helpers/models_helper.rb +++ b/app/helpers/models_helper.rb @@ -1,2 +1,2 @@ -module ModelsHelper -end +module ModelsHelper +end diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb index 1c6365e..b31c322 100644 --- a/app/helpers/pages_helper.rb +++ b/app/helpers/pages_helper.rb @@ -1,5 +1,5 @@ -module PagesHelper - def link_to_model_url(name = model.model, model) - link_to(name, "/#{model.vendor.vendor_slug}/models/#{model.model_slug}") - end -end +module PagesHelper + def link_to_model_url(name = model.model, model) + link_to(name, "/#{model.vendor.vendor_slug}/models/#{model.model_slug}") + end +end diff --git a/app/helpers/recorders_helper.rb b/app/helpers/recorders_helper.rb index 02b6d1f..e54080f 100644 --- a/app/helpers/recorders_helper.rb +++ b/app/helpers/recorders_helper.rb @@ -1,2 +1,2 @@ -module RecordersHelper -end +module RecordersHelper +end diff --git a/app/helpers/vendors_helper.rb b/app/helpers/vendors_helper.rb index 501e30b..5429ffa 100644 --- a/app/helpers/vendors_helper.rb +++ b/app/helpers/vendors_helper.rb @@ -1,2 +1,2 @@ -module VendorsHelper -end +module VendorsHelper +end diff --git a/app/models/document.rb b/app/models/document.rb index 394de47..4f108de 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -1,6 +1,6 @@ -class Document < ActiveRecord::Base - belongs_to :owner, polymorphic: true - has_attached_file :file - validates_attachment :file, presence: true, content_type: { content_type: /\A.*\Z/ } - validates :file_fingerprint, uniqueness: { scope: :owner_id, :message => "already exists in the database." } -end +class Document < ActiveRecord::Base + belongs_to :owner, polymorphic: true + has_attached_file :file + validates_attachment :file, presence: true, content_type: { content_type: /\A.*\Z/ } + validates :file_fingerprint, uniqueness: { scope: :owner_id, :message => "already exists in the database." } +end diff --git a/app/models/image.rb b/app/models/image.rb index de9927b..6db517f 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -1,19 +1,19 @@ -class Image < ActiveRecord::Base - belongs_to :owner, polymorphic: true - - has_attached_file :file, styles: { small: '120x50', medium: '350x350' } - validates_attachment :file, presence: true, content_type: { content_type: /\Aimage\/.*\Z/ } - validates :file_fingerprint, uniqueness: { scope: :owner_id, :message => "already exists in the database." } - - scope :sorted, -> { order(:position) } - - before_post_process :rename_file - - protected - - def rename_file - curr = file.instance_read(:file_name) - succ = "#{SecureRandom.hex}#{File.extname(curr).downcase}" - file.instance_write(:file_name, succ) - end -end +class Image < ActiveRecord::Base + belongs_to :owner, polymorphic: true + + has_attached_file :file, styles: { small: '120x50', medium: '350x350' } + validates_attachment :file, presence: true, content_type: { content_type: /\Aimage\/.*\Z/ } + validates :file_fingerprint, uniqueness: { scope: :owner_id, :message => "already exists in the database." } + + scope :sorted, -> { order(:position) } + + before_post_process :rename_file + + protected + + def rename_file + curr = file.instance_read(:file_name) + succ = "#{SecureRandom.hex}#{File.extname(curr).downcase}" + file.instance_write(:file_name, succ) + end +end diff --git a/app/models/model.rb b/app/models/model.rb index 89ca287..87fe47d 100644 --- a/app/models/model.rb +++ b/app/models/model.rb @@ -1,48 +1,48 @@ -class Model < ActiveRecord::Base - has_many :images, as: :owner - has_many :documents, as: :owner - belongs_to :vendor - before_save :make_slug - before_save :titleize_shape - has_paper_trail - - accepts_nested_attributes_for :images, allow_destroy: true, reject_if: :all_blank - - SHAPES = [ - 'dome', - 'bullet', - 'box' - ] - FEATURES = ['Onvif', 'PSIA', 'PTZ', 'Infrared', 'Varifocal', 'SD Card', 'UPnP', 'Discontinued', 'Audio In', 'Audio Out', 'PoE', 'WiFi'].freeze - - validates :model, presence: true, :case_sensitive => false, :uniqueness => {:scope => :vendor_id} - validates :vendor, presence: true - validates :shape, presence: true - - rails_admin do - edit do - include_all_fields - field :additional_information, :text do - formatted_value do - value.to_s.gsub('{', '').gsub('}', '') - end - end - end - end - - def make_slug - self.model_slug = self.model.to_url - end - - def titleize_shape - self.shape = self.shape.titleize - end - - def next - Model.where("id > ?", id).order("id ASC").first - end - - def prev - Model.where("id < ?", id).order("id DESC").first - end -end +class Model < ActiveRecord::Base + has_many :images, as: :owner + has_many :documents, as: :owner + belongs_to :vendor + before_save :make_slug + before_save :titleize_shape + has_paper_trail + + accepts_nested_attributes_for :images, allow_destroy: true, reject_if: :all_blank + + SHAPES = [ + 'dome', + 'bullet', + 'box' + ] + FEATURES = ['Onvif', 'PSIA', 'PTZ', 'Infrared', 'Varifocal', 'SD Card', 'UPnP', 'Discontinued', 'Audio In', 'Audio Out', 'PoE', 'WiFi'].freeze + + validates :model, presence: true, :case_sensitive => false, :uniqueness => {:scope => :vendor_id} + validates :vendor, presence: true + validates :shape, presence: true + + rails_admin do + edit do + include_all_fields + field :additional_information, :text do + formatted_value do + value.to_s.gsub('{', '').gsub('}', '') + end + end + end + end + + def make_slug + self.model_slug = self.model.to_url + end + + def titleize_shape + self.shape = self.shape.titleize + end + + def next + Model.where("id > ?", id).order("id ASC").first + end + + def prev + Model.where("id < ?", id).order("id DESC").first + end +end diff --git a/app/models/recorder.rb b/app/models/recorder.rb index a1ae7cb..da1a280 100644 --- a/app/models/recorder.rb +++ b/app/models/recorder.rb @@ -1,37 +1,37 @@ -class Recorder < ActiveRecord::Base - has_many :images, as: :owner - has_many :documents, as: :owner - belongs_to :vendor - before_save :make_slug - #before_save :titleize_type - has_paper_trail - - accepts_nested_attributes_for :images, allow_destroy: true, reject_if: :all_blank - - TYPES = [ - 'DVR', - 'NVR', - 'Hybrid DVR' - ] - FEATURES = ['Onvif', 'PSIA', 'PTZ', 'Support 3rdparty', 'UPnP', 'Discontinued', 'Audio In', 'Audio Out'].freeze - - validates :model, presence: true, :case_sensitive => false, :uniqueness => {:scope => :vendor_id} - validates :vendor, presence: true - validates :recorder_type, presence: true - - def make_slug - self.recorder_slug = self.model.downcase - end - - #def titleize_type - # self.recorder_type = self.recorder_type.titleize - #end - - def next - Recorder.where("id > ?", id).order("id ASC").first - end - - def prev - Recorder.where("id < ?", id).order("id DESC").first - end -end +class Recorder < ActiveRecord::Base + has_many :images, as: :owner + has_many :documents, as: :owner + belongs_to :vendor + before_save :make_slug + #before_save :titleize_type + has_paper_trail + + accepts_nested_attributes_for :images, allow_destroy: true, reject_if: :all_blank + + TYPES = [ + 'DVR', + 'NVR', + 'Hybrid DVR' + ] + FEATURES = ['Onvif', 'PSIA', 'PTZ', 'Support 3rdparty', 'UPnP', 'Discontinued', 'Audio In', 'Audio Out'].freeze + + validates :model, presence: true, :case_sensitive => false, :uniqueness => {:scope => :vendor_id} + validates :vendor, presence: true + validates :recorder_type, presence: true + + def make_slug + self.recorder_slug = self.model.downcase + end + + #def titleize_type + # self.recorder_type = self.recorder_type.titleize + #end + + def next + Recorder.where("id > ?", id).order("id ASC").first + end + + def prev + Recorder.where("id < ?", id).order("id DESC").first + end +end diff --git a/app/models/user.rb b/app/models/user.rb index e2fddc3..8a5e9e0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,17 +1,17 @@ -class User < ActiveRecord::Base -# Include default devise modules. Others available are: -# :confirmable, :lockable, :timeoutable and :omniauthable -devise :database_authenticatable, :registerable, -:recoverable, :rememberable, :trackable, :validatable - -attr_accessor :login - -def password_required? - false -end - -validates :username, -:uniqueness => { - :case_sensitive => false -} -end +class User < ActiveRecord::Base +# Include default devise modules. Others available are: +# :confirmable, :lockable, :timeoutable and :omniauthable +devise :database_authenticatable, :registerable, +:recoverable, :rememberable, :trackable, :validatable + +attr_accessor :login + +def password_required? + false +end + +validates :username, +:uniqueness => { + :case_sensitive => false +} +end diff --git a/app/models/vendor.rb b/app/models/vendor.rb index 0c62c5c..21875dc 100644 --- a/app/models/vendor.rb +++ b/app/models/vendor.rb @@ -1,15 +1,15 @@ -class Vendor < ActiveRecord::Base - has_one :image, as: :owner - has_many :recorders - has_many :models - before_create :make_slug - has_paper_trail - - accepts_nested_attributes_for :image, allow_destroy: true, reject_if: :all_blank - - validates :name, presence: true, uniqueness: true - - def make_slug - self.vendor_slug = self.name.to_url - end -end +class Vendor < ActiveRecord::Base + has_one :image, as: :owner + has_many :recorders + has_many :models + before_create :make_slug + has_paper_trail + + accepts_nested_attributes_for :image, allow_destroy: true, reject_if: :all_blank + + validates :name, presence: true, uniqueness: true + + def make_slug + self.vendor_slug = self.name.to_url + end +end diff --git a/app/views/api/v1/_image.json.jbuilder b/app/views/api/v1/_image.json.jbuilder index f428659..9a0bbe4 100644 --- a/app/views/api/v1/_image.json.jbuilder +++ b/app/views/api/v1/_image.json.jbuilder @@ -1 +1 @@ -json.url image.file.url +json.url image.file.url diff --git a/app/views/api/v1/_metadata.json.jbuilder b/app/views/api/v1/_metadata.json.jbuilder index ce97a3c..ffba0b1 100644 --- a/app/views/api/v1/_metadata.json.jbuilder +++ b/app/views/api/v1/_metadata.json.jbuilder @@ -1,5 +1,5 @@ -json.metadata do - json.www_path_prefix root_url - json.api_path_prefix api_url - json.version 1 -end +json.metadata do + json.www_path_prefix root_url + json.api_path_prefix api_url + json.version 1 +end diff --git a/app/views/api/v1/_paging.json.jbuilder b/app/views/api/v1/_paging.json.jbuilder index 67cf64f..197b8ca 100644 --- a/app/views/api/v1/_paging.json.jbuilder +++ b/app/views/api/v1/_paging.json.jbuilder @@ -1,12 +1,12 @@ -json.paging do - unless object.last_page? - json.next_page_url "#{path}?page=#{object.next_page}" - end - json.total_items object.total_count - json.number_of_pages object.total_pages - json.items_per_page Kaminari.config.default_per_page - unless object.first_page? - json.prev_page_url "#{path}?page=#{object.prev_page}" - end - json.current_page object.current_page -end +json.paging do + unless object.last_page? + json.next_page_url "#{path}?page=#{object.next_page}" + end + json.total_items object.total_count + json.number_of_pages object.total_pages + json.items_per_page Kaminari.config.default_per_page + unless object.first_page? + json.prev_page_url "#{path}?page=#{object.prev_page}" + end + json.current_page object.current_page +end diff --git a/app/views/api/v1/changes/_change.json.jbuilder b/app/views/api/v1/changes/_change.json.jbuilder index 8ad3fa1..6bb918c 100644 --- a/app/views/api/v1/changes/_change.json.jbuilder +++ b/app/views/api/v1/changes/_change.json.jbuilder @@ -1,12 +1,12 @@ -change ||= @change - -json.id change['id'] -json.object_changed change['item_type'] -json.object_id change['item_id'] -json.object_id change['item_type'].classify.constantize.find(change['item_id'])["#{change['item_type'].downcase}_slug"] -json.created_at change['created_at'] - -if change.class == ActiveRecord::Base && !change.persisted? && - !change.valid? - json.errors change.errors.messages -end +change ||= @change + +json.id change['id'] +json.object_changed change['item_type'] +json.object_id change['item_id'] +json.object_id change['item_type'].classify.constantize.find(change['item_id'])["#{change['item_type'].downcase}_slug"] +json.created_at change['created_at'] + +if change.class == ActiveRecord::Base && !change.persisted? && + !change.valid? + json.errors change.errors.messages +end diff --git a/app/views/api/v1/changes/index.json.jbuilder b/app/views/api/v1/changes/index.json.jbuilder index 5347ced..fc81ed8 100644 --- a/app/views/api/v1/changes/index.json.jbuilder +++ b/app/views/api/v1/changes/index.json.jbuilder @@ -1,6 +1,6 @@ -json.prettify! -json.partial! 'api/v1/metadata' -json.data do |data| - json.partial! 'api/v1/paging', object: @changes, path: api_v1_changes_url - json.changes @changes, partial: 'api/v1/changes/change', as: :change -end +json.prettify! +json.partial! 'api/v1/metadata' +json.data do |data| + json.partial! 'api/v1/paging', object: @changes, path: api_v1_changes_url + json.changes @changes, partial: 'api/v1/changes/change', as: :change +end diff --git a/app/views/api/v1/changes/show.json.jbuilder b/app/views/api/v1/changes/show.json.jbuilder index d599d49..44598fd 100644 --- a/app/views/api/v1/changes/show.json.jbuilder +++ b/app/views/api/v1/changes/show.json.jbuilder @@ -1,19 +1,19 @@ -change ||= @change - -json.prettify! -json.id change['id'] -json.object_changed change['item_type'] -json.object_id change['item_id'] -json.object_id change['item_type'].classify.constantize.find(change['item_id'])["#{change['item_type'].downcase}_slug"] -json.object_changes YAML::load(change.object_changes) -if change.originator - json.changed_by User.find(change.originator).username -else - json.changed_by 'Admin' -end -json.created_at change['created_at'] - -if change.class == ActiveRecord::Base && !change.persisted? && - !change.valid? - json.errors change.errors.messages -end +change ||= @change + +json.prettify! +json.id change['id'] +json.object_changed change['item_type'] +json.object_id change['item_id'] +json.object_id change['item_type'].classify.constantize.find(change['item_id'])["#{change['item_type'].downcase}_slug"] +json.object_changes YAML::load(change.object_changes) +if change.originator + json.changed_by User.find(change.originator).username +else + json.changed_by 'Admin' +end +json.created_at change['created_at'] + +if change.class == ActiveRecord::Base && !change.persisted? && + !change.valid? + json.errors change.errors.messages +end diff --git a/app/views/api/v1/models/_model.json.jbuilder b/app/views/api/v1/models/_model.json.jbuilder index a467d0f..cde1a55 100644 --- a/app/views/api/v1/models/_model.json.jbuilder +++ b/app/views/api/v1/models/_model.json.jbuilder @@ -1,33 +1,33 @@ -model ||= @model -json.id model['model_slug'] -json.vendor_id model.vendor['vendor_slug'] -json.model model['model'] -json.jpeg_url model['jpeg_url'] -json.h264_url model['h264_url'] -json.mjpeg_url model['mjpeg_url'] -json.resolution model['resolution'] -json.shape model['shape'] -json.onvif model['onvif'] -json.psia model['psia'] -json.ptz model['ptz'] -json.infrared model['infrared'] -json.varifocal model['varifocal'] -json.sd_card model['sd_card'] -json.upnp model['upnp'] -json.poe model['poe'] -json.wifi model['wifi'] -json.discontinued model['discontinued'] -json.audio_in model['audio_in'] -json.audio_out model['audio_out'] -json.default_username model['default_username'] -json.default_password model['default_password'] -json.official_url model['official_url'] -json.images do - json.array! model.images.sorted, partial: 'api/v1/image', as: :image -end -json.url api_v1_model_url(model.model_slug, format: :json) - -if model.class == ActiveRecord::Base && !model.persisted? && - !model.valid? - json.errors model.errors.messages -end +model ||= @model +json.id model['model_slug'] +json.vendor_id model.vendor['vendor_slug'] +json.model model['model'] +json.jpeg_url model['jpeg_url'] +json.h264_url model['h264_url'] +json.mjpeg_url model['mjpeg_url'] +json.resolution model['resolution'] +json.shape model['shape'] +json.onvif model['onvif'] +json.psia model['psia'] +json.ptz model['ptz'] +json.infrared model['infrared'] +json.varifocal model['varifocal'] +json.sd_card model['sd_card'] +json.upnp model['upnp'] +json.poe model['poe'] +json.wifi model['wifi'] +json.discontinued model['discontinued'] +json.audio_in model['audio_in'] +json.audio_out model['audio_out'] +json.default_username model['default_username'] +json.default_password model['default_password'] +json.official_url model['official_url'] +json.images do + json.array! model.images.sorted, partial: 'api/v1/image', as: :image +end +json.url api_v1_model_url(model.model_slug, format: :json) + +if model.class == ActiveRecord::Base && !model.persisted? && + !model.valid? + json.errors model.errors.messages +end diff --git a/app/views/api/v1/models/index.json.jbuilder b/app/views/api/v1/models/index.json.jbuilder index d6bdec7..8984ee2 100644 --- a/app/views/api/v1/models/index.json.jbuilder +++ b/app/views/api/v1/models/index.json.jbuilder @@ -1,10 +1,10 @@ -json.prettify! -json.partial! 'api/v1/metadata' -json.data do |data| - json.partial! 'api/v1/paging', object: @models, path: api_v1_models_url - json.models @models do |model| - json.id model['model_slug'] - json.vendor_id model.vendor['vendor_slug'] - json.url api_v1_model_url(model.model_slug, format: :json) - end -end +json.prettify! +json.partial! 'api/v1/metadata' +json.data do |data| + json.partial! 'api/v1/paging', object: @models, path: api_v1_models_url + json.models @models do |model| + json.id model['model_slug'] + json.vendor_id model.vendor['vendor_slug'] + json.url api_v1_model_url(model.model_slug, format: :json) + end +end diff --git a/app/views/api/v1/models/show.json.jbuilder b/app/views/api/v1/models/show.json.jbuilder index a2d8a5d..0ea38f4 100644 --- a/app/views/api/v1/models/show.json.jbuilder +++ b/app/views/api/v1/models/show.json.jbuilder @@ -1,4 +1,4 @@ -json.prettify! -json.models do - json.partial! 'api/v1/models/model', model: @model, path: api_v1_models_url -end +json.prettify! +json.models do + json.partial! 'api/v1/models/model', model: @model, path: api_v1_models_url +end diff --git a/app/views/api/v1/recorders/_recorder.json.jbuilder b/app/views/api/v1/recorders/_recorder.json.jbuilder index 05b3d3e..e8e1035 100644 --- a/app/views/api/v1/recorders/_recorder.json.jbuilder +++ b/app/views/api/v1/recorders/_recorder.json.jbuilder @@ -1,33 +1,33 @@ -recorder ||= @recorder -json.id recorder['recorder_slug'] -json.vendor_id recorder.vendor['vendor_slug'] -json.recorder recorder['model'] -json.jpeg_url recorder['jpeg_url'] -json.h264_url recorder['h264_url'] -json.mjpeg_url recorder['mjpeg_url'] -json.resolution recorder['resolution'] -json.shape recorder['shape'] -json.onvif recorder['onvif'] -json.psia recorder['psia'] -json.ptz recorder['ptz'] -json.infrared recorder['infrared'] -json.varifocal recorder['varifocal'] -json.sd_card recorder['sd_card'] -json.upnp recorder['upnp'] -json.poe recorder['poe'] -json.wifi recorder['wifi'] -json.discontinued recorder['discontinued'] -json.audio_in recorder['audio_in'] -json.audio_out recorder['audio_out'] -json.default_username recorder['default_username'] -json.default_password recorder['default_password'] -json.official_url recorder['official_url'] -json.images do - json.array! recorder.images.sorted, partial: 'api/v1/image', as: :image -end -json.url api_v1_recorder_url(recorder.recorder_slug, format: :json) - -if recorder.class == ActiveRecord::Base && !recorder.persisted? && - !recorder.valid? - json.errors recorder.errors.messages -end +recorder ||= @recorder +json.id recorder['recorder_slug'] +json.vendor_id recorder.vendor['vendor_slug'] +json.recorder recorder['model'] +json.jpeg_url recorder['jpeg_url'] +json.h264_url recorder['h264_url'] +json.mjpeg_url recorder['mjpeg_url'] +json.resolution recorder['resolution'] +json.shape recorder['shape'] +json.onvif recorder['onvif'] +json.psia recorder['psia'] +json.ptz recorder['ptz'] +json.infrared recorder['infrared'] +json.varifocal recorder['varifocal'] +json.sd_card recorder['sd_card'] +json.upnp recorder['upnp'] +json.poe recorder['poe'] +json.wifi recorder['wifi'] +json.discontinued recorder['discontinued'] +json.audio_in recorder['audio_in'] +json.audio_out recorder['audio_out'] +json.default_username recorder['default_username'] +json.default_password recorder['default_password'] +json.official_url recorder['official_url'] +json.images do + json.array! recorder.images.sorted, partial: 'api/v1/image', as: :image +end +json.url api_v1_recorder_url(recorder.recorder_slug, format: :json) + +if recorder.class == ActiveRecord::Base && !recorder.persisted? && + !recorder.valid? + json.errors recorder.errors.messages +end diff --git a/app/views/api/v1/recorders/index.json.jbuilder b/app/views/api/v1/recorders/index.json.jbuilder index 367ea57..724a75f 100644 --- a/app/views/api/v1/recorders/index.json.jbuilder +++ b/app/views/api/v1/recorders/index.json.jbuilder @@ -1,10 +1,10 @@ -json.prettify! -json.partial! 'api/v1/metadata' -json.data do |data| - json.partial! 'api/v1/paging', object: @recorders, path: api_v1_recorders_url - json.recorders @recorders do |recorder| - json.id recorder['recorder_slug'] - json.vendor_id recorder.vendor['vendor_slug'] - json.url api_v1_recorder_url(recorder.recorder_slug, format: :json) - end -end +json.prettify! +json.partial! 'api/v1/metadata' +json.data do |data| + json.partial! 'api/v1/paging', object: @recorders, path: api_v1_recorders_url + json.recorders @recorders do |recorder| + json.id recorder['recorder_slug'] + json.vendor_id recorder.vendor['vendor_slug'] + json.url api_v1_recorder_url(recorder.recorder_slug, format: :json) + end +end diff --git a/app/views/api/v1/recorders/show.json.jbuilder b/app/views/api/v1/recorders/show.json.jbuilder index b2a9d9d..e7520c2 100644 --- a/app/views/api/v1/recorders/show.json.jbuilder +++ b/app/views/api/v1/recorders/show.json.jbuilder @@ -1,4 +1,4 @@ -json.prettify! -json.recorders do - json.partial! 'api/v1/recorders/model', recorder: @recorder, path: api_v1_recorders_url -end +json.prettify! +json.recorders do + json.partial! 'api/v1/recorders/model', recorder: @recorder, path: api_v1_recorders_url +end diff --git a/app/views/api/v1/vendors/_vendor.json.jbuilder b/app/views/api/v1/vendors/_vendor.json.jbuilder index 1278987..9e46399 100644 --- a/app/views/api/v1/vendors/_vendor.json.jbuilder +++ b/app/views/api/v1/vendors/_vendor.json.jbuilder @@ -1,11 +1,11 @@ -vendor ||= @vendor - -json.id vendor['vendor_slug'] -json.name vendor['name'] -json.logo vendor.image ? vendor.image.file.url : '' -json.mac vendor['mac'] - -if vendor.class == ActiveRecord::Base && !vendor.persisted? && - !vendor.valid? - json.errors vendor.errors.messages -end +vendor ||= @vendor + +json.id vendor['vendor_slug'] +json.name vendor['name'] +json.logo vendor.image ? vendor.image.file.url : '' +json.mac vendor['mac'] + +if vendor.class == ActiveRecord::Base && !vendor.persisted? && + !vendor.valid? + json.errors vendor.errors.messages +end diff --git a/app/views/api/v1/vendors/index.json.jbuilder b/app/views/api/v1/vendors/index.json.jbuilder index 24f0151..e7dc9d5 100644 --- a/app/views/api/v1/vendors/index.json.jbuilder +++ b/app/views/api/v1/vendors/index.json.jbuilder @@ -1,6 +1,6 @@ -json.prettify! -json.partial! 'api/v1/metadata' -json.data do |data| - json.partial! 'api/v1/paging', object: @vendors, path: api_v1_vendors_url - json.vendors @vendors, partial: 'api/v1/vendors/vendor', as: :vendor -end +json.prettify! +json.partial! 'api/v1/metadata' +json.data do |data| + json.partial! 'api/v1/paging', object: @vendors, path: api_v1_vendors_url + json.vendors @vendors, partial: 'api/v1/vendors/vendor', as: :vendor +end diff --git a/app/views/api/v1/vendors/show.json.jbuilder b/app/views/api/v1/vendors/show.json.jbuilder index 8f5190a..ed1803f 100644 --- a/app/views/api/v1/vendors/show.json.jbuilder +++ b/app/views/api/v1/vendors/show.json.jbuilder @@ -1,9 +1,9 @@ -json.prettify! -json.partial! 'api/v1/metadata' -json.data do |data| - json.partial! 'api/v1/paging', object: @models, path: api_v1_vendor_url - json.partial! 'api/v1/vendors/vendor', vendor: @vendor - json.models @vendor.models do |model| - json.partial! 'api/v1/models/model', model: model - end -end +json.prettify! +json.partial! 'api/v1/metadata' +json.data do |data| + json.partial! 'api/v1/paging', object: @models, path: api_v1_vendor_url + json.partial! 'api/v1/vendors/vendor', vendor: @vendor + json.models @vendor.models do |model| + json.partial! 'api/v1/models/model', model: model + end +end diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index a5b75fb..65ba288 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,12 +1,12 @@ -

Resend confirmation instructions

- -<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, autofocus: true %>
- -
<%= f.submit "Resend confirmation instructions" %>
-<% end %> - -<%= render "devise/shared/links" %> +

Resend confirmation instructions

+ +<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %>
+ +
<%= f.submit "Resend confirmation instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index 491d767..dc55f64 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,5 @@ -

Welcome <%= @email %>!

- -

You can confirm your account email through the link below:

- -

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

+

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index 572feaa..f667dc1 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -1,8 +1,8 @@ -

Hello <%= @resource.email %>!

- -

Someone has requested a link to change your password. You can do this through the link below.

- -

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

- -

If you didn't request this, please ignore this email.

-

Your password won't change until you access the link above and create a new one.

+

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb index 78b9581..41e148b 100644 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -1,7 +1,7 @@ -

Hello <%= @resource.email %>!

- -

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

- -

Click the link below to unlock your account:

- -

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

+

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index d367a42..5535098 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,16 +1,16 @@ -

Change your password

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> - -
<%= f.label :password, "New password" %>
- <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
- -
<%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %>
- -
<%= f.submit "Change my password" %>
-<% end %> - -<%= render "devise/shared/links" %> +

Change your password

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> + +
<%= f.label :password, "New password" %>
+ <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
+ +
<%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ +
<%= f.submit "Change my password" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index d01bcc8..24bd4f2 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,10 +1,10 @@ -

Forgot your password?

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, autofocus: true %>
- -
<%= f.submit "Send me reset password instructions" %>
-<% end %> +

Forgot your password?

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %>
+ +
<%= f.submit "Send me reset password instructions" %>
+<% end %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 7a4c06b..8d4f8e5 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,42 +1,42 @@ -
-
-

Settings

-
-
- <%= devise_error_messages! %> -
-

Account Details

- <%= form_for(current_user, as: current_user, url: registration_path(current_user), html: { method: :put }) do |f| %> -

- <%= f.label :email %> - <%= f.email_field :email, autofocus: true %> -

-

- <%= f.label :password %> - <%= f.password_field :password, autocomplete: "off" %> -

- -

- <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, autocomplete: "off" %> -

- -

- <%= f.label :current_password %> - <%= f.password_field :current_password, autocomplete: "off" %> -

- -

- <%= f.label :avatar %> - <%= link_to image_tag(avatar_url(current_user)), 'https://en.gravatar.com/', class: 'avatar', target: "_blank" %> -

- -

- <%= f.submit "save" %> -

- <% end %> -
-
-
-
-
+
+
+

Settings

+
+
+ <%= devise_error_messages! %> +
+

Account Details

+ <%= form_for(current_user, as: current_user, url: registration_path(current_user), html: { method: :put }) do |f| %> +

+ <%= f.label :email %> + <%= f.email_field :email, autofocus: true %> +

+

+ <%= f.label :password %> + <%= f.password_field :password, autocomplete: "off" %> +

+ +

+ <%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation, autocomplete: "off" %> +

+ +

+ <%= f.label :current_password %> + <%= f.password_field :current_password, autocomplete: "off" %> +

+ +

+ <%= f.label :avatar %> + <%= link_to image_tag(avatar_url(current_user)), 'https://en.gravatar.com/', class: 'avatar', target: "_blank" %> +

+ +

+ <%= f.submit "save" %> +

+ <% end %> +
+
+
+
+
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index c569429..d0e47e7 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,17 +1,17 @@ -

Sign up

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -

<%= f.label :username %>
- <%= f.text_field :username %>

-

<%= f.label :email %>
- <%= f.email_field :email %>

- -
<%= f.label :password %>
- <%= f.password_field :password, autocomplete: "off" %>
- -
<%= f.submit "Sign up" %>
-<% end %> - -<%= render "devise/shared/links" %> +

Sign up

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + <%= devise_error_messages! %> + +

<%= f.label :username %>
+ <%= f.text_field :username %>

+

<%= f.label :email %>
+ <%= f.email_field :email %>

+ +
<%= f.label :password %>
+ <%= f.password_field :password, autocomplete: "off" %>
+ +
<%= f.submit "Sign up" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 15b6e31..bc20fa6 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,17 +1,17 @@ -

Sign in

- -<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -

<%= f.label :login %>
- <%= f.text_field :login %>

- -
<%= f.label :password %>
- <%= f.password_field :password, autocomplete: "off" %>
- - <% if devise_mapping.rememberable? -%> -
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
- <% end -%> - -
<%= f.submit "Sign in" %>
-<% end %> - -<%= render "devise/shared/links" %> +

Sign in

+ +<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> +

<%= f.label :login %>
+ <%= f.text_field :login %>

+ +
<%= f.label :password %>
+ <%= f.password_field :password, autocomplete: "off" %>
+ + <% if devise_mapping.rememberable? -%> +
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
+ <% end -%> + +
<%= f.submit "Sign in" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb index 0c9819f..d84bdde 100644 --- a/app/views/devise/shared/_links.erb +++ b/app/views/devise/shared/_links.erb @@ -1,25 +1,25 @@ -<%- if controller_name != 'sessions' %> - <%= link_to "Sign in", new_session_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> -<% end -%> +<%- if controller_name != 'sessions' %> + <%= link_to "Sign in", new_session_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> +<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 9473777..6fb5612 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,12 +1,12 @@ -

Resend unlock instructions

- -<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, autofocus: true %>
- -
<%= f.submit "Resend unlock instructions" %>
-<% end %> - -<%= render "devise/shared/links" %> +

Resend unlock instructions

+ +<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %>
+ +
<%= f.submit "Resend unlock instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f08de54..a3105bd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,34 +1,34 @@ - - - - - - <%= content_for?(:title) ? "Cambase | #{content_for(:title)}" : 'Cambase' %> - - - - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - <%= render "shared/header" %> -
-
- <%= flash_messages %> -
- <%= yield %> -
-
-
- <%= render "shared/footer" %> - <% if user_signed_in? %> - <%= render 'shared/add_model_modal' %> - <%= render 'shared/add_vendor_modal' %> - <%= render 'shared/add_recorder_modal' %> - <% else %> - <%= render 'shared/signin_modal' %> - <% end %> - - + + + + + + <%= content_for?(:title) ? "Cambase | #{content_for(:title)}" : 'Cambase' %> + + + + <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> + + <%= javascript_include_tag "application", "data-turbolinks-track" => true %> + <%= csrf_meta_tags %> + + + <%= render "shared/header" %> +
+
+ <%= flash_messages %> +
+ <%= yield %> +
+
+
+ <%= render "shared/footer" %> + <% if user_signed_in? %> + <%= render 'shared/add_model_modal' %> + <%= render 'shared/add_vendor_modal' %> + <%= render 'shared/add_recorder_modal' %> + <% else %> + <%= render 'shared/signin_modal' %> + <% end %> + + diff --git a/app/views/models/_form.html.erb b/app/views/models/_form.html.erb index 6086909..82f6581 100644 --- a/app/views/models/_form.html.erb +++ b/app/views/models/_form.html.erb @@ -1,91 +1,91 @@ -<%= form_for(@model, :url => vendor_model_path(@model.vendor.vendor_slug, @model.model_slug)) do |f| %> -<% if @model.errors.any? %> -
-

<%= pluralize(@model.errors.count, "error") %> prohibited this model from being saved:

- - -
-<% end %> - -
-

- <%= f.label :vendor %> - <%= f.collection_select(:vendor_id, Vendor.order(:name), :id, :name, :include_blank => 'Vendor') %> -

-

- <%= f.label :model %> - <%= f.text_field :model, :placeholder => 'Model' %> -

-

- <%= f.label :manual_url %> - <%= f.text_field :manual_url, :placeholder => 'Manual URL' %> -

-

- <%= f.label :jpeg_url %> - <%= f.text_field :jpeg_url, :placeholder => 'JPEG URL' %> -

-

- <%= f.label :h264_url %> - <%= f.text_field :h264_url, :placeholder => 'H264 URL' %> -

-

- <%= f.label :mjpeg_url %> - <%= f.text_field :mjpeg_url, :placeholder => 'MJPEG URL' %> -

-

- <%= f.label :resolution %> - <%= f.select(:resolution, Model.uniq.pluck(:resolution).compact.sort, :include_blank => 'Resolution')%> -

-

- <%= f.label :firmware %> - <%= f.text_field :firmware, :placeholder => 'Firmware' %> -

-

- <%= f.label :default_username %> - <%= f.text_field :default_username, :placeholder => 'Default Username' %> -

-

- <%= f.label :default_password %> - <%= f.text_field :default_password, :placeholder => 'Default Password' %> -

-

- <%= f.label :shape %> - <%= f.select(:shape, Model.uniq.pluck(:shape).compact.sort, :include_blank => 'Shape') %> -

-

- <%= f.label :onvif %> - <%= f.check_box :onvif, :placeholder => 'ONVIF' %> -

-

- <%= f.label :psia %> - <%= f.check_box :psia, :placeholder => 'PSIA' %> -

-

- <%= f.label :ptz %> - <%= f.check_box :ptz, :placeholder => 'PTZ' %> -

-

- <%= f.label :infrared %> - <%= f.check_box :infrared, :placeholder => 'Infrared' %> -

-

- <%= f.label :varifocal %> - <%= f.check_box :varifocal, :placeholder => 'Varifocal' %> -

-

- <%= f.label :sd_card %> - <%= f.check_box :sd_card, :placeholder => 'SD card' %> -

-

- <%= f.label :upnp %> - <%= f.check_box :upnp, :placeholder => 'UPnP' %> -

-
-
- <%= f.submit %> -
-<% end %> +<%= form_for(@model, :url => vendor_model_path(@model.vendor.vendor_slug, @model.model_slug)) do |f| %> +<% if @model.errors.any? %> +
+

<%= pluralize(@model.errors.count, "error") %> prohibited this model from being saved:

+ + +
+<% end %> + +
+

+ <%= f.label :vendor %> + <%= f.collection_select(:vendor_id, Vendor.order(:name), :id, :name, :include_blank => 'Vendor') %> +

+

+ <%= f.label :model %> + <%= f.text_field :model, :placeholder => 'Model' %> +

+

+ <%= f.label :manual_url %> + <%= f.text_field :manual_url, :placeholder => 'Manual URL' %> +

+

+ <%= f.label :jpeg_url %> + <%= f.text_field :jpeg_url, :placeholder => 'JPEG URL' %> +

+

+ <%= f.label :h264_url %> + <%= f.text_field :h264_url, :placeholder => 'H264 URL' %> +

+

+ <%= f.label :mjpeg_url %> + <%= f.text_field :mjpeg_url, :placeholder => 'MJPEG URL' %> +

+

+ <%= f.label :resolution %> + <%= f.select(:resolution, Model.uniq.pluck(:resolution).compact.sort, :include_blank => 'Resolution')%> +

+

+ <%= f.label :firmware %> + <%= f.text_field :firmware, :placeholder => 'Firmware' %> +

+

+ <%= f.label :default_username %> + <%= f.text_field :default_username, :placeholder => 'Default Username' %> +

+

+ <%= f.label :default_password %> + <%= f.text_field :default_password, :placeholder => 'Default Password' %> +

+

+ <%= f.label :shape %> + <%= f.select(:shape, Model.uniq.pluck(:shape).compact.sort, :include_blank => 'Shape') %> +

+

+ <%= f.label :onvif %> + <%= f.check_box :onvif, :placeholder => 'ONVIF' %> +

+

+ <%= f.label :psia %> + <%= f.check_box :psia, :placeholder => 'PSIA' %> +

+

+ <%= f.label :ptz %> + <%= f.check_box :ptz, :placeholder => 'PTZ' %> +

+

+ <%= f.label :infrared %> + <%= f.check_box :infrared, :placeholder => 'Infrared' %> +

+

+ <%= f.label :varifocal %> + <%= f.check_box :varifocal, :placeholder => 'Varifocal' %> +

+

+ <%= f.label :sd_card %> + <%= f.check_box :sd_card, :placeholder => 'SD card' %> +

+

+ <%= f.label :upnp %> + <%= f.check_box :upnp, :placeholder => 'UPnP' %> +

+
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/models/edit.html.erb b/app/views/models/edit.html.erb index 13b0340..8680719 100644 --- a/app/views/models/edit.html.erb +++ b/app/views/models/edit.html.erb @@ -1,6 +1,6 @@ -

Editing model

- -<%= render 'form' %> - -<%= link_to 'Show', vendor_model_path(@model.vendor.vendor_slug, @model.model_slug) %> | -<%= link_to 'Back', models_path %> +

Editing model

+ +<%= render 'form' %> + +<%= link_to 'Show', vendor_model_path(@model.vendor.vendor_slug, @model.model_slug) %> | +<%= link_to 'Back', models_path %> diff --git a/app/views/models/index.html.erb b/app/views/models/index.html.erb index 1c56652..84fcbbb 100644 --- a/app/views/models/index.html.erb +++ b/app/views/models/index.html.erb @@ -1 +1 @@ -<%= render 'shared/models' %> +<%= render 'shared/models' %> diff --git a/app/views/models/new.html.erb b/app/views/models/new.html.erb index e4ff3d5..e004c81 100644 --- a/app/views/models/new.html.erb +++ b/app/views/models/new.html.erb @@ -1,3 +1,3 @@ -<%= render 'form' %> - -<%= link_to 'Back', models_path %> +<%= render 'form' %> + +<%= link_to 'Back', models_path %> diff --git a/app/views/models/search.html.erb b/app/views/models/search.html.erb index 1c56652..84fcbbb 100644 --- a/app/views/models/search.html.erb +++ b/app/views/models/search.html.erb @@ -1 +1 @@ -<%= render 'shared/models' %> +<%= render 'shared/models' %> diff --git a/app/views/models/show.html.erb b/app/views/models/show.html.erb index a99abeb..132d873 100644 --- a/app/views/models/show.html.erb +++ b/app/views/models/show.html.erb @@ -1,265 +1,265 @@ -<% content_for :title do %> - <%= "#{@model.vendor.name} #{@model.model}" %> -<% end %> - -
-

<%= "#{@model.vendor.name} #{@model.model}" %>

- <% if @model.prev %> - <%= link_to "prev", "/#{@model.prev.vendor.name.downcase}/models/#{@model.prev.model_slug}", class: 'align-left' %> - <% end %> - <% if @model.next %> - <%= link_to "next", "/#{@model.next.vendor.name.downcase}/models/#{@model.next.model_slug}", class: 'align-left' %> - <% end %> - <%= link_to "json", "/api/v1/models/#{@model.model_slug}", class: 'align-right' %> - <%= link_to "url", '', class: 'align-right' %> -
- -
-
-
-
-
-

Model Information

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vendor - <%= link_to @model.vendor.name, "/#{@model.vendor.vendor_slug}" %> - <%= link_to('Website', @model.vendor.url, target: "_blank", class: 'icon-link') %> -
Model<%= @model.model || 'Unknown' %>
Resolution<%= @model.resolution || 'Unknown' %>
Shape<%= @model.shape || 'Unknown' %>
JPEG URL<%= @model.jpeg_url || 'Unknown' %>
H264 URL<%= @model.h264_url || 'Unknown' %>
MJPEG URL<%= @model.mjpeg_url || 'Unknown' %>
Default Username<%= @model.default_username || 'Unknown' %>
Default Password<%= @model.default_password || 'Unknown' %>
Official Page - <% if @model.official_url %> - <%= link_to @model.official_url, @model.official_url, target: '_blank' %> - <% else %> - Unknown - <% end %> -
-
-
-
- <% if @model.additional_information %> -
-
-

Additional Information

-
-
-
- - - <% @model.additional_information.each do |key, value| %> - - - - - - <% end %> - -
<%= key %><%= @model.additional_information[key] || 'Unknown' %>
-
-
-
- <% end %> -
-
-

Model Features

-
-
-
- - - - - <%= editable @model, :onvif, tag: :td %> - - - - <%= editable @model, :psia, tag: :td %> - - - - <%= editable @model, :ptz, tag: :td %> - - - - <%= editable @model, :infrared, tag: :td %> - - - - <%= editable @model, :varifocal, tag: :td %> - - - - <%= editable @model, :sd_card, tag: :td %> - - - - <%= editable @model, :upnp, tag: :td %> - - - - <%= editable @model, :poe, tag: :td %> - - - - <%= editable @model, :wifi, tag: :td %> - - - - <%= editable @model, :audio_in, tag: :td %> - - - - <%= editable @model, :audio_out, tag: :td %> - - - - <%= editable @model, :discontinued, tag: :td %> - - -
ONVIF
PSIA
PTZ
Infrared
Varifocal
SD Card Storage
UPnP
PoE
WiFi
Audio In
Audio Out
Discontinued
-
-
-
-
-
-

Tips

-
-
-
- - - comments powered by Disqus -
-
-
-
-
+<% content_for :title do %> + <%= "#{@model.vendor.name} #{@model.model}" %> +<% end %> + +
+

<%= "#{@model.vendor.name} #{@model.model}" %>

+ <% if @model.prev %> + <%= link_to "prev", "/#{@model.prev.vendor.name.downcase}/models/#{@model.prev.model_slug}", class: 'align-left' %> + <% end %> + <% if @model.next %> + <%= link_to "next", "/#{@model.next.vendor.name.downcase}/models/#{@model.next.model_slug}", class: 'align-left' %> + <% end %> + <%= link_to "json", "/api/v1/models/#{@model.model_slug}", class: 'align-right' %> + <%= link_to "url", '', class: 'align-right' %> +
+ +
+
+
+
+
+

Model Information

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Vendor + <%= link_to @model.vendor.name, "/#{@model.vendor.vendor_slug}" %> + <%= link_to('Website', @model.vendor.url, target: "_blank", class: 'icon-link') %> +
Model<%= @model.model || 'Unknown' %>
Resolution<%= @model.resolution || 'Unknown' %>
Shape<%= @model.shape || 'Unknown' %>
JPEG URL<%= @model.jpeg_url || 'Unknown' %>
H264 URL<%= @model.h264_url || 'Unknown' %>
MJPEG URL<%= @model.mjpeg_url || 'Unknown' %>
Default Username<%= @model.default_username || 'Unknown' %>
Default Password<%= @model.default_password || 'Unknown' %>
Official Page + <% if @model.official_url %> + <%= link_to @model.official_url, @model.official_url, target: '_blank' %> + <% else %> + Unknown + <% end %> +
+
+
+
+ <% if @model.additional_information %> +
+
+

Additional Information

+
+
+
+ + + <% @model.additional_information.each do |key, value| %> + + + + + + <% end %> + +
<%= key %><%= @model.additional_information[key] || 'Unknown' %>
+
+
+
+ <% end %> +
+
+

Model Features

+
+
+
+ + + + + <%= editable @model, :onvif, tag: :td %> + + + + <%= editable @model, :psia, tag: :td %> + + + + <%= editable @model, :ptz, tag: :td %> + + + + <%= editable @model, :infrared, tag: :td %> + + + + <%= editable @model, :varifocal, tag: :td %> + + + + <%= editable @model, :sd_card, tag: :td %> + + + + <%= editable @model, :upnp, tag: :td %> + + + + <%= editable @model, :poe, tag: :td %> + + + + <%= editable @model, :wifi, tag: :td %> + + + + <%= editable @model, :audio_in, tag: :td %> + + + + <%= editable @model, :audio_out, tag: :td %> + + + + <%= editable @model, :discontinued, tag: :td %> + + +
ONVIF
PSIA
PTZ
Infrared
Varifocal
SD Card Storage
UPnP
PoE
WiFi
Audio In
Audio Out
Discontinued
+
+
+
+
+
+

Tips

+
+
+
+ + + comments powered by Disqus +
+
+
+
+
diff --git a/app/views/pages/about_cambase.html.erb b/app/views/pages/about_cambase.html.erb index ffb839c..6d88d9e 100644 --- a/app/views/pages/about_cambase.html.erb +++ b/app/views/pages/about_cambase.html.erb @@ -1 +1 @@ -

About Cambase

+

About Cambase

diff --git a/app/views/pages/about_evercam.html.erb b/app/views/pages/about_evercam.html.erb index 2ca16d9..64bcb74 100644 --- a/app/views/pages/about_evercam.html.erb +++ b/app/views/pages/about_evercam.html.erb @@ -1 +1 @@ -

About Evercam

+

About Evercam

diff --git a/app/views/pages/api_docs.html.erb b/app/views/pages/api_docs.html.erb index 12e0bbe..ebb5764 100644 --- a/app/views/pages/api_docs.html.erb +++ b/app/views/pages/api_docs.html.erb @@ -1,48 +1,48 @@ -<% content_for :title do %> - API Documentation -<% end %> - -<%= javascript_include_tag 'swagger/lib/shred.bundle' %> -<%= javascript_include_tag 'swagger/lib/shred.bundle' %> -<%= javascript_include_tag 'swagger/lib/jquery-1.8.0.min' %> -<%= javascript_include_tag 'swagger/lib/jquery.slideto.min' %> -<%= javascript_include_tag 'swagger/lib/jquery.wiggle.min' %> -<%= javascript_include_tag 'swagger/lib/jquery.ba-bbq.min' %> -<%= javascript_include_tag 'swagger/lib/handlebars-1.0.0' %> -<%= javascript_include_tag 'swagger/lib/underscore-min' %> -<%= javascript_include_tag 'swagger/lib/backbone-min' %> -<%= javascript_include_tag 'swagger/lib/swagger' %> -<%= javascript_include_tag 'swagger/swagger-ui' %> -<%= javascript_include_tag 'swagger/lib/highlight.7.3.pack' %> -<%= javascript_include_tag 'swagger/lib/swagger-oauth' %> - - - -
-   -
- -
+<% content_for :title do %> + API Documentation +<% end %> + +<%= javascript_include_tag 'swagger/lib/shred.bundle' %> +<%= javascript_include_tag 'swagger/lib/shred.bundle' %> +<%= javascript_include_tag 'swagger/lib/jquery-1.8.0.min' %> +<%= javascript_include_tag 'swagger/lib/jquery.slideto.min' %> +<%= javascript_include_tag 'swagger/lib/jquery.wiggle.min' %> +<%= javascript_include_tag 'swagger/lib/jquery.ba-bbq.min' %> +<%= javascript_include_tag 'swagger/lib/handlebars-1.0.0' %> +<%= javascript_include_tag 'swagger/lib/underscore-min' %> +<%= javascript_include_tag 'swagger/lib/backbone-min' %> +<%= javascript_include_tag 'swagger/lib/swagger' %> +<%= javascript_include_tag 'swagger/swagger-ui' %> +<%= javascript_include_tag 'swagger/lib/highlight.7.3.pack' %> +<%= javascript_include_tag 'swagger/lib/swagger-oauth' %> + + + +
+   +
+ +
diff --git a/app/views/pages/contact.html.erb b/app/views/pages/contact.html.erb index eb80af0..2ba2746 100644 --- a/app/views/pages/contact.html.erb +++ b/app/views/pages/contact.html.erb @@ -1 +1 @@ -

Contact Us

+

Contact Us

diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index be4b646..6416350 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,47 +1,47 @@ - -
-
- <% @images.each_with_index do |image, index| %> - <% if image.owner %> - <% owner = image.owner_type.classify.constantize.find(image.owner_id) %> - <% if image.owner_type == "Model" %> - <% if image.position == 1 %> -
-
- <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.model}"), "/#{owner.vendor.vendor_slug}/#{owner.model_slug}") %> -
-
- <% else %> -
-
- <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.model}"), "/#{owner.vendor.vendor_slug}/#{owner.model_slug}") %> -
-
- <% end %> - <% elsif image.owner_type == "Recorder" %> - <% if image.position == 1 %> -
-
- <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.recorder}"), "/#{owner.vendor.vendor_slug}/#{owner.recorder_slug}") %> -
-
- <% else %> -
-
- <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.recorder}"), "/#{owner.vendor.vendor_slug}/#{owner.recorder_slug}") %> -
-
- <% end %> - <% else %> -
-
- <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.name}"), "/#{owner.vendor_slug}") %> -
-
- <% end %> - <% end %> - <% end %> -
-
+ +
+
+ <% @images.each_with_index do |image, index| %> + <% if image.owner %> + <% owner = image.owner_type.classify.constantize.find(image.owner_id) %> + <% if image.owner_type == "Model" %> + <% if image.position == 1 %> +
+
+ <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.model}"), "/#{owner.vendor.vendor_slug}/#{owner.model_slug}") %> +
+
+ <% else %> +
+
+ <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.model}"), "/#{owner.vendor.vendor_slug}/#{owner.model_slug}") %> +
+
+ <% end %> + <% elsif image.owner_type == "Recorder" %> + <% if image.position == 1 %> +
+
+ <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.recorder}"), "/#{owner.vendor.vendor_slug}/#{owner.recorder_slug}") %> +
+
+ <% else %> +
+
+ <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.recorder}"), "/#{owner.vendor.vendor_slug}/#{owner.recorder_slug}") %> +
+
+ <% end %> + <% else %> +
+
+ <%= link_to(image_tag(@images[index].file.url, :title => "#{owner.name}"), "/#{owner.vendor_slug}") %> +
+
+ <% end %> + <% end %> + <% end %> +
+
diff --git a/app/views/pages/terms.html.erb b/app/views/pages/terms.html.erb index 601f0ba..8127724 100644 --- a/app/views/pages/terms.html.erb +++ b/app/views/pages/terms.html.erb @@ -1,102 +1,102 @@ -
-
-

Cambase Terms of Service

-
-
-

Effective December 12, 2013

-

General

-

Cambase provides information about cameras, camera related hardware and their manufacturers.

-

The Cambase Dataset (the “Dataset”) is a structured set of data, text, and media files that include information about cameras, camera related hardware and their manufacturers. The Cambase Platform (the “Platform”) provides access to the Dataset through the Cambase website (the “Site”), mobile applications, API, data exports and widgets. The Cambase Platform and Cambase Dataset (together, the “Service”) is operated by Evercam Ltd., (hereinafter referred to as “Cambase”).

-

The user is referred as to as “You”. If the user is an individual, You means such individual. If the user is a corporation, partnership or other entity (“Corporate Entity”), You refers to such Corporate Entity and the individual represents and warrants that the individual has the authority to bind the Corporate Entity.

-

By accessing or using the Service, You acknowledge that You have read, understand and agree to be bound by these Terms of Service (“Terms of Service” or “Agreement”), whether or not You have a registered account for the Service. We reserve the right, at any time, to add to, change, update, or modify these Terms of Service, simply by posting such change, update, or modification on the Site and without any other notice to You. Any such change, update, or modification will be effective immediately upon posting on the Site. It is Your responsibility to review these Terms of Service from time to time to ensure that You continue to agree with all of its terms.

-

Please read these Terms of Service carefully as they contain important information regarding Your legal rights, remedies and obligations. These Terms of Service establish the rights that Cambase and others in the user community will have in and to any content that You contribute to the Cambase Dataset.

-

Eligibility

-

Use of the Service is void where prohibited. This Service is intended solely for users who are thirteen (13) years of age or older. Any registration by, use of or access to the Service by anyone under 13 is unauthorized, unlicensed and in violation of these Terms of Service. By accessing or using the Service, You represent and warrant that You are 13 or older, and that You agree to and to abide by all of the terms and conditions of this Agreement.

-

Your Contributions to Cambase

-

If You create or modify any content on Cambase, You agree to (a) provide accurate, and current information; (b) maintain the security of Your password and identification if You have one; (c) be fully responsible for all use of Your account and for any actions that take place using Your account.

-

By contributing or posting any content on the Service (including making updates to existing content on the Cambase Dataset or adding new content to the Cambase Dataset) (“Your Content”), You grant Cambase and our assigns, agents, and licensees the non-exclusive, irrevocable, royalty free, perpetual, worldwide license, with the right to sublicense through multiple tiers of sub-licensees, to use, reproduce, modify, display, perform, and distribute Your Content in any medium and through any form of technology whether now in existence or which comes into existence in the future. You should not upload any content in which You do not have sufficient rights to grant this license to Cambase.

-

Cambase owns all rights, title, and interests in intellectual property rights in any contributions by its employees, any derivative works developed by Cambase and the compilations and collective works in the Cambase Dataset, including those works incorporating Your Content (but not rights to Your Content by itself).

-

The Cambase Dataset benefits from content, including media files, submitted by anonymous users, registered users, partners, and the Cambase staff. This information may be inaccurate and / or out-of-date. Cambase assumes no responsibility regarding the accuracy of the information in the Service. Use of such information is at Your own risk.

-

Cambase shall not be responsible for any failure to remove, or delay in removing, harmful, inaccurate, unlawful, or otherwise objectionable content from the Service. Cambase has no responsibility or liability for the deletion or failure to store or display any content that is contributed to the Cambase Dataset.

-

The Cambase Dataset may be changed, updated, or deleted without notice for any reason at Cambase’s sole discretion.

-

Your Use of the Cambase Dataset

-

Non-Commercial Use of the Cambase Dataset

-

Effective December 12, 2013, we provide the Cambase Dataset under the Creative Commons Attribution-NonCommercial License [CC-BY-NC]. This license applies to contributions received to the Cambase Dataset after December 12, 2013, including, without limitation, the structured data, text and media files. Certain parts of the Cambase Dataset may contain contributions made prior to December 12, 2013, and those contributions will continue to be governed by the prior Cambase Terms of Service referencing the Creative Commons Attribution License [CC-BY].

-

If You display or distribute all or part of the Cambase Dataset (hereafter also referred to as the “Content”), You are required to provide attribution that is plainly visible to all users of the Content. Attribution gives everyone in the community the opportunity to correct errors and keep the Content up to date. Our recommended attribution guidelines are described below.

-

Ultimately, You have the responsibility to ensure You are in full compliance with the license terms whenever You use or reuse the Content.

-

Attribution

-

Attribution must clearly state that the Content is sourced from the Cambase Dataset and link to the webpage of the source material on the Site.

-

When You are using Content from a specific entity within the Dataset, Cambase asks that You use a snippet in the following form:

-
Source: <a title="NAME on Cambase" href="http://www.cambase.io/NAMESPACE/PERMALINK">NAME on Cambase</a>
-

Attribution for Twitter data would look like:

-

Source: Cambase

-

When You are referencing Content from multiple entities within the Dataset, Cambase asks that You use a snippet in the following form:

-
Source: <a title="Cambase" href="http://www.cambase.io/">Cambase</a>
-

The attribution will look like:

-

Source: Cambase

-

If you have any questions concerning attribution, feel free to contact us by e-mailing licensing@cambase.io. You may also consult the Creative Commons Attribution-NonCommercial Legal Code.

-

Commercial Use of the Cambase Dataset

-

We encourage others to incorporate all or part of the Cambase Dataset into commercial applications, but to protect the community’s investment in the Cambase Dataset and safeguard the integrity of the Cambase Dataset, Cambase requires a separate license for commercial use. Commercial is defined by the Creative Commons Attribution-NonCommercial License [CC-BY-NC] as a use in any manner that is primarily intended for or directed towards commercial advantage or monetary compensation.

-

Cambase is committed to helping people build on the Cambase Dataset, and being flexible in working with companies of all shapes and sizes. Please contact us for more details and to work with us.

-

Accessing the Cambase Platform

-

Cambase may provide a number of different ways for You to access portions of the Service. These may include, but are not necessarily limited to, copying Content directly from the Site, receiving an export data file or other form of data dump directly from Cambase or by using the Cambase API thereby enabling You to build applications on top of the Cambase Platform. You agree to utilize the Cambase Platform, including the Cambase API, in accordance with these Terms of Service and as outlined in the further documentation provided by us on the Site. For purposes of these Terms of Service, receipt of Content from the Platform by any means constitutes use of the Site and Service.

-

Because Cambase wishes to protect the integrity of the Cambase Dataset for the entire user community, Cambase does not allow You to use crawlers, spiders or other scraping technology to electronically cull data from the Site and Service. Any collection of any Content using these methods is a violation of these Terms of Service. For clarification, authorized use of the Cambase API is permitted.

-

Cambase will utilize commercially reasonable efforts to provide the Cambase Platform on a 24/7 basis but it shall not be responsible for any disruption, regardless of length. Furthermore, Cambase shall not be liable for losses or damages You may incur due to any errors or omissions in any Content or due to Your inability to access the Cambase Dataset due to disruption of the Cambase Platform.

-

Cambase reserves the right in its sole discretion (for any reason or for no reason) and at any time without notice to You to change, suspend or discontinue the availability of the Services.

-

If You choose to utilize the Cambase API or other Cambase Platform tools that provide ongoing access to the Cambase Dataset in a manner enabling the building of applications on top of the Cambase Platform, Cambase reserves the right in its sole discretion (for any reason or for no reason) and at any time without notice to You to suspend Your access to the Cambase Dataset in the future or terminate Your rights under these Terms of Service to access, use and/or display the Cambase API and/or such other Cambase Platform tools.

-

Elements of the Service

-

The graphical layout and schema of the Site, and all other elements of the Site, software applications, Content and the Service not described above are owned by Cambase or its licensors, and may not be reproduced without permission.

-

User Conduct

-

You represent, warrant and agree that no contributions of any kind submitted to the Site for the Cambase Dataset or otherwise posted, transmitted, or shared by You on or through the Site or Service will violate or infringe upon the rights of any third party, including copyright, trademark, privacy, publicity or other personal or proprietary rights; or contain libelous, defamatory or otherwise unlawful material.

-

In addition, You agree not to:

-

1. harvest or collect email addresses or other contact information of other users from the Site or Service by electronic or other means for the purposes of sending unsolicited emails or other unsolicited communications;

-

2. use the Site or Service in any unlawful manner or in any other manner that could damage, disable, overburden or impair the Site or Service;

-

3. upload, post, transmit, share, store or otherwise make available any content that we deem to be harmful, threatening, unlawful, defamatory, infringing, abusive, inflammatory, harassing, vulgar, obscene, fraudulent, invasive of privacy or publicity rights, hateful, or racially, ethnically or otherwise objectionable;

-

4. impersonate any person or entity, or falsely state or otherwise misrepresent Yourself, Your age or Your affiliation with any person or entity;

-

5. upload, post, transmit, share or otherwise make available any unsolicited or unauthorized advertising, solicitations, promotional materials, “junk mail,” “spam,” “chain letters,” “pyramid schemes,” or any other form of solicitation;

-

6. upload, post, transmit, share, store or otherwise make publicly available on the Site or Service any private information such as Social Security numbers and credit card numbers;

-

7. solicit personal information from anyone under 18 or solicit passwords or personally identifying information for commercial or unlawful purposes;

-

8. upload, post, transmit, share or otherwise make available any material that contains software viruses or any other computer code, files or programs designed to interrupt, destroy or limit the functionality of any computer software or hardware or telecommunications equipment;

-

9. intimidate or harass another;

-

10. upload, post, transmit, share, store or otherwise make available content that would constitute, encourage or provide instructions for a criminal offense, violate the rights of any party, or that would otherwise create liability or violate any local, state, national or international law;

-

11. use or attempt to use another’s account, service or system without authorization from Cambase, or create a false identity on the Site or Service.

-

12. upload, post, transmit, share, store or otherwise make available content that, in our sole judgment, is objectionable or which restricts or inhibits any other person from using or enjoying the Site, or which may expose Cambase or its users to any harm or liability of any type.

-

13. post anything that exploits children or minors or that depicts cruelty to animals.

-

Copyright Infringement

-

Cambase has in place certain legally mandated procedures regarding allegations of copyright infringement (as well as other intellectual property rights) occurring on the Site. Cambase has adopted a policy that provides for the immediate suspension and/or termination of any Site user who is found to have infringed on the rights of Cambase or of a third party, or otherwise violated any intellectual property laws of Cambase or a third party. The Cambase policy is to investigate any allegations of infringements of third party rights brought to Cambase’s attention. If You have evidence, know, or have a good faith belief that Your rights or the rights of a third party have been violated and You want Cambase to delete, edit, or disable the material in question, You must provide Cambase with all of the following information: (a) a physical or electronic signature of a person authorized to act on behalf of the owner of the exclusive right that is allegedly infringed; (b) identification of the right claimed to have been infringed, or, if multiple rights are covered by a single notification, a representative list of the relevant parts of the Service; (c) identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; (d) information reasonably sufficient to permit Cambase to contact You, such as an address, telephone number, and if available, an electronic mail address at which You may be contacted; (e) a statement that You have a good faith belief that use of the material in the manner complained of is not authorized by the owner of rights, its agent, or the law; and (f) a statement that the information in the notification is accurate, and under penalty of perjury, that You are authorized to act on behalf of the owner of an exclusive right that is allegedly infringed. For this notification to be effective, You must provide it to Cambase’s designated agent at:

-
Marco Herbst
-    Evercam Ltd.
-    The Ierne Ballroom
-    12 Parnell Sq. East
-    Dublin 1
-    info@cambase.io
-

Links to Third Party Sites

-

The Site contains (or You may be sent through the Site) links to other web sites (“Third Party Sites”) as well as articles, photographs, text, graphics, pictures, designs, music, sound, video, information, applications, software and other content or items belonging to or originating from third parties on such websites (the “Third Party Site Content”). Cambase does not control or monitor such Third Party Sites or Third Party Site Content, and Cambase is not responsible for any Third Party Sites or Third Party Site Content accessed through the Site or Service. Inclusion of, linking to or permitting the use or installation of any Third Party Site or any Third Party Site Content does not imply approval or endorsement thereof by Cambase. If You decide to leave the Site or Service and access the Third Party Sites, You do so at Your own risk and You should be aware that Site Terms of Service and other Cambase policies no longer govern.

-

Proprietary Rights

-

This Site and Service are protected by copyright, trademark, and other laws of both the United States and foreign countries. Except as expressly permitted in these Terms of Service, You may not reproduce, modify or prepare derivative works based on, distribute, sell, transfer, publicly display, publicly perform, transmit, or otherwise use this Site or the Service, or any portion thereof.

-

Relationship of the Parties

-

You and Cambase are independent contractors, and nothing in this Agreement will create any partnership, joint venture, agency, franchise, sales relationship, or employment relationship between the parties. You will have no authority to make or accept any offers or representations on Cambase’s behalf.

-

Termination

-

Cambase may terminate Your account, delete Your Cambase entry and any of Your Content and/or prohibit You from using or accessing the Site for any reason, or no reason, at any time in its sole discretion, with or without notice.

- -

Disclaimer

-

CAMBASE HEREBY DISCLAIMS ALL WARRANTIES. CAMBASE IS MAKING THE SITE AND SERVICE AVAILABLE “AS IS” WITHOUT WARRANTY OF ANY KIND. YOU ASSUME THE RISK OF ANY AND ALL DAMAGE OR LOSS FROM USE OF, OR INABILITY TO USE, THE SITE OR SERVICE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, WE EXPRESSLY DISCLAIM ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE SITE AND SERVICE, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CAMBASE DOES NOT WARRANT THAT THE SITE OR SERVICE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SITE WILL BE UNINTERRUPTED OR ERROR-FREE.

-

Limitation on Liability

-

CAMBASE’S LIABILITY TO YOU IS LIMITED. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL CAMBASE OR ITS DIRECTORS, EMPLOYEES, AFFILIATES OR AGENTS BE LIABLE TO YOU FOR DAMAGES OF ANY KIND (INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, LOST PROFITS, OR LOST DATA, REGARDLESS OF THE FORESEEABILITY OF THOSE DAMAGES) ARISING OUT OF OR IN CONNECTION WITH YOUR USE OF THE SITE OR SERVICE OR ANY OTHER MATERIALS OR SERVICES PROVIDED TO YOU BY CAMBASE. THIS LIMITATION SHALL APPLY REGARDLESS OF WHETHER THE DAMAGES ARISE OUT OF BREACH OF CONTRACT, TORT, OR ANY OTHER LEGAL THEORY OR FORM OF ACTION.

-

Indemnity

-

You agree to indemnify, defend, and hold harmless Cambase, its affiliates, officers, directors, employees, consultants, agents, and representatives from any and all third party claims, losses, liability, damages, and/or costs (including reasonable attorney fees and costs) arising from Your access to or use of the Site or Service (including the Content), Your violation of these Terms of Service, or Your infringement, or infringement by any other user of Your account, of any intellectual property or other right of any third party or Cambase. Cambase will notify You promptly of any such claim, loss, liability, or demand, and will provide You with reasonable assistance, at Your expense, in defending any such claim, loss, liability, damage, or cost.

-

Governing Law

-

These Terms of Service shall be construed in accordance with and governed by the laws of the United States and the State of New York, without reference to their rules regarding conflicts of law. You hereby irrevocably consent to the exclusive jurisdiction of the state or federal courts in New York County, New York, USA in all disputes arising out of or related to the use of the Site or Service.

-

Severability; Waiver

-

If, for whatever reason, a court of competent jurisdiction finds any term or condition in this Agreement to be unenforceable, all other terms and conditions will remain unaffected and in full force and effect. No waiver of any breach of any provision of this Agreement shall constitute a waiver of any prior, concurrent, or subsequent breach of the same or any other provisions hereof, and no waiver shall be effective unless made in writing and signed by an authorized representative of the waiving party.

-

Change of Control

-

In the event of a change of control of Cambase or the sale of substantially all of Cambase’s assets, all rights of Cambase hereunder shall be transferable without notice to You.

-

Entire Agreement

-

These Terms of Service constitute the entire agreement between You and Cambase regarding the use of the Site and Service, superseding any prior agreements between You and Cambase relating to Your use of the Site and Service.

-

Contact us by Email

-

info@cambase.io

-

Trademarks

-

The Cambase mark and other Cambase graphics, logos, designs, page headers, button icons, scripts and service names are registered trademarks, trademarks or trade dress of Cambase in the U.S. and/or other countries.

-
- -
+
+
+

Cambase Terms of Service

+
+
+

Effective December 12, 2013

+

General

+

Cambase provides information about cameras, camera related hardware and their manufacturers.

+

The Cambase Dataset (the “Dataset”) is a structured set of data, text, and media files that include information about cameras, camera related hardware and their manufacturers. The Cambase Platform (the “Platform”) provides access to the Dataset through the Cambase website (the “Site”), mobile applications, API, data exports and widgets. The Cambase Platform and Cambase Dataset (together, the “Service”) is operated by Evercam Ltd., (hereinafter referred to as “Cambase”).

+

The user is referred as to as “You”. If the user is an individual, You means such individual. If the user is a corporation, partnership or other entity (“Corporate Entity”), You refers to such Corporate Entity and the individual represents and warrants that the individual has the authority to bind the Corporate Entity.

+

By accessing or using the Service, You acknowledge that You have read, understand and agree to be bound by these Terms of Service (“Terms of Service” or “Agreement”), whether or not You have a registered account for the Service. We reserve the right, at any time, to add to, change, update, or modify these Terms of Service, simply by posting such change, update, or modification on the Site and without any other notice to You. Any such change, update, or modification will be effective immediately upon posting on the Site. It is Your responsibility to review these Terms of Service from time to time to ensure that You continue to agree with all of its terms.

+

Please read these Terms of Service carefully as they contain important information regarding Your legal rights, remedies and obligations. These Terms of Service establish the rights that Cambase and others in the user community will have in and to any content that You contribute to the Cambase Dataset.

+

Eligibility

+

Use of the Service is void where prohibited. This Service is intended solely for users who are thirteen (13) years of age or older. Any registration by, use of or access to the Service by anyone under 13 is unauthorized, unlicensed and in violation of these Terms of Service. By accessing or using the Service, You represent and warrant that You are 13 or older, and that You agree to and to abide by all of the terms and conditions of this Agreement.

+

Your Contributions to Cambase

+

If You create or modify any content on Cambase, You agree to (a) provide accurate, and current information; (b) maintain the security of Your password and identification if You have one; (c) be fully responsible for all use of Your account and for any actions that take place using Your account.

+

By contributing or posting any content on the Service (including making updates to existing content on the Cambase Dataset or adding new content to the Cambase Dataset) (“Your Content”), You grant Cambase and our assigns, agents, and licensees the non-exclusive, irrevocable, royalty free, perpetual, worldwide license, with the right to sublicense through multiple tiers of sub-licensees, to use, reproduce, modify, display, perform, and distribute Your Content in any medium and through any form of technology whether now in existence or which comes into existence in the future. You should not upload any content in which You do not have sufficient rights to grant this license to Cambase.

+

Cambase owns all rights, title, and interests in intellectual property rights in any contributions by its employees, any derivative works developed by Cambase and the compilations and collective works in the Cambase Dataset, including those works incorporating Your Content (but not rights to Your Content by itself).

+

The Cambase Dataset benefits from content, including media files, submitted by anonymous users, registered users, partners, and the Cambase staff. This information may be inaccurate and / or out-of-date. Cambase assumes no responsibility regarding the accuracy of the information in the Service. Use of such information is at Your own risk.

+

Cambase shall not be responsible for any failure to remove, or delay in removing, harmful, inaccurate, unlawful, or otherwise objectionable content from the Service. Cambase has no responsibility or liability for the deletion or failure to store or display any content that is contributed to the Cambase Dataset.

+

The Cambase Dataset may be changed, updated, or deleted without notice for any reason at Cambase’s sole discretion.

+

Your Use of the Cambase Dataset

+

Non-Commercial Use of the Cambase Dataset

+

Effective December 12, 2013, we provide the Cambase Dataset under the Creative Commons Attribution-NonCommercial License [CC-BY-NC]. This license applies to contributions received to the Cambase Dataset after December 12, 2013, including, without limitation, the structured data, text and media files. Certain parts of the Cambase Dataset may contain contributions made prior to December 12, 2013, and those contributions will continue to be governed by the prior Cambase Terms of Service referencing the Creative Commons Attribution License [CC-BY].

+

If You display or distribute all or part of the Cambase Dataset (hereafter also referred to as the “Content”), You are required to provide attribution that is plainly visible to all users of the Content. Attribution gives everyone in the community the opportunity to correct errors and keep the Content up to date. Our recommended attribution guidelines are described below.

+

Ultimately, You have the responsibility to ensure You are in full compliance with the license terms whenever You use or reuse the Content.

+

Attribution

+

Attribution must clearly state that the Content is sourced from the Cambase Dataset and link to the webpage of the source material on the Site.

+

When You are using Content from a specific entity within the Dataset, Cambase asks that You use a snippet in the following form:

+
Source: <a title="NAME on Cambase" href="http://www.cambase.io/NAMESPACE/PERMALINK">NAME on Cambase</a>
+

Attribution for Twitter data would look like:

+

Source: Cambase

+

When You are referencing Content from multiple entities within the Dataset, Cambase asks that You use a snippet in the following form:

+
Source: <a title="Cambase" href="http://www.cambase.io/">Cambase</a>
+

The attribution will look like:

+

Source: Cambase

+

If you have any questions concerning attribution, feel free to contact us by e-mailing licensing@cambase.io. You may also consult the Creative Commons Attribution-NonCommercial Legal Code.

+

Commercial Use of the Cambase Dataset

+

We encourage others to incorporate all or part of the Cambase Dataset into commercial applications, but to protect the community’s investment in the Cambase Dataset and safeguard the integrity of the Cambase Dataset, Cambase requires a separate license for commercial use. Commercial is defined by the Creative Commons Attribution-NonCommercial License [CC-BY-NC] as a use in any manner that is primarily intended for or directed towards commercial advantage or monetary compensation.

+

Cambase is committed to helping people build on the Cambase Dataset, and being flexible in working with companies of all shapes and sizes. Please contact us for more details and to work with us.

+

Accessing the Cambase Platform

+

Cambase may provide a number of different ways for You to access portions of the Service. These may include, but are not necessarily limited to, copying Content directly from the Site, receiving an export data file or other form of data dump directly from Cambase or by using the Cambase API thereby enabling You to build applications on top of the Cambase Platform. You agree to utilize the Cambase Platform, including the Cambase API, in accordance with these Terms of Service and as outlined in the further documentation provided by us on the Site. For purposes of these Terms of Service, receipt of Content from the Platform by any means constitutes use of the Site and Service.

+

Because Cambase wishes to protect the integrity of the Cambase Dataset for the entire user community, Cambase does not allow You to use crawlers, spiders or other scraping technology to electronically cull data from the Site and Service. Any collection of any Content using these methods is a violation of these Terms of Service. For clarification, authorized use of the Cambase API is permitted.

+

Cambase will utilize commercially reasonable efforts to provide the Cambase Platform on a 24/7 basis but it shall not be responsible for any disruption, regardless of length. Furthermore, Cambase shall not be liable for losses or damages You may incur due to any errors or omissions in any Content or due to Your inability to access the Cambase Dataset due to disruption of the Cambase Platform.

+

Cambase reserves the right in its sole discretion (for any reason or for no reason) and at any time without notice to You to change, suspend or discontinue the availability of the Services.

+

If You choose to utilize the Cambase API or other Cambase Platform tools that provide ongoing access to the Cambase Dataset in a manner enabling the building of applications on top of the Cambase Platform, Cambase reserves the right in its sole discretion (for any reason or for no reason) and at any time without notice to You to suspend Your access to the Cambase Dataset in the future or terminate Your rights under these Terms of Service to access, use and/or display the Cambase API and/or such other Cambase Platform tools.

+

Elements of the Service

+

The graphical layout and schema of the Site, and all other elements of the Site, software applications, Content and the Service not described above are owned by Cambase or its licensors, and may not be reproduced without permission.

+

User Conduct

+

You represent, warrant and agree that no contributions of any kind submitted to the Site for the Cambase Dataset or otherwise posted, transmitted, or shared by You on or through the Site or Service will violate or infringe upon the rights of any third party, including copyright, trademark, privacy, publicity or other personal or proprietary rights; or contain libelous, defamatory or otherwise unlawful material.

+

In addition, You agree not to:

+

1. harvest or collect email addresses or other contact information of other users from the Site or Service by electronic or other means for the purposes of sending unsolicited emails or other unsolicited communications;

+

2. use the Site or Service in any unlawful manner or in any other manner that could damage, disable, overburden or impair the Site or Service;

+

3. upload, post, transmit, share, store or otherwise make available any content that we deem to be harmful, threatening, unlawful, defamatory, infringing, abusive, inflammatory, harassing, vulgar, obscene, fraudulent, invasive of privacy or publicity rights, hateful, or racially, ethnically or otherwise objectionable;

+

4. impersonate any person or entity, or falsely state or otherwise misrepresent Yourself, Your age or Your affiliation with any person or entity;

+

5. upload, post, transmit, share or otherwise make available any unsolicited or unauthorized advertising, solicitations, promotional materials, “junk mail,” “spam,” “chain letters,” “pyramid schemes,” or any other form of solicitation;

+

6. upload, post, transmit, share, store or otherwise make publicly available on the Site or Service any private information such as Social Security numbers and credit card numbers;

+

7. solicit personal information from anyone under 18 or solicit passwords or personally identifying information for commercial or unlawful purposes;

+

8. upload, post, transmit, share or otherwise make available any material that contains software viruses or any other computer code, files or programs designed to interrupt, destroy or limit the functionality of any computer software or hardware or telecommunications equipment;

+

9. intimidate or harass another;

+

10. upload, post, transmit, share, store or otherwise make available content that would constitute, encourage or provide instructions for a criminal offense, violate the rights of any party, or that would otherwise create liability or violate any local, state, national or international law;

+

11. use or attempt to use another’s account, service or system without authorization from Cambase, or create a false identity on the Site or Service.

+

12. upload, post, transmit, share, store or otherwise make available content that, in our sole judgment, is objectionable or which restricts or inhibits any other person from using or enjoying the Site, or which may expose Cambase or its users to any harm or liability of any type.

+

13. post anything that exploits children or minors or that depicts cruelty to animals.

+

Copyright Infringement

+

Cambase has in place certain legally mandated procedures regarding allegations of copyright infringement (as well as other intellectual property rights) occurring on the Site. Cambase has adopted a policy that provides for the immediate suspension and/or termination of any Site user who is found to have infringed on the rights of Cambase or of a third party, or otherwise violated any intellectual property laws of Cambase or a third party. The Cambase policy is to investigate any allegations of infringements of third party rights brought to Cambase’s attention. If You have evidence, know, or have a good faith belief that Your rights or the rights of a third party have been violated and You want Cambase to delete, edit, or disable the material in question, You must provide Cambase with all of the following information: (a) a physical or electronic signature of a person authorized to act on behalf of the owner of the exclusive right that is allegedly infringed; (b) identification of the right claimed to have been infringed, or, if multiple rights are covered by a single notification, a representative list of the relevant parts of the Service; (c) identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; (d) information reasonably sufficient to permit Cambase to contact You, such as an address, telephone number, and if available, an electronic mail address at which You may be contacted; (e) a statement that You have a good faith belief that use of the material in the manner complained of is not authorized by the owner of rights, its agent, or the law; and (f) a statement that the information in the notification is accurate, and under penalty of perjury, that You are authorized to act on behalf of the owner of an exclusive right that is allegedly infringed. For this notification to be effective, You must provide it to Cambase’s designated agent at:

+
Marco Herbst
+    Evercam Ltd.
+    The Ierne Ballroom
+    12 Parnell Sq. East
+    Dublin 1
+    info@cambase.io
+

Links to Third Party Sites

+

The Site contains (or You may be sent through the Site) links to other web sites (“Third Party Sites”) as well as articles, photographs, text, graphics, pictures, designs, music, sound, video, information, applications, software and other content or items belonging to or originating from third parties on such websites (the “Third Party Site Content”). Cambase does not control or monitor such Third Party Sites or Third Party Site Content, and Cambase is not responsible for any Third Party Sites or Third Party Site Content accessed through the Site or Service. Inclusion of, linking to or permitting the use or installation of any Third Party Site or any Third Party Site Content does not imply approval or endorsement thereof by Cambase. If You decide to leave the Site or Service and access the Third Party Sites, You do so at Your own risk and You should be aware that Site Terms of Service and other Cambase policies no longer govern.

+

Proprietary Rights

+

This Site and Service are protected by copyright, trademark, and other laws of both the United States and foreign countries. Except as expressly permitted in these Terms of Service, You may not reproduce, modify or prepare derivative works based on, distribute, sell, transfer, publicly display, publicly perform, transmit, or otherwise use this Site or the Service, or any portion thereof.

+

Relationship of the Parties

+

You and Cambase are independent contractors, and nothing in this Agreement will create any partnership, joint venture, agency, franchise, sales relationship, or employment relationship between the parties. You will have no authority to make or accept any offers or representations on Cambase’s behalf.

+

Termination

+

Cambase may terminate Your account, delete Your Cambase entry and any of Your Content and/or prohibit You from using or accessing the Site for any reason, or no reason, at any time in its sole discretion, with or without notice.

+ +

Disclaimer

+

CAMBASE HEREBY DISCLAIMS ALL WARRANTIES. CAMBASE IS MAKING THE SITE AND SERVICE AVAILABLE “AS IS” WITHOUT WARRANTY OF ANY KIND. YOU ASSUME THE RISK OF ANY AND ALL DAMAGE OR LOSS FROM USE OF, OR INABILITY TO USE, THE SITE OR SERVICE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, WE EXPRESSLY DISCLAIM ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE SITE AND SERVICE, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CAMBASE DOES NOT WARRANT THAT THE SITE OR SERVICE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SITE WILL BE UNINTERRUPTED OR ERROR-FREE.

+

Limitation on Liability

+

CAMBASE’S LIABILITY TO YOU IS LIMITED. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL CAMBASE OR ITS DIRECTORS, EMPLOYEES, AFFILIATES OR AGENTS BE LIABLE TO YOU FOR DAMAGES OF ANY KIND (INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, LOST PROFITS, OR LOST DATA, REGARDLESS OF THE FORESEEABILITY OF THOSE DAMAGES) ARISING OUT OF OR IN CONNECTION WITH YOUR USE OF THE SITE OR SERVICE OR ANY OTHER MATERIALS OR SERVICES PROVIDED TO YOU BY CAMBASE. THIS LIMITATION SHALL APPLY REGARDLESS OF WHETHER THE DAMAGES ARISE OUT OF BREACH OF CONTRACT, TORT, OR ANY OTHER LEGAL THEORY OR FORM OF ACTION.

+

Indemnity

+

You agree to indemnify, defend, and hold harmless Cambase, its affiliates, officers, directors, employees, consultants, agents, and representatives from any and all third party claims, losses, liability, damages, and/or costs (including reasonable attorney fees and costs) arising from Your access to or use of the Site or Service (including the Content), Your violation of these Terms of Service, or Your infringement, or infringement by any other user of Your account, of any intellectual property or other right of any third party or Cambase. Cambase will notify You promptly of any such claim, loss, liability, or demand, and will provide You with reasonable assistance, at Your expense, in defending any such claim, loss, liability, damage, or cost.

+

Governing Law

+

These Terms of Service shall be construed in accordance with and governed by the laws of the United States and the State of New York, without reference to their rules regarding conflicts of law. You hereby irrevocably consent to the exclusive jurisdiction of the state or federal courts in New York County, New York, USA in all disputes arising out of or related to the use of the Site or Service.

+

Severability; Waiver

+

If, for whatever reason, a court of competent jurisdiction finds any term or condition in this Agreement to be unenforceable, all other terms and conditions will remain unaffected and in full force and effect. No waiver of any breach of any provision of this Agreement shall constitute a waiver of any prior, concurrent, or subsequent breach of the same or any other provisions hereof, and no waiver shall be effective unless made in writing and signed by an authorized representative of the waiving party.

+

Change of Control

+

In the event of a change of control of Cambase or the sale of substantially all of Cambase’s assets, all rights of Cambase hereunder shall be transferable without notice to You.

+

Entire Agreement

+

These Terms of Service constitute the entire agreement between You and Cambase regarding the use of the Site and Service, superseding any prior agreements between You and Cambase relating to Your use of the Site and Service.

+

Contact us by Email

+

info@cambase.io

+

Trademarks

+

The Cambase mark and other Cambase graphics, logos, designs, page headers, button icons, scripts and service names are registered trademarks, trademarks or trade dress of Cambase in the U.S. and/or other countries.

+
+ +
diff --git a/app/views/rails_admin/main/history.html.haml b/app/views/rails_admin/main/history.html.haml index e5365da..5ffece8 100644 --- a/app/views/rails_admin/main/history.html.haml +++ b/app/views/rails_admin/main/history.html.haml @@ -1,54 +1,54 @@ -- params = request.params.except(:action, :controller, :model_name) -- query = params[:query] -- filter = params[:filter] -- sort = params[:sort] -- sort_reverse = params[:sort_reverse] -- path_method = params[:id] ? "history_show_path" : "history_index_path" - -= form_tag("", method: "get", class: "search pjax-form form-inline") do - .well - %input{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'} - %button.btn.btn-primary{type: "submit", :'data-disable-with' => " ".html_safe + t("admin.misc.refresh")} - %i.icon-white.icon-refresh - = t("admin.misc.refresh") - -%table#history.table.table-striped.table-condensed - %thead - %tr - - columns = [] - - columns << { property_name: "created_at", css_class: "created_at",link_text: t('admin.table_headers.created_at') } - - columns << { property_name: "username", css_class: "username", link_text: t('admin.table_headers.username') } - - columns << { property_name: "item", css_class: "item", link_text: t('admin.table_headers.item') } if @general - - columns << { property_name: "changes", css_class: "changes", link_text: t('admin.table_headers.changes') } - - columns << { property_name: "approve", css_class: "approve", link_text: t('admin.table_headers.approve_change') } - - - columns.each do |column| - - property_name = column[:property_name] - - selected = (sort == property_name) - - sort_direction = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) - - sort_location = send(path_method, params.except("sort_reverse").merge(model_name: @abstract_model.to_param, sort: property_name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {})) - %th{class: "header pjax #{column[:css_class]} #{sort_direction if selected}", :'data-href' => sort_location}= column[:link_text] - %tbody - - @history.each_with_index do |object, index| - %tr - - unless object.created_at.nil? - %td= l(object.created_at, format: :long, default: l(object.created_at, format: :long, locale: :en)) - %td= object.username - - if @general - - if o = @abstract_model.get(object.item) - - label = o.send(@abstract_model.config.object_label_method) - - if show_action = action(:show, @abstract_model, o) - %td= link_to(label, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: o.id), class: 'pjax') - - else - %td= label - - else - %td= "#{@abstract_model.config.label} ##{object.item}" - %td= object.changes - - if index == 0 - %td - - else - %td= link_to("##{object.id}", "#", :class => 'history_approve_contribution', :'data-id' => "#{object.id}") - -- unless params[:all] || !@history.respond_to?(:current_page) - = paginate(@history, theme: 'twitter-bootstrap', remote: true) - = link_to(t("admin.misc.show_all"), send(path_method, params.merge(all: true)), class: "show-all btn pjax") unless (tc = @history.total_count) <= @history.size || tc > 100 +- params = request.params.except(:action, :controller, :model_name) +- query = params[:query] +- filter = params[:filter] +- sort = params[:sort] +- sort_reverse = params[:sort_reverse] +- path_method = params[:id] ? "history_show_path" : "history_index_path" + += form_tag("", method: "get", class: "search pjax-form form-inline") do + .well + %input{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'} + %button.btn.btn-primary{type: "submit", :'data-disable-with' => " ".html_safe + t("admin.misc.refresh")} + %i.icon-white.icon-refresh + = t("admin.misc.refresh") + +%table#history.table.table-striped.table-condensed + %thead + %tr + - columns = [] + - columns << { property_name: "created_at", css_class: "created_at",link_text: t('admin.table_headers.created_at') } + - columns << { property_name: "username", css_class: "username", link_text: t('admin.table_headers.username') } + - columns << { property_name: "item", css_class: "item", link_text: t('admin.table_headers.item') } if @general + - columns << { property_name: "changes", css_class: "changes", link_text: t('admin.table_headers.changes') } + - columns << { property_name: "approve", css_class: "approve", link_text: t('admin.table_headers.approve_change') } + + - columns.each do |column| + - property_name = column[:property_name] + - selected = (sort == property_name) + - sort_direction = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) + - sort_location = send(path_method, params.except("sort_reverse").merge(model_name: @abstract_model.to_param, sort: property_name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {})) + %th{class: "header pjax #{column[:css_class]} #{sort_direction if selected}", :'data-href' => sort_location}= column[:link_text] + %tbody + - @history.each_with_index do |object, index| + %tr + - unless object.created_at.nil? + %td= l(object.created_at, format: :long, default: l(object.created_at, format: :long, locale: :en)) + %td= object.username + - if @general + - if o = @abstract_model.get(object.item) + - label = o.send(@abstract_model.config.object_label_method) + - if show_action = action(:show, @abstract_model, o) + %td= link_to(label, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: o.id), class: 'pjax') + - else + %td= label + - else + %td= "#{@abstract_model.config.label} ##{object.item}" + %td= object.changes + - if index == 0 + %td + - else + %td= link_to("##{object.id}", "#", :class => 'history_approve_contribution', :'data-id' => "#{object.id}") + +- unless params[:all] || !@history.respond_to?(:current_page) + = paginate(@history, theme: 'twitter-bootstrap', remote: true) + = link_to(t("admin.misc.show_all"), send(path_method, params.merge(all: true)), class: "show-all btn pjax") unless (tc = @history.total_count) <= @history.size || tc > 100 diff --git a/app/views/recorders/_form.html.erb b/app/views/recorders/_form.html.erb index 7f2fecd..1d72db4 100644 --- a/app/views/recorders/_form.html.erb +++ b/app/views/recorders/_form.html.erb @@ -1,91 +1,91 @@ -<%= form_for(@recorder, :url => vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug)) do |f| %> -<% if @recorder.errors.any? %> -
-

<%= pluralize(@recorder.errors.count, "error") %> prohibited this recorder from being saved:

- - -
-<% end %> - -
-

- <%= f.label :vendor %> - <%= f.collection_select(:vendor_id, Vendor.order(:name), :id, :name, :include_blank => 'Vendor') %> -

-

- <%= f.label :model %> - <%= f.text_field :model, :placeholder => 'Model' %> -

-

- <%= f.label :manual_url %> - <%= f.text_field :manual_url, :placeholder => 'Manual URL' %> -

-

- <%= f.label :jpeg_url %> - <%= f.text_field :jpeg_url, :placeholder => 'JPEG URL' %> -

-

- <%= f.label :h264_url %> - <%= f.text_field :h264_url, :placeholder => 'H264 URL' %> -

-

- <%= f.label :mjpeg_url %> - <%= f.text_field :mjpeg_url, :placeholder => 'MJPEG URL' %> -

-

- <%= f.label :resolution %> - <%= f.select(:resolution, Recorder.uniq.pluck(:resolution).compact.sort, :include_blank => 'Resolution')%> -

-

- <%= f.label :firmware %> - <%= f.text_field :firmware, :placeholder => 'Firmware' %> -

-

- <%= f.label :default_username %> - <%= f.text_field :default_username, :placeholder => 'Default Username' %> -

-

- <%= f.label :default_password %> - <%= f.text_field :default_password, :placeholder => 'Default Password' %> -

-

- <%= f.label :shape %> - <%= f.select(:shape, Recorder.uniq.pluck(:shape).compact.sort, :include_blank => 'Shape') %> -

-

- <%= f.label :onvif %> - <%= f.check_box :onvif, :placeholder => 'ONVIF' %> -

-

- <%= f.label :psia %> - <%= f.check_box :psia, :placeholder => 'PSIA' %> -

-

- <%= f.label :ptz %> - <%= f.check_box :ptz, :placeholder => 'PTZ' %> -

-

- <%= f.label :infrared %> - <%= f.check_box :infrared, :placeholder => 'Infrared' %> -

-

- <%= f.label :varifocal %> - <%= f.check_box :varifocal, :placeholder => 'Varifocal' %> -

-

- <%= f.label :sd_card %> - <%= f.check_box :sd_card, :placeholder => 'SD card' %> -

-

- <%= f.label :upnp %> - <%= f.check_box :upnp, :placeholder => 'UPnP' %> -

-
-
- <%= f.submit %> -
-<% end %> +<%= form_for(@recorder, :url => vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug)) do |f| %> +<% if @recorder.errors.any? %> +
+

<%= pluralize(@recorder.errors.count, "error") %> prohibited this recorder from being saved:

+ + +
+<% end %> + +
+

+ <%= f.label :vendor %> + <%= f.collection_select(:vendor_id, Vendor.order(:name), :id, :name, :include_blank => 'Vendor') %> +

+

+ <%= f.label :model %> + <%= f.text_field :model, :placeholder => 'Model' %> +

+

+ <%= f.label :manual_url %> + <%= f.text_field :manual_url, :placeholder => 'Manual URL' %> +

+

+ <%= f.label :jpeg_url %> + <%= f.text_field :jpeg_url, :placeholder => 'JPEG URL' %> +

+

+ <%= f.label :h264_url %> + <%= f.text_field :h264_url, :placeholder => 'H264 URL' %> +

+

+ <%= f.label :mjpeg_url %> + <%= f.text_field :mjpeg_url, :placeholder => 'MJPEG URL' %> +

+

+ <%= f.label :resolution %> + <%= f.select(:resolution, Recorder.uniq.pluck(:resolution).compact.sort, :include_blank => 'Resolution')%> +

+

+ <%= f.label :firmware %> + <%= f.text_field :firmware, :placeholder => 'Firmware' %> +

+

+ <%= f.label :default_username %> + <%= f.text_field :default_username, :placeholder => 'Default Username' %> +

+

+ <%= f.label :default_password %> + <%= f.text_field :default_password, :placeholder => 'Default Password' %> +

+

+ <%= f.label :shape %> + <%= f.select(:shape, Recorder.uniq.pluck(:shape).compact.sort, :include_blank => 'Shape') %> +

+

+ <%= f.label :onvif %> + <%= f.check_box :onvif, :placeholder => 'ONVIF' %> +

+

+ <%= f.label :psia %> + <%= f.check_box :psia, :placeholder => 'PSIA' %> +

+

+ <%= f.label :ptz %> + <%= f.check_box :ptz, :placeholder => 'PTZ' %> +

+

+ <%= f.label :infrared %> + <%= f.check_box :infrared, :placeholder => 'Infrared' %> +

+

+ <%= f.label :varifocal %> + <%= f.check_box :varifocal, :placeholder => 'Varifocal' %> +

+

+ <%= f.label :sd_card %> + <%= f.check_box :sd_card, :placeholder => 'SD card' %> +

+

+ <%= f.label :upnp %> + <%= f.check_box :upnp, :placeholder => 'UPnP' %> +

+
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/recorders/edit.html.erb b/app/views/recorders/edit.html.erb index ac57595..bf8083f 100644 --- a/app/views/recorders/edit.html.erb +++ b/app/views/recorders/edit.html.erb @@ -1,6 +1,6 @@ -

Editing recorder

- -<%= render 'form' %> - -<%= link_to 'Show', vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug) %> | -<%= link_to 'Back', recorders_path %> +

Editing recorder

+ +<%= render 'form' %> + +<%= link_to 'Show', vendor_recorder_path(@recorder.vendor.vendor_slug, @recorder.recorder_slug) %> | +<%= link_to 'Back', recorders_path %> diff --git a/app/views/recorders/index.html.erb b/app/views/recorders/index.html.erb index 57cada0..3d2235e 100644 --- a/app/views/recorders/index.html.erb +++ b/app/views/recorders/index.html.erb @@ -1 +1 @@ -<%= render 'shared/recorders' %> +<%= render 'shared/recorders' %> diff --git a/app/views/recorders/new.html.erb b/app/views/recorders/new.html.erb index 16c2065..a41b316 100644 --- a/app/views/recorders/new.html.erb +++ b/app/views/recorders/new.html.erb @@ -1,3 +1,3 @@ -<%= render 'form' %> - -<%= link_to 'Back', recorders_path %> +<%= render 'form' %> + +<%= link_to 'Back', recorders_path %> diff --git a/app/views/recorders/search.html.erb b/app/views/recorders/search.html.erb index 57cada0..3d2235e 100644 --- a/app/views/recorders/search.html.erb +++ b/app/views/recorders/search.html.erb @@ -1 +1 @@ -<%= render 'shared/recorders' %> +<%= render 'shared/recorders' %> diff --git a/app/views/recorders/show.html.erb b/app/views/recorders/show.html.erb index f788981..b111e59 100644 --- a/app/views/recorders/show.html.erb +++ b/app/views/recorders/show.html.erb @@ -1,232 +1,232 @@ -<% content_for :title do %> - <%= "#{@recorder.vendor.name} #{@recorder.model}" %> -<% end %> - -
-

<%= "#{@recorder.vendor.name} #{@recorder.model}" %>

- <% if @recorder.prev %> - <%= link_to "prev", "/#{@recorder.prev.vendor.name.downcase}/recorders/#{@recorder.prev.model.downcase}", class: 'align-left' %> - <% end %> - <% if @recorder.next %> - <%= link_to "next", "/#{@recorder.next.vendor.name.downcase}/recorders/#{@recorder.next.model.downcase}", class: 'align-left' %> - <% end %> - <%= link_to "json", "/api/v1/recorders/#{@recorder.recorder_slug}", class: 'align-right' %> - <%= link_to "url", '', class: 'align-right' %> -
- -
-
-
-
-
-

Recorder Information

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vendor - <%= @recorder.vendor.name || 'Unknown' %> - <%= link_to('Website', @recorder.vendor.url, target: "_blank", class: 'icon-link') %> -
Name<%= @recorder.name || 'Unknown' %>
Model<%= @recorder.model || 'Unknown' %>
Max. Resolution<%= @recorder.resolution || 'Unknown' %>
Type<%= @recorder.recorder_type || 'Unknown' %>
Input Channels<%= @recorder.input_channels || 'Unknown' %>
Playback Channels<%= @recorder.playback_channels || 'Unknown' %>
JPEG URL<%= @recorder.jpeg_url || 'Unknown' %>
H264 URL<%= @recorder.h264_url || 'Unknown' %>
MJPEG URL<%= @recorder.mjpeg_url || 'Unknown' %>
Default Username<%= @recorder.default_username || 'Unknown' %>
Default Password<%= @recorder.default_password || 'Unknown' %>
Official Page - <% if @recorder.official_url %> - <%= link_to @recorder.official_url, @recorder.official_url, target: '_blank' %> - <% else %> - Unknown - <% end %> -
-
-
-
-
-
-

Recorder Features

-
-
-
- - - - - <%= editable @recorder, :onvif, tag: :td %> - - - - <%= editable @recorder, :psia, tag: :td %> - - - - <%= editable @recorder, :ptz, tag: :td %> - - - - <%= editable @recorder, :upnp, tag: :td %> - - - - <%= editable @recorder, :support_3rdparty, tag: :td %> - - - - <%= editable @recorder, :audio_in, tag: :td %> - - - - <%= editable @recorder, :audio_out, tag: :td %> - - - - <%= editable @recorder, :discontinued, tag: :td %> - - -
ONVIF
PSIA
PTZ
UPnP
3rdparty Support
Audio In
Audio Out
Discontinued
-
-
-
-
-
-

Tips

-
-
-
- - - comments powered by Disqus -
-
-
-
-
+<% content_for :title do %> + <%= "#{@recorder.vendor.name} #{@recorder.model}" %> +<% end %> + +
+

<%= "#{@recorder.vendor.name} #{@recorder.model}" %>

+ <% if @recorder.prev %> + <%= link_to "prev", "/#{@recorder.prev.vendor.name.downcase}/recorders/#{@recorder.prev.model.downcase}", class: 'align-left' %> + <% end %> + <% if @recorder.next %> + <%= link_to "next", "/#{@recorder.next.vendor.name.downcase}/recorders/#{@recorder.next.model.downcase}", class: 'align-left' %> + <% end %> + <%= link_to "json", "/api/v1/recorders/#{@recorder.recorder_slug}", class: 'align-right' %> + <%= link_to "url", '', class: 'align-right' %> +
+ +
+
+
+
+
+

Recorder Information

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Vendor + <%= @recorder.vendor.name || 'Unknown' %> + <%= link_to('Website', @recorder.vendor.url, target: "_blank", class: 'icon-link') %> +
Name<%= @recorder.name || 'Unknown' %>
Model<%= @recorder.model || 'Unknown' %>
Max. Resolution<%= @recorder.resolution || 'Unknown' %>
Type<%= @recorder.recorder_type || 'Unknown' %>
Input Channels<%= @recorder.input_channels || 'Unknown' %>
Playback Channels<%= @recorder.playback_channels || 'Unknown' %>
JPEG URL<%= @recorder.jpeg_url || 'Unknown' %>
H264 URL<%= @recorder.h264_url || 'Unknown' %>
MJPEG URL<%= @recorder.mjpeg_url || 'Unknown' %>
Default Username<%= @recorder.default_username || 'Unknown' %>
Default Password<%= @recorder.default_password || 'Unknown' %>
Official Page + <% if @recorder.official_url %> + <%= link_to @recorder.official_url, @recorder.official_url, target: '_blank' %> + <% else %> + Unknown + <% end %> +
+
+
+
+
+
+

Recorder Features

+
+
+
+ + + + + <%= editable @recorder, :onvif, tag: :td %> + + + + <%= editable @recorder, :psia, tag: :td %> + + + + <%= editable @recorder, :ptz, tag: :td %> + + + + <%= editable @recorder, :upnp, tag: :td %> + + + + <%= editable @recorder, :support_3rdparty, tag: :td %> + + + + <%= editable @recorder, :audio_in, tag: :td %> + + + + <%= editable @recorder, :audio_out, tag: :td %> + + + + <%= editable @recorder, :discontinued, tag: :td %> + + +
ONVIF
PSIA
PTZ
UPnP
3rdparty Support
Audio In
Audio Out
Discontinued
+
+
+
+
+
+

Tips

+
+
+
+ + + comments powered by Disqus +
+
+
+
+
diff --git a/app/views/shared/_add_model_modal.erb b/app/views/shared/_add_model_modal.erb index 9df5d5f..c20b244 100644 --- a/app/views/shared/_add_model_modal.erb +++ b/app/views/shared/_add_model_modal.erb @@ -1,77 +1,77 @@ - + diff --git a/app/views/shared/_add_recorder_modal.erb b/app/views/shared/_add_recorder_modal.erb index 9df5d5f..c20b244 100644 --- a/app/views/shared/_add_recorder_modal.erb +++ b/app/views/shared/_add_recorder_modal.erb @@ -1,77 +1,77 @@ - + diff --git a/app/views/shared/_add_vendor_modal.erb b/app/views/shared/_add_vendor_modal.erb index 207b640..b4183d2 100644 --- a/app/views/shared/_add_vendor_modal.erb +++ b/app/views/shared/_add_vendor_modal.erb @@ -1,39 +1,39 @@ - + diff --git a/app/views/shared/_filters.html.erb b/app/views/shared/_filters.html.erb index 6f28fe5..1e23e6c 100644 --- a/app/views/shared/_filters.html.erb +++ b/app/views/shared/_filters.html.erb @@ -1,54 +1,54 @@ - + diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index 9a102cd..feaaff0 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,33 +1,33 @@ - + diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb index 41c16b6..ca18580 100644 --- a/app/views/shared/_header.html.erb +++ b/app/views/shared/_header.html.erb @@ -1,43 +1,43 @@ -