diff --git a/.github/workflows/next-rails.yml b/.github/workflows/next-rails.yml index 4d0aac83..5f31a6eb 100644 --- a/.github/workflows/next-rails.yml +++ b/.github/workflows/next-rails.yml @@ -26,7 +26,7 @@ jobs: echo "BUNDLE_CACHE_PATH=vendor/cache.next" >> $GITHUB_ENV - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 3.1.0 bundler-cache: true - name: Prepare spec run: | diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index a80430d0..4dadf9b7 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 3.1.0 bundler-cache: true - run: bundle exec rubocop - run: bundle exec haml-lint app/views @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 3.1 bundler-cache: true - name: Prepare spec run: | diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d0ba1ec4..0d9a6f13 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-08-13 12:49:18 UTC using RuboCop version 1.19.0. +# on 2022-02-10 16:47:29 UTC using RuboCop version 1.25.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemfile, **/Gemfile, **/gems.rb @@ -14,13 +14,12 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 5 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: IndentationWidth. Layout/AssignmentIndentation: Exclude: - 'app/helpers/format_helper.rb' - - 'config/environments/development.rb' # Offense count: 4 # Cop supports --auto-correct. @@ -33,6 +32,7 @@ Layout/ClosingParenthesisIndentation: # Offense count: 14 # Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. Layout/CommentIndentation: Exclude: - 'app/controllers/admin/comments_controller.rb' @@ -42,13 +42,6 @@ Layout/CommentIndentation: - 'app/models/track.rb' - 'spec/features/volunteers_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowBorderComment, AllowMarginComment. -Layout/EmptyComment: - Exclude: - - 'config/initializers/formtastic.rb' - # Offense count: 3 # Cop supports --auto-correct. Layout/EmptyLineAfterGuardClause: @@ -62,7 +55,7 @@ Layout/EmptyLineAfterMagicComment: Exclude: - 'spec/models/conference_spec.rb' -# Offense count: 113 +# Offense count: 108 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, no_empty_lines @@ -75,17 +68,13 @@ Layout/EmptyLinesAroundExceptionHandlingKeywords: Exclude: - 'app/models/payment.rb' -# Offense count: 13 +# Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. Layout/ExtraSpacing: Exclude: - - 'Guardfile' - 'app/controllers/application_controller.rb' - 'app/views/admin/events/_all_with_comments.xlsx.axlsx' - - 'bin/rails' - - 'config.ru' - - 'config/environments/test.rb' - 'db/migrate/20140623101032_create_ahoy_events.rb' - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' - 'db/migrate/20140719160903_create_delayed_jobs.rb' @@ -140,12 +129,11 @@ Layout/IndentationWidth: Exclude: - 'app/controllers/users_controller.rb' -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. Layout/LeadingCommentSpace: Exclude: - - 'Guardfile' - 'app/models/comment.rb' # Offense count: 32 @@ -179,14 +167,14 @@ Layout/MultilineHashBraceLayout: - 'config/routes.rb' - 'spec/models/event_spec.rb' -# Offense count: 36 +# Offense count: 35 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineMethodCallBraceLayout: Enabled: false -# Offense count: 56 +# Offense count: 55 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver @@ -241,14 +229,13 @@ Layout/SpaceAroundMethodCallOperator: - 'spec/features/organizer_ability_spec.rb' - 'spec/models/program_spec.rb' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. # SupportedStylesForExponentOperator: space, no_space Layout/SpaceAroundOperators: Exclude: - 'app/views/admin/events/_all_with_comments.xlsx.axlsx' - - 'config/environments/test.rb' - 'lib/tasks/data.rake' # Offense count: 139 @@ -278,12 +265,6 @@ Layout/SpaceBeforeFirstArg: Exclude: - 'app/controllers/admin/booths_controller.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Layout/SpaceBeforeSemicolon: - Exclude: - - 'Guardfile' - # Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. @@ -339,7 +320,7 @@ Layout/SpaceInsideHashLiteralBraces: # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. -# SupportedStyles: space, no_space +# SupportedStyles: space, compact, no_space Layout/SpaceInsideParens: Exclude: - 'app/views/admin/registrations/index.xlsx.axlsx' @@ -371,11 +352,17 @@ Lint/AmbiguousBlockAssociation: - 'spec/controllers/schedules_controller_spec.rb' - 'spec/models/user_spec.rb' -# Offense count: 1 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: +# Offense count: 13 +# Cop supports --auto-correct. +Lint/AmbiguousOperatorPrecedence: Exclude: - - 'bin/spring' + - 'app/controllers/application_controller.rb' + - 'app/helpers/conference_helper.rb' + - 'app/models/admin_ability.rb' + - 'app/models/commercial.rb' + - 'app/models/conference.rb' + - 'app/models/track.rb' + - 'app/pdfs/ticket_pdf.rb' # Offense count: 1 # Configuration parameters: AllowedMethods. @@ -409,31 +396,12 @@ Lint/IneffectiveAccessModifier: - 'app/models/commercial.rb' - 'app/models/conference.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Lint/NonDeterministicRequireOrder: - Exclude: - - 'spec/spec_helper.rb' - # Offense count: 1 # Cop supports --auto-correct. Lint/RedundantCopDisableDirective: Exclude: - 'spec/support/save_feature_failures.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Lint/ScriptPermission: - Exclude: - - 'Guardfile' - - 'Rakefile' - -# Offense count: 1 -# Configuration parameters: AllowComments, AllowNil. -Lint/SuppressedException: - Exclude: - - 'bin/rspec' - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. @@ -455,16 +423,16 @@ Lint/UriRegexp: - 'app/models/commercial.rb' - 'app/models/contact.rb' -# Offense count: 128 +# Offense count: 127 # Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: Max: 71 -# Offense count: 315 +# Offense count: 313 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. # IgnoredMethods: refine Metrics/BlockLength: - Max: 1344 + Max: 1341 # Offense count: 1 # Configuration parameters: CountBlocks. @@ -476,12 +444,12 @@ Metrics/BlockNesting: Metrics/ClassLength: Max: 652 -# Offense count: 28 +# Offense count: 29 # Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: Max: 16 -# Offense count: 150 +# Offense count: 152 # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. Metrics/MethodLength: Max: 56 @@ -491,7 +459,7 @@ Metrics/MethodLength: Metrics/ModuleLength: Max: 173 -# Offense count: 25 +# Offense count: 26 # Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: Max: 19 @@ -510,15 +478,6 @@ Naming/HeredocDelimiterNaming: - 'spec/factories/users.rb' - 'spec/models/user_spec.rb' -# Offense count: 10 -# Configuration parameters: CheckIdentifiers, CheckConstants, CheckVariables, CheckStrings, CheckSymbols, CheckComments, CheckFilepaths, FlaggedTerms. -Naming/InclusiveLanguage: - Exclude: - - 'app/controllers/admin/contacts_controller.rb' - - 'app/controllers/users_controller.rb' - - 'app/uploaders/picture_uploader.rb' - - 'config/application.rb' - # Offense count: 2 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to @@ -618,7 +577,7 @@ RSpec/DescribedClass: - 'spec/serializers/speaker_serializer_spec.rb' - 'spec/serializers/track_serializer_spec.rb' -# Offense count: 13 +# Offense count: 11 # Cop supports --auto-correct. # Configuration parameters: AllowConsecutiveOneLiners. RSpec/EmptyLineAfterExample: @@ -649,7 +608,7 @@ RSpec/EmptyLineAfterFinalLet: - 'spec/models/payment_spec.rb' - 'spec/models/ticket_spec.rb' -# Offense count: 16 +# Offense count: 17 # Cop supports --auto-correct. RSpec/EmptyLineAfterHook: Exclude: @@ -682,7 +641,7 @@ RSpec/EmptyLineAfterSubject: RSpec/ExampleLength: Max: 187 -# Offense count: 19 +# Offense count: 18 # Cop supports --auto-correct. # Configuration parameters: CustomTransform, IgnoredWords. RSpec/ExampleWording: @@ -829,7 +788,7 @@ RSpec/MultipleDescribes: - 'spec/controllers/application_controller_spec.rb' - 'spec/models/conference_spec.rb' -# Offense count: 279 +# Offense count: 277 RSpec/MultipleExpectations: Max: 97 @@ -951,7 +910,7 @@ Style/AccessorGrouping: - 'app/models/payment.rb' # Offense count: 12 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. Style/CaseLikeIf: Exclude: - 'app/controllers/admin/roles_controller.rb' @@ -1007,14 +966,6 @@ Style/ConditionalAssignment: Style/Documentation: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: allowed_in_returns, forbidden -Style/DoubleNegation: - Exclude: - - 'config/environments/production.rb' - # Offense count: 2 # Cop supports --auto-correct. Style/EmptyCaseCondition: @@ -1042,37 +993,22 @@ Style/EmptyMethod: - 'db/migrate/20130206192339_rename_attending_social_events_with_partner.rb' - 'db/migrate/20130216122155_set_registration_defaults_to_false.rb' -# Offense count: 4 +# Offense count: 3 # Cop supports --auto-correct. Style/Encoding: Exclude: - 'app/uploaders/picture_uploader.rb' - - 'config/initializers/formtastic.rb' - - 'config/initializers/money.rb' - 'spec/models/conference_spec.rb' -# Offense count: 11 +# Offense count: 3 # Cop supports --auto-correct. Style/ExpandPathArguments: Exclude: - - 'Rakefile' - 'bin/bundle' - - 'bin/rails' - 'bin/rspec' - - 'bin/setup' - - 'bin/update' - - 'config.ru' - - 'config/application.rb' - - 'config/environment.rb' - 'spec/spec_helper.rb' -# Offense count: 9 -# Cop supports --auto-correct. -Style/ExplicitBlockArgument: - Exclude: - - 'Guardfile' - -# Offense count: 48 +# Offense count: 41 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -1085,7 +1021,7 @@ Style/GlobalStdStream: Exclude: - 'config/environments/production.rb' -# Offense count: 28 +# Offense count: 29 # Configuration parameters: MinBodyLength. Style/GuardClause: Enabled: false @@ -1114,25 +1050,22 @@ Style/HashLikeCase: Exclude: - 'app/helpers/versions_helper.rb' -# Offense count: 7 +# Offense count: 358 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either Style/HashSyntax: - Exclude: - - 'Gemfile' - - 'app/views/admin/events/events.xlsx.axlsx' - - 'app/views/admin/registrations/index.xlsx.axlsx' - - 'lib/tasks/user.rake' + Enabled: false # Offense count: 2 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. Style/HashTransformValues: Exclude: - 'app/controllers/admin/comments_controller.rb' - 'app/helpers/chart_helper.rb' -# Offense count: 59 +# Offense count: 61 # Cop supports --auto-correct. Style/IfUnlessModifier: Enabled: false @@ -1144,6 +1077,12 @@ Style/LineEndConcatenation: - 'spec/features/conference_spec.rb' - 'spec/features/registration_periods_spec.rb' +# Offense count: 1 +# Cop supports --auto-correct-all. +Style/MapToHash: + Exclude: + - 'app/controllers/admin/comments_controller.rb' + # Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. @@ -1154,12 +1093,9 @@ Style/MethodDefParentheses: - 'app/models/user.rb' - 'lib/tasks/demo_data_for_development.rake' -# Offense count: 4 +# Offense count: 1 Style/MixinUsage: Exclude: - - 'bin/setup' - - 'bin/update' - - 'config/application.rb' - 'spec/spec_helper.rb' # Offense count: 7 @@ -1213,12 +1149,12 @@ Style/NumericLiteralPrefix: # Offense count: 7 # Cop supports --auto-correct. -# Configuration parameters: Strict. +# Configuration parameters: Strict, AllowedNumbers. Style/NumericLiterals: MinDigits: 15 # Offense count: 36 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. # Configuration parameters: EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison Style/NumericPredicate: @@ -1266,14 +1202,28 @@ Style/ParenthesesAroundCondition: - 'app/controllers/application_controller.rb' - 'app/helpers/format_helper.rb' -# Offense count: 21 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: - Enabled: false + Exclude: + - 'Gemfile' + - 'app/controllers/admin/users_controller.rb' + - 'app/models/cfp.rb' + - 'app/models/comment.rb' + - 'app/models/commercial.rb' + - 'app/models/conference.rb' + - 'app/models/contact.rb' + - 'app/models/registration.rb' + - 'app/models/subscription.rb' + - 'app/models/track.rb' + - 'app/uploaders/picture_uploader.rb' + - 'config/deploy.rb' + - 'config/initializers/formtastic.rb' + - 'spec/models/program_spec.rb' # Offense count: 1 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. # Configuration parameters: EnforcedStyle. # SupportedStyles: short, verbose Style/PreferredHashMethods: @@ -1308,7 +1258,7 @@ Style/RedundantCondition: - 'app/models/ticket.rb' # Offense count: 3 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. # Configuration parameters: SafeForConstants. Style/RedundantFetchBlock: Exclude: @@ -1336,13 +1286,12 @@ Style/RedundantReturn: - 'app/controllers/admin/events_controller.rb' - 'app/controllers/admin/organizations_controller.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Exclude: - - 'Guardfile' - 'app/uploaders/picture_uploader.rb' # Offense count: 2 @@ -1363,13 +1312,6 @@ Style/SignalException: - 'lib/tasks/user.rake' - 'spec/support/flash.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowIfMethodIsEmpty. -Style/SingleLineMethods: - Exclude: - - 'Guardfile' - # Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: AllowModifier. @@ -1382,13 +1324,20 @@ Style/SoleNestedConditional: - 'db/migrate/20140801170430_move_event_media_to_commercial.rb' - 'db/migrate/20151018152439_create_programs_table.rb' -# Offense count: 31 +# Offense count: 1 # Cop supports --auto-correct. +# Configuration parameters: RequireEnglish. +# SupportedStyles: use_perl_names, use_english_names +Style/SpecialGlobalVars: + EnforcedStyle: use_perl_names + +# Offense count: 31 +# Cop supports --auto-correct-all. # Configuration parameters: Mode. Style/StringConcatenation: Enabled: false -# Offense count: 31 +# Offense count: 35 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes @@ -1396,7 +1345,6 @@ Style/StringLiterals: Exclude: - 'Gemfile' - 'bin/rspec' - - 'bin/spring' - 'config/deploy.rb' - 'config/environments/production.rb' - 'config/puma.rb' @@ -1416,7 +1364,7 @@ Style/StringLiteralsInInterpolation: - 'app/views/admin/events/_confirmed_events.xlsx.axlsx' - 'lib/tasks/dump_db.rake' -# Offense count: 108 +# Offense count: 109 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinSize. # SupportedStyles: percent, brackets @@ -1424,7 +1372,7 @@ Style/SymbolArray: Enabled: false # Offense count: 10 -# Cop supports --auto-correct. +# Cop supports --auto-correct-all. # Configuration parameters: AllowMethodsWithArguments, IgnoredMethods. # IgnoredMethods: respond_to, define_method Style/SymbolProc: @@ -1445,14 +1393,6 @@ Style/TernaryParentheses: Exclude: - 'app/helpers/format_helper.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArrayLiteral: - Exclude: - - 'Guardfile' - # Offense count: 21 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline. @@ -1476,9 +1416,9 @@ Style/WordArray: EnforcedStyle: percent MinSize: 6 -# Offense count: 533 +# Offense count: 532 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: Max: 619 diff --git a/.ruby-version b/.ruby-version index 30f69e8c..fd2a0186 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.9 +3.1.0 diff --git a/Dockerfile b/Dockerfile index 85d2a80a..276b87a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM registry.opensuse.org/opensuse/infrastructure/dale/containers/osem/base:latest ARG CONTAINER_USERID +ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1 # Configure our user RUN usermod -u $CONTAINER_USERID osem @@ -12,13 +13,15 @@ COPY Gemfile /osem/ COPY Gemfile.lock /osem/ RUN chown -R osem /osem -# Add our files +# Install bundler & foreman +RUN gem.ruby3.1 install bundler -v "$(grep -A 1 "BUNDLED WITH" /osem/Gemfile.lock | tail -n 1)"; \ + gem.ruby3.1 install foreman + +# Continue as user USER osem WORKDIR /osem/ -# Install bundler & foreman -RUN sudo gem install bundler:1.17.3 foreman # Install our bundle -RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 +RUN bundle install --jobs=3 --retry=3 CMD ["foreman", "start"] diff --git a/Gemfile b/Gemfile index 9c966d32..bc221407 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ end source 'https://rubygems.org' -ruby ENV['OSEM_RUBY_VERSION'] || '2.5.9' +ruby ENV['OSEM_RUBY_VERSION'] || '3.1.0' # rails-assets requires >= 1.8.4 if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.8.4') @@ -14,7 +14,7 @@ end # as web framework if next? - gem 'rails', '~> 6' + gem 'rails', '~> 7' else gem 'rails', '~> 5.2' end @@ -85,8 +85,6 @@ gem 'uglifier', '>= 1.3.0' gem 'autoprefixer-rails' gem 'bootstrap-sass', '~> 3.4.0' gem 'cocoon' -gem 'formtastic', '~> 3.1.5' -gem 'formtastic-bootstrap' # as the JavaScript library gem 'jquery-rails' @@ -143,6 +141,9 @@ gem 'country_select' # as PDF generator gem 'prawn-qrcode' gem 'prawn-rails' +# FIXME: for prawn, matrix isn't in the default set of Ruby 3.1 anymore +# see https://github.com/prawnpdf/prawn/commit/3658d5125c3b20eb11484c3b039ca6b89dc7d1b7 +gem 'matrix', '~> 0.4' # for QR code generation gem 'rqrcode' @@ -165,9 +166,6 @@ gem 'font-awesome-rails' # for markdown gem 'redcarpet' -# for visitor tracking -gem 'piwik_analytics', '~> 1.0.1' - # for recurring jobs gem 'delayed_job_active_record' gem 'whenever', :require => false @@ -228,16 +226,12 @@ gem 'dalli' gem 'icalendar' -# Use guard and spring for testing in development group :development do - # to launch specs when files are modified - gem 'guard-rspec' - gem 'haml_lint' - gem 'spring-commands-rspec' # for static code analisys gem 'rubocop', require: false gem 'rubocop-rspec', require: false gem 'rubocop-rails', require: false + gem 'haml_lint' # to open mails gem 'letter_opener' gem 'letter_opener_web' @@ -265,7 +259,7 @@ group :test do # for mocking external requests gem 'webmock' # for mocking Stripe responses in tests - gem 'stripe-ruby-mock' + gem 'stripe-ruby-mock', '~> 3.1.0.rc3' # For validating JSON schemas gem 'json-schema' # For using 'assigns' in tests diff --git a/Gemfile.lock b/Gemfile.lock index 680e8037..d6b86f5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,29 @@ +GEM + remote: https://rails-assets.org/ + specs: + rails-assets-bootstrap (3.3.6) + rails-assets-jquery (>= 1.9.1, < 3) + rails-assets-bootstrap-markdown (2.10.0) + rails-assets-bootstrap (~> 3) + rails-assets-bootstrap-select (1.13.3) + rails-assets-bootstrap (>= 3.0.0) + rails-assets-jquery (>= 1.9.1, < 4) + rails-assets-date.format (1.2.3) + rails-assets-holderjs (2.9.6) + rails-assets-jquery (2.2.4) + rails-assets-jquery-smooth-scroll (2.2.0) + rails-assets-jquery (>= 1.7.0) + rails-assets-markdown (0.5.0) + rails-assets-momentjs (2.22.2) + rails-assets-spectrum (1.8.0) + rails-assets-jquery (>= 1.7.2) + rails-assets-tinycolor (1.4.1) + rails-assets-to-markdown (3.1.1) + rails-assets-trianglify (1.2.0) + rails-assets-waypoints (4.0.1) + GEM remote: https://rubygems.org/ - remote: https://rails-assets.org/ specs: Ascii85 (1.1.0) actioncable (5.2.6) @@ -66,8 +89,8 @@ GEM ast (2.4.2) autoprefixer-rails (10.3.3.0) execjs (~> 2) - awesome_nested_set (3.4.0) - activerecord (>= 4.0.0, < 7.0) + awesome_nested_set (3.5.0) + activerecord (>= 4.0.0, < 7.1) aws_cf_signer (0.1.3) bcrypt (3.1.16) bindex (0.8.1) @@ -110,7 +133,7 @@ GEM caxlsx_rails (0.6.2) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (3.4.2) + chartkick (4.1.3) childprocess (3.0.0) chronic (0.10.2) chunky_png (1.4.0) @@ -119,7 +142,6 @@ GEM aws_cf_signer rest-client (>= 2.0.0) cocoon (1.2.15) - coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.1.9) countable-rails (0.0.1) @@ -147,7 +169,7 @@ GEM delayed_job_active_record (4.1.6) activerecord (>= 3.0, < 6.2) delayed_job (>= 3.0, < 5) - devise (4.8.0) + devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -197,30 +219,11 @@ GEM ffi (1.15.4) font-awesome-rails (4.7.0.7) railties (>= 3.2, < 7) - formatador (0.3.0) - formtastic (3.1.5) - actionpack (>= 3.2.13) - formtastic-bootstrap (3.1.1) - formtastic (>= 3.0) geckodriver-helper (0.24.0) archive-zip (~> 0.7) globalid (0.4.2) activesupport (>= 4.2.0) gravtastic (3.2.6) - guard (2.18.0) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.13.0) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) haml (5.2.2) temple (>= 0.8.0) tilt @@ -248,7 +251,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.4) domain_name (~> 0.5) - i18n (1.8.10) + i18n (1.9.1) concurrent-ruby (~> 1.0) i18n_data (0.13.0) icalendar (2.7.1) @@ -285,16 +288,13 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) - listen (3.7.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.12.0) + loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - lumberjack (1.2.8) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.1) + matrix (0.4.2) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) @@ -304,8 +304,8 @@ GEM rake mini_magick (4.11.0) mini_mime (1.1.1) - mini_portile2 (2.6.1) - minitest (5.14.4) + mini_portile2 (2.7.1) + minitest (5.15.0) momentjs-rails (2.20.1) railties (>= 3.1) monetize (1.9.4) @@ -321,17 +321,13 @@ GEM multi_xml (0.6.0) multipart-post (2.1.1) mysql2 (0.5.3) - nenv (0.3.0) netrc (0.11.0) next_rails (1.0.4) colorize (>= 0.8.1) nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.1) + mini_portile2 (~> 2.7.0) racc (~> 1.4) - notiffany (0.1.3) - nenv (~> 0.1) - shellany (~> 0.0) oauth2 (1.4.7) faraday (>= 0.8, < 2.0) jwt (>= 1.0, < 3.0) @@ -363,11 +359,11 @@ GEM omniauth (~> 2.0) open4 (1.3.4) orm_adapter (0.5.0) - paper_trail (12.1.0) + paper_trail (12.2.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.20.1) - parser (3.0.2.0) + parallel (1.21.0) + parser (3.1.0.0) ast (~> 2.4.1) pdf-core (0.9.0) pdf-inspector (1.3.0) @@ -379,10 +375,6 @@ GEM ruby-rc4 ttfunk pg (1.2.3) - piwik_analytics (1.0.2) - actionpack - activesupport - rails (>= 3.0.0) prawn (2.4.0) pdf-core (~> 0.9.0) ttfunk (~> 1.7) @@ -395,13 +387,10 @@ GEM prawn-table prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) public_suffix (4.0.6) puma (4.3.9) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-openid (1.4.2) rack (>= 1.1.0) @@ -423,26 +412,6 @@ GEM bundler (>= 1.3.0) railties (= 5.2.6) sprockets-rails (>= 2.0.0) - rails-assets-bootstrap (3.3.6) - rails-assets-jquery (>= 1.9.1, < 3) - rails-assets-bootstrap-markdown (2.10.0) - rails-assets-bootstrap (~> 3) - rails-assets-bootstrap-select (1.13.3) - rails-assets-bootstrap (>= 3.0.0) - rails-assets-jquery (>= 1.9.1, < 4) - rails-assets-date.format (1.2.3) - rails-assets-holderjs (2.9.6) - rails-assets-jquery (2.2.4) - rails-assets-jquery-smooth-scroll (2.2.0) - rails-assets-jquery (>= 1.7.0) - rails-assets-markdown (0.5.0) - rails-assets-momentjs (2.22.2) - rails-assets-spectrum (1.8.0) - rails-assets-jquery (>= 1.7.2) - rails-assets-tinycolor (1.4.1) - rails-assets-to-markdown (3.1.1) - rails-assets-trianglify (1.2.0) - rails-assets-waypoints (4.0.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -461,7 +430,7 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.0) rb-inotify (0.10.1) @@ -469,8 +438,8 @@ GEM recaptcha (4.14.0) json redcarpet (3.5.1) - regexp_parser (2.1.1) - request_store (1.5.0) + regexp_parser (2.2.0) + request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) @@ -486,10 +455,6 @@ GEM chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rspec (3.6.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) rspec-activemodel-mocks (1.1.0) activemodel (>= 3.0) activesupport (>= 3.0) @@ -511,16 +476,16 @@ GEM rspec-mocks (~> 3.6.0) rspec-support (~> 3.6.0) rspec-support (3.6.0) - rubocop (1.19.1) + rubocop (1.25.1) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.9.1, < 2.0) + rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.11.0) + rubocop-ast (1.15.1) parser (>= 3.0.1.1) rubocop-rails (2.11.3) activesupport (>= 4.2.0) @@ -563,7 +528,6 @@ GEM concurrent-ruby faraday sexp_processor (4.15.3) - shellany (0.0.1) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) simplecov (0.21.2) @@ -581,9 +545,6 @@ GEM activesupport (>= 4.2.0) sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) - spring (2.1.1) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -594,13 +555,13 @@ GEM sqlite3 (1.4.2) ssrf_filter (1.0.7) stripe (5.38.0) - stripe-ruby-mock (3.0.1) + stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) sysexits (1.2.0) temple (0.8.2) - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) tilt (2.0.10) timecop (0.9.4) @@ -616,7 +577,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.7) - unicode-display_width (2.0.0) + unicode-display_width (2.1.0) unicode_utils (1.4.0) unobtrusive_flash (3.3.1) railties @@ -679,11 +640,8 @@ DEPENDENCIES faker feature font-awesome-rails - formtastic (~> 3.1.5) - formtastic-bootstrap geckodriver-helper gravtastic - guard-rspec haml-rails haml_lint icalendar @@ -695,6 +653,7 @@ DEPENDENCIES leaflet-rails letter_opener letter_opener_web + matrix (~> 0.4) mina mini_magick money-rails @@ -710,7 +669,6 @@ DEPENDENCIES paper_trail pdf-inspector pg - piwik_analytics (~> 1.0.1) prawn-qrcode prawn-rails puma (~> 4.3) @@ -746,11 +704,10 @@ DEPENDENCIES shoulda-matchers simplecov-cobertura skylight - spring-commands-rspec sprockets-rails sqlite3 stripe - stripe-ruby-mock + stripe-ruby-mock (~> 3.1.0.rc3) timecop transitions turbolinks @@ -762,7 +719,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 2.5.9p229 + ruby 3.1.0 BUNDLED WITH - 1.17.3 + 2.3.3 diff --git a/Gemfile.next.lock b/Gemfile.next.lock index fe03953a..0e8acc2e 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -1,76 +1,105 @@ GEM - remote: https://rubygems.org/ remote: https://rails-assets.org/ + specs: + rails-assets-bootstrap (3.4.1) + rails-assets-jquery (>= 1.9.1, < 4) + rails-assets-bootstrap-markdown (2.10.0) + rails-assets-bootstrap (~> 3) + rails-assets-bootstrap-select (1.13.10) + rails-assets-bootstrap (>= 3.0.0) + rails-assets-jquery (>= 1.9.1, < 4) + rails-assets-date.format (1.2.3) + rails-assets-holderjs (2.9.6) + rails-assets-jquery (3.4.1) + rails-assets-jquery-smooth-scroll (2.2.0) + rails-assets-jquery (>= 1.7.0) + rails-assets-markdown (0.5.0) + rails-assets-momentjs (2.22.2) + rails-assets-spectrum (1.8.0) + rails-assets-jquery (>= 1.7.2) + rails-assets-tinycolor (1.4.1) + rails-assets-to-markdown (3.1.1) + rails-assets-trianglify (1.2.0) + rails-assets-waypoints (4.0.1) + +GEM + remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (6.1.4) - actionpack (= 6.1.4) - activesupport (= 6.1.4) + actioncable (7.0.1) + actionpack (= 7.0.1) + activesupport (= 7.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4) - actionpack (= 6.1.4) - activejob (= 6.1.4) - activerecord (= 6.1.4) - activestorage (= 6.1.4) - activesupport (= 6.1.4) + actionmailbox (7.0.1) + actionpack (= 7.0.1) + activejob (= 7.0.1) + activerecord (= 7.0.1) + activestorage (= 7.0.1) + activesupport (= 7.0.1) mail (>= 2.7.1) - actionmailer (6.1.4) - actionpack (= 6.1.4) - actionview (= 6.1.4) - activejob (= 6.1.4) - activesupport (= 6.1.4) + net-imap + net-pop + net-smtp + actionmailer (7.0.1) + actionpack (= 7.0.1) + actionview (= 7.0.1) + activejob (= 7.0.1) + activesupport (= 7.0.1) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.4) - actionview (= 6.1.4) - activesupport (= 6.1.4) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.1) + actionview (= 7.0.1) + activesupport (= 7.0.1) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.4) - actionpack (= 6.1.4) - activerecord (= 6.1.4) - activestorage (= 6.1.4) - activesupport (= 6.1.4) + actiontext (7.0.1) + actionpack (= 7.0.1) + activerecord (= 7.0.1) + activestorage (= 7.0.1) + activesupport (= 7.0.1) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.4) - activesupport (= 6.1.4) + actionview (7.0.1) + activesupport (= 7.0.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.12) - actionpack (>= 4.1, < 6.2) - activemodel (>= 4.1, < 6.2) + active_model_serializers (0.10.13) + actionpack (>= 4.1, < 7.1) + activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (6.1.4) - activesupport (= 6.1.4) + activejob (7.0.1) + activesupport (= 7.0.1) globalid (>= 0.3.6) - activemodel (6.1.4) - activesupport (= 6.1.4) - activerecord (6.1.4) - activemodel (= 6.1.4) - activesupport (= 6.1.4) - activestorage (6.1.4) - actionpack (= 6.1.4) - activejob (= 6.1.4) - activerecord (= 6.1.4) - activesupport (= 6.1.4) - marcel (~> 1.0.0) + activemodel (7.0.1) + activesupport (= 7.0.1) + activerecord (7.0.1) + activemodel (= 7.0.1) + activesupport (= 7.0.1) + activestorage (7.0.1) + actionpack (= 7.0.1) + activejob (= 7.0.1) + activerecord (= 7.0.1) + activesupport (= 7.0.1) + marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.4) + activesupport (7.0.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - acts_as_commentable_with_threading (2.0.1) - activerecord (>= 4.0) - activesupport (>= 4.0) - awesome_nested_set (>= 3.0) + acts_as_commentable_with_threading (1.2.0) + activerecord (>= 3.0) + activesupport (>= 3.0) + awesome_nested_set (>= 2.0) acts_as_list (1.0.4) activerecord (>= 4.2) addressable (2.8.0) @@ -83,8 +112,8 @@ GEM ast (2.4.2) autoprefixer-rails (10.3.1.0) execjs (~> 2) - awesome_nested_set (3.4.0) - activerecord (>= 4.0.0, < 7.0) + awesome_nested_set (3.5.0) + activerecord (>= 4.0.0, < 7.1) aws_cf_signer (0.1.3) bcrypt (3.1.16) bindex (0.8.1) @@ -127,7 +156,7 @@ GEM caxlsx_rails (0.6.2) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (3.4.2) + chartkick (4.1.3) childprocess (3.0.0) chronic (0.10.2) chunky_png (1.4.0) @@ -136,7 +165,6 @@ GEM aws_cf_signer rest-client (>= 2.0.0) cocoon (1.2.15) - coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.1.9) countable-rails (0.0.1) @@ -159,12 +187,12 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - delayed_job (4.1.9) - activesupport (>= 3.0, < 6.2) - delayed_job_active_record (4.1.6) - activerecord (>= 3.0, < 6.2) + delayed_job (4.1.10) + activesupport (>= 3.0, < 8.0) + delayed_job_active_record (4.1.7) + activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) - devise (4.8.0) + devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -173,6 +201,7 @@ GEM devise_ichain_authenticatable (0.3.2) devise (>= 2.2) diff-lcs (1.4.4) + digest (3.1.0) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -212,32 +241,13 @@ GEM fastimage (2.2.5) feature (1.4.0) ffi (1.15.3) - font-awesome-rails (4.7.0.7) - railties (>= 3.2, < 7) - formatador (0.3.0) - formtastic (3.1.5) - actionpack (>= 3.2.13) - formtastic-bootstrap (3.1.1) - formtastic (>= 3.0) + font-awesome-rails (4.7.0.8) + railties (>= 3.2, < 8.0) geckodriver-helper (0.24.0) archive-zip (~> 0.7) - globalid (0.5.2) + globalid (1.0.0) activesupport (>= 5.0) gravtastic (3.2.6) - guard (2.18.0) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.13.0) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) haml (5.2.2) temple (>= 0.8.0) tilt @@ -265,7 +275,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.4) domain_name (~> 0.5) - i18n (1.8.10) + i18n (1.9.1) concurrent-ruby (~> 1.0) i18n_data (0.13.0) icalendar (2.7.1) @@ -275,6 +285,7 @@ GEM mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) io-like (0.3.1) + io-wait (0.2.1) iso-639 (0.3.5) jquery-datatables-rails (3.4.0) actionpack (>= 3.1) @@ -298,20 +309,18 @@ GEM rails (>= 4.2.0) letter_opener (1.7.0) launchy (~> 2.2) - letter_opener_web (1.4.0) - actionmailer (>= 3.2) - letter_opener (~> 1.0) - railties (>= 3.2) - listen (3.6.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.12.0) + letter_opener_web (2.0.0) + actionmailer (>= 5.2) + letter_opener (~> 1.7) + railties (>= 5.2) + rexml + loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - lumberjack (1.2.8) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.1) + matrix (0.4.2) method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) @@ -320,9 +329,9 @@ GEM open4 (~> 1.3.4) rake mini_magick (4.11.0) - mini_mime (1.1.0) - mini_portile2 (2.6.1) - minitest (5.14.4) + mini_mime (1.1.2) + mini_portile2 (2.7.1) + minitest (5.15.0) momentjs-rails (2.20.1) railties (>= 3.1) monetize (1.9.4) @@ -338,17 +347,28 @@ GEM multi_xml (0.6.0) multipart-post (2.1.1) mysql2 (0.5.3) - nenv (0.3.0) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.2) + io-wait + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout netrc (0.11.0) next_rails (1.0.4) colorize (>= 0.8.1) nio4r (2.5.8) - nokogiri (1.12.3) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.1) + mini_portile2 (~> 2.7.0) racc (~> 1.4) - notiffany (0.1.3) - nenv (~> 0.1) - shellany (~> 0.0) oauth2 (1.4.7) faraday (>= 0.8, < 2.0) jwt (>= 1.0, < 3.0) @@ -380,11 +400,11 @@ GEM omniauth (~> 2.0) open4 (1.3.4) orm_adapter (0.5.0) - paper_trail (12.0.0) + paper_trail (12.2.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.20.1) - parser (3.0.2.0) + parallel (1.21.0) + parser (3.1.0.0) ast (~> 2.4.1) pdf-core (0.9.0) pdf-inspector (1.3.0) @@ -396,10 +416,6 @@ GEM ruby-rc4 ttfunk pg (1.2.3) - piwik_analytics (1.0.2) - actionpack - activesupport - rails (>= 3.0.0) prawn (2.4.0) pdf-core (~> 0.9.0) ttfunk (~> 1.7) @@ -412,13 +428,10 @@ GEM prawn-table prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) public_suffix (4.0.6) puma (4.3.8) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-openid (1.4.2) rack (>= 1.1.0) @@ -427,41 +440,20 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.1.4) - actioncable (= 6.1.4) - actionmailbox (= 6.1.4) - actionmailer (= 6.1.4) - actionpack (= 6.1.4) - actiontext (= 6.1.4) - actionview (= 6.1.4) - activejob (= 6.1.4) - activemodel (= 6.1.4) - activerecord (= 6.1.4) - activestorage (= 6.1.4) - activesupport (= 6.1.4) + rails (7.0.1) + actioncable (= 7.0.1) + actionmailbox (= 7.0.1) + actionmailer (= 7.0.1) + actionpack (= 7.0.1) + actiontext (= 7.0.1) + actionview (= 7.0.1) + activejob (= 7.0.1) + activemodel (= 7.0.1) + activerecord (= 7.0.1) + activestorage (= 7.0.1) + activesupport (= 7.0.1) bundler (>= 1.15.0) - railties (= 6.1.4) - sprockets-rails (>= 2.0.0) - rails-assets-bootstrap (3.4.1) - rails-assets-jquery (>= 1.9.1, < 4) - rails-assets-bootstrap-markdown (2.10.0) - rails-assets-bootstrap (~> 3) - rails-assets-bootstrap-select (1.13.10) - rails-assets-bootstrap (>= 3.0.0) - rails-assets-jquery (>= 1.9.1, < 4) - rails-assets-date.format (1.2.3) - rails-assets-holderjs (2.9.6) - rails-assets-jquery (3.4.1) - rails-assets-jquery-smooth-scroll (2.2.0) - rails-assets-jquery (>= 1.7.0) - rails-assets-markdown (0.5.0) - rails-assets-momentjs (2.22.2) - rails-assets-spectrum (1.8.0) - rails-assets-jquery (>= 1.7.2) - rails-assets-tinycolor (1.4.1) - rails-assets-to-markdown (3.1.1) - rails-assets-trianglify (1.2.0) - rails-assets-waypoints (4.0.1) + railties (= 7.0.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -469,27 +461,25 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - rails-i18n (6.0.0) + rails-i18n (7.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 7) - railties (6.1.4) - actionpack (= 6.1.4) - activesupport (= 6.1.4) + railties (>= 6.0.0, < 8) + railties (7.0.1) + actionpack (= 7.0.1) + activesupport (= 7.0.1) method_source - rake (>= 0.13) + rake (>= 12.2) thor (~> 1.0) - rainbow (3.0.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) recaptcha (5.8.1) json redcarpet (3.5.1) - regexp_parser (2.1.1) - request_store (1.5.0) + regexp_parser (2.2.0) + request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) @@ -505,10 +495,6 @@ GEM chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.1.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) rspec-activemodel-mocks (1.1.0) activemodel (>= 3.0) activesupport (>= 3.0) @@ -530,16 +516,16 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.10.2) - rubocop (1.19.0) + rubocop (1.25.1) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.9.1, < 2.0) + rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.10.0) + rubocop-ast (1.15.1) parser (>= 3.0.1.1) rubocop-rails (2.11.3) activesupport (>= 4.2.0) @@ -579,7 +565,6 @@ GEM concurrent-ruby faraday sexp_processor (4.15.3) - shellany (0.0.1) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) simplecov (0.21.2) @@ -595,9 +580,6 @@ GEM activesupport (>= 5.2.0) sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) - spring (2.1.1) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -607,16 +589,18 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.4.2) ssrf_filter (1.0.7) - stripe (5.38.0) - stripe-ruby-mock (3.0.1) + stripe (5.43.0) + stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) + strscan (3.0.1) sysexits (1.2.0) temple (0.8.2) - thor (1.1.0) + thor (1.2.1) tilt (2.0.10) timecop (0.9.4) + timeout (0.2.0) transitions (1.2.1) ttfunk (1.7.0) turbolinks (5.2.1) @@ -629,7 +613,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.7) - unicode-display_width (2.0.0) + unicode-display_width (2.1.0) unicode_utils (1.4.0) unobtrusive_flash (3.3.1) railties @@ -655,7 +639,7 @@ GEM chronic (>= 0.6.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.5.4) PLATFORMS ruby @@ -693,11 +677,8 @@ DEPENDENCIES faker feature font-awesome-rails - formtastic (~> 3.1.5) - formtastic-bootstrap geckodriver-helper gravtastic - guard-rspec haml-rails haml_lint icalendar @@ -709,6 +690,7 @@ DEPENDENCIES leaflet-rails letter_opener letter_opener_web + matrix (~> 0.4) mina mini_magick money-rails @@ -724,11 +706,10 @@ DEPENDENCIES paper_trail pdf-inspector pg - piwik_analytics (~> 1.0.1) prawn-qrcode prawn-rails puma (~> 4.3) - rails (~> 6) + rails (~> 7) rails-assets-bootstrap-markdown! rails-assets-bootstrap-select! rails-assets-date.format! @@ -760,11 +741,10 @@ DEPENDENCIES shoulda-matchers simplecov-cobertura skylight - spring-commands-rspec sprockets-rails sqlite3 stripe - stripe-ruby-mock + stripe-ruby-mock (~> 3.1.0.rc3) timecop transitions turbolinks @@ -776,7 +756,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 2.5.9p229 + ruby 3.1.0 BUNDLED WITH - 1.17.3 + 2.3.3 diff --git a/Guardfile b/Guardfile deleted file mode 100644 index ba8f6520..00000000 --- a/Guardfile +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/ruby -# frozen_string_literal: true - -# -# More info at https://github.com/guard/guard#readme - -guard_opts = { - all_on_start: true, - all_after_pass: true, - cmd: 'spring rspec' -} - -def model_specs ; 'spec/models' end - -def model_spec(model) - "spec/models/#{model}_spec.rb" -end - -def all_testunit_tests - [ - model_tests, - controller_tests, - helper_tests, - integration_tests, - ] -end - -def all_specs - [ - model_specs, - ] -end - -def startup_guards - watch(%r{^Gemfile$}) { yield } - watch(%r{^Gemfile.lock$}) { yield } - watch(%r{^config/routes.rb$}) { yield } - watch(%r{^config/application\.rb$}) { yield } - watch(%r{^config/environment\.rb$}) { yield } - watch(%r{^config/environments/.+\.rb$}) { yield } - watch(%r{^config/initializers/.+\.rb$}) { yield } - watch(%r{^db/schema\.rb$}) { yield } - watch(%r{^spec/spec_helper\.rb$}) { yield } -end - -def rspec_guards - watch(%r{^spec/factories/.+\.rb$}) { all_specs } - watch(%r{^spec/.+_spec\.rb$}) - watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } -end - -group :rspec do - guard 'rspec', guard_opts do - #startup_guards { all_specs } - rspec_guards - #all_specs - end -end - -# group :bundler do -# guard 'bundler' do -# watch('Gemfile') -# # Uncomment next line if Gemfile contain `gemspec' command -# # watch(/^.+\.gemspec/) -# end -# end diff --git a/Rakefile b/Rakefile index ff005ce2..e85f9139 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,6 @@ -#!/usr/bin/env rake -# frozen_string_literal: true - # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require File.expand_path('../config/application', __FILE__) +require_relative 'config/application' -Osem::Application.load_tasks +Rails.application.load_tasks diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index bceaf4db..daff3dc0 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,7 +1,7 @@ // This is a sprockets 4.0 manifest file // -//= link webui/application.css -//= link webui/application.js +//= link application.css +//= link application.js //= link_tree ../images //= link_tree ../fonts diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9917612b..cf12a085 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,6 @@ // //= require jquery //= require jquery_ujs -//= require jquery.mobile.custom.min //= require jquery-ui/widgets/draggable //= require jquery-ui/widgets/droppable //= require waypoints/jquery.waypoints diff --git a/app/assets/javascripts/jquery.mobile.custom.min.js b/app/assets/javascripts/jquery.mobile.custom.min.js deleted file mode 100644 index 058c3453..00000000 --- a/app/assets/javascripts/jquery.mobile.custom.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */ - -(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;di||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;xMath.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(se.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)}); \ No newline at end of file diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index dcab692c..5f1bc625 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -94,11 +94,6 @@ $(function () { return false; }); - $("#event-comment-link").click(function(){ - $("#comments-div").toggle(); - return false; - }); - $(".comment-reply").hide(); $(".user-details-popover").popover(); $("#comments-div").hide(); diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 567fa050..3594e187 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,6 +1,5 @@ /* *= require strap-on - *= require formtastic-bootstrap *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap *= require osem *= require osem-rating diff --git a/app/controllers/admin/booths_controller.rb b/app/controllers/admin/booths_controller.rb index dd4e5844..0a899921 100644 --- a/app/controllers/admin/booths_controller.rb +++ b/app/controllers/admin/booths_controller.rb @@ -53,7 +53,7 @@ module Admin def update @url = admin_conference_booth_path(@conference.short_title, @booth.id) - @booth.update_attributes(booth_params) + @booth.update(booth_params) if @booth.save redirect_to admin_conference_booths_path, diff --git a/app/controllers/admin/cfps_controller.rb b/app/controllers/admin/cfps_controller.rb index fab49f2f..cb43bf56 100644 --- a/app/controllers/admin/cfps_controller.rb +++ b/app/controllers/admin/cfps_controller.rb @@ -35,7 +35,7 @@ module Admin send_mail_on_cfp_dates_updates = @cfp.notify_on_cfp_date_update? - if @cfp.update_attributes(cfp_params) + if @cfp.update(cfp_params) ConferenceCfpUpdateMailJob.perform_later(@conference) if send_mail_on_cfp_dates_updates redirect_to admin_conference_program_cfps_path(@conference.short_title), notice: 'Call for papers successfully updated.' diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index f25f2cfe..80e36f47 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -68,7 +68,6 @@ module Admin def new @conference = Conference.new - @organizations = Organization.accessible_by(current_ability, :update).pluck(:name, :id) end def create @@ -91,7 +90,7 @@ module Admin @conference.assign_attributes(conference_params) send_mail_on_conf_update = @conference.notify_on_dates_changed? - if @conference.update_attributes(conference_params) + if @conference.update(conference_params) ConferenceDateUpdateMailJob.perform_later(@conference) if send_mail_on_conf_update redirect_to edit_admin_conference_path(id: @conference.short_title), notice: 'Conference was successfully updated.' diff --git a/app/controllers/admin/difficulty_levels_controller.rb b/app/controllers/admin/difficulty_levels_controller.rb index 30c57452..e5717f7e 100644 --- a/app/controllers/admin/difficulty_levels_controller.rb +++ b/app/controllers/admin/difficulty_levels_controller.rb @@ -28,7 +28,7 @@ module Admin end def update - if @difficulty_level.update_attributes(difficulty_level_params) + if @difficulty_level.update(difficulty_level_params) redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title), notice: 'Difficulty level successfully updated.' else diff --git a/app/controllers/admin/event_types_controller.rb b/app/controllers/admin/event_types_controller.rb index 137e8f00..a171b427 100644 --- a/app/controllers/admin/event_types_controller.rb +++ b/app/controllers/admin/event_types_controller.rb @@ -26,7 +26,7 @@ module Admin end def update - if @event_type.update_attributes(event_type_params) + if @event_type.update(event_type_params) redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title), notice: 'Event type successfully updated.' else diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index 9db4a438..7187940e 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -72,7 +72,7 @@ module Admin def update @languages = @program.languages_list - if @event.update_attributes(event_params) + if @event.update(event_params) if request.xhr? render js: 'index' @@ -142,7 +142,7 @@ module Admin @votes = @event.votes.includes(:user) if (votes = current_user.votes.find_by_event_id(params[:id])) - votes.update_attributes(rating: params[:rating]) + votes.update(rating: params[:rating]) else @myvote = @event.votes.build @myvote.user = current_user diff --git a/app/controllers/admin/lodgings_controller.rb b/app/controllers/admin/lodgings_controller.rb index 7a095e3d..639e0544 100644 --- a/app/controllers/admin/lodgings_controller.rb +++ b/app/controllers/admin/lodgings_controller.rb @@ -26,7 +26,7 @@ module Admin def edit; end def update - if @lodging.update_attributes(lodging_params) + if @lodging.update(lodging_params) redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title), notice: 'Lodging successfully updated.' else diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index ca1ec5b9..14ff040d 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -27,7 +27,7 @@ module Admin def edit; end def update - if @organization.update_attributes(organization_params) + if @organization.update(organization_params) redirect_to admin_organizations_path, notice: 'Organization successfully updated' else diff --git a/app/controllers/admin/programs_controller.rb b/app/controllers/admin/programs_controller.rb index 634b0726..d47d4d1d 100644 --- a/app/controllers/admin/programs_controller.rb +++ b/app/controllers/admin/programs_controller.rb @@ -12,11 +12,12 @@ module Admin def update authorize! :update, @conference.program @program = @conference.program + params['program']['languages'] = params['program']['languages'].join(',') if params['program']['languages'].present? @program.assign_attributes(program_params) send_mail_on_schedule_public = @program.notify_on_schedule_public? event_schedules_count_was = @program.event_schedules.count - if @program.update_attributes(program_params) + if @program.save ConferenceScheduleUpdateMailJob.perform_later(@conference) if send_mail_on_schedule_public respond_to do |format| format.html do @@ -40,7 +41,7 @@ module Admin private def program_params - params.require(:program).permit(:rating, :schedule_public, :schedule_interval, :schedule_fluid, :languages, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id) + params.require(:program).permit(:rating, :schedule_public, :schedule_interval, :schedule_fluid, :blind_voting, :voting_start_date, :voting_end_date, :selected_schedule_id, :languages) end end end diff --git a/app/controllers/admin/questions_controller.rb b/app/controllers/admin/questions_controller.rb index 1905d36c..b6451c92 100644 --- a/app/controllers/admin/questions_controller.rb +++ b/app/controllers/admin/questions_controller.rb @@ -3,7 +3,7 @@ module Admin class QuestionsController < Admin::BaseController load_and_authorize_resource :conference, find_by: :short_title - load_and_authorize_resource through: :conference, except: [:new, :create] + load_and_authorize_resource except: [:new, :create] def index authorize! :index, Question.new(conference_id: @conference.id) @@ -48,7 +48,7 @@ module Admin # PUT questions/1 def update - if @question.update_attributes(question_params) + if @question.update(question_params) redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated." else redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed. #{@question.errors.full_messages.join('. ')}" @@ -58,7 +58,7 @@ module Admin # Update questions used for the conference def update_conference authorize! :update, Question.new(conference_id: @conference.id) - if @conference.update_attributes(conference_params) + if @conference.update(conference_params) redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated." else redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed." diff --git a/app/controllers/admin/registrations_controller.rb b/app/controllers/admin/registrations_controller.rb index ef94ae2e..0fa8a8af 100644 --- a/app/controllers/admin/registrations_controller.rb +++ b/app/controllers/admin/registrations_controller.rb @@ -20,7 +20,7 @@ module Admin respond_to do |format| format.html format.json do - render json: RegistrationDatatable.new(view_context, conference: @conference) + render json: RegistrationDatatable.new({}, conference: @conference, view_context: view_context) end format.pdf { render 'index', layout: false } format.xlsx do @@ -37,9 +37,9 @@ module Admin def edit; end def update - @user.update_attributes(user_params) + @user.update(user_params) - @registration.update_attributes(registration_params) + @registration.update(registration_params) if @registration.save redirect_to admin_conference_registrations_path(@conference.short_title), notice: "Successfully updated registration for #{@registration.user.email}!" diff --git a/app/controllers/admin/resources_controller.rb b/app/controllers/admin/resources_controller.rb index af75e428..a6e51e99 100644 --- a/app/controllers/admin/resources_controller.rb +++ b/app/controllers/admin/resources_controller.rb @@ -25,7 +25,7 @@ module Admin end def update - if @resource.update_attributes(resource_params) + if @resource.update(resource_params) redirect_to admin_conference_resources_path(conference_id: @conference.short_title), notice: 'Resource successfully updated.' else diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index 98e2e13c..ca455dce 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -36,7 +36,7 @@ module Admin def update role_name = @role.name - if @role.update_attributes(role_params) + if @role.update(role_params) url = if @track admin_conference_program_track_role_path(@conference.short_title, @track, @role.name) else diff --git a/app/controllers/admin/rooms_controller.rb b/app/controllers/admin/rooms_controller.rb index c4fac65d..af83d5cb 100644 --- a/app/controllers/admin/rooms_controller.rb +++ b/app/controllers/admin/rooms_controller.rb @@ -26,7 +26,7 @@ module Admin end def update - if @room.update_attributes(room_params) + if @room.update(room_params) redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title), notice: 'Room successfully updated.' else diff --git a/app/controllers/admin/splashpages_controller.rb b/app/controllers/admin/splashpages_controller.rb index fd432cde..6b40d0d1 100644 --- a/app/controllers/admin/splashpages_controller.rb +++ b/app/controllers/admin/splashpages_controller.rb @@ -25,7 +25,7 @@ module Admin end def update - if @splashpage.update_attributes(splashpage_params) + if @splashpage.update(splashpage_params) redirect_to admin_conference_splashpage_path, notice: 'Splashpage successfully updated.' else diff --git a/app/controllers/admin/sponsors_controller.rb b/app/controllers/admin/sponsors_controller.rb index ca57d4a0..bc61d834 100644 --- a/app/controllers/admin/sponsors_controller.rb +++ b/app/controllers/admin/sponsors_controller.rb @@ -28,7 +28,7 @@ module Admin end def update - if @sponsor.update_attributes(sponsor_params) + if @sponsor.update(sponsor_params) redirect_to admin_conference_sponsors_path( conference_id: @conference.short_title), notice: 'Sponsor successfully updated.' diff --git a/app/controllers/admin/sponsorship_levels_controller.rb b/app/controllers/admin/sponsorship_levels_controller.rb index 9f59d4ca..443aa8b9 100644 --- a/app/controllers/admin/sponsorship_levels_controller.rb +++ b/app/controllers/admin/sponsorship_levels_controller.rb @@ -27,7 +27,7 @@ module Admin end def update - if @sponsorship_level.update_attributes(sponsorship_level_params) + if @sponsorship_level.update(sponsorship_level_params) redirect_to admin_conference_sponsorship_levels_path( conference_id: @conference.short_title), notice: 'Sponsorship level successfully updated.' diff --git a/app/controllers/admin/survey_questions_controller.rb b/app/controllers/admin/survey_questions_controller.rb index b425fc4b..61febf1d 100644 --- a/app/controllers/admin/survey_questions_controller.rb +++ b/app/controllers/admin/survey_questions_controller.rb @@ -28,7 +28,7 @@ module Admin # PUT questions/1 def update - if @survey_question.update_attributes(survey_question_params) + if @survey_question.update(survey_question_params) redirect_to admin_conference_survey_path(@conference.short_title, @survey), notice: 'Successfully updated Survey Question.' else @url = admin_conference_survey_survey_question_path(@conference.short_title, @survey, @survey_question) diff --git a/app/controllers/admin/surveys_controller.rb b/app/controllers/admin/surveys_controller.rb index 0cef238f..8054cc44 100644 --- a/app/controllers/admin/surveys_controller.rb +++ b/app/controllers/admin/surveys_controller.rb @@ -28,7 +28,7 @@ module Admin end def update - if @survey.update_attributes(survey_params) + if @survey.update(survey_params) redirect_to admin_conference_surveys_path(@conference.short_title) else @url = admin_conference_survey_path(@conference.short_title, @survey) diff --git a/app/controllers/admin/tickets_controller.rb b/app/controllers/admin/tickets_controller.rb index 6635ed29..e0e5b186 100644 --- a/app/controllers/admin/tickets_controller.rb +++ b/app/controllers/admin/tickets_controller.rb @@ -17,7 +17,7 @@ module Admin def create @ticket = @conference.tickets.new(ticket_params) - if @ticket.save(ticket_params) + if @ticket.save redirect_to admin_conference_tickets_path(conference_id: @conference.short_title), notice: 'Ticket successfully created.' else @@ -29,7 +29,7 @@ module Admin def edit; end def update - if @ticket.update_attributes(ticket_params) + if @ticket.update(ticket_params) redirect_to admin_conference_tickets_path(conference_id: @conference.short_title), notice: 'Ticket successfully updated.' else diff --git a/app/controllers/admin/tracks_controller.rb b/app/controllers/admin/tracks_controller.rb index 511a4fa9..77de53f4 100644 --- a/app/controllers/admin/tracks_controller.rb +++ b/app/controllers/admin/tracks_controller.rb @@ -56,7 +56,7 @@ module Admin def edit; end def update - if @track.update_attributes(track_params) + if @track.update(track_params) redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title), notice: 'Track successfully updated.' else @@ -122,7 +122,7 @@ module Admin end def update_selected_schedule - if @track.update_attributes(params.require(:track).permit(:selected_schedule_id)) + if @track.update(params.require(:track).permit(:selected_schedule_id)) respond_to do |format| format.js { render json: {} } end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 4d7925dd..6b317a7e 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -23,7 +23,7 @@ module Admin respond_to do |format| format.html format.json do - render json: UserDatatable.new(view_context) + render json: UserDatatable.new(view_context: view_context) end end end @@ -56,7 +56,7 @@ module Admin end end - if @user.update_attributes(user_params) + if @user.update(user_params) redirect_to admin_users_path, notice: "Updated #{@user.name} (#{@user.email})!" + message else redirect_to admin_users_path, error: "Could not update #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}." diff --git a/app/controllers/admin/venues_controller.rb b/app/controllers/admin/venues_controller.rb index 79de3c8f..17ba4c99 100644 --- a/app/controllers/admin/venues_controller.rb +++ b/app/controllers/admin/venues_controller.rb @@ -25,7 +25,7 @@ module Admin end def update - if @venue.update_attributes(venue_params) + if @venue.update(venue_params) redirect_to admin_conference_venue_path(conference_id: @conference.short_title), notice: 'Venue was successfully updated.' else diff --git a/app/controllers/admin/volunteers_controller.rb b/app/controllers/admin/volunteers_controller.rb index dc310d17..b0b85ffc 100644 --- a/app/controllers/admin/volunteers_controller.rb +++ b/app/controllers/admin/volunteers_controller.rb @@ -26,7 +26,7 @@ module Admin end def update - if @conference.update_attributes(conference_params) + if @conference.update(conference_params) redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: 'Volunteering options were successfully updated.' else redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), error: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}" diff --git a/app/controllers/booths_controller.rb b/app/controllers/booths_controller.rb index 959c9d5d..f8057637 100644 --- a/app/controllers/booths_controller.rb +++ b/app/controllers/booths_controller.rb @@ -36,7 +36,7 @@ class BoothsController < ApplicationController def update @url = conference_booth_path(@conference.short_title, @booth.id) - @booth.update_attributes(booth_params) + @booth.update(booth_params) if @booth.save redirect_to conference_booths_path, diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index 887d0ce1..70cfc736 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -24,7 +24,7 @@ class ConferenceRegistrationsController < ApplicationController end authorize! :new, @registration, message: message - # @user variable needs to be set so that _sign_up_form_embedded works properly + # @user needs to be set for devise/registrations/new_embedded @user = @registration.build_user end @@ -42,7 +42,7 @@ class ConferenceRegistrationsController < ApplicationController @registration = @conference.registrations.new(registration_params) @user = if current_user.nil? - # @user variable needs to be set so that _sign_up_form_embedded works properly + # @user needs to be set for devise/registrations/new_embedded @registration.build_user(user_params) else current_user @@ -72,7 +72,7 @@ class ConferenceRegistrationsController < ApplicationController end def update - if @registration.update_attributes(registration_params) + if @registration.update(registration_params) redirect_to conference_conference_registration_path(@conference.short_title), notice: 'Registration was successfully updated.' else diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 2b022571..c281d4e1 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,16 +3,6 @@ class RegistrationsController < Devise::RegistrationsController prepend_before_action :check_captcha, only: [:create] - def edit - @openids = Openid.where(user_id: current_user.id).order(:provider) - super - end - - def update - @openids = Openid.where(user_id: current_user.id).order(:provider) - super - end - protected def after_update_path_for(resource) diff --git a/app/controllers/surveys_controller.rb b/app/controllers/surveys_controller.rb index 349bc34b..fdf24963 100644 --- a/app/controllers/surveys_controller.rb +++ b/app/controllers/surveys_controller.rb @@ -27,14 +27,14 @@ class SurveysController < ApplicationController reply_text = survey_submission[survey_question.id.to_s].reject(&:blank?).join(',') if reply - reply.update_attributes(text: reply_text) unless reply.text == reply_text + reply.update(text: reply_text) unless reply.text == reply_text else survey_question.survey_replies.create!(text: reply_text, user: current_user) end user_survey_submission = @survey.survey_submissions.find_by(user: current_user) if user_survey_submission - user_survey_submission.update_attributes(updated_at: Time.current) + user_survey_submission.update_attribute(:updated_at, Time.current) else @survey.survey_submissions.create!(user: current_user) end diff --git a/app/controllers/tracks_controller.rb b/app/controllers/tracks_controller.rb index ad418d46..6db26991 100644 --- a/app/controllers/tracks_controller.rb +++ b/app/controllers/tracks_controller.rb @@ -31,7 +31,7 @@ class TracksController < ApplicationController end def update - if @track.update_attributes(track_params) + if @track.update(track_params) redirect_to conference_program_tracks_path(conference_id: @conference.short_title), notice: 'Track request successfully updated.' else diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3db62d11..0e802ad8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class UsersController < ApplicationController + before_action :authenticate_user!, only: :search load_and_authorize_resource # GET /users/1 @@ -22,6 +23,14 @@ class UsersController < ApplicationController end end + def search + respond_to do |format| + format.json do + render json: { users: User.where('username like ?', "%#{params[:query]}%").select(:username, :id) } + end + end + end + private # Only allow a trusted parameter "white list" through. diff --git a/app/datatables/registration_datatable.rb b/app/datatables/registration_datatable.rb index a20fe3af..7384933c 100644 --- a/app/datatables/registration_datatable.rb +++ b/app/datatables/registration_datatable.rb @@ -1,8 +1,15 @@ # frozen_string_literal: true -class RegistrationDatatable < AjaxDatatablesRails::Base +class RegistrationDatatable < AjaxDatatablesRails::ActiveRecord + extend Forwardable + def_delegator :@view, :edit_admin_conference_registration_path + def initialize(params, opts = {}) + @view = opts[:view_context] + super + end + def view_columns @view_columns ||= { id: { source: 'Registration.id', cond: :eq }, diff --git a/app/datatables/user_datatable.rb b/app/datatables/user_datatable.rb index b97eb404..cc2ece66 100644 --- a/app/datatables/user_datatable.rb +++ b/app/datatables/user_datatable.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class UserDatatable < AjaxDatatablesRails::Base + extend Forwardable + def_delegator :@view, :show_roles def_delegator :@view, :admin_user_path def_delegator :@view, :edit_admin_user_path diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 24c08d0e..fe8b25e2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -88,14 +88,6 @@ module ApplicationHelper end end - def redirect_back_or_to(options = {}, response_status = {}) - if request.env['HTTP_REFERER'] - redirect_back(fallback_location: root_path) - else - redirect_to options, response_status - end - end - def concurrent_events(event) return nil unless event.scheduled? && event.program.selected_event_schedules @@ -123,14 +115,6 @@ module ApplicationHelper user_selector_input(:speakers, form, '', true) end - def responsibles_selector_input(form) - user_selector_input( - :responsibles, - form, - "The people responsible for the #{t 'booth'}. You can only select existing users." - ) - end - def user_selector_input(field, form, hint = '', multiple = true) users = User.where(is_disabled: false).pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase } form.input( diff --git a/app/helpers/event_types_helper.rb b/app/helpers/event_types_helper.rb new file mode 100644 index 00000000..e200e33c --- /dev/null +++ b/app/helpers/event_types_helper.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module EventTypesHelper + ## + # Includes functions related to event_types + ## + ## + # ====Returns + # * +String+ -> number of registrations / max allowed registrations + def event_type_select_options(event_types = {}) + event_types.map { |type| ["#{type.title} - #{show_time(type.length)}", type.id] } + end +end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 31384a2c..ddb16e4c 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -46,14 +46,6 @@ module EventsHelper end end - def track_selector_input(form) - if @program.tracks.confirmed.cfp_active.any? - form.input :track_id, as: :select, - collection: @program.tracks.confirmed.cfp_active.pluck(:name, :id), - include_blank: '(Please select)' - end - end - def rating_tooltip(event, max_rating) "#{event.average_rating}/#{max_rating}, #{pluralize(event.voters.length, 'vote')}" end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 55cfcfd9..1ee065ea 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -10,6 +10,8 @@ module UsersHelper end def omniauth_configured + return Devise.omniauth_providers if OmniAuth.config.test_mode + providers = [] Devise.omniauth_providers.each do |provider| provider_key = "#{provider}_key" diff --git a/app/models/conference.rb b/app/models/conference.rb index 8d0b786d..cac3a849 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -28,8 +28,8 @@ class Conference < ApplicationRecord delegate :city, :country_name, to: :venue, allow_nil: true delegate :name, :street, to: :venue, prefix: true, allow_nil: true - has_many :physical_tickets, through: :ticket_purchases has_many :ticket_purchases, dependent: :destroy + has_many :physical_tickets, through: :ticket_purchases has_many :payments, dependent: :destroy has_many :supporters, through: :ticket_purchases, source: :user has_many :tickets, dependent: :destroy diff --git a/app/models/program.rb b/app/models/program.rb index 8db24c6c..f367d1b2 100644 --- a/app/models/program.rb +++ b/app/models/program.rb @@ -268,7 +268,7 @@ class Program < ApplicationRecord def normalize_event_types_length event_types.each do |event_type| new_length = event_type.length > schedule_interval ? event_type.length - (event_type.length % schedule_interval) : schedule_interval - event_type.update_attributes length: new_length + event_type.update_attribute(:length, new_length) end end end diff --git a/app/models/ticket_purchase.rb b/app/models/ticket_purchase.rb index 129d7916..f8e6c210 100644 --- a/app/models/ticket_purchase.rb +++ b/app/models/ticket_purchase.rb @@ -77,7 +77,7 @@ class TicketPurchase < ApplicationRecord end def pay(payment) - update_attributes(paid: true, payment: payment) + update(paid: true, payment: payment) PhysicalTicket.transaction do quantity.times { physical_tickets.create } end diff --git a/app/models/user.rb b/app/models/user.rb index 7c764fa1..86c197db 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,7 +7,6 @@ class UserDisabled < StandardError end class User < ApplicationRecord - rolify # prevent N+1 queries with has_cached_role? by preloading roles *always* default_scope { preload(:roles) } @@ -17,8 +16,15 @@ class User < ApplicationRecord where('ticket_purchases.conference_id = ?', conference) end end + has_many :tickets, through: :ticket_purchases, source: :ticket do + def for_registration conference + where(conference: conference, registration_ticket: true).first + end + end + has_many :users_roles has_many :roles, through: :users_roles, dependent: :destroy + rolify has_paper_trail on: [:create, :update], ignore: [:sign_in_count, :remember_created_at, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip, :last_sign_in_ip, :unconfirmed_email, :avatar_content_type, :avatar_file_size, :avatar_updated_at, :updated_at, :confirmation_sent_at, :confirmation_token, :reset_password_token] @@ -69,11 +75,7 @@ class User < ApplicationRecord end has_many :events_registrations, through: :registrations has_many :payments, dependent: :destroy - has_many :tickets, through: :ticket_purchases, source: :ticket do - def for_registration conference - where(conference: conference, registration_ticket: true).first - end - end + has_many :votes, dependent: :destroy has_many :voted_events, through: :votes, source: :events has_many :subscriptions, dependent: :destroy @@ -154,9 +156,9 @@ class User < ApplicationRecord raise UserDisabled if user&.is_disabled if user - user.update_attributes(email: attributes[:email], - last_sign_in_at: user.current_sign_in_at, - current_sign_in_at: Time.current) + user.update(email: attributes[:email], + last_sign_in_at: user.current_sign_in_at, + current_sign_in_at: Time.current) else begin user = create!(username: username, email: attributes[:email]) diff --git a/app/pdfs/ticket_pdf.rb b/app/pdfs/ticket_pdf.rb index c4408e7c..cb624b1d 100644 --- a/app/pdfs/ticket_pdf.rb +++ b/app/pdfs/ticket_pdf.rb @@ -51,7 +51,7 @@ class TicketPdf < Prawn::Document when 'http', 'ftp:' # CDNs begin open(@conference.picture.ticket.url) - rescue OpenURI::HTTPError + rescue OpenURI::HTTPError, Errno::ENOENT nil end when '/sys' # local storage diff --git a/app/views/admin/booths/edit.html.haml b/app/views/admin/booths/edit.html.haml index 0cac17e7..07fca460 100644 --- a/app/views/admin/booths/edit.html.haml +++ b/app/views/admin/booths/edit.html.haml @@ -1,5 +1,9 @@ -%h1 - Editing - = @booth.title - -= render 'booths/form' +.row + .col-md-12 + .page-header + %h1 + Edit #{t'booth'} + = @booth.title +.row + .col-md-8 + = render 'booths/form' diff --git a/app/views/admin/booths/new.html.haml b/app/views/admin/booths/new.html.haml index 0cf6adb5..843ade27 100644 --- a/app/views/admin/booths/new.html.haml +++ b/app/views/admin/booths/new.html.haml @@ -1,3 +1,8 @@ -%h1 New #{t'booth'} - -= render 'booths/form' +.row + .col-md-12 + .page-header + %h1 + New #{t'booth'} +.row + .col-md-8 + = render 'booths/form' diff --git a/app/views/admin/cfps/_form.html.haml b/app/views/admin/cfps/_form.html.haml index 8e3c7f35..f6af3687 100644 --- a/app/views/admin/cfps/_form.html.haml +++ b/app/views/admin/cfps/_form.html.haml @@ -1,28 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - Call for - = cfp.cfp_type.capitalize -.row - .col-md-8 - = semantic_form_for(cfp, url: cfp_form_url(cfp, conference), - html: { multipart: true, - data: { end_conference: conference.end_date.to_s } }) do |f| - = f.input :cfp_type, as: :hidden - = f.input :start_date, as: :string, - input_html: { class: 'form-control', - id: 'registration-period-start-datepicker' } - = f.input :end_date, as: :string, - input_html: { class: 'form-control', - id: 'registration-period-end-datepicker' } - = f.input :description, hint: markdown_hint, - input_html: { rows: 2, data: { provide: 'markdown' } } - - if cfp.cfp_type == 'events' - = f.input :enable_registrations, as: :boolean, - hint: 'Allow submitters to request registration?' - - else - = f.input :enable_registrations, as: :hidden - %p.text-right - = f.action :submit, as: :button, - button_html: { class: 'btn btn-primary' } += form_for(@cfp, url: (@cfp.new_record? ? admin_conference_program_cfps_path : admin_conference_program_cfp_path(@conference.short_title, @cfp)), data: { end_conference: @conference.end_date.to_s }) do |f| + = f.hidden_field :cfp_type + .form-group + = f.label :start_date, "Start Date" + = f.text_field :start_date, class: 'form-control', id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + .form-group + = f.label :end_date, "End Date" + = f.text_field :end_date, class: 'form-control', id: 'registration-period-end-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + .form-group + = f.label :description, "Description" + = f.text_area :description, rows: 2, data: { provide: 'markdown' } + %span.help-block + = markdown_hint + - if @cfp.cfp_type == 'events' + .checkbox + %label + = f.check_box :enable_registrations + Allow submitters to request registration? + %p.text-right + = f.submit nil, { class: 'btn btn-success' } diff --git a/app/views/admin/cfps/edit.haml b/app/views/admin/cfps/edit.haml index 2851f823..ea45338e 100644 --- a/app/views/admin/cfps/edit.haml +++ b/app/views/admin/cfps/edit.haml @@ -1 +1,9 @@ -= render 'form', cfp: @cfp, conference: @conference +.row + .col-md-12 + .page-header + %h1 + Call for + = @cfp.cfp_type.capitalize +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/cfps/new.haml b/app/views/admin/cfps/new.haml index 2851f823..ea45338e 100644 --- a/app/views/admin/cfps/new.haml +++ b/app/views/admin/cfps/new.haml @@ -1 +1,9 @@ -= render 'form', cfp: @cfp, conference: @conference +.row + .col-md-12 + .page-header + %h1 + Call for + = @cfp.cfp_type.capitalize +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml index 095ddad2..0da9ffef 100644 --- a/app/views/admin/commercials/index.html.haml +++ b/app/views/admin/commercials/index.html.haml @@ -13,10 +13,13 @@ #resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' } .row .col-md-6 - = semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true }, - hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| + .form-group + = f.label :url + = f.url_field :url, required: 'required', autofocus: true, class: 'form-control' + %span.help-block + Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, { class: 'btn btn-primary pull-right', id: 'commercial_submit_action', disabled: true } %hr - @commercials.each_slice(3) do |slice| @@ -29,9 +32,13 @@ = render partial: 'shared/media_item', locals: { commercial: commercial } .caption - if can? :update, commercial - = semantic_form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider' - = f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update' + = form_for commercial, url: admin_conference_commercial_path(conference_id: @conference.short_title, id: commercial) do |f| + .form-group + = f.label :url + = f.url_field :url, id: "commercial_url_#{commercial.id}", required: 'required' + %span.help-block + Just paste the url of your video/photo provider + = f.submit nil, { class: 'btn btn-success' } - if can? :destroy, commercial = link_to 'Delete', admin_conference_commercial_path(@conference.short_title, commercial.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/admin/conferences/_form_fields.html.haml b/app/views/admin/conferences/_form_fields.html.haml new file mode 100644 index 00000000..ceb72acc --- /dev/null +++ b/app/views/admin/conferences/_form_fields.html.haml @@ -0,0 +1,95 @@ +%h4 + Basic Information +%hr +- if f.object.new_record? + .form-group + = f.label :organization, "Organization" + = f.select :organization_id, Organization.accessible_by(current_ability, :update).pluck(:name, :id) +.form-group + = f.label :title, "Title" + %abbr{title: 'This field is required'} * + = f.text_field :title, required: true, class: 'form-control', placeholder: 'Title' + %span.help-block + The name of your conference as it shall appear throughout the site. Example: 'openSUSE Conference 2013' +.form-group + = f.label :title, "Short Title" + %abbr{title: 'This field is required'} * + = f.text_field :short_title, required: true, pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.', prepend: conferences_url + '/', class: 'form-control', placeholder: 'Short Title' + %span.help-block + A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: + %em + froscon2011 +- unless f.object.new_record? # We are showing more fields on the edit form + .form-group + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint('A description of the conference.') + .form-group + = f.color_field :color, size: 6, class: 'form-control' + %span.help-block + The color will be used for the dashboard, for instance. + .form-group + = f.label :picture, 'Conference Logo' + - if f.object.picture? + = image_tag f.object.picture.thumb.url + = f.file_field :picture + %span.help-block + This will be displayed on the front page. + = f.hidden_field :picture_cache + = f.select :ticket_layout, Conference.ticket_layouts.keys, {}, class: 'form-control' + %span.help-block + Layout type for tickets of the conference. + +%h4 + Scheduling +%hr += f.time_zone_select :timezone, nil, { default: 'UTC' }, { class: 'form-control' } +%span.help-block + Please select in what time zone your conference will take place. +.form-group + = f.label :start_date, "Start Date" + %abbr{title: 'This field is required'} * + = f.text_field :start_date, id: 'conference-start-datepicker', required: true, class: 'form-control' +.form-group + = f.label :end_date, "End Date" + %abbr{title: 'This field is required'} * + = f.text_field :end_date, id: 'conference-end-datepicker', required: true, class: 'form-control' +- unless f.object.new_record? # We are showing more fields on the edit form + .form-group + = f.number_field :start_hour, size: 2, min: 0, max: 23, class: 'form-control' + %span.help-block + = rescheduling_hint(@affected_event_count) + .form-group + = f.number_field :end_hour, size: 2, min: 1, max: 24, class: 'form-control' + %span.help-block + = rescheduling_hint(@affected_event_count) + %h4 + Registrations + %hr + .form-group + = f.number_field :registration_limit, in: 0..9999, class: 'form-control' + %span.help-block + Limit the number of registrations to the conference (0 no limit). Please note that the registration limit + does not apply to speakers of confirmed events, they will still be able to register even if the limit has been reached. + You currently have + = pluralize(@conference.registrations.count, 'registration') + %h4 + Booths + %hr + .form-group + = f.number_field :booth_limit, in: 0..9999, class: 'form-control' + %span.help-block + = (t'booth').capitalize + limit is the maximum number of + = (t'booth').pluralize + that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not + going to accept more + = (t'booth').pluralize + than the conference can accommodate. You currently have + = pluralize(@conference.booths.accepted.count, "accepted #{t'booth'}") + '.' +%p.text-right + - if f.object.new_record? + = f.submit nil, { class: 'btn btn-success' } + - else + = f.submit nil, { class: 'btn btn-success', data: { confirm: 'Are you sure you want to proceed?' } } + diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index 456c5f12..4537783f 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -6,27 +6,5 @@ The most basic settings of your conference .row .col-md-8 - = semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| - = f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'" - = f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs" - = f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'} - = f.label 'Conference Logo' - %br - - if @conference.picture? - = image_tag @conference.picture.thumb.url - = f.input :picture, label: false, hint: 'This will be displayed on the front page.' - = f.hidden_field :picture_cache - = f.input :ticket_layout, as: :select, collection: Conference.ticket_layouts.keys, hint: "Layout type for tickets of the conference." - = f.inputs name: 'Scheduling' do - = f.input :timezone, as: :time_zone, hint: 'The conference time zone' - = f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', readonly: 'readonly' } - = f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', readonly: 'readonly' } - = f.input :start_hour, input_html: {size: 2, type: 'number', min: 0, max: 23}, hint: rescheduling_hint(@affected_event_count) - = f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24}, hint: rescheduling_hint(@affected_event_count) - = f.inputs name: 'Registrations' do - = f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration') - = f.inputs name: 'Booths' do - = f.input :booth_limit, as: :number, in: 0..9999, - hint: "#{(t'booth').capitalize } limit is the maximum number of #{(t'booth').pluralize} that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more #{(t'booth').pluralize} than the conference can accommodate. You currently have " + pluralize(@conference.booths.accepted.count, "accepted #{t'booth'}") +'.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary', data: { confirm: 'Are you sure you want to proceed?' } } + = form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| + = render partial: 'form_fields', locals: { f: f } diff --git a/app/views/admin/conferences/new.html.haml b/app/views/admin/conferences/new.html.haml index 9e115457..2d2ea53e 100644 --- a/app/views/admin/conferences/new.html.haml +++ b/app/views/admin/conferences/new.html.haml @@ -1,15 +1,4 @@ .row .col-md-8 - = semantic_form_for(@conference, url: admin_conferences_path) do |f| - = f.inputs 'Basic Information' do - = f.input :organization, as: :select, collection: @organizations - = f.input :title, hint: "The name of your conference as it shall appear throughout the site. Example: 'OpenSUSE Conference 2013'", - input_html: { required: 'required' } - = f.input :short_title, hint: "A short and unique handle for your conference, using only letters, numbers, underscores, and dashes. This will be used to identify your conference in URLs etc. Example: 'froscon2011'", - input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }, prepend: conferences_url + '/' - = f.inputs 'Scheduling' do - = f.input :timezone, as: :time_zone, default: Time.zone.name, hint: 'Please select in what time zone your conference will take place.' - = f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' } - = f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', required: 'required' } - = f.actions do - = f.action :submit, button_html: {class: 'btn btn-success pull-right'} + = form_for(@conference, url: admin_conferences_path) do |f| + = render partial: 'form_fields', locals: { f: f } diff --git a/app/views/admin/contacts/edit.html.haml b/app/views/admin/contacts/edit.html.haml index c242a01f..1a67342c 100644 --- a/app/views/admin/contacts/edit.html.haml +++ b/app/views/admin/contacts/edit.html.haml @@ -6,17 +6,53 @@ How people can contact you .row .col-md-8 - = semantic_form_for(@contact, url: admin_conference_contact_path(@conference.short_title), html: {multipart: true}) do |f| - = f.inputs name: 'Mail' do - = f.input :email, input_html: { autofocus: true }, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.' - = f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers' - = f.inputs name: 'Social Media' do - = f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'" - = f.input :blog, hint: 'This will appear in the social media section as a link to your conference blog.' - = f.input :facebook, hint: 'This will appear in the social media section as a link to the Facebook page of your Conference' - = f.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as a link to the Google+ Page of your Conference' - = f.input :twitter, hint: 'This will appear in the social media section as a link to the Twitter Page of your Conference' - = f.input :instagram, hint: 'This will appear in the social media section as a link to the Instagram Page of your Conference' - = f.input :mastodon, hint: 'This will appear in the social media section as a link to the Mastodon Page of your Conference' - = f.input :youtube, hint: 'This will appear in the social media section as a link to the YouTube channel for your conference.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for(@contact, url: admin_conference_contact_path(@conference.short_title), html: {multipart: true}) do |f| + %h4 + Mail + %hr + .form-group + = f.label :email + = f.email_field :email, autofocus: true, class: 'form-control' + %span.help-block + Contact email address for your conference. Will be used as reply-to address in emails sent out by the system. + = f.label :sponsor_email + = f.email_field :sponsor_email, class: 'form-control' + %span.help-block + This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers. + %h4 + Social Media + %hr + .form-group + = f.label :social_tag + = f.text_field :social_tag, class: 'form-control' + %span.help-block + The hashtag you'll use on Twitter and Google+. Don't include the '#' sign! + = f.label :blog, 'Blog URL' + = f.url_field :blog, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to your conference blog. + = f.label :facebook, 'Facebook URL' + = f.url_field :facebook, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Facebook page of your Conference' + = f.label :googleplus, 'Google+ URL' + = f.url_field :googleplus, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Google+ Page of your Conference' + = f.label :twitter, 'Twitter URL' + = f.url_field :twitter, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Twitter Page of your Conference' + = f.label :instagram, 'Insta URL' + = f.url_field :instagram, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Instagram Page of your Conference + = f.label :mastodon, 'Mastodon URL' + = f.url_field :mastodon, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the Mastodon Page of your Conference + = f.label :youtube, 'Youtube URL' + = f.url_field :youtube, class: 'form-control' + %span.help-block + This will appear in the social media section as a link to the YouTube channel for your conference. + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/difficulty_levels/_form.html.haml b/app/views/admin/difficulty_levels/_form.html.haml index f28ab7e3..0f3b40b9 100644 --- a/app/views/admin/difficulty_levels/_form.html.haml +++ b/app/views/admin/difficulty_levels/_form.html.haml @@ -1,16 +1,13 @@ -.row - .col-md-12 - .page-header - %h1 - - if @difficulty_level.new_record? - New - Difficulty Level - = @difficulty_level.title -.row - .col-md-8 - = semantic_form_for(@difficulty_level, url: (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f| - = f.input :title, input_html: { autofocus: true }, required: true - = f.input :description, input_html: {rows: 3, class: 'span6'} - = f.input :color, input_html: {size: 6, type: 'color'} - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@difficulty_level, url: (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true , required: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 3, class: 'span6 form-control' + .form-group + = f.label :color + = f.color_field :color, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/difficulty_levels/edit.html.haml b/app/views/admin/difficulty_levels/edit.html.haml new file mode 100644 index 00000000..baec7d47 --- /dev/null +++ b/app/views/admin/difficulty_levels/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Difficulty Level + = @difficulty_level.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/difficulty_levels/new.html.haml b/app/views/admin/difficulty_levels/new.html.haml new file mode 100644 index 00000000..6d8fc4de --- /dev/null +++ b/app/views/admin/difficulty_levels/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Difficulty Level +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/emails/index.html.haml b/app/views/admin/emails/index.html.haml index 97946a75..48f19a89 100644 --- a/app/views/admin/emails/index.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -1,6 +1,6 @@ .row .col-md-8 - = semantic_form_for(@settings, url: admin_conference_email_path(@conference.short_title, @conference.email_settings), html: {multipart: true}) do |f| + = form_for(@settings, url: admin_conference_email_path(@conference.short_title, @conference.email_settings), html: {multipart: true}) do |f| .row .col-md-12 %div{ role: 'tabpanel' } @@ -19,43 +19,77 @@ / Tab panes .tab-content #onboarding.tab-pane.active{ role: 'tabpanel' } - = f.input :send_on_registration, label: 'Send an email when the user registers for the conference?', input_html: {'data-name' => 'email_settings_registration_subject', 'class' => 'send_on_radio'} - = f.input :registration_subject - = f.input :registration_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_registration, data: {name: 'email_settings_registration_subject'}, class: 'send_on_radio' + Send an email when the user registers for the conference? + .form-group + = f.label :registration_subject, 'Subject' + = f.text_field :registration_subject, class: 'form-control' + .form-group + = f.label :registration_body, 'Body' + = f.text_area :registration_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_registration_subject', 'data-subject-text' => 'Thank you for registering', 'data-body-input-id' => 'email_settings_registration_body', 'data-body-text' => "Dear {name},\n\nThank you for Registering for the conference {conference}.\nPlease complete your registration by filling out your travel information.\n\nIf you are unable to attend please unregister online:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\nWe look forward to see you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'registration_help' } Show Help = render partial: 'help', locals: { id: 'registration_help', show_event_variables: false } #proposal.tab-pane{ role: 'tabpanel' } - = f.input :send_on_submitted_proposal, label: 'Send an email when the proposal is submitted', input_html: { 'data-name' => 'email_settings_proposal_submited_subject', 'class' => 'send_on_radio' } - = f.input :submitted_proposal_subject - = f.input :submitted_proposal_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_submitted_proposal, data: { name: 'email_settings_proposal_submited_subject'}, class: 'send_on_radio' + Send an email when the proposal is submitted + .form-group + = f.label :submitted_proposal_subject, 'Subject' + = f.text_field :submitted_proposal_subject, class: 'form-control' + .form-group + = f.label :submitted_proposal_body, 'Body' + = f.text_area :submitted_proposal_body, input_html: { rows: 10, cols: 20 }, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_submitted_proposal_subject', 'data-subject-text' => 'Your proposal has been submitted successfully', 'data-body-input-id' => 'email_settings_submitted_proposal_body', 'data-body-text' => "Dear {name}\n\nThank you for submitting your proposal {eventtitle}.\n\nOur team will review it and get back to you as soon as possible.\n\nFeel free to contact us with any questions or concerns.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'submitted_proposal_help' } Show Help = render partial: 'help', locals: { id: 'submitted_proposal_help', show_event_variables: true } - - = f.input :send_on_accepted, label: 'Send an email when the proposal is accepted?', input_html: { 'data-name' => 'email_settings_accepted_subject', 'class' => 'send_on_radio' } - = f.input :accepted_subject - = f.input :accepted_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_accepted, data: { name: 'email_settings_accepted_subject' }, class: 'send_on_radio' + Send an email when the proposal is accepted? + .form-group + = f.label :accepted_subject, 'Subject' + = f.text_field :accepted_subject, class: 'form-control' + .form-group + = f.label :accepted_body, 'Body' + = f.text_area :accepted_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_accepted_subject', 'data-subject-text' => 'Your submission has been accepted', 'data-body-input-id' => 'email_settings_accepted_body', 'data-body-text' => "Dear {name}\n\nWe are very pleased to inform you that your submission {eventtitle} has been accepted for the conference {conference}.\n\nThe public page of your submission can be found at:\n{proposalslink}\nIf you haven´t already registered for {conference}, please do as soon as possible:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'accepted_help' } Show Help = render partial: 'help', locals: { id: 'accepted_help', show_event_variables: true } - = f.input :send_on_rejected, label: 'Send an email when the proposal is rejected?', input_html: { 'data-name' => 'email_settings_rejected_subject', 'class' => 'send_on_radio' } - = f.input :rejected_subject - = f.input :rejected_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_rejected, data: { name: 'email_settings_rejected_subject'}, class: 'send_on_radio' + Send an email when the proposal is rejected? + .form-group + = f.label :rejected_subject, 'Subject' + = f.text_field :rejected_subject, class: 'form-control' + .form-group + = f.label :rejected_body, 'Body' + = f.text_area :rejected_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_rejected_subject', 'data-subject-text' => 'Your submission has been rejected', 'data-body-input-id' => 'email_settings_rejected_body', 'data-body-text' => "Dear {name},\n\nThank you for your submission {eventtitle} for the conference {conference}.\nAfter careful consideration we are sorry to inform you that your submission has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'rejected_help' } Show Help = render partial: 'help', locals: {id: 'rejected_help', show_event_variables: true} - = f.input :send_on_confirmed_without_registration, label: "Send an email when a user has a confirmed proposal, but isn't yet registered?", input_html: {'data-name' => 'email_settings_confirmed_without_registration_subject', 'class' => 'send_on_radio'} - = f.input :confirmed_without_registration_subject - = f.input :confirmed_without_registration_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_confirmed_without_registration, data: {name: 'email_settings_confirmed_without_registration_subject'}, class: 'send_on_radio' + Send an email when a user has a confirmed proposal, but isn't yet registered? + .form-group + = f.label :confirmed_without_registration_subject, 'Subject' + = f.text_field :confirmed_without_registration_subject, class: 'form-control' + .form-group + = f.label :confirmed_without_registration_body, 'Body' + = f.text_area :confirmed_without_registration_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_confirmed_without_registration_subject', 'data-subject-text' => 'Your proposal has been confirmed without registration', 'data-body-input-id' => 'email_settings_confirmed_without_registration_body', @@ -63,27 +97,48 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'confirmed_help' } Show Help = render partial: 'help', locals: {id: 'confirmed_help', show_event_variables: true} #notifications.tab-pane{ role: 'tabpanel' } - = f.input :send_on_conference_dates_updated, label: 'This is to notify all participants that the conference dates has been changed.', input_html: { 'data-name' => 'email_settings_conference_dates_updated_subject', 'class' => 'send_on_radio' } - = f.input :conference_dates_updated_subject - = f.input :conference_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_conference_dates_updated, data: { name: 'email_settings_conference_dates_updated_subject'}, class: 'send_on_radio' + Send an email when to all participants if the conference dates are changed? + .form-group + = f.label :conference_dates_updated_subject, 'Subject' + = f.text_field :conference_dates_updated_subject, class: 'form-control' + .form-group + = f.label :conference_dates_updated_body, 'Body' + = f.text_area :conference_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_conference_dates_updated_subject', 'data-subject-text' => 'The dates of the conference have changed', 'data-body-input-id' => 'email_settings_conference_dates_updated_body', 'data-body-text' => "Dear {name},\n\nThe date of {conference} has changed.\n New Dates : {conference_start_date} - {conference_end_date}.\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_dates_help' } Show Help = render partial: 'help', locals: {id: 'updated_dates_help', show_event_variables: false} - = f.input :send_on_conference_registration_dates_updated, label: 'This is to notify all participants that the conference registration dates has been changed.', input_html: {'data-name' => 'email_settings_conference_registration_dates_updated_subject', 'class' => 'send_on_radio'} - = f.input :conference_registration_dates_updated_subject - = f.input :conference_registration_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_conference_registration_dates_updated, data: { name: 'email_settings_conference_registration_dates_updated_subject' }, class: 'send_on_radio' + Send an email when to all participants if the conference registration dates changed? + .form-group + = f.label :conference_registration_dates_updated_subject, 'Subject' + = f.text_field :conference_registration_dates_updated_subject, class: 'form-control' + .form-group + = f.label :conference_registration_dates_updated_body, 'Body' + = f.text_area :conference_registration_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_conference_registration_dates_updated_subject', 'data-subject-text' => 'The registration dates have changed', 'data-body-input-id' => 'email_settings_conference_registration_dates_updated_body', 'data-body-text' => "Dear {name},\n\nThe registration date of {conference} has changed.\n New Dates : {registration_start_date} - {registration_end_date}.\n\nFeel free to contact us with any questions or concerns.\n\nWe look forward to seeing you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_registrations_dates_help' } Show Help = render partial: 'help', locals: {id: 'updated_registrations_dates_help', show_event_variables: false} - = f.input :send_on_venue_updated, label: 'Send an email on updating the Venue.', input_html: { 'data-name' => 'email_settings_venue_updated_subject', 'class' => 'send_on_radio' } - = f.input :venue_updated_subject - = f.input :venue_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_venue_updated, data: { name: 'email_settings_venue_updated_subject'}, class: 'send_on_radio' + Send an email on updating the Venue? + .form-group + = f.label :venue_updated_subject, 'Subject' + = f.text_field :venue_updated_subject, class: 'form-control' + .form-group + = f.label :venue_updated_body, 'Body' + = f.text_area :venue_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_venue_updated_subject', 'data-subject-text' => 'The venue has changed', 'data-body-input-id' => 'email_settings_venue_updated_body', @@ -91,18 +146,32 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_venue_help' } Show Help = render partial: 'help', locals: {id: 'updated_venue_help', show_event_variables: false} #cfp.tab-pane{ role: 'tabpanel' } - = f.input :send_on_program_schedule_public, hint: 'This will notify all participants when the dates are updated or when the schedule is made public' - = f.input :program_schedule_public_subject, hint: 'This subject will used whenever dates are updated or when the schedule is made public' - = f.input :program_schedule_public_body, input_html: { rows: 10, cols: 20 } + .checkbox + %labl + = f.check_box :send_on_program_schedule_public + Send an email when to all participants if the schedule is made public? + .form-group + = f.label :program_schedule_public_subject, 'Subject' + = f.text_field :program_schedule_public_subject, class: 'form-control' + .form-group + = f.label :program_schedule_public_body, 'Body' + = f.text_area :program_schedule_public_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_program_schedule_public_subject', 'data-subject-text' => 'The schedule has been released', 'data-body-input-id' => 'email_settings_program_schedule_public_body', 'data-body-text' => "Dear {name},\n\nThe schedule for {conference} has been announced.\nLink to Schedule {schedule_link}\n\nBest wishes\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_cfp_help' } Show Help = render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false} - = f.input :send_on_cfp_dates_updated, hint: 'This will notify all participants when the dates are updated or when the schedule is made public' - = f.input :cfp_dates_updated_subject, hint: 'This subject will used whenever dates are updated or when the schedule is made public' - = f.input :cfp_dates_updated_body, input_html: { rows: 10, cols: 20 } + .checkbox + %label + = f.check_box :send_on_cfp_dates_updated + Send an email when to all participants if call for paper dates are updated? + .form-group + = f.label :cfp_dates_updated_subject, 'Subject' + = f.text_field :cfp_dates_updated_subject, class: 'form-control' + .form-group + = f.label :cfp_dates_updated_body, 'Body' + = f.text_area :cfp_dates_updated_body, rows: 10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_cfp_dates_updated_subject', 'data-subject-text' => 'The Call for Papers dates have changed', 'data-body-input-id' => 'email_settings_cfp_dates_updated_body', @@ -110,18 +179,30 @@ %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'updated_cfp_help' } Show Help = render partial: 'help', locals: {id: 'updated_cfp_help', show_event_variables: false} #booth.tab-pane{ role: 'tabpanel' } - = f.input :send_on_booths_acceptance - = f.input :booths_acceptance_subject - = f.input :booths_acceptance_body, input_html: { rows:10, cols: 20 } + .check_box + %label + = f.check_box :send_on_booths_acceptance + .form-group + = f.label :booths_acceptance_subject, 'Subject' + = f.text_field :booths_acceptance_subject, class: 'form-control' + .form-group + = f.label :booths_acceptance_body, 'Body' + = f.text_area :booths_acceptance_body, rows:10, cols: 20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_acceptance_subject', 'data-subject-text' => "Your #{t'booth'} has been accepted!", 'data-body-input-id' => 'email_settings_booths_acceptance_body', 'data-body-text' => "Dear {name},\n\nWe are pleased to inform you that your #{t'booth'} request {booth_title} has been accepted for the conference {conference}.\nPlease click the confirm button to let us know you can make it as soon as possible!\n\nFeel free to contact us with any questions or concerns.\n\nWe are looking forward to seeing you there.\n\nBest wishes\n\n{conference} Team"} Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_acceptance_help' } Show help = render partial: 'help', locals: {id: 'booth_acceptance_help', show_event_variables: false} - = f.input :send_on_booths_rejection - = f.input :booths_rejection_subject - = f.input :booths_rejection_body, input_html: { rows:10, cols:20 } + .checkbox + %label + = f.check_box :send_on_booths_rejection + .form-group + = f.label :booths_rejection_subject, 'Subject' + = f.text_field :booths_rejection_subject, class: 'form-control' + .form-group + = f.label :booths_rejection_body, 'Body' + = f.text_area :booths_rejection_body, rows:10, cols:20, class: 'form-control' %a.btn.btn-link.control_label.load_template{ 'data-subject-input-id' => 'email_settings_booths_rejection_subject', 'data-subject-text' => "Your #{t'booth'} request has been rejected", 'data-body-input-id' => 'email_settings_booths_rejection_body', @@ -131,4 +212,4 @@ .row .col-md-12 - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/event_types/_form.html.haml b/app/views/admin/event_types/_form.html.haml index 29fac398..813474c3 100644 --- a/app/views/admin/event_types/_form.html.haml +++ b/app/views/admin/event_types/_form.html.haml @@ -1,19 +1,29 @@ -.row - .col-md-12 - .page-header - %h1 - - if @event_type.new_record? - New - Event Type - = @event_type.title -.row - .col-md-12 - = semantic_form_for(@event_type, url: (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f| - = f.input :title, input_html: { autofocus: true } - = f.input :length, input_html: {size: 3, type: 'number', step: @event_type.program.schedule_interval, min: @event_type.program.schedule_interval} - = f.input :description - = f.input :minimum_abstract_length, input_html: {size: 3} - = f.input :maximum_abstract_length, input_html: {size: 3} - = f.input :color, input_html: { size: 6, type: 'color' } - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@event_type, url: (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control' + .form-group + = f.label :length + = f.number_field :length, size: 3, step: @event_type.program.schedule_interval, min: @event_type.program.schedule_interval, class: 'form-control' + %span.help-block + In steps of + = @event_type.program.schedule_interval + and minimum + = @event_type.program.schedule_interval + .form-group + = f.label :description + = f.text_field :description, class: 'form-control' + .form-group + = f.label :minimum_abstract_length + %abbr{title: 'This field is required'} * + = f.number_field :minimum_abstract_length, size: 3, required: true, class: 'form-control' + .form-group + = f.label :maximum_abstract_length + %abbr{title: 'This field is required'} * + = f.number_field :maximum_abstract_length, size: 3, required: true, class: 'form-control' + .form-group + = f.label :color + = f.color_field :color, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/event_types/edit.html.haml b/app/views/admin/event_types/edit.html.haml new file mode 100644 index 00000000..ebf17c09 --- /dev/null +++ b/app/views/admin/event_types/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Event Type + = @event_type.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/event_types/new.html.haml b/app/views/admin/event_types/new.html.haml new file mode 100644 index 00000000..a106ce43 --- /dev/null +++ b/app/views/admin/event_types/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Event Type +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/events/_nested_comments.html.haml b/app/views/admin/events/_nested_comments.html.haml index 0bfb440c..41165fd1 100644 --- a/app/views/admin/events/_nested_comments.html.haml +++ b/app/views/admin/events/_nested_comments.html.haml @@ -6,8 +6,9 @@ %div %a.pull-right.comment-reply-link{ href: '#' } Reply .comment-reply - = semantic_form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id), method: :post do |f| - = f.input :body + = form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id), method: :post do |f| + .form-group + = f.text_area :body, class: 'form-control' %input{ name: 'parent', type: 'hidden', value: comment.id } %input{ name: 'authenticity_token', type: 'hidden', value: '#{form_authenticity_token}' } %button.btn.btn-primary.pull-right{ name: 'button', type: 'submit' } Add Reply diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 999313b7..12f0efb6 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -122,17 +122,19 @@ - cache [@conference, @event, @comments] do .row - = link_to "Comments (#{@comment_count})", '#', id: 'event-comment-link' - #comments-div + .col-md-12 + %h4 + Comments + = "(#{@comment_count})" + = link_to('#comment-collapse', class: 'btn btn-link', role: 'button', data: {toggle: "collapse" }) do + Show %hr - %ul.media - %div - .row-fluid - = semantic_form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post do |f| - = f.input :body - = f.submit 'Add Comment', class: 'btn btn-primary pull-right' - %br - %br - - @comments.each do |comment| - %div - = render partial: 'nested_comments', locals: { comment: comment, padding: 0} + .collapse#comment-collapse + - @comments.each do |comment| + = render partial: 'nested_comments', locals: { comment: comment, padding: 0} + = form_for(:comment, url: comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post) do |f| + .form-group + = f.text_area :body, class: 'form-control' + .text-right + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 4944d946..eda41a3f 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -28,21 +28,21 @@ .modal-dialog .modal-content .modal-header - %h1 Add commercials to events - .text-muted - Upload your file with data in the following format: - %b Event_ID:Commercial_Link - , eg. - %br - %b 11:https://youtube.com/myvideo - + %h1 + Add commercials to events .modal-body - = semantic_form_for '', - url: mass_upload_commercials_admin_conference_program_path(@conference.short_title), - method: :post do |f| - = f.input 'file', as: :file + = form_for('', url: mass_upload_commercials_admin_conference_program_path(@conference.short_title), method: :post) do |f| + .form-group + = f.file_field 'file', as: :file + %span.help-block + Upload your file with data in the following format: + %b Event_ID:Commercial_Link + for instance: + %pre + 11:https://youtube.com/myvideo + 23:https://vimeo.com/myvideo .modal-footer - = f.submit 'Add', class: 'btn btn-primary' + = f.submit nil, class: 'btn btn-primary' .row .col-md-4 = render 'donut_chart', title: 'Events state', diff --git a/app/views/admin/lodgings/_form.html.haml b/app/views/admin/lodgings/_form.html.haml index 8d5ba82e..a0fae78a 100644 --- a/app/views/admin/lodgings/_form.html.haml +++ b/app/views/admin/lodgings/_form.html.haml @@ -1,19 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - - if @lodging.new_record? - New - Lodging - = @lodging.name -.row - .col-md-8 - = semantic_form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f| - = f.input :name, input_html: { autofocus: true} - = f.input :website_link, input_html: { type: :url } - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - - if @lodging.picture? - = image_tag @lodging.picture.thumb.url - = f.input :picture - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, require: true, autofocus: true, class: 'form-control' + .form-group + = f.label :website_link + = f.url_field :website_link, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + - if @lodging.picture? + = image_tag @lodging.picture.thumb.url + = f.label :picture + = f.file_field :picture, class: 'form-control' + %p.text-right + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/lodgings/edit.html.haml b/app/views/admin/lodgings/edit.html.haml new file mode 100644 index 00000000..2a62cc01 --- /dev/null +++ b/app/views/admin/lodgings/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Lodging + = @lodging.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/lodgings/new.html.haml b/app/views/admin/lodgings/new.html.haml new file mode 100644 index 00000000..23a97b03 --- /dev/null +++ b/app/views/admin/lodgings/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Lodging +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml index 9e8db2a1..13544440 100644 --- a/app/views/admin/organizations/_form.html.haml +++ b/app/views/admin/organizations/_form.html.haml @@ -1,20 +1,22 @@ -= semantic_form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f| - = f.inputs name: 'Organization details' do - = f.input :name, as: :string, required: true - = f.input :description, as: :text, - input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint, - placeholder: 'Decribe about your organization...' - = f.input :code_of_conduct, as: :text, - input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint, - placeholder: 'Rules governing behavior and dispute resolution...' += form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f| + .form-group + = f.label :name, "Name" + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, class: 'form-control', placeholder: 'Name' + .form-group + = f.text_area :description, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Decribe about your organization...' + %span.help-block + = markdown_hint + .form-group + = f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Rules governing behavior and dispute resolution...' + %span.help-block + = markdown_hint + .form-group = image_tag f.object.picture.thumb.url if f.object.picture? - - if @organization.picture? - = image_tag(@organization.picture.thumb.url, width: '20%') - = f.input :picture + = f.file_field :picture %p.text-right - - if @organization.new_record? - = f.submit 'Create Organization', class: 'btn btn-success' - - else - = f.submit 'Update Organization', class: 'btn btn-success' + %button{type: 'submit', class: 'btn btn-success'} + - if @organization.new_record? + Create Organization + - else + Update Organization diff --git a/app/views/admin/organizations/edit.html.haml b/app/views/admin/organizations/edit.html.haml new file mode 100644 index 00000000..c9d69bcd --- /dev/null +++ b/app/views/admin/organizations/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Organization + = @organization.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/new.html.haml b/app/views/admin/organizations/new.html.haml new file mode 100644 index 00000000..b38ea937 --- /dev/null +++ b/app/views/admin/organizations/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Organization +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/organizations/show_org_admins.haml b/app/views/admin/organizations/show_org_admins.haml index 7fe1f943..5c7698db 100644 --- a/app/views/admin/organizations/show_org_admins.haml +++ b/app/views/admin/organizations/show_org_admins.haml @@ -8,15 +8,11 @@ .row.col-md-3 - if ( can? :assign_org_admins, @organization ) - = semantic_form_for :user, - url: assign_org_admins_admin_organization_path(@organization, - @role.name), method: :post do |u| - - = u.label 'Add user by email: ' - .input-group - = u.input :email, label: false, placeholder: "User's email" - .input-group-btn - = u.submit 'Add', id: 'user-add', class: 'btn btn-primary' + = form_for :user, url: assign_org_admins_admin_organization_path(@organization, @role.name), method: :post do |f| + .form-group + = f.label :email, 'Add user by email: ' + = f.text_field :email, placeholder: "User's email", class: 'form-control', required: true + = f.submit 'Add', id: 'user-add', class: 'btn btn-primary' .row .col-md-12 diff --git a/app/views/admin/programs/_form.html.haml b/app/views/admin/programs/_form.html.haml index c158453a..037418bf 100644 --- a/app/views/admin/programs/_form.html.haml +++ b/app/views/admin/programs/_form.html.haml @@ -1,17 +1,51 @@ -.row - .col-md-12 - .page-header - %h1 Program -.row - .col-md-8 - = semantic_form_for(@program, url: admin_conference_program_path(@conference.short_title), html: {multipart: true}) do |f| - = f.input :schedule_public, label: 'Show Schedule on the home and splash page' - = f.input :schedule_fluid, label: 'Allow submitters to change their event after it is scheduled' - = f.input :rating, hint: 'Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals.' - = f.input :languages, hint: "Enter the languages allowed for events as values of #{link_to('ISO 639-1', 'http://www.loc.gov/standards/iso639-2/php/code_list.php', target: "_blank")} language codes separated with commas. The first language would be the default language. Leave it blank if you do not want to specify languages.".html_safe - = f.input :schedule_interval, input_html: { autofocus: true }, hint: "It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. Warning! Some events could be unscheduled when changing this value." - = f.input :blind_voting, hint: 'Enable this feature if you do not want to show voting results and voters prior to user submitting a vote. For the feature to work you need to set the voting dates below as well' - = f.input :voting_start_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?) } - = f.input :voting_end_date, as: :string, input_html: { id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?) } - %p.text-right - = f.action :submit, as: :button, button_html: {class: 'btn btn-primary'} += form_for(@program, url: admin_conference_program_path(@conference.short_title), html: {multipart: true}) do |f| + .checkbox + %label + = f.check_box :schedule_public + Show Schedule on the home and splash page + .checkbox + %label + = f.check_box :schedule_fluid + Allow submitters to change their event after it is scheduled + %h4 + Voting + %hr + .form-group + = f.label :rating + = f.number_field :rating, class: 'form-control' + %span.help-block + Enter the number of different rating levels you want to have for voting on proposals. + Enter 0 if you do not want to vote on proposals. + .checkbox + %label + = f.check_box :blind_voting + Enable blind voting + %span.help-block + If you do not want to show other peoples votes prior to submitting a vote. + For the feature to work you need to set the voting dates below as well + .form-group + = f.label :voting_start_date + = f.text_field :voting_start_date, id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?), class: 'form-control' + = f.label :voting_end_date + = f.text_field :voting_end_date, id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?), class: 'form-control' + %h4 + Languages + %hr + %p + Current Languages: + - if f.object.languages.present? + = f.object.languages_list.to_sentence + - else + Any Language + .form-group + = f.label :languages + = f.select :languages, I18nData.languages.invert, { include_blank: 'Any Language', include_hidden: false }, { multiple: true, class: 'form-control' } + %span.help-block + The languages allowed for events. + .form-group + = f.number_field :schedule_interval, autofocus: true, class: 'form-control' + %span.help-block + It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. + Warning! Some events could be unscheduled when changing this value. + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/programs/edit.html.haml b/app/views/admin/programs/edit.html.haml new file mode 100644 index 00000000..8d2be031 --- /dev/null +++ b/app/views/admin/programs/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Program +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/programs/new.html.haml b/app/views/admin/programs/new.html.haml new file mode 100644 index 00000000..a607a890 --- /dev/null +++ b/app/views/admin/programs/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Program +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/programs/show.html.haml b/app/views/admin/programs/show.html.haml index eceb21c5..db1e91ff 100644 --- a/app/views/admin/programs/show.html.haml +++ b/app/views/admin/programs/show.html.haml @@ -34,7 +34,10 @@ %dt Languages: %dd - = @program.languages + - if @program.languages.present? + = @program.languages_list.to_sentence + - else + Any Language %dt Public Schedule %dd#schedule_public diff --git a/app/views/admin/questions/_answer_fields.html.haml b/app/views/admin/questions/_answer_fields.html.haml index 5bffc9bc..e650995e 100644 --- a/app/views/admin/questions/_answer_fields.html.haml +++ b/app/views/admin/questions/_answer_fields.html.haml @@ -1,4 +1,3 @@ .nested-fields - = f.inputs do - = f.input :title - = remove_association_link :answer, f + = f.text_field :title + = remove_association_link :answer, f diff --git a/app/views/admin/questions/_form.html.haml b/app/views/admin/questions/_form.html.haml index abefd902..75326bf4 100644 --- a/app/views/admin/questions/_form.html.haml +++ b/app/views/admin/questions/_form.html.haml @@ -1,10 +1,17 @@ .row .col-md-6 %legend Question - = f.input :title, label: 'Your Question' - = f.input :question_type - = f.input :global, label: 'Make Global', - hint: '(Global questions are available for selection to all conferences)' + .form-group + = f.label :title, 'Your Question' + = f.text_field :title, class: 'form-control' + .form-group + = f.select :question_type_id, QuestionType.all.pluck(:title, :id), {}, { class: 'form-control' } + .checkbox + %label + = f.check_box :global + Make Global + %span.help-block + Global questions are available for selection to all conferences .col-md-6.hidden{id: 'answers_col'} = dynamic_association :answers, 'Answers', f, hint: 'Insert your answers in the order you want them to appear' diff --git a/app/views/admin/questions/edit.html.haml b/app/views/admin/questions/edit.html.haml index 4b261f38..31aa35a1 100644 --- a/app/views/admin/questions/edit.html.haml +++ b/app/views/admin/questions/edit.html.haml @@ -2,8 +2,6 @@ Edit Question %h3 "#{@question.title}" -= semantic_form_for(@question, url: admin_conference_question_path(@conference.short_title, @question.id)) do |f| - += form_for(@question, url: admin_conference_question_path(@conference.short_title, @question.id)) do |f| = render partial: 'form', locals: {f: f} - = f.submit 'Save', class: 'btn btn-primary', confirm: 'Are you sure you want to make these changes?' diff --git a/app/views/admin/questions/index.html.haml b/app/views/admin/questions/index.html.haml index f69d2846..6d2d187c 100644 --- a/app/views/admin/questions/index.html.haml +++ b/app/views/admin/questions/index.html.haml @@ -11,7 +11,7 @@ .row .col-md-12 - if @questions.count > 0 - = semantic_form_for(@conference, url: update_conference_admin_conference_questions_path(@conference.short_title)) do |f| + = form_for(@conference, url: update_conference_admin_conference_questions_path(@conference.short_title)) do |f| .questions{id: 'myquestions'} = render partial: 'questions' - if can? :update, Question.new(conference_id: @conference.id) @@ -25,7 +25,7 @@ %h3{id: 'new-question-header'} Add new question .modal-body - = semantic_form_for(@new_question, url: admin_conference_questions_path(@conference.short_title), method: :post) do |f| + = form_for(@new_question, url: admin_conference_questions_path(@conference.short_title), method: :post) do |f| = render partial: 'form', locals: {f: f} %button{class: 'btn btn-primary'} Save diff --git a/app/views/admin/registration_periods/_form.html.haml b/app/views/admin/registration_periods/_form.html.haml index c3d3c86c..35b996b1 100644 --- a/app/views/admin/registration_periods/_form.html.haml +++ b/app/views/admin/registration_periods/_form.html.haml @@ -1,11 +1,11 @@ -.row - .col-md-12 - .page-header - %h1 Registration Period -.row - .col-md-8 - = semantic_form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f| - = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date } - = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker' } - %p.text-right - = f.submit 'Save Registration Period', class: 'btn btn-primary' += form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f| + .form-group + = f.label :start_date + %abbr{title: 'This field is required'} * + = f.text_field :start_date, required: true, 'data-end-conference': @conference.end_date.to_s, id: 'registration-period-start-datepicker', class: 'form-control' + .form-group + = f.label :end_date + %abbr{title: 'This field is required'} * + = f.text_field :end_date, required: true, id: 'registration-period-end-datepicker', class: 'form-control' + %p.text-right + = f.submit 'Save Registration Period', class: 'btn btn-primary' diff --git a/app/views/admin/registration_periods/edit.html.haml b/app/views/admin/registration_periods/edit.html.haml new file mode 100644 index 00000000..df1967c1 --- /dev/null +++ b/app/views/admin/registration_periods/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Registration Period +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/registration_periods/new.html.haml b/app/views/admin/registration_periods/new.html.haml new file mode 100644 index 00000000..05af3751 --- /dev/null +++ b/app/views/admin/registration_periods/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Registration Period +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/registrations/edit.html.haml b/app/views/admin/registrations/edit.html.haml index b9b99769..0301d010 100644 --- a/app/views/admin/registrations/edit.html.haml +++ b/app/views/admin/registrations/edit.html.haml @@ -7,12 +7,20 @@ = link_to 'Edit User', edit_admin_user_path(@user), class: 'btn btn-primary pull-right' if can? :edit, @user .row .col-md-6 - = semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f| - = f.inputs 'Personal Information' do - = semantic_fields_for :user do |u| - = u.input :name, as: :string - = u.input :nickname, as: :string - = u.input :affiliation, placeholder: 'Company/User Group/nothing', as: :string - = f.inputs 'Registration Information' do + = form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f| + %h4 + Personal Information + %hr + = fields_for :user do |u| + .form-group + = u.label :name + = u.text_field :name, class: 'form-control' + = u.label :nickname + = u.text_field :nickname, class: 'form-control' + = u.label :affiliation + = u.text_field :affiliation, placeholder: 'Company/User Group etc.', class: 'form-control' + %h4 + Registration Information + %hr = render partial: 'conference_registrations/registration_info', locals: { f: f } - = f.action :submit, button_html: { class: 'btn btn-primary' } + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/resources/_form.html.haml b/app/views/admin/resources/_form.html.haml index a7a1b328..726c0c0a 100644 --- a/app/views/admin/resources/_form.html.haml +++ b/app/views/admin/resources/_form.html.haml @@ -1,16 +1,20 @@ -.row - .col-md-12 - .page-header - %h1 - - if @resource.new_record? - New - Resource -.row - .col-md-8 - = semantic_form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :used - = f.input :quantity - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, autofocus: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + = f.label :used + %abbr{title: 'This field is required'} * + = f.number_field :used, required: true, class: 'form-control' + .form-group + = f.label :quantity + %abbr{title: 'This field is required'} * + = f.number_field :quantity, required: true, class: 'form-control' + %p.text-right + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/resources/edit.html.haml b/app/views/admin/resources/edit.html.haml new file mode 100644 index 00000000..0c3e05e8 --- /dev/null +++ b/app/views/admin/resources/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Resource + = @resource.name +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/resources/new.html.haml b/app/views/admin/resources/new.html.haml index bcc58327..af670bab 100644 --- a/app/views/admin/resources/new.html.haml +++ b/app/views/admin/resources/new.html.haml @@ -1 +1,8 @@ -= render 'form' +.row + .col-md-12 + .page-header + %h1 + Create Resource +.row + .col-md-8 + = render 'form' diff --git a/app/views/admin/roles/_form.html.haml b/app/views/admin/roles/_form.html.haml index 860f43a9..dc9ad563 100644 --- a/app/views/admin/roles/_form.html.haml +++ b/app/views/admin/roles/_form.html.haml @@ -1,15 +1,5 @@ -.row - .col-md-12 - .page-header - %h2 - Role - = @role.name.titleize - .text-muted - = @role.description - -= semantic_form_for @role, url: @url do |f| - .row - .col-md-5 - = f.input :description, input_html: { autofocus: true } - - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for @role, url: @url do |f| + .form-group + = f.label :description + = f.text_field :description, autofocus: true, class: 'form-control' + = f.submit nil, { class: 'btn btn-primary' } diff --git a/app/views/admin/roles/edit.html.haml b/app/views/admin/roles/edit.html.haml new file mode 100644 index 00000000..bf848966 --- /dev/null +++ b/app/views/admin/roles/edit.html.haml @@ -0,0 +1,11 @@ +.row + .col-md-12 + .page-header + %h2 + Role + = @role.name.titleize + .text-muted + = @role.description +.row + .col-md-5 + = render partial: 'form' diff --git a/app/views/admin/roles/show.html.haml b/app/views/admin/roles/show.html.haml index b8796121..629427fb 100644 --- a/app/views/admin/roles/show.html.haml +++ b/app/views/admin/roles/show.html.haml @@ -17,16 +17,15 @@ = link_to @track.name, admin_conference_program_track_path(@conference.short_title, @track) -.row.col-md-3 - - if ( can? :toggle_user, @role ) && !@role.new_record? +.row + .col-md-3 + - if ( can? :toggle_user, @role ) && !@role.new_record? - = semantic_form_for :user, url: @url, method: :post do |u| - - = u.label 'Add user by email: ' - .input-group - = u.input :email, input_html: { autofocus: true }, label: false, placeholder: "User's email" - .input-group-btn - = u.submit 'Add', id: 'user-add', class: 'btn btn-primary' + = form_for :user, url: @url, method: :post do |f| + .form-group + = f.label :email, 'Add user by email: ' + = f.email_field :email, autofocus: true, placeholder: "User's email", class: 'form-control' + = f.submit 'Add', id: 'user-add', class: 'btn btn-primary' .row .col-md-12 diff --git a/app/views/admin/rooms/_form.html.haml b/app/views/admin/rooms/_form.html.haml index 90de99e0..a531548a 100644 --- a/app/views/admin/rooms/_form.html.haml +++ b/app/views/admin/rooms/_form.html.haml @@ -1,15 +1,9 @@ -.row - .col-md-12 - .page-header - %h1 - - if @room.new_record? - New - Room - = @room.name -.row - .col-md-8 - = semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :size, label: 'Capacity', input_html: {size: 5} - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, autofocus: true, required: true, class: 'form-control' + = f.label :size, 'Capacity' + = f.number_field :size, size: 5, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/rooms/edit.html.haml b/app/views/admin/rooms/edit.html.haml new file mode 100644 index 00000000..068748b8 --- /dev/null +++ b/app/views/admin/rooms/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Room + = @room.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/rooms/new.html.haml b/app/views/admin/rooms/new.html.haml new file mode 100644 index 00000000..2e4c1538 --- /dev/null +++ b/app/views/admin/rooms/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Room +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/schedules/_form.html.haml b/app/views/admin/schedules/_form.html.haml index 8c6c091d..9304b8e8 100644 --- a/app/views/admin/schedules/_form.html.haml +++ b/app/views/admin/schedules/_form.html.haml @@ -5,6 +5,8 @@ New Track Schedule .row .col-md-12 - = semantic_form_for @schedule, url: admin_conference_schedules_path(@conference.short_title) do |f| - = f.input :track, collection: Track.accessible_by(current_ability).where(program: @program).self_organized.confirmed.pluck(:name, :id), include_blank: false - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for @schedule, url: admin_conference_schedules_path(@conference.short_title) do |f| + .form-group + = f.select :track, Track.accessible_by(current_ability).where(program: @program).confirmed.pluck(:name, :id), { include_blank: false }, { class: 'form-control' } + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index 3db1e9ea..64456158 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -1,66 +1,71 @@ -.row - .col-md-12 - .page-header - %h1 Splashpage - -= semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| - .row - .col-md-12 - = f.inputs name: 'Components' do - %ul.fa-ul - %li - %th - %button.btn.btn-default#select-all{ type: "button" } - Select All - %th - %button.btn.btn-default#unselect-all{ type: "button" } - Unselect All - %li - = f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } - %li - = f.input :include_program, label: 'Display the program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } - - %ul.fa-ul - %li - = f.input :include_tracks, label: 'Include confirmed tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } - %li - = f.input :include_booths, label: "Include confirmed #{(t'booth').pluralize}", input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) } - - %li - = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } - - %li - = f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) } - - %li - = f.input :include_venue, label: 'Display the venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } - - %li - = f.input :include_lodgings, label: 'Display the lodgings', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_lodgings) } - - %li - = f.input :include_sponsors, label: 'Display sponsors', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_sponsors) } - - %li - = f.input :include_social_media, label: 'Display social media links', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) } - - = f.inputs name: 'Access' do - %ul.fa-ul - %li - = f.input :public, label: 'Make splash page public?' - .row - .col-md-12 - %p.text-right - = f.submit 'Save Changes', class: 'btn btn-primary' += form_for(@splashpage, url: admin_conference_splashpage_path) do |f| + .checkbox + %label + = f.check_box :include_cfp + Display call for papers and call for tracks? + .checkbox + %label + = f.check_box :include_program + Display the program? + .checkbox + %label + = f.check_box :include_tracks + Include confirmed tracks in the program? + .checkbox + %label + = f.check_box :include_booths + Include confirmed + = (t'booth').pluralize + in the program? + .checkbox + %label + = f.check_box :include_registrations + Display the registration period? + .checkbox + %label + = f.check_box :include_tickets + Display the tickets? + .checkbox + %label + = f.check_box :include_venue + Display the venue? + .checkbox + %label + = f.check_box :include_lodgings + Display the lodgings? + .checkbox + %label + = f.check_box :include_sponsors + Display the sponsors? + .checkbox + %label + = f.check_box :include_social_media + Display the social media links? + %h4 + Access + %hr + .checkbox + %label + = f.check_box :public + Make splash page public? + .text-right + .checkbox + %label + = check_box_tag 'selectAll' + Select / Deselect All + = f.submit 'Save', { class: 'btn btn-primary' } :javascript $(document).ready(function(){ - $('#select-all').click(function(event) { - var parent = $(this).parents('.inputs:last'); - parent.find('.input.checkbox input[type=checkbox]').prop('checked',true); - }); - $('#unselect-all').click(function(event) { - var parent = $(this).parents('.inputs:last'); - parent.find('.input.checkbox input[type=checkbox]').prop('checked',false); - }); + $('#selectAll').click(function() { + if (this.checked) { + $(':checkbox').each(function() { + this.checked = true; + }); + } else { + $(':checkbox').each(function() { + this.checked = false; + }); + } + }); }); diff --git a/app/views/admin/splashpages/edit.html.haml b/app/views/admin/splashpages/edit.html.haml new file mode 100644 index 00000000..0711bd1b --- /dev/null +++ b/app/views/admin/splashpages/edit.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Configure Splashpage +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/splashpages/new.html.haml b/app/views/admin/splashpages/new.html.haml new file mode 100644 index 00000000..0711bd1b --- /dev/null +++ b/app/views/admin/splashpages/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Configure Splashpage +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index a9046fdc..0bf3267c 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -55,7 +55,7 @@ .row .col-md-12 - if can? :update, @splashpage - = link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary' + = link_to 'Configure', edit_admin_conference_splashpage_path, class: 'btn btn-primary' - if can? :destroy, @splashpage = link_to 'Delete', admin_conference_splashpage_path, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/admin/sponsors/_form.html.haml b/app/views/admin/sponsors/_form.html.haml index 19bc2ae6..78cf0c4d 100644 --- a/app/views/admin/sponsors/_form.html.haml +++ b/app/views/admin/sponsors/_form.html.haml @@ -1,19 +1,23 @@ -.row - .col-md-12 - .page-header - %h1 - -if @sponsor.new_record? - New - Sponsor - = @sponsor.name -.row - .col-md-8 - = semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - = image_tag f.object.picture.thumb.url if f.object.picture? - = f.input :picture - = f.input :website_url - = f.input :sponsorship_level, collection: @conference.sponsorship_levels - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, autofocus: true, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint + .form-group + = f.label :picture + = image_tag f.object.picture.thumb.url if f.object.picture? + = f.file_field :picture + .form-group + = f.label :website_url + %abbr{title: 'This field is required'} * + = f.url_field :website_url, required: true, class: 'form-control' + .form-group + = f.label :sponsorship_level_id, 'Level' + = f.select :sponsorship_level_id, @conference.sponsorship_levels.pluck(:title, :id), { include_blank: false }, { class: 'form-control' } + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/sponsors/edit.html.haml b/app/views/admin/sponsors/edit.html.haml new file mode 100644 index 00000000..2114a547 --- /dev/null +++ b/app/views/admin/sponsors/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Sponsor + = @sponsor.name +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsors/new.html.haml b/app/views/admin/sponsors/new.html.haml new file mode 100644 index 00000000..2ed726b6 --- /dev/null +++ b/app/views/admin/sponsors/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Sponsor +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsorship_levels/_form.html.haml b/app/views/admin/sponsorship_levels/_form.html.haml index ae819a71..459c3fd3 100644 --- a/app/views/admin/sponsorship_levels/_form.html.haml +++ b/app/views/admin/sponsorship_levels/_form.html.haml @@ -1,14 +1,8 @@ -.row - .col-md-12 - .page-header - %h1 - - if @sponsorship_level.new_record? - New - Sponsorship Level - = @sponsorship_level.title -.row - .col-md-8 - = semantic_form_for(@sponsorship_level, url: (@sponsorship_level.new_record? ? admin_conference_sponsorship_levels_path : admin_conference_sponsorship_level_path(@conference.short_title, @sponsorship_level))) do |f| - = f.input :title, input_html: { autofocus: true } - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@sponsorship_level, url: (@sponsorship_level.new_record? ? admin_conference_sponsorship_levels_path : admin_conference_sponsorship_level_path(@conference.short_title, @sponsorship_level))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control' + %p.text-right + = f.submit nil, class: 'btn btn-primary' + diff --git a/app/views/admin/sponsorship_levels/edit.html.haml b/app/views/admin/sponsorship_levels/edit.html.haml new file mode 100644 index 00000000..fab6a007 --- /dev/null +++ b/app/views/admin/sponsorship_levels/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Sponsorship Level + = @sponsorship_level.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/sponsorship_levels/new.html.haml b/app/views/admin/sponsorship_levels/new.html.haml new file mode 100644 index 00000000..5a8bebd6 --- /dev/null +++ b/app/views/admin/sponsorship_levels/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Sponsorship Level +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/survey_questions/_form.html.haml b/app/views/admin/survey_questions/_form.html.haml index eb861944..a4e1eea6 100644 --- a/app/views/admin/survey_questions/_form.html.haml +++ b/app/views/admin/survey_questions/_form.html.haml @@ -11,82 +11,85 @@ = @survey_question.title .col-md-6 - = semantic_form_for @survey_question, url: @url do |f| - - .row - .col-md-12 - = f.input :title, input_html: { autofocus: true } - = f.input :mandatory - .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' } - = f.input :possible_answers, hint: 'Comma separated', input_html: { rows: 3 } - .row - .col-md-6 - = f.input :min_choices - .col-md-6 - = f.input :max_choices - %hr - .row - .col-md-6 - %label{ required: 'required' } - Type of Question: - .form-group - %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' } - - SurveyQuestion.kinds.each do |kind| - %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first } - = kind.first - .col-md-6 + = form_for @survey_question, url: @url do |f| + .form-group + = f.text_field :title, autofocus: true, class: 'form-control' + .checkbox %label - Preview: - .panel.panel-default - .panel-body{ id: 'survey_question_preview' } - %p{ id: 'title', style: 'word-wrap: break-word' } - = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title - - .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' } - %input{ type: 'radio', name: 'radio' } Yes + = f.check_box :mandatory + Mandatory? + .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' } + .form-group + = f.text_area :possible_answers, rows: 3, class: 'form-control' + %span.help-block + Comma separated + .form-group + = f.label :min_choices + = f.number_field :min_choices, class: 'form-control' + .form-group + = f.label :max_choices + = f.number_field :max_choices, class: 'form-control' + .form-group + %label{ required: 'required' } + Type of Question: + .form-group + %select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' } + - SurveyQuestion.kinds.each do |kind| + %option{ id: "#{kind.second}", 'data-icon' => "fa fa-#{SurveyQuestion::ICONS[kind.first.to_sym]}", selected: @survey_question.kind == kind.first } + = kind.first + = f.submit nil, class: 'btn btn-primary' + .col-md-6 + %label + Preview: + %span.help-block + This is how you visitors will see the question in the survey. + .panel.panel-default + .panel-body{ id: 'survey_question_preview' } + %p{ id: 'title', style: 'word-wrap: break-word' } + = @survey_question.title.blank? ? 'What is your answer?' : @survey_question.title + .kinds.boolean{ class: @survey_question.boolean? ? '' : 'hidden' } + %input{ type: 'radio', name: 'radio' } Yes + %br + %input{ type: 'radio', name: 'radio' } No + .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' } + - if @survey_question.possible_answers.blank? + - if @survey_question.single_choice? + .radio + %label + %input{ type: 'radio' } + Choice + - else + .checkbox + %label + %input{ type: 'checkbox' } + Choice 1 + .checkbox + %label + %input{ type: 'checkbox' } + Choice 2 + .checkbox + %label + %input{ type: 'checkbox' } + Choice 3 + - else + - @survey_question.possible_answers.split(',').map(&:strip).each do |option| + - if @survey_question.single_choice? + %input{ type: 'radio', name: 'radio' } + = option %br - %input{ type: 'radio', name: 'radio' } No - - .kinds.choice{ class: @survey_question.choice? ? '' : 'hidden' } - - if @survey_question.possible_answers.blank? - - if @survey_question.single_choice? - %input{ type: 'radio', name: 'radio' } Choice 1 - %br - %input{ type: 'radio', name: 'radio' } Choice 2 - %br - %input{ type: 'radio', name: 'radio' } Choice 3 - - else - %input{ type: 'checkbox', name: 'checkbox' } Choice 1 - %br - %input{ type: 'checkbox', name: 'checkbox' } Choice 2 - %br - %input{ type: 'checkbox', name: 'checkbox' } Choice 3 - - else - - @survey_question.possible_answers.split(',').map(&:strip).each do |option| - - if @survey_question.single_choice? - %input{ type: 'radio', name: 'radio' } - = option - %br - - else - %input{ type: 'checkbox', name: 'checkbox' } - = option - %br - - .kinds.string{ class: @survey_question.string? ? '' : 'hidden' } - %input.form-control - - .kinds.text{ class: @survey_question.text? ? '' : 'hidden' } - %textarea.form-control{ rows: 4 } - - - .kinds.datetime{ class: @survey_question.datetime? ? '' : 'hidden' } - .form-group{ class: 'datetimepicker' } - .input-group - .input-group-addon - %span.fa.fa-calendar - %input.form-control{ readonly: 'readonly' } - .kinds.numeric{ class: @survey_question.numeric? ? '' : 'hidden' } - - %input.form-control{ type: 'number' } - - = f.submit 'Save', class: 'btn btn-primary' + - else + %input{ type: 'checkbox', name: 'checkbox' } + = option + %br + .kinds.string{ class: @survey_question.string? ? '' : 'hidden' } + %input.form-control + .kinds.text{ class: @survey_question.text? ? '' : 'hidden' } + %textarea.form-control{ rows: 4 } + .kinds.datetime{ class: @survey_question.datetime? ? '' : 'hidden' } + .form-group{ class: 'datetimepicker' } + .input-group + .input-group-addon + %span.fa.fa-calendar + %input.form-control{ readonly: 'readonly' } + .kinds.numeric{ class: @survey_question.numeric? ? '' : 'hidden' } + %input.form-control{ type: 'number' } diff --git a/app/views/admin/surveys/_form.html.haml b/app/views/admin/surveys/_form.html.haml index d01eb467..ef35538f 100644 --- a/app/views/admin/surveys/_form.html.haml +++ b/app/views/admin/surveys/_form.html.haml @@ -7,12 +7,22 @@ %h1 Edit Survey: #{ @survey.title } .col-md-6 - = semantic_form_for @survey, url: @url do |f| + = form_for @survey, url: @url do |f| = f.hidden_field :surveyable_type = f.hidden_field :surveyable_id - = f.input :title - = f.input :description, input_html: { rows: 3 } - = f.input :target, as: :select, collection: Survey.targets.keys, label: "When to ask" - = f.input :start_date, as: :string, input_html: { class: 'datetimepicker' } - = f.input :end_date, as: :string, input_html: { class: 'datetimepicker' } - = f.submit 'Save', class: 'btn btn-primary' + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 3, class: 'form-control' + .form-group + = f.label :target, "When to ask" + = f.select :target, Survey.targets.keys, class: 'form-control' + .form-group + = f.label :start_date + = f.text_field :start_date, class: 'datetimepicker', class: 'form-control' + = f.label :end_date + = f.text_field :end_date, class: 'datetimepicker', class: 'form-control' + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/surveys/_survey_question.html.haml b/app/views/admin/surveys/_survey_question.html.haml index bb7a54d3..485bd559 100644 --- a/app/views/admin/surveys/_survey_question.html.haml +++ b/app/views/admin/surveys/_survey_question.html.haml @@ -11,7 +11,6 @@ %label %input{ type: 'radio', name: "survey_submission[#{survey_question.id}][]", value: 'No', checked: survey_reply.text == 'No' } No - - elsif survey_question.choice? %input{ type: 'hidden', name: "survey_submission[#{survey_question.id}][]" } - possible_answers = survey_question.possible_answers.split(',').map(&:strip) diff --git a/app/views/admin/surveys/show.html.haml b/app/views/admin/surveys/show.html.haml index 27f8b2c8..521fed7c 100644 --- a/app/views/admin/surveys/show.html.haml +++ b/app/views/admin/surveys/show.html.haml @@ -21,12 +21,9 @@ = link_to 'Stats' , '#stats-content', 'data-toggle' => 'tab' .tab-content .tab-pane.active#questions-content - = semantic_form_for 'survey_submission', url: '#' do |f| - - @survey.survey_questions.each.with_index(1) do |survey_question, question_index| - .row - .col-md-12 - - survey_reply = survey_question.survey_replies.new(survey_question_id: survey_question.id, user_id: current_user.id) - = render partial: 'survey_question', locals: { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply } + - @survey.survey_questions.each.with_index(1) do |survey_question, question_index| + - survey_reply = survey_question.survey_replies.new(survey_question_id: survey_question.id, user_id: current_user.id) + = render partial: 'survey_question', locals: { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply } = link_to 'Add Question', new_admin_conference_survey_survey_question_path(@conference.short_title, @survey), class: 'btn btn-success pull-right' .tab-pane#replies-content = render partial: 'survey_replies' diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index 8e07116f..54f82c50 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -1,18 +1,25 @@ -.row - .col-md-12 - .page-header - %h1 - - if @ticket.new_record? - New - = @ticket.title - Ticket -.row - .col-md-8 - = semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f| - = f.input :title, input_html: { autofocus: true } - = f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } } - = f.input :price - = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false - = f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.' - %p.text-right - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f| + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, required: true, autofocus: true, class: 'form-control' + .form-group + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + .form-group + = f.label :price + = f.number_field :price, class: 'form-control' + - if Ticket.where(conference: @conference).empty? + .form-group + = f.label :price_currency, 'Currency' + = f.select :price_currency, ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], { include_blank: false }, { class: 'form-control' } + - else + = hidden_field_tag "ticket[price_currency]", f.object.conference.tickets.first.price_currency + %span.help-block + Your conference tickets are in + = f.object.conference.tickets.first.price_currency + .checkbox + %label + = f.check_box :registration_ticket + A registration ticket is with which user register for the conference. + %p.text-right + = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/tickets/edit.html.haml b/app/views/admin/tickets/edit.html.haml new file mode 100644 index 00000000..01dd790d --- /dev/null +++ b/app/views/admin/tickets/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Ticket + = @ticket.title +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/tickets/new.html.haml b/app/views/admin/tickets/new.html.haml new file mode 100644 index 00000000..2481b479 --- /dev/null +++ b/app/views/admin/tickets/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + Create Ticket +.row + .col-md-8 + = render partial: 'form' diff --git a/app/views/admin/tracks/_form.html.haml b/app/views/admin/tracks/_form.html.haml index 7c9fda4e..24f0913d 100644 --- a/app/views/admin/tracks/_form.html.haml +++ b/app/views/admin/tracks/_form.html.haml @@ -1,28 +1,2 @@ -.row - .col-md-12 - .page-header - %h1 - -if @track.new_record? - New - = @track.name - Track -.row - .col-md-12 - = semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f| - = f.input :name, input_html: { autofocus: true } - = f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' } - = f.input :color, input_html: {size: 6, type: 'color'}, required: true - = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, required: @track.self_organized_and_accepted_or_confirmed? } - = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', required: @track.self_organized_and_accepted_or_confirmed? } - - if @conference.venue.try(:rooms).present? - = f.input :room, as: :select, collection: (@conference.venue.rooms).map {|room| ["#{room.name}", room.id]}, include_blank: true, label: 'Room', input_html: { class: 'select-help-toggle', required: @track.self_organized_and_accepted_or_confirmed? } - - else - %b - Please add a - = link_to 'venue', admin_conference_venue_path(@conference.short_title) - with - = link_to 'rooms', admin_conference_venue_rooms_path(@conference.short_title) - , if you want to select a room for the track. - = f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, hint: markdown_hint - = f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f| + = render partial: 'tracks/form_fields', locals: { f: f } diff --git a/app/views/admin/tracks/edit.html.haml b/app/views/admin/tracks/edit.html.haml new file mode 100644 index 00000000..8d29ea44 --- /dev/null +++ b/app/views/admin/tracks/edit.html.haml @@ -0,0 +1,9 @@ +.row + .col-md-12 + .page-header + %h1 + Edit Tack + = @track.name +.row + .col-md-12 + = render partial: 'form' diff --git a/app/views/admin/tracks/new.html.haml b/app/views/admin/tracks/new.html.haml new file mode 100644 index 00000000..9fde2274 --- /dev/null +++ b/app/views/admin/tracks/new.html.haml @@ -0,0 +1,8 @@ +.row + .col-md-12 + .page-header + %h1 + New Track +.row + .col-md-12 + = render partial: 'form' diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml deleted file mode 100644 index 7604f0d3..00000000 --- a/app/views/admin/users/_form.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -= semantic_form_for [:admin, @user] do |f| - = f.inputs 'Basic Information' do - - unless @user.new_record? - .pull-right - %b - Confirmed? - - if can? :toggle_confirmation, @user - = check_box_tag @user.id, @user.id, @user.confirmed?, - url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=", - class: 'switch-checkbox', - readonly: false - - else - = check_box_tag @user.id, @user.id, @user.confirmed?, - url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=", - class: 'switch-checkbox', - readonly: true - = f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.' - = f.input :name, as: :string - = f.input :username, :as => :string if @user.new_record? - = f.input :email - = f.input :password if @user.new_record? - = f.input :affiliation, as: :string - = f.input :biography, input_html: { rows: 10, data: { provide: 'markdown' } }, - hint: markdown_hint - = f.actions do - = f.action :submit, button_html: {class: 'btn btn-primary'} diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml new file mode 100644 index 00000000..f5f89e68 --- /dev/null +++ b/app/views/admin/users/new.html.haml @@ -0,0 +1,7 @@ +.row + .col-md-12 + .page-header + %h1 + Create User + = form_for [:admin, @user] do |f| + = render partial: 'devise/registrations/form_fields', locals: { f: f, full: true } diff --git a/app/views/admin/venues/_form.html.haml b/app/views/admin/venues/_form.html.haml index 1c68282f..960b01e4 100644 --- a/app/views/admin/venues/_form.html.haml +++ b/app/views/admin/venues/_form.html.haml @@ -12,17 +12,47 @@ .tab-content #details-content.tab-pane.active .col-md-8 - = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| - = f.inputs :name, :website - = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint - = f.label 'Venue Logo' - %br - - if @venue.picture? - = image_tag @venue.picture.thumb.url - = f.input :picture, label: false, hint: 'This will be displayed on the venue are of the splash page.' - = f.hidden_field :picture_cache - = f.inputs :street, :postalcode, :city, :country, :latitude, :longitude - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } + = form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| + .form-group + = f.label :name + %abbr{title: 'This field is required'} * + = f.text_field :name, required: true, class: 'form-control' + .form-group + = f.label :website + = f.url_field :website, class: 'form-control' + .form-group + = f.label :description + = f.text_area :description, rows: 5, cols: 20, data: { provide: 'markdown' } + %span.help-block + = markdown_hint + .form-group + = f.label 'Logo' + %br + - if @venue.picture? + = image_tag @venue.picture.thumb.url + = f.file_field :picture + = f.hidden_field :picture_cache + %span.help-block + This will be displayed on the venue are of the splash page. + .form-group + = f.label :street + %abbr{title: 'This field is required'} * + = f.text_field :street, required: true, class: 'form-control' + = f.label :postalcode + = f.text_field :postalcode, class: 'form-control' + = f.label :city + %abbr{title: 'This field is required'} * + = f.text_field :city, required: true, class: 'form-control' + .form-group + = f.label :country + = f.select :country, I18nData.countries.invert, { include_hidden: false }, { class: 'form-control' } + .form-group + = f.label :latitude + = f.text_field :latitude, class: 'form-control' + .form-group + = f.label :longitude + = f.text_field :longitude, class: 'form-control' + = f.submit nil, class: 'btn btn-primary' #commercials-content.tab-pane - if can? :create, @venue.commercial and @venue.id @@ -34,10 +64,13 @@ .row .col-md-6 - = semantic_form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, - hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| + .form-group + = f.label :url + = f.url_field :url, class: 'form-control', required: 'required' + %span.help-block + Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, class: 'btn btn-primary pull-right', id: 'commercial_submit_action', disabled: true %hr - else - if @venue.commercial.persisted? @@ -47,9 +80,13 @@ = render partial: 'shared/media_item', locals: { commercial: @venue.commercial } .caption - if can? :update, @venue.commercial - = semantic_form_for @venue.commercial, as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{@venue.commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider' - = f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update' + = form_for @venue.commercial, as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id) do |f| + .form-group + = f.label :url + = f.url_field :url, id: "commercial_url_#{@venue.commercial.id}", class: 'form-control', required: 'required' + %span.help-block + Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + = f.submit nil, class: 'btn btn-success' - if can? :destroy, @venue.commercial = link_to 'Delete', admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/application/edit.html.haml b/app/views/admin/venues/edit.html.haml similarity index 100% rename from app/views/application/edit.html.haml rename to app/views/admin/venues/edit.html.haml diff --git a/app/views/application/new.html.haml b/app/views/admin/venues/new.html.haml similarity index 100% rename from app/views/application/new.html.haml rename to app/views/admin/venues/new.html.haml diff --git a/app/views/admin/volunteers/_vday_fields.html.erb b/app/views/admin/volunteers/_vday_fields.html.erb deleted file mode 100644 index 21c40b23..00000000 --- a/app/views/admin/volunteers/_vday_fields.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -
- <%= f.inputs do %> - <%= f.date_select :day %> - <%= f.input :description, input_html: {rows: '2', class: 'col-md-8'} %> - <%= remove_association_link :vday, f %> - <% end %> -
diff --git a/app/views/admin/volunteers/_vday_fields.html.haml b/app/views/admin/volunteers/_vday_fields.html.haml new file mode 100644 index 00000000..b7cbc9a6 --- /dev/null +++ b/app/views/admin/volunteers/_vday_fields.html.haml @@ -0,0 +1,4 @@ +.nested-fields + = f.date_select :day + = f.text_field :description, rows: '2', class: 'col-md-8' + = remove_association_link :vday, f diff --git a/app/views/admin/volunteers/_vposition_fields.html.erb b/app/views/admin/volunteers/_vposition_fields.html.erb deleted file mode 100644 index f464fdbf..00000000 --- a/app/views/admin/volunteers/_vposition_fields.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -
- <%= f.inputs do %> - <%= f.input :title %> - <%= f.input :description, input_html: {rows: '2', class: 'col-md-8'}%> - <%= f.input :vdays, collection: @conference.vdays.map {|x| [x.day, x.id]}, label: 'Position is required for the following days:'%> - <%= remove_association_link :vposition, f %> - <% end %> -
diff --git a/app/views/admin/volunteers/_vposition_fields.html.haml b/app/views/admin/volunteers/_vposition_fields.html.haml new file mode 100644 index 00000000..152411d3 --- /dev/null +++ b/app/views/admin/volunteers/_vposition_fields.html.haml @@ -0,0 +1,6 @@ +.nested-fields + = f.text_field :title + = f.text_area :description, rows: '2', class: 'col-md-8' + = f.label :vdays, 'Position is required for the following days:' + = f.select :vdays, @conference.vdays.pluck(:day, :id) + = remove_association_link :vposition, f diff --git a/app/views/admin/volunteers/index.html.haml b/app/views/admin/volunteers/index.html.haml index fb4f274a..829bea3d 100644 --- a/app/views/admin/volunteers/index.html.haml +++ b/app/views/admin/volunteers/index.html.haml @@ -1,14 +1,15 @@ .row .col-md-8 - = semantic_form_for(@conference, url: admin_conference_volunteers_update_path(@conference.short_title)) do |f| - = f.action :submit, as: :button, button_html: {class: 'btn btn-primary'} - %br - %br - = f.input :use_volunteers, label: 'Enable Volunteering' - .row - .col-md-6 - = f.input :use_vdays, label: false - = dynamic_association :vdays, "Volunteer Days", f - .col-md-6 - = f.input :use_vpositions, label: false - = dynamic_association :vpositions, "Volunteer positions", f + = form_for(@conference, url: admin_conference_volunteers_update_path(@conference.short_title)) do |f| + = f.submit nil, class: 'btn btn-primary' + .checkbox + %label + = f.check_box :use_volunteers + Enable Volunteering + .checkbox + %label + = f.check_box :use_vdays + = dynamic_association :vdays, "Volunteer Days", f + .col-md-6 + = f.check_box :use_vpositions + = dynamic_association :vpositions, "Volunteer positions", f diff --git a/app/views/application/_donut_chart.haml b/app/views/application/_donut_chart.haml index 351ff216..8a65e390 100644 --- a/app/views/application/_donut_chart.haml +++ b/app/views/application/_donut_chart.haml @@ -1,16 +1,8 @@ :ruby combined_data ||= {} data ||= chart_values(combined_data) - colors ||= chart_colors(combined_data) - - options = { - donut: true, - legend: 'bottom', - download: true, - messages: { empty: 'No data' } - } - options[:colors] = colors if colors.present? .text-center - %h4= title - = pie_chart data, options + %h4 + = title + = pie_chart data, donut: true, legend: 'bottom', download: true, messages: { empty: 'No data' }, colors: chart_colors(combined_data) diff --git a/app/views/application/_line_chart.html.haml b/app/views/application/_line_chart.html.haml index b3dbf7be..7fc2cdfd 100644 --- a/app/views/application/_line_chart.html.haml +++ b/app/views/application/_line_chart.html.haml @@ -1,10 +1,3 @@ -:ruby - options = { - legend: 'bottom', - download: true, - messages: { empty: 'No data' } - } - .row .col-md-12 .text-center @@ -12,4 +5,4 @@ = title .row .col-md-12 - = line_chart data, options + = line_chart data, legend: 'bottom', download: true, messages: { empty: 'No data' } diff --git a/app/views/booths/_form.html.haml b/app/views/booths/_form.html.haml index 8135de50..a7dbfd65 100644 --- a/app/views/booths/_form.html.haml +++ b/app/views/booths/_form.html.haml @@ -1,30 +1,70 @@ -.container - .row - .col-md-8 - = semantic_form_for(@booth, url: @url, html: { multipart: true }) do |f| - = f.input :title, as: :string, input_html: { autofocus: true }, required: true - = f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true, - hint: 'This field becomes public upon request acceptance' - = f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true, - label: 'How it fits the conference' - = f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true, - label: 'Submitter\'s relation', - hint: 'e.g. employee, comunity manager, etc' - = f.input :website_url - = responsibles_selector_input f - = image_tag f.object.picture.thumb.url if f.object.picture? - = f.input :picture += form_for(@booth, url: @url) do |f| + .form-group + = f.label :title, 'Title' + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control', placeholder: 'Title' + .form-group + = f.label :description, 'Description' + %abbr{title: 'This field is required'} * + = f.text_area :description, rows: 5, data: { provide: 'markdown' }, required: true, class: 'form-control' + %span.help-block + This field becomes public upon request acceptance + .form-group + = f.label :reasoning, 'How it fits the conference' + %abbr{title: 'This field is required'} * + = f.text_area :reasoning, rows: 5, data: { provide: 'markdown' }, required: true, class: 'form-control' + .form-group + = f.label :submitter_relationship, 'Submitter\'s relation' + %abbr{title: 'This field is required'} * + = f.text_field :submitter_relationship, rows: 5, required: true, class: 'form-control' + %span.help-block + e.g. employee, comunity manager, etc + .form-group + = f.label :website_url, 'Website URL' + %abbr{title: 'This field is required'} * + = f.text_field :website_url, class: 'form-control', required: true, placeholder: 'URL' + .form-group + = f.text_field :responsible_ids, multiple: true, class: "form-control", id: "booth_responsibles", placeholder: "Responsibles" + %span.help-block + The people responsible for the `t('booth')`. You can only select existing users. + .form-group + = image_tag f.object.picture.thumb.url if f.object.picture? + = f.label :picture, 'Picture' + = f.file_field :picture + %p.text-right + %button{type: 'submit', class: 'btn btn-success'} + - if @booth.new_record? + Create `(t'booth').capitalize` Request + - else + Update `(t'booth').capitalize` Request - %p.text-right - - if @booth.new_record? - = f.submit "Create #{(t'booth').capitalize } Request", class: 'btn btn-success' - - else - = f.submit "Update #{(t'booth').capitalize } Request", class: 'btn btn-success' - - :javascript - $(document).ready(function() { - $('#booth_responsible_ids').selectize({ - plugins: ['remove_button'], - minItems: 2 - } ) +:javascript + $(document).ready(function() { + $('#booth_responsibles').selectize({ + persist: false, + create: false, + valueField: 'id', + labelField: 'username', + searchField: 'username', + load: function(query, callback) { + if (!query.length) return callback(); + $.ajax({ + url: "#{search_users_path}.json", + type: 'GET', + dataType: 'json', + data: { + query: query, + }, + error: function(res) { + console.log("selectize error"); + callback(); + }, + success: function(res) { + console.log("selectize success"); + // console.log(res); + callback(res.users); + } + }); + } }); + }); diff --git a/app/views/booths/edit.html.haml b/app/views/booths/edit.html.haml index 9f60196d..61dc072e 100644 --- a/app/views/booths/edit.html.haml +++ b/app/views/booths/edit.html.haml @@ -1,6 +1,9 @@ -.container - %h1 - Editing - = @booth.title - - = render 'form' +.row + .col-md-12 + .page-header + %h1 + Edit Booth + = @booth.title +.row + .col-md-8 + = render 'form' diff --git a/app/views/booths/index.html.haml b/app/views/booths/index.html.haml index a1b37cc1..895e5447 100644 --- a/app/views/booths/index.html.haml +++ b/app/views/booths/index.html.haml @@ -1,51 +1,50 @@ -.container - .row - .col-md-12.page-header - %h1 - Your #{t'booth'} requests for - = @conference.title - .row - .col-md-12 - .margin-booth-table - %table.table.table-striped.table-hover - %thead - %th - %b State - %th - %b Logo - %th - %b Title - %th - %b Actions - - @booths.each do |booth| - %tr - %td{ style: "padding:20px 8px 20px 8px;" } - - if (booth.state == 'to_accept' || booth.state == 'to_reject') - - show_state = 'new' - - else - - show_state = booth.state - %span{ title: show_state, class: "fa #{status_icon(booth)}" } - %td - - if booth.logo_link - = image_tag(booth.picture.thumb.url, width: '20%') - %td - = link_to booth.title, conference_booth_path(@conference.short_title, booth) - %td - -if can? :edit, booth - = link_to 'Edit', edit_conference_booth_path(@conference.short_title, booth.id), - class: 'btn btn-default' - - if booth.transition_possible? :withdraw - = link_to 'Withdraw', - withdraw_conference_booth_path(@conference.short_title, booth), - method: :patch, class: 'btn btn-mini btn-warning', id: "withdraw_booth_#{booth.id}", - data: { confirm: 'Are you sure you really want to withdraw this request?' } - - if booth.transition_possible? :confirm - = link_to 'Confirm', - confirm_conference_booth_path(@conference.short_title, booth), - method: :patch, class: 'btn btn-mini btn-success', id: "confirm_booth_#{booth.id}" - - if booth.transition_possible? :restart - = link_to 'Re-submit', - restart_conference_booth_path(@conference.short_title, booth), - method: :patch, class: 'btn btn-mini btn-success', id: "restart_booth_#{booth.id}" - .pull-right - = link_to "Add #{(t'booth').capitalize }", new_conference_booth_path(@conference.short_title), class: 'button btn btn-primary' +.row + .col-md-12.page-header + %h1 + Your #{t'booth'} requests for + = @conference.title +.row + .col-md-12 + .margin-booth-table + %table.table.table-striped.table-hover + %thead + %th + %b State + %th + %b Logo + %th + %b Title + %th + %b Actions + - @booths.each do |booth| + %tr + %td{ style: "padding:20px 8px 20px 8px;" } + - if (booth.state == 'to_accept' || booth.state == 'to_reject') + - show_state = 'new' + - else + - show_state = booth.state + %span{ title: show_state, class: "fa #{status_icon(booth)}" } + %td + - if booth.logo_link + = image_tag(booth.picture.thumb.url, width: '20%') + %td + = link_to booth.title, conference_booth_path(@conference.short_title, booth) + %td + -if can? :edit, booth + = link_to 'Edit', edit_conference_booth_path(@conference.short_title, booth.id), + class: 'btn btn-default' + - if booth.transition_possible? :withdraw + = link_to 'Withdraw', + withdraw_conference_booth_path(@conference.short_title, booth), + method: :patch, class: 'btn btn-mini btn-warning', id: "withdraw_booth_#{booth.id}", + data: { confirm: 'Are you sure you really want to withdraw this request?' } + - if booth.transition_possible? :confirm + = link_to 'Confirm', + confirm_conference_booth_path(@conference.short_title, booth), + method: :patch, class: 'btn btn-mini btn-success', id: "confirm_booth_#{booth.id}" + - if booth.transition_possible? :restart + = link_to 'Re-submit', + restart_conference_booth_path(@conference.short_title, booth), + method: :patch, class: 'btn btn-mini btn-success', id: "restart_booth_#{booth.id}" + .pull-right + = link_to "Add #{(t'booth').capitalize }", new_conference_booth_path(@conference.short_title), class: 'button btn btn-primary' diff --git a/app/views/booths/new.html.haml b/app/views/booths/new.html.haml index 6713d312..efacb85e 100644 --- a/app/views/booths/new.html.haml +++ b/app/views/booths/new.html.haml @@ -1,4 +1,8 @@ -.container - %h1 Request a #{t'booth'} - - = render 'form' +.row + .col-md-12 + .page-header + %h1 + Request a #{t'booth'} +.row + .col-md-8 + = render 'form' diff --git a/app/views/commercials/edit.html.haml b/app/views/commercials/edit.html.haml deleted file mode 100644 index 174a1a60..00000000 --- a/app/views/commercials/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.container - .row - .col-md-12 - .page-header - %h1 Editing Commercial - .row - .col-md-12 - = semantic_form_for @commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event.id, id: @commercial.id) do |f| - = render 'form', f: f diff --git a/app/views/commercials/new.html.haml b/app/views/commercials/new.html.haml deleted file mode 100644 index da726e89..00000000 --- a/app/views/commercials/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.container - .row - .col-md-12 - .page-header - %h1 New Commercial - .row - .col-md-12 - = semantic_form_for @commercial, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event.id) do |f| - = render 'form', f: f diff --git a/app/views/conference_registrations/_form.html.haml b/app/views/conference_registrations/_form.html.haml index 1dd5f175..3a776ef7 100644 --- a/app/views/conference_registrations/_form.html.haml +++ b/app/views/conference_registrations/_form.html.haml @@ -1,34 +1,9 @@ -.container - .row - .col-md-12 - .page-header - %h1 - Registration for - = @conference.title - .row - .col-md-8 - - unless current_user - %legend - %span - =link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do - = ENV['OSEM_NAME'] || 'OSEM' - Account - %span.pull-right#account-already - =link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do - Already have an account? - .tab-content - .tab-pane.active{role: 'tabpanel', id: 'signup'} - = semantic_form_for(@registration, url: conference_conference_registration_path(@conference.short_title)) do |f| - = render partial: 'devise/shared/sign_up_form_embedded' - - = render partial: 'registration_info', locals: { f: f } - = f.input :conference_id, as: :hidden, value: @conference.id - .row - .col-md-12 - %p.pull-right - - if @conference.user_registered?(current_user) - = f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' } - - else - =f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' } - .tab-pane{role: 'tabpanel', id: 'signin'} - = render partial: 'devise/shared/sign_in_form_embedded' += form_for(@registration, url: conference_conference_registration_path(@conference.short_title)) do |f| + = render partial: 'devise/registrations/new_embedded' + = render partial: 'registration_info', locals: { f: f } + = f.hidden_field :conference_id, value: @conference.id + %p.pull-right + - if @conference.user_registered?(current_user) + = f.submit 'Update Registration', { class: 'btn btn-primary' } + - else + =f.submit 'Register', { class: 'btn btn-primary', id: 'register' } diff --git a/app/views/conference_registrations/_registration_info.html.haml b/app/views/conference_registrations/_registration_info.html.haml index 5fdd9bf4..b7cae0ff 100644 --- a/app/views/conference_registrations/_registration_info.html.haml +++ b/app/views/conference_registrations/_registration_info.html.haml @@ -6,22 +6,25 @@ I have read and accepted the = code_of_conduct_link - else - = f.input :accepted_code_of_conduct, - label: "I have read and accept the #{code_of_conduct_link}".html_safe, - required: true + .checkbox + %label + = f.check_box :accepted_code_of_conduct, required: true + I have read and accept the + = code_of_conduct_link + %abbr{title: 'This field is required'} * - if @conference.program.events.with_registration_open.any? || @registration.events.any? - = f.inputs 'Pre-registration required for the following:' do - - - @registration.events_ordered.each do |event| - %label - = hidden_field_tag "registration[event_ids][]", nil - = check_box_tag "registration[event_ids][]", event.id, event.registrations.include?(@registration) - = event.title - .text-muted - = registered_text(event) - - if event.scheduled? - (Scheduled on: #{event.time.to_date}) - %br + %h4 + Pre-registration required for the following: + - @registration.events_ordered.each do |event| + %label + = hidden_field_tag "registration[event_ids][]", nil + = check_box_tag "registration[event_ids][]", event.id, event.registrations.include?(@registration) + = event.title + .text-muted + = registered_text(event) + - if event.scheduled? + (Scheduled on: #{event.time.to_date}) + %br = render 'conferences/code_of_conduct', organization: @conference.organization diff --git a/app/views/conference_registrations/edit.html.haml b/app/views/conference_registrations/edit.html.haml new file mode 100644 index 00000000..25a22666 --- /dev/null +++ b/app/views/conference_registrations/edit.html.haml @@ -0,0 +1,23 @@ +.container + .row + .col-md-12 + .page-header + %h1 + Registration for + = @conference.title + .row + .col-md-8 + - unless current_user + %legend + %span + =link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + = ENV['OSEM_NAME'] || 'OSEM' + Account + %span.pull-right#account-already + =link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + Already have an account? + .tab-content + .tab-pane.active{role: 'tabpanel', id: 'signup'} + = render partial: 'form' + .tab-pane{role: 'tabpanel', id: 'signin'} + = render partial: 'devise/sessions/new_embedded' diff --git a/app/views/conference_registrations/new.html.haml b/app/views/conference_registrations/new.html.haml new file mode 100644 index 00000000..25a22666 --- /dev/null +++ b/app/views/conference_registrations/new.html.haml @@ -0,0 +1,23 @@ +.container + .row + .col-md-12 + .page-header + %h1 + Registration for + = @conference.title + .row + .col-md-8 + - unless current_user + %legend + %span + =link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + = ENV['OSEM_NAME'] || 'OSEM' + Account + %span.pull-right#account-already + =link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + Already have an account? + .tab-content + .tab-pane.active{role: 'tabpanel', id: 'signup'} + = render partial: 'form' + .tab-pane{role: 'tabpanel', id: 'signin'} + = render partial: 'devise/sessions/new_embedded' diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 8df4efc1..1aa00e55 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -6,9 +6,13 @@ %h3.panel-title Resend confirmation instructions .panel-body - = semantic_form_for(resource, as: resource_name, url: confirmation_path(resource_name), method: :post) do |f| - = f.input :email, input_html: { autofocus: true, required: true } + = form_for(resource, as: resource_name, url: confirmation_path(resource_name), method: :post) do |f| + .form-group + = f.label :email, "Email" + %abbr{title: 'This field is required'} * + = f.email_field :email, autofocus: true, required: true, class: 'form-control', placeholder: 'Email' %p.text-right - = f.action :submit, as: :button, label: 'Submit', button_html: { class: 'btn btn-success' } + %button{type: 'submit', class: 'btn btn-success'} + Send me reset password instructions = render partial: 'devise/shared/help' diff --git a/app/views/devise/ichain_sessions/new.html.haml b/app/views/devise/ichain_sessions/new.html.haml index 0d873e06..1d0a25ee 100644 --- a/app/views/devise/ichain_sessions/new.html.haml +++ b/app/views/devise/ichain_sessions/new.html.haml @@ -6,15 +6,21 @@ %h3.panel-title Sign in .panel-body - = semantic_form_for '', method: :post, enctype: 'application/x-www-form-urlencoded', url: @login_url do |f| - = f.input :url, as: :hidden, input_html: { value: @back_url } - = f.input :context, as: :hidden, input_html: { value: @context } - = f.input :proxypath, as: :hidden, input_html: { value: @proxypath } - - = f.input :username, input_html: { autofocus: true } - = f.input :password, as: :password + = form_for(@login_url, method: :post, enctype: 'application/x-www-form-urlencoded', id: 'session' do |f| + = f.hidden_field :url, value: @back_url + = f.hidden_field :context, value: @context + = f.hidden_field :proxypath, value: @proxypath + .form-group + = f.label :username, "Username" + %abbr{title: 'This field is required'} * + = f.text_field :username, autofocus: true, required: true, class: 'form-control', placeholder: 'Username' + .form-group + = f.label :password, "Password" + %abbr{title: 'This field is required'} * + = f.password_field :password, required: true, class: 'form-control', placeholder: 'Password' %p.text-right - = f.action :submit, as: :button, label: 'Sign In', button_html: { class: 'btn btn-success' } + %button{type: 'submit', class: 'btn btn-success'} + Sign In = render partial: 'devise/shared/help' diff --git a/app/views/devise/ichain_sessions/new_test.html.haml b/app/views/devise/ichain_sessions/new_test.html.haml index 9dcb1ccf..4540f151 100644 --- a/app/views/devise/ichain_sessions/new_test.html.haml +++ b/app/views/devise/ichain_sessions/new_test.html.haml @@ -3,17 +3,21 @@ .col-md-6.col-md-offset-3 .panel.panel-default .panel-heading - %h3.panel-title - Sign in (TEST MODE) + %h3 Sign In (TEST MODE) + %p.text-muted + Just fill out all the details and you're logged in. .panel-body - = semantic_form_for "", method: :post, enctype: 'application/x-www-form-urlencoded', url: @login_url do |f| - = f.input :username, input_html: { autofocus: true } - - - if ::Devise.ichain_force_test_attributes.blank? + = form_tag(@login_url, method: :post, enctype: 'application/x-www-form-urlencoded', id: 'session') do + .form-group + = label_tag :username, "Username" + = text_field_tag :username, "", :autofocus => true, :placeholder => 'Username', :class => 'form-control', :required => "required" + .form-group - @fields.each do |field| - = f.input "attributes[#{field}]", label: field.to_s.humanize - + = label_tag "attributes[#{field}]", field.to_s.humanize + = text_field_tag "attributes[#{field}]", nil, :class => 'form-control', :required => "required" %p.text-right - = f.action :submit, as: :button, label: 'Sign In', button_html: { class: 'btn btn-success' } + %button{type: 'submit', class: 'btn btn-success'} + Sign In - = render partial: 'devise/shared/help' + - if devise_mapping.ichain_registerable? + = link_to "Sign up", new_ichain_registration_path(resource_name) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml deleted file mode 100644 index 1f3f785d..00000000 --- a/app/views/devise/passwords/edit.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -.container - .row - .col-md-6.col-md-offset-3 - .panel.panel-default - .panel-heading - %h3.panel-title - Change your password - .panel-body - = semantic_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| - = f.hidden_field :reset_password_token - = f.input :password, input_html: { autofocus: true, required: true, autocomplete: "off"}, label: 'New password' - = f.input :password_confirmation, input_html: { required: true, autocomplete: "off" }, label: 'New password confirmation' - %p.text-right - = f.action :submit, as: :button, label: 'Change my password', button_html: { class: 'btn btn-success' } - - = render partial: 'devise/shared/help' diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 24a061a8..49765d77 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -6,9 +6,13 @@ %h3.panel-title Forgot your password? .panel-body - = semantic_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| - = f.input :email, input_html: { autofocus: true, required: true} + = form_for(resource, as: resource_name, url: password_path(resource_name), method: :post) do |f| + .form-group + = f.label :email, "Email" + %abbr{title: 'This field is required'} * + = f.email_field :email, autofocus: true, required: true, class: 'form-control', placeholder: 'Email' %p.text-right - = f.action :submit, as: :button, label: 'Send me reset password instructions', button_html: { class: 'btn btn-success' } + %button{type: 'submit', class: 'btn btn-success'} + Send me reset password instructions = render partial: 'devise/shared/help' diff --git a/app/views/devise/registrations/_form_fields.html.haml b/app/views/devise/registrations/_form_fields.html.haml new file mode 100644 index 00000000..88ab0d39 --- /dev/null +++ b/app/views/devise/registrations/_form_fields.html.haml @@ -0,0 +1,49 @@ +.form-group + = f.label :username + %abbr{title: 'This field is required'} * + = f.text_field :username, required: true, autocomplete: 'off', class: 'form-control', placeholder: 'Username' +.form-group + = f.label :email + %abbr{title: 'This field is required'} * + = f.email_field :email, required: true, autocomplete: 'off', class: 'form-control', placeholder: 'Email' +- if local_assigns[:full] + .checkbox + %label + = f.check_box :email_public + Check if you want your email address to appear publicly (e.g. on sessions, registration lists, etc.) + .form-group + = f.label :name, 'Real Name' + = f.text_field :name, required: true, class: 'form-control', placeholder: 'Name' +.form-group + = f.label :password, 'Password' + %abbr{title: 'This field is required'} * + = f.password_field :password, required: true, class: 'form-control', placeholder: 'Password' +.form-group + = f.label :password_confirmation, 'Password Confirmation' + = f.password_field :password_confirmation, required: true, class: 'form-control', placeholder: 'Password Confirmation' +- if @user.persisted? + %p.text-muted + Leave blank if you don't want to change your password + = render partial: 'form_fields_openid', locals: { f: f } +- if current_user.try(:is_admin?) + .checkbox + %label + = f.check_box :is_admin + is Admin? + %span.help-block + An admin can create a new conference, manage users and make other users admins. +- elsif @user.persisted? + %h4 + Confirmation + %hr + .form-group + = f.label :password, "Current Password" + %abbr{title: 'This field is required'} * + = f.password_field :current_password, autocomplete: 'off', class: 'form-control', placeholder: 'Password' + %p.text-muted + We need your current password to confirm password, email or username changes +- Feature.with(:recaptcha) do + .form-group + = recaptcha_tags +%p.text-right + = f.submit nil, class: 'btn btn-success' diff --git a/app/views/devise/registrations/_form_fields_openid.html.haml b/app/views/devise/registrations/_form_fields_openid.html.haml new file mode 100644 index 00000000..187e4f19 --- /dev/null +++ b/app/views/devise/registrations/_form_fields_openid.html.haml @@ -0,0 +1,23 @@ +- if omniauth_configured.present? && @user == current_user + %h4 + OpenID + %hr + - openids = Openid.where(user: @user).order(:provider) + - if openids.any? + %p + Currently the following openIDs are associated with your account + - openids.each do |openid| + %li{ style: "list-style: none; margin-left: 20px;" } + = link_to user_openid_path(openid, user_id: current_user.id), method: :delete, + data: { confirm: "Remove association with #{openid.provider} account?" } do + %span.fa.fa-times{ style: "color: red;" } + %span #{openid.provider}:#{openid.email} + %br + - else + %p + Currently there are no openIDs are associated with your account. + %p + To add an openID with a different email address to your account, sign in with your + openID while logged in to OSEM + #openidlinks + = render 'devise/shared/openid_links' diff --git a/app/views/devise/registrations/_new_embedded.html.haml b/app/views/devise/registrations/_new_embedded.html.haml new file mode 100644 index 00000000..2ced9882 --- /dev/null +++ b/app/views/devise/registrations/_new_embedded.html.haml @@ -0,0 +1,5 @@ +- unless current_user + = fields_for @user do |u| + = render partial: 'devise/registrations/form_fields', locals: { f: u } + = render partial: 'devise/shared/openid' + = render partial: 'devise/shared/help' diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 928c292f..73ff1162 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -5,30 +5,5 @@ %h1 Edit your Account .row .col-md-12 - = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| - = f.input :username, required: false, input_html: { autocomplete: 'off' } - = f.input :email, required: false, input_html: { autocomplete: 'off' } - = f.input :email_public, - hint: "Do you want your email address to appear publicly? (e.g. on sessions, registration lists, etc.)" - = f.input :password, hint: "(Leave blank if you don't want to change it)", input_html: { autocomplete: 'off' } - = f.input :password_confirmation, input_html: { autocomplete: 'off' } - = f.inputs name: 'OpenID' do - %h4 - Currently the following openIDs are associated with your account - - @openids.each do |openid| - %li{ style: "list-style: none; margin-left: 20px;" } - = link_to user_openid_path(openid, user_id: current_user.id), method: :delete, - data: { confirm: "Remove association with #{openid.provider} account?" } do - %span.fa.fa-times{ style: "color: red;" } - %span #{openid.provider}:#{openid.email} - %br - %h4 - To add an openID with a different email address to your account, sign in with your - openID while logged in to OSEM - - if User.omniauth_providers.present? - #openidlinks - = render 'devise/shared/openid_links' - = f.inputs name: 'Confirmation' do - = f.input :current_password, input_html: {autocomplete: 'off'}, - hint: '(we need your current password to confirm password, email or username changes)' - = f.action :submit, as: :button, label: 'Update Account', button_html: {class: 'btn btn-primary'} + = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| + = render partial: 'form_fields', locals: { f: f, full: true, edit: true } diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 64aaa99e..1215e5de 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -6,16 +6,8 @@ %h3.panel-title Sign Up .panel-body - = semantic_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| - = f.input :username, input_html: { required: true }, hint: 'This is how the other users see you, not your real name' - = f.input :email, input_html: { required: true } - = f.input :name, input_html: { required: true }, hint: 'This is your real name' - = f.input :password, input_html: { required: true } - = f.input :password_confirmation, input_html: { required: true } - - Feature.with(:recaptcha) do - = recaptcha_tags - %p.text-right - = f.action :submit, as: :button, label: 'Sign Up', button_html: { class: 'btn btn-success' } + = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| + = render partial: 'form_fields', locals: { f: f } = render partial: 'devise/shared/openid' = render partial: 'devise/shared/help' diff --git a/app/views/devise/sessions/_form_fields.html.haml b/app/views/devise/sessions/_form_fields.html.haml new file mode 100644 index 00000000..8f29c0fa --- /dev/null +++ b/app/views/devise/sessions/_form_fields.html.haml @@ -0,0 +1,15 @@ +.form-group + = f.label :login, "Username" + %abbr{title: 'This field is required'} * + = f.text_field :login, autofocus: true, required: true, class: 'form-control', placeholder: 'Username' +.form-group + = f.label :password, "Password" + %abbr{title: 'This field is required'} * + = f.password_field :password, required: true, class: 'form-control', placeholder: 'Password' +- if devise_mapping.rememberable? + %p.text-right.small + = f.label 'Remember me' + = f.check_box :remember_me +%p.text-right + %button{type: 'submit', class: 'btn btn-success'} + Sign In diff --git a/app/views/devise/shared/_sign_in_form_embedded.html.haml b/app/views/devise/sessions/_new_embedded.html.haml similarity index 96% rename from app/views/devise/shared/_sign_in_form_embedded.html.haml rename to app/views/devise/sessions/_new_embedded.html.haml index 362fc695..16f21c52 100644 --- a/app/views/devise/shared/_sign_in_form_embedded.html.haml +++ b/app/views/devise/sessions/_new_embedded.html.haml @@ -21,5 +21,5 @@ %p.text-right %a.small.btn.btn-default{"data-toggle" => "collapse", "data-target" => "#devise-help-sign-in"} Need Help? - #devise-help-sign-in.collapse + .collapse#devise-help-sign-in = render partial: 'devise/shared/links' diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 2c1bb613..f2f637d1 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -6,14 +6,7 @@ %h3.panel-title Sign In .panel-body - = semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| - = f.input :login - = f.input :password - - if devise_mapping.rememberable? - %p.text-right.small - = f.label 'Remember me' - = f.check_box :remember_me - %p.text-right - = f.action :submit, as: :button, label: 'Sign In', button_html: {class: 'btn btn-success'} + = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| + = render partial: 'form_fields', locals: { f: f } = render partial: 'devise/shared/openid' = render partial: 'devise/shared/help' diff --git a/app/views/devise/shared/_sign_up_form_embedded.html.haml b/app/views/devise/shared/_sign_up_form_embedded.html.haml deleted file mode 100644 index 5bc038f0..00000000 --- a/app/views/devise/shared/_sign_up_form_embedded.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- unless current_user - = semantic_fields_for @user do |u| - = u.input :username, input_html: { required: 'required', autocomplete: 'off' } - = u.input :email, input_html: { required: 'required', autocomplete: 'off' } - = u.input :password, input_html: { required: 'required', autocomplete: 'off', id: 'password_inline' } - = u.input :password_confirmation, input_html: { required: 'required', autocomplete: 'off' } - = render partial: 'devise/shared/openid' - = render partial: 'devise/shared/help' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d4c194b9..7dfaf2c8 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -51,4 +51,3 @@ #{link_to "Skylight", ENV["SKYLIGHT_PUBLIC_DASHBOARD_URL"]}. = yield :script_body = yield :charts_js - = piwik_tracking_tag diff --git a/app/views/proposals/_commercial_form_fields.html.haml b/app/views/proposals/_commercial_form_fields.html.haml new file mode 100644 index 00000000..6f9b7ea0 --- /dev/null +++ b/app/views/proposals/_commercial_form_fields.html.haml @@ -0,0 +1,18 @@ +.form-group + = f.label :url + %abbr{title: 'This field is required'} * + = f.text_field :url, required: 'required', class: 'form-control' + %span.help-block + Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr. + .form-group + - if f.object.new_record? + = f.submit nil, class: 'btn btn-primary pull-right', id: 'commercial_submit_action', disabled: true + - else + = f.submit nil, class: 'btn btn-primary pull-right' + - if can? :destroy, commercial + = link_to('Delete', conference_program_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), + :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger') + - if f.object.versions.any? + .text-right + added by + = link_to_user(commercial.versions.last.whodunnit) diff --git a/app/views/proposals/_form.html.haml b/app/views/proposals/_form.html.haml index fe966ed1..248846e4 100644 --- a/app/views/proposals/_form.html.haml +++ b/app/views/proposals/_form.html.haml @@ -19,10 +19,8 @@ #resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' } .row .col-md-6 - = semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, - hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = form_for(@event.commercials.new, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f| + = render partial: 'proposals/commercial_form_fields', locals: { f: f, commercial: @event.commercials.build } %hr - @event.commercials.each_slice(3) do |slice| .row @@ -34,13 +32,6 @@ = render partial: 'shared/media_item', locals: { commercial: commercial } .caption - if can? :update, commercial - = semantic_form_for commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required', type: 'url' } - = f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update' - - if can? :destroy, commercial - = link_to 'Delete', conference_program_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), - :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' - - if commercial.versions.any? - .text-right - = "added by " - = link_to_user(commercial.versions.last.whodunnit) + = form_for(commercial, url: conference_program_proposal_commercial_path(conference_id: @conference.short_title, proposal_id: @event, id: commercial)) do |f| + = render partial: 'proposals/commercial_form_fields', locals: { f: f, commercial: commercial } + diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index d37ef28c..3571379e 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -1,37 +1,37 @@ -= semantic_form_for(@event, url: @url) do |f| - = f.inputs name: 'Proposal Information' do - = f.input :title, as: :string, input_html: { autofocus: true }, required: true - - = f.input :subtitle, as: :string - - = speaker_selector_input f - - = track_selector_input f - - = f.input :event_type_id, as: :select, - collection: @conference.program.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, - data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]}, - include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } - - - if @program.languages.present? - = f.input :language, as: :select, - collection: @languages, - include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' } - - - @conference.program.event_types.each do |event_type| - %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } - = event_type.description - - = f.input :difficulty_level, as: :select, collection: @conference.program.difficulty_levels, input_html: { class: 'select-help-toggle' }, - include_blank: '(Please select)' if @conference.program.difficulty_levels.any? - += form_for(@event, url: @url) do |f| + %h4 + Proposal Information + %hr + .form-group + = f.label :title + %abbr{title: 'This field is required'} * + = f.text_field :title, autofocus: true, required: true, class: 'form-control' + .form-group + = f.label :subtitle + = f.text_field :subtitle, class: 'form-control' + = # speaker_selector_input f + - if @program.tracks.confirmed.cfp_active.any? + = f.label :track_id, 'Track' + = f.select :track_id, @program.tracks.confirmed.cfp_active.pluck(:name, :id), include_blank: '(Please select)' + = f.label :event_type_id, 'Type' + = f.select :event_type_id, event_type_select_options(@conference.program.event_types), { include_blank: false }, { class: 'select-help-toggle form-control' } + - if @program.languages.present? + = f.label :language + = f.select :language, @languages, { include_blank: false}, { class: 'select-help-toggle form-control' } + - @conference.program.event_types.each do |event_type| + %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } + = event_type.description + - if @conference.program.difficulty_levels.any? + = f.label :difficulty_level + = f.select :difficulty_level_id, @conference.program.difficulty_levels.map{|level| [level.title, level.id ] }, {include_blank: false}, { class: 'select-help-toggle form-control' } - @conference.program.difficulty_levels.each do |difficulty_level| %span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" } = difficulty_level.description - - = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)') - + .form-group + = f.label :abstract + = f.text_area :abstract, required: true, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)') %p You have used %span#abstract-count #{@event.abstract_word_count} @@ -42,28 +42,35 @@ %span#abstract-maximum-word-count 250 words. - - - if current_user.is_admin? or @program.cfp&.enable_registrations? - = f.inputs 'Enable pre-registration' do - = f.input :require_registration, label: 'Require participants to register to your event' - - message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.' - = f.input :max_attendees, hint: 'The maximum number of participants. ' + message - - - if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference } - = f.input :is_highlight - + - if current_user.is_admin? || @program.cfp&.enable_registrations? + %h4 + Event Registration + %hr + .checkbox + %label + = f.check_box :require_registration + Require participants to register to your event + .form-group + = f.number_field :max_attendees + %span.help-block + - message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.' + = 'The maximum number of participants. ' + message + - if current_user.has_any_role?(:admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }) + .checkbox + %label + = f.check_box :is_highlight + Is a highlight? %p.text-right = link_to '#description', 'data-toggle' => 'collapse' do - Do you require something special? + Do you require something special for your event? #description{ class: "collapse #{ 'in' if @event.description.present? }" } - = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' - - + .form-group + = f.label :description, 'Requirements' + = f.text_area :description, rows: 5 + %span.help-block + Eg. Whiteboard, printer, or something like that. %p.text-right - - if @event.new_record? - = f.submit 'Create Proposal', class: 'btn btn-success' - - else - = f.submit 'Update Proposal', class: 'btn btn-success' + = f.submit 'Update Proposal', class: 'btn btn-success' :javascript $(document).ready(function() { diff --git a/app/views/proposals/new.html.haml b/app/views/proposals/new.html.haml index 63916751..f3e93ee8 100644 --- a/app/views/proposals/new.html.haml +++ b/app/views/proposals/new.html.haml @@ -24,30 +24,26 @@ Already have an account? .tab-content .tab-pane.active{role: 'tabpanel', id: 'signup'} - - = semantic_form_for(@event, url: @url) do |f| - - = render partial: 'devise/shared/sign_up_form_embedded' - - = f.inputs name: 'Proposal Information' do - = f.input :title, as: :string, required: true, input_html: { required: true } - = f.input :event_type_id, as: :select, - collection: @program.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, - data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]}, - include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } - - - if @program.languages.present? - = f.input :language, as: :select, - collection: @languages, - include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' } - - - @program.event_types.each do |event_type| - %span{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help" } - = event_type.description - - = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)') - + = form_for(@event, url: @url) do |f| + = render partial: 'devise/registrations/new_embedded' + %h4 + Proposal Information + %hr + .form-group + = f.label :title + = f.text_field :title, required: true, class: 'form-control' + = f.label :event_type_id, 'Type' + = f.select :event_type_id, @program.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id] }, { include_blank: false }, { class: 'select-help-toggle form-control' } + - if @program.languages.present? + = f.label :language + = f.select :language, @languages, include_blank: false, class: 'select-help-toggle form-control' + - @program.event_types.each do |event_type| + %span{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help" } + = event_type.description + .form-group + = f.label :abstract + = f.text_area :abstract, required: true, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block %p You have used %span#abstract-count #{@event.abstract_word_count} @@ -58,18 +54,21 @@ %span#abstract-maximum-word-count 250 words. - + = markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)') - if @program.cfp.enable_registrations? - = f.input :require_registration, label: 'Require participants to register to your event' - + .form-group + = f.label :require_registration, 'Require participants to register to your event' + = f.check_box :require_registration, class: 'form-control' %p.text-right = link_to '#description', 'data-toggle' => 'collapse', id: 'description_link' do - Do you require something special? + Do you require something special for your event? .collapse#description - = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' - + .form-group + = f.label :description, 'Requirements' + = f.text_area :description, rows: 5, class: 'form-control' + %span.help-block + Tell us what you need for your event. A whiteboard, a printer or something like that. %p.text-right = f.submit 'Create Proposal', class: 'btn btn-success' - .tab-pane{role: 'tabpanel', id: 'signin'} - = render partial: 'devise/shared/sign_in_form_embedded' + = render partial: 'devise/sessions/new_embedded' diff --git a/app/views/schedules/_schedule.html.haml b/app/views/schedules/_schedule.html.haml index 68dc9407..3b4c3dac 100644 --- a/app/views/schedules/_schedule.html.haml +++ b/app/views/schedules/_schedule.html.haml @@ -57,12 +57,4 @@ $(document).ready(function(){ // hide the left control when the page is ready $('.carousel').children('.left.carousel-control').hide(); - - // carousel swipe - $(".carousel-inner").swiperight(function() { - $(this).parent().carousel('prev'); - }); - $(".carousel-inner").swipeleft(function() { - $(this).parent().carousel('next'); - }); }); diff --git a/app/views/schedules/show.html.haml b/app/views/schedules/show.html.haml index 03aa16fe..8000b1ad 100644 --- a/app/views/schedules/show.html.haml +++ b/app/views/schedules/show.html.haml @@ -67,14 +67,6 @@ } }); - // carousel swipe - $(".carousel-inner").swiperight(function() { - $(this).parent().carousel('prev'); - }); - $(".carousel-inner").swipeleft(function() { - $(this).parent().carousel('next'); - }); - var day = "#{@current_day}"; // we only go to the date tag in the url if the conference is not taking place now if(day === ""){ diff --git a/app/views/shared/_dynamic_association.html.haml b/app/views/shared/_dynamic_association.html.haml index 9a29119d..13951211 100644 --- a/app/views/shared/_dynamic_association.html.haml +++ b/app/views/shared/_dynamic_association.html.haml @@ -1,10 +1,14 @@ -= f.inputs title do - - if hint - %p.inline-hint= hint - %div{class: association_name.to_s} - = f.semantic_fields_for association_name do |association_form| - = render association_name.to_s.singularize + "_fields", f: association_form - .links +%h4 + Title +%hr +- if hint + %p.inline-hint + = hint +%div{class: association_name.to_s} + = f.fields_for association_name do |association_form| + = render association_name.to_s.singularize + "_fields", f: association_form + .links + %p = add_association_link association_name, f, association_name - %br - %br + %br + %br diff --git a/app/views/surveys/show.html.haml b/app/views/surveys/show.html.haml index 2efe7a65..d2104312 100644 --- a/app/views/surveys/show.html.haml +++ b/app/views/surveys/show.html.haml @@ -16,7 +16,7 @@ This survey does not accept replies at this monent. .row .col-md-12 - = semantic_form_for @survey_submission, url: reply_conference_survey_path(@conference.short_title, @survey) do |f| + = form_for(@survey_submission, url: reply_conference_survey_path(@conference.short_title, @survey)) do |f| - @survey.survey_questions.each.with_index(1) do |survey_question, question_index| .row .col-md-10.col-md-offset-1 diff --git a/app/views/tracks/_form.html.haml b/app/views/tracks/_form.html.haml index 1fc8bc5a..f2007c33 100644 --- a/app/views/tracks/_form.html.haml +++ b/app/views/tracks/_form.html.haml @@ -1,20 +1,2 @@ -.container - .row - .col-md-12 - .page-header - %h1 - - if @track.new_record? - New - = @track.name - Track - .row - .col-md-12 - = semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path(@conference.short_title) : conference_program_track_path(@conference.short_title, @track))) do |f| - = f.input :name - = f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' } - = f.input :color, input_html: {size: 6, type: 'color'}, required: true - = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' } - = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' } - = f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, required: true, hint: "This will be public #{markdown_hint}".html_safe - = f.input :relevance, input_html: {rows: 5, data: { provide: 'markdown' } }, required: true, hint: "Please explain here how this track relates to the conference, how you are related to its content and why we should accept it. #{markdown_hint}".html_safe - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } += form_for(@track, url: (@track.new_record? ? conference_program_tracks_path(@conference.short_title) : conference_program_track_path(@conference.short_title, @track))) do |f| + = render partial: 'form_fields', locals: { f: f } diff --git a/app/views/tracks/_form_fields.html.haml b/app/views/tracks/_form_fields.html.haml new file mode 100644 index 00000000..b3242099 --- /dev/null +++ b/app/views/tracks/_form_fields.html.haml @@ -0,0 +1,60 @@ +.form-group + = f.label :name, "Name" + = f.text_field :name, autofocus: true, class: 'form-control', placeholder: 'Name' +.form-group + = f.label :short_name, "Short Name" + %abbr{title: 'This field is required'} * + = f.text_field :short_name, required: true, pattern: '[a-zA-Z0-9_-]+', class: 'form-control', placeholder: 'Short Name' + %span.help-block + A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track' +.form-group + = f.label :color, "Color" + %abbr{title: 'This field is required'} * + = f.color_field :color, size: 6, required: true, class: 'form-control' +.form-group + = f.label :start_date, "Start Date" + = f.text_field :start_date, id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' + - if @track.self_organized_and_accepted_or_confirmed? + %abbr{title: 'This field is required'} * +.form-group + = f.label :end_date, "End Date" + = f.text_field :end_date, id: 'registration-period-end-datepicker', required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' + - if @track.self_organized_and_accepted_or_confirmed? + %abbr{title: 'This field is required'} * +- if current_user.is_admin? + - if @conference.venue.try(:rooms).present? + .form-group + = f.label :room, "Room" + = f.select :room, @conference.venue.rooms.map {|room| ["#{room.name}", room.id]}, { include_blank: true }, { required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control select-help-toggle' } + - else + %p + Please add a + = link_to admin_conference_venue_path(@conference.short_title) do + venue + with + = link_to admin_conference_venue_rooms_path(@conference.short_title) do + rooms + if you want to select a room for the track. +.form-group + = f.label :description, "Description" + = f.text_area :description, rows: 4, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + = markdown_hint +- unless current_user.has_cached_role?(:organizer, @conference) || current_user.has_cached_role?(:cfp, @conference) || current_user.is_admin + .form-group + = f.label :relevance, "Relevance" + = f.text_area :relevance, rows: 4, data: { provide: 'markdown' }, required: true, class: 'form-control' + %span.help-block + Please explain here how this track relates to the conference, how you are related to its content and why we should accept it. + = markdown_hint +- if current_user.is_admin? + .checkbox + %label + = f.check_box :cfp_active + Allow event submitters to select this track for their proposal +%p.text-right + %button{type: 'submit', class: 'btn btn-success'} + - if @track.new_record? + Create Track + - else + Update Track diff --git a/app/views/tracks/edit.html.haml b/app/views/tracks/edit.html.haml new file mode 100644 index 00000000..352ef76f --- /dev/null +++ b/app/views/tracks/edit.html.haml @@ -0,0 +1,10 @@ +.container + .row + .col-md-12 + .page-header + %h1 + Edit Track + = @track.name + .row + .col-md-12 + = render partial: 'form' diff --git a/app/views/tracks/new.html.haml b/app/views/tracks/new.html.haml new file mode 100644 index 00000000..bc23ff55 --- /dev/null +++ b/app/views/tracks/new.html.haml @@ -0,0 +1,9 @@ +.container + .row + .col-md-12 + .page-header + %h1 + New Track + .row + .col-md-12 + = render partial: 'form' diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 52c0d57f..fa85d57f 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -5,21 +5,37 @@ %h1 Edit your profile .row .col-md-12 - = semantic_form_for(@user, url: user_path(@user.id)) do |f| - = f.input :name, as: :string, hint: 'This is your real name.' - = f.input :nickname, as: :string, hint: 'This is how the other users see you, not your real name' - .control-label - = "Avatar" - = image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '') - = link_to 'Change your avatar here', 'https://gravatar.com' - = f.input :affiliation, as: :string, - hint: 'This could be a company, a user group, or nothing at all.' - = f.input :biography, input_html: { rows: 5, data: { provide: 'markdown' } }, - hint: markdown_hint - You have used - %span#bio_length - = @user.biography ? @user.biography.split.length : 0 - words. Biographies are limited to 150 words. - %br - %br - = f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'} + = form_for(@user) do |f| + .form-group + = f.label :name + = f.text_field :name, class: 'form-control' + %span.help-block + This is your real name + .form-group + = f.label :nickname + = f.text_field :nickname, class: 'form-control' + .form-group + = f.label :avatar + %br + = image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded') + %span.help-block + Change your avatar on + = link_to 'gravatar.com', 'https://gravatar.com' + .form-group + = f.label :affiliation + = f.text_field :affiliation, class: 'form-control' + %span.help-block + The company you work work, the user group you belong to, or nothing at all. + .form-group + = f.label :biography + = f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control' + %span.help-block + You have used + %span#bio_length + = @user.biography ? @user.biography.split.length : 0 + words. Biographies are limited to 150 words. + = markdown_hint + .form-group + .text-right + = f.submit nil, class: 'btn btn-primary' + diff --git a/bin/bundle b/bin/bundle index 66e9889e..96131dad 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,120 @@ #!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV['BUNDLER_VERSION'] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update` + + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + + bundler_version = Regexp.last_match(1) + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV['BUNDLE_GEMFILE'] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path('../../Gemfile', __FILE__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile) + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + requirement = bundler_gem_version.approximate_recommendation + + return requirement unless Gem.rubygems_version < Gem::Version.new('2.7.0') + + requirement += '.a' if bundler_gem_version.prerelease? + + requirement + end + + def load_bundler! + ENV['BUNDLE_GEMFILE'] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem 'bundler', bundler_requirement + end + return if gem_error.nil? + + require_error = activation_error_handling do + require 'bundler/version' + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path('bundler', 'bundle') +end diff --git a/bin/bundle_report b/bin/bundle_report new file mode 100755 index 00000000..b136eb23 --- /dev/null +++ b/bin/bundle_report @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle_report' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path('bundle', __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.') + end +end + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('next_rails', 'bundle_report') diff --git a/bin/deprecations b/bin/deprecations new file mode 100755 index 00000000..825e288e --- /dev/null +++ b/bin/deprecations @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'deprecations' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path('bundle', __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.') + end +end + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('next_rails', 'deprecations') diff --git a/bin/gem-next-diff b/bin/gem-next-diff new file mode 100755 index 00000000..f9f4a82a --- /dev/null +++ b/bin/gem-next-diff @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'gem-next-diff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path('bundle', __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('next_rails', 'gem-next-diff') diff --git a/bin/next b/bin/next new file mode 100755 index 00000000..e813021d --- /dev/null +++ b/bin/next @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'next' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path('bundle', __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('next_rails', 'next') diff --git a/bin/rake b/bin/rake index 31bcf935..17240489 100755 --- a/bin/rake +++ b/bin/rake @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -load File.expand_path('spring', __dir__) require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/rspec b/bin/rspec index 20060ebd..e800d9aa 100755 --- a/bin/rspec +++ b/bin/rspec @@ -1,7 +1,29 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile.next", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end end -require 'bundler/setup' -load Gem.bin_path('rspec-core', 'rspec') + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/setup b/bin/setup deleted file mode 100755 index a8e630c6..00000000 --- a/bin/setup +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby -require 'fileutils' - -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -FileUtils.chdir APP_ROOT do - # This script is a way to set up or update your development environment automatically. - # This script is idempotent, so that you can run it at any time and get an expectable outcome. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/bin/spring b/bin/spring deleted file mode 100755 index acb2557a..00000000 --- a/bin/spring +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV']) - gem "bundler" - require "bundler" - - # Load Spring without loading other gems in the Gemfile, for speed. - Bundler.locked_gems&.specs&.find { |spec| spec.name == 'spring' }&.tap do |spring| - Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path - gem 'spring', spring.version - require 'spring/binstub' - rescue Gem::LoadError - # Ignore when Spring is not installed. - end -end diff --git a/bin/update b/bin/update deleted file mode 100755 index a8e4462f..00000000 --- a/bin/update +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env ruby -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - puts "\n== Updating database ==" - system! 'bin/rails db:migrate' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/config.ru b/config.ru index 949a0571..6f4d491b 100644 --- a/config.ru +++ b/config.ru @@ -5,4 +5,4 @@ require_relative 'config/environment' run Rails.application -Rails.application.load_server if Rails::VERSION::MAJOR == 6 +Rails.application.load_server if Rails::VERSION::MAJOR == 7 diff --git a/config/application.rb b/config/application.rb index 6d21d010..9897473c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,6 +1,18 @@ require_relative 'boot' -require 'rails/all' +require 'rails' +# Pick the frameworks you want: +require 'active_model/railtie' +# require 'active_job/railtie' +require 'active_record/railtie' +# require 'active_storage/engine' +require 'action_controller/railtie' +require 'action_mailer/railtie' +# require 'action_mailbox/engine' +# require 'action_text/engine' +require 'action_view/railtie' +# require 'action_cable/engine' +require 'rails/test_unit/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -9,7 +21,7 @@ Bundler.require(*Rails.groups) module Osem class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.0 + config.load_defaults 7.0 # Configuration for the application, engines, and railties goes here. # @@ -19,8 +31,9 @@ module Osem config.time_zone = ENV.fetch('OSEM_TIME_ZONE') { 'UTC' } # Enable escaping HTML in JSON. config.active_support.escape_html_entities_in_json = true - config.active_record.sqlite3.represent_boolean_as_integer = false - # Require `belongs_to` associations by default. Previous versions had false. + # Don't generate system test files. + config.generators.system_tests = nil + # This is a nightmare with our current data model, no one ever thought about this. config.active_record.belongs_to_required_by_default = false end end diff --git a/config/cable.yml b/config/cable.yml deleted file mode 100644 index 2a9e33d4..00000000 --- a/config/cable.yml +++ /dev/null @@ -1,10 +0,0 @@ -development: - adapter: async - -test: - adapter: test - -production: - adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: osem_production diff --git a/config/environments/development.rb b/config/environments/development.rb index 2e165809..7c66d30e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,117 +1,131 @@ -Osem::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +require 'active_support/core_ext/integer/time' - config.action_mailer.delivery_method = :letter_opener +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false - config.cache_store = :memory_store, { size: 64.megabytes } - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger - config.active_support.deprecation = :log - - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin - - # Raise exception on mass assignment protection for Active Record models - # config.active_record.mass_assignment_sanitizer = :strict - - # Do not compress assets - config.assets.compress = false - - # Expands the lines which load the assets - config.assets.debug = true - # Do not eager load code on boot. config.eager_load = false - # Do not log asset requests + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Suppress logger output for asset requests. config.assets.quiet = true + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + # Set the detault url for action mailer config.action_mailer.default_url_options = { host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000') } - # Set the secret key base if it's not set via other means - config.secret_key_base ||= 'f4be765bc98e516de82ac01daa8f8aa11c5ca13cb6c911887851ac89457b6c0b056b2361a21b5c08926c9386e0f91eef84fc0b103d522bf00bc0c78ea8ce7c58' + # Access all mails sent at http://localhost:3000/letter_opener + config.action_mailer.delivery_method = :letter_opener # Use omniauth mock credentials OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[:facebook] = - OmniAuth::AuthHash.new( - provider: 'facebook', - uid: 'facebook-test-uid-1', - info: { - name: 'facebook user', - email: 'user-facebook@example.com', - username: 'user_facebook' - }, - credentials: { - token: 'fb_mock_token', - secret: 'fb_mock_secret' - } - ) + OmniAuth::AuthHash.new( + provider: 'facebook', + uid: 'facebook-test-uid-1', + info: { + name: 'facebook user', + email: 'user-facebook@example.com', + username: 'user_facebook' + }, + credentials: { + token: 'fb_mock_token', + secret: 'fb_mock_secret' + } + ) OmniAuth.config.mock_auth[:google] = - OmniAuth::AuthHash.new( - provider: 'google', - uid: 'google-test-uid-1', - info: { - name: 'google user', - email: 'user-google@example.com', - username: 'user_google' - }, - credentials: { - token: 'google_mock_token', - secret: 'google_mock_secret' - } - ) + OmniAuth::AuthHash.new( + provider: 'google', + uid: 'google-test-uid-1', + info: { + name: 'google user', + email: 'user-google@example.com', + username: 'user_google' + }, + credentials: { + token: 'google_mock_token', + secret: 'google_mock_secret' + } + ) OmniAuth.config.mock_auth[:suse] = - OmniAuth::AuthHash.new( - provider: 'suse', - uid: 'suse-test-uid-1', - info: { - name: 'suse user', - email: 'user-suse@example.com', - username: 'user_suse' - }, - credentials: { - token: 'suse_mock_token', - secret: 'suse_mock_secret' - } - ) + OmniAuth::AuthHash.new( + provider: 'suse', + uid: 'suse-test-uid-1', + info: { + name: 'suse user', + email: 'user-suse@example.com', + username: 'user_suse' + }, + credentials: { + token: 'suse_mock_token', + secret: 'suse_mock_secret' + } + ) OmniAuth.config.mock_auth[:github] = - OmniAuth::AuthHash.new( - provider: 'github', - uid: 'github-test-uid-1', - info: { - name: 'github user', - email: 'user-github@example.com', - username: 'user_github' - }, - credentials: { - token: 'github_mock_token', - secret: 'github_mock_secret' - } - ) - + OmniAuth::AuthHash.new( + provider: 'github', + uid: 'github-test-uid-1', + info: { + name: 'github user', + email: 'user-github@example.com', + username: 'user_github' + }, + credentials: { + token: 'github_mock_token', + secret: 'github_mock_secret' + } + ) config.after_initialize do Devise.setup do |devise_config| # Enable ichain test mode devise_config.ichain_test_mode = true end end - config.active_record.verbose_query_logs = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index a74cac43..4f40e48f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,7 @@ Rails.application.configure do # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass @@ -31,22 +31,14 @@ Rails.application.configure do config.assets.compile = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.asset_host = 'http://assets.example.com' + # config.asset_host = "http://assets.example.com" # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true if ENV.fetch('FORCE_SSL', false) + # config.force_ssl = true # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). @@ -56,57 +48,21 @@ Rails.application.configure do config.log_tags = [:request_id] # Use a different cache store in production. - if ENV["OSEM_MEMCACHED_SERVERS"] - config.cache_store = :mem_cache_store, ENV["OSEM_MEMCACHED_SERVERS"].split(','), { - username: ENV["OSEM_MEMCACHED_USERNAME"], - password: ENV["OSEM_MEMCACHED_PASSWORD"] - } - end - - # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "osem_production" - - config.action_mailer.perform_caching = false - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - config.action_mailer.default_url_options = { host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000') } - config.action_mailer.smtp_settings = { - address: ENV['OSEM_SMTP_ADDRESS'], - port: ENV['OSEM_SMTP_PORT'], - user_name: ENV['OSEM_SMTP_USERNAME'], - password: ENV['OSEM_SMTP_PASSWORD'], - authentication: ENV['OSEM_SMTP_AUTHENTICATION'].try(:to_sym), - domain: ENV['OSEM_SMTP_DOMAIN'], - enable_starttls_auto: ENV['OSEM_SMTP_ENABLE_STARTTLS_AUTO'], - openssl_verify_mode: ENV['OSEM_SMTP_OPENSSL_VERIFY_MODE'] - }.compact - - # Set the secret_key_base from the env, if not set by any other means - config.secret_key_base ||= ENV["SECRET_KEY_BASE"] + # config.cache_store = :mem_cache_store # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Log disallowed deprecations. - config.active_support.disallowed_deprecation = :log - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) @@ -116,25 +72,4 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - - # Inserts middleware to perform automatic connection switching. - # The `database_selector` hash is used to pass options to the DatabaseSelector - # middleware. The `delay` is used to determine how long to wait after a write - # to send a subsequent read to the primary. - # - # The `database_resolver` class is used by the middleware to determine which - # database is appropriate to use based on the time delay. - # - # The `database_resolver_context` class is used by the middleware to set - # timestamps for the last write to the primary. The resolver uses the context - # class timestamps to determine how long to wait before reading from the - # replica. - # - # By default Rails will store a last write timestamp in the session. The - # DatabaseSelector middleware is designed as such you can define your own - # strategy for connection switching and pass that into the middleware through - # these configuration options. - # config.active_record.database_selector = { delay: 2.seconds } - # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver - # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/config/environments/test.rb b/config/environments/test.rb index 9a2ddb3e..25a85f43 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,13 +8,13 @@ require 'active_support/core_ext/integer/time' Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - config.cache_classes = false - config.action_view.cache_template_loading = true + # Turn false under Spring and add config.action_view.cache_template_loading = true. + config.cache_classes = true - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV['CI'].present? # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true @@ -25,6 +25,7 @@ Rails.application.configure do # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.action_mailer.perform_caching = false config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. @@ -33,16 +34,6 @@ Rails.application.configure do # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory. - config.active_storage.service = :test - - config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr @@ -54,12 +45,7 @@ Rails.application.configure do # Set the detault url for action mailer config.action_mailer.default_url_options = { host: 'localhost:3000' } - - # Raises error for missing translations. - # config.i18n.raise_on_missing_translations = true - - # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true + config.action_mailer.delivery_method = :test config.after_initialize do # Set Time.now to May 1, 2014 00:01:00 AM (at this instant), but allow it to move forward diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb deleted file mode 100644 index d4d9b3b9..00000000 --- a/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code -# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". -Rails.backtrace_cleaner.remove_silencers! if ENV['BACKTRACE'] diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 41c43016..3621f97f 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -4,25 +4,23 @@ # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy -# Rails.application.config.content_security_policy do |policy| -# policy.default_src :self, :https -# policy.font_src :self, :https, :data -# policy.img_src :self, :https, :data -# policy.object_src :none -# policy.script_src :self, :https -# policy.style_src :self, :https - -# # Specify URI for violation reports -# # policy.report_uri "/csp-violation-report-endpoint" +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report CSP violations to a specified URI. See: +# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# # config.content_security_policy_report_only = true # end - -# If you are using UJS then enable automatic nonce generation -# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } - -# Set the nonce only to specific directives -# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) - -# Report CSP violations to a specified URI -# For further information see the following documentation: -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only -# Rails.application.config.content_security_policy_report_only = true diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb deleted file mode 100644 index f51a497e..00000000 --- a/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Specify a serializer for the signed and encrypted cookie jars. -# Valid options are :json, :marshal, and :hybrid. -Rails.application.config.action_dispatch.cookies_serializer = :hybrid diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb deleted file mode 100644 index f21da2e7..00000000 --- a/config/initializers/formtastic.rb +++ /dev/null @@ -1,113 +0,0 @@ -# encoding: utf-8 - -# Set the default text field size when input is a string. Default is nil. -# Formtastic::FormBuilder.default_text_field_size = 50 - -# Set the default text area height when input is a text. Default is 20. -# Formtastic::FormBuilder.default_text_area_height = 5 - -# Set the default text area width when input is a text. Default is nil. -# Formtastic::FormBuilder.default_text_area_width = 50 - -# Should all fields be considered "required" by default? -# Defaults to true. -# Formtastic::FormBuilder.all_fields_required_by_default = true - -# Should select fields have a blank option/prompt by default? -# Defaults to true. -Formtastic::FormBuilder.include_blank_for_select_by_default = false - -# Set the string that will be appended to the labels/fieldsets which are required -# It accepts string or procs and the default is a localized version of -# '*'. In other words, if you configure formtastic.required -# in your locale, it will replace the abbr title properly. But if you don't want to use -# abbr tag, you can simply give a string as below -Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{ *}) } - -# Set the string that will be appended to the labels/fieldsets which are optional -# Defaults to an empty string ("") and also accepts procs (see required_string above) -# Formtastic::FormBuilder.optional_string = "(optional)" - -# Set the way inline errors will be displayed. -# Defaults to :sentence, valid options are :sentence, :list, :first and :none -# Formtastic::FormBuilder.inline_errors = :sentence -# Formtastic uses the following classes as default for hints, inline_errors and error list - -# If you override the class here, please ensure to override it in your stylesheets as well -# Formtastic::FormBuilder.default_hint_class = "inline-hints" -# Formtastic::FormBuilder.default_inline_error_class = "inline-errors" -# Formtastic::FormBuilder.default_error_list_class = "errors" - -# Set the method to call on label text to transform or format it for human-friendly -# reading when formtastic is used without object. Defaults to :humanize. -# Formtastic::FormBuilder.label_str_method = :humanize - -# Set the array of methods to try calling on parent objects in :select and :radio inputs -# for the text inside each @