diff --git a/.gitignore b/.gitignore index c5f7c47..f7bacf9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,8 +30,8 @@ # Ignore some of the initializers config/initializers/recaptcha.rb -#config/initializers/devise.rb -#config/initializers/contact_us.rb +config/initializers/devise.rb +config/initializers/wicked_pdf.rb # Ignore enviroments settings #config/environments/development.rb diff --git a/Gemfile b/Gemfile index fa23bda..4d72799 100644 --- a/Gemfile +++ b/Gemfile @@ -68,6 +68,7 @@ # ------------------------------------------------ # EXPORTING +gem 'wkhtmltopdf-binary' gem 'thin' gem 'wicked_pdf' gem 'htmltoword' diff --git a/Gemfile.lock b/Gemfile.lock index b71d100..edee9b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,6 +17,14 @@ sass-rails sprockets (< 4.1) +GIT + remote: https://github.com/vyruss/yaml_db.git + revision: 00b304aeb0243b0ad1d96519564e7650c9760f21 + specs: + yaml_db (0.4.2) + rails (>= 3.0, < 5.1) + rake (>= 0.8.7) + GEM remote: https://rubygems.org/ specs: @@ -311,11 +319,9 @@ railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) wicked_pdf (1.1.0) + wkhtmltopdf-binary (0.12.3) xpath (2.0.0) nokogiri (~> 1.3) - yaml_db (0.4.2) - rails (>= 3.0, < 5.1) - rake (>= 0.8.7) yard (0.9.5) PLATFORMS @@ -366,11 +372,12 @@ uglifier web-console (~> 2.0) wicked_pdf - yaml_db + wkhtmltopdf-binary + yaml_db! yard RUBY VERSION ruby 2.2.2p95 BUNDLED WITH - 1.12.5 + 1.13.2 diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index 45e9f4e..9d29e44 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -199,8 +199,7 @@ //action to hide the alert to edit a version $("#edit-version-confirmed").click(function (e){ - e.preventDefault(); - $("#version_edit_alert").modal("hide"); + $("#version_edit_alert").modal("hide"); }); //action to clone/add a version diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js index b2db6ea..59ea647 100644 --- a/app/assets/javascripts/projects.js +++ b/app/assets/javascripts/projects.js @@ -5,7 +5,7 @@ $("#project_funder_id").change(function(){ reloadTemplateData(); - if($(this).val().length > 0){ + if($(this).select2().val().length > 0){ $("#other-funder-name").hide(); $("#project_funder_name").val(""); @@ -15,14 +15,14 @@ $("#institution-control-group").show(); $("#create-plan-button").show(); - $("#confirm-funder").text($(this).val()); + $("#confirm-funder").text($("#project_funder_id option:selected").text()); }); // ---------------------------------------------------------- $("#project_institution_id").change(function(){ reloadTemplateData(); - $("#confirm-institution").text($("#project_institution_id").select2('data').text); + $("#confirm-institution").text($("#project_institution_id option:selected").text()); }); // ---------------------------------------------------------- @@ -33,7 +33,11 @@ // ---------------------------------------------------------- $("#no-funder").click(function(e) { e.preventDefault(); - $("#project_funder_id").select2("val", ""); + // For some reason we need to access the select2 box's value again to get the + // UI to update correctly + $("#project_funder_id").select2().val(""); + $("#project_funder_id").select2().val(); + $("#institution-control-group").show(); $("#create-plan-button").show(); $("#other-funder-name").show(); @@ -47,7 +51,11 @@ // ---------------------------------------------------------- $("#no-institution").click(function() { - $("#project_institution_id").select2("val", ""); + // For some reason we need to access the select2 box's value again to get the + // UI to update correctly + $("#project_institution_id").select2().val(""); + $("#project_institution_id").select2().val(); + $("#confirm-institution").text(I18n.t("helpers.none")); }); @@ -172,7 +180,7 @@ "
  • " + "" + "
  • " diff --git a/app/assets/stylesheets/admin.css.less b/app/assets/stylesheets/admin.css.less index 3a52df1..132e00e 100644 --- a/app/assets/stylesheets/admin.css.less +++ b/app/assets/stylesheets/admin.css.less @@ -15,6 +15,7 @@ // Font Awesome @import "fontawesome/font-awesome"; + // Glyphicons //@import "twitter/bootstrap/sprites.less"; @@ -113,7 +114,7 @@ margin-top: 70px; font-size: @font_size; } - + /*********************************************/ /**** header ****/ /*********************************************/ @@ -475,7 +476,6 @@ margin-left:0px; } - /**********************/ /* Organisation admin */ /**********************/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9069855..e1ca731 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized def user_not_authorized - render(file: File.join(Rails.root, 'public/403.html'), status: 403, layout: false) + redirect_to root_url, alert: I18n.t('unauthorized') end before_filter :set_locale diff --git a/app/controllers/dmptemplates_controller.rb b/app/controllers/dmptemplates_controller.rb index e7680a5..9c7f757 100644 --- a/app/controllers/dmptemplates_controller.rb +++ b/app/controllers/dmptemplates_controller.rb @@ -230,7 +230,7 @@ #clone a version of a template def admin_cloneversion @old_version = Version.find(params[:version_id]) - authorize @version.phase.dmptemplate + authorize @old_version.phase.dmptemplate @version = @old_version.amoeba_dup @phase = @version.phase respond_to do |format| @@ -255,7 +255,6 @@ # SECTIONS - #create a section def admin_createsection @section = Section.new(params[:section]) diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 2f932ec..9116fb1 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -3,7 +3,17 @@ protected def after_resetting_password_path_for(resource) - root_path - end + root_path + end + + ## + # Override Devise default behaviour by sending user to the home page + # after the password reset email has been sent + # + # @resource_name [String] The user's email address + # --------------------------------------------------------------------- + def after_sending_reset_password_instructions_path_for(resource_name) + root_path + end end \ No newline at end of file diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 59b52b5..3394ba2 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -76,9 +76,6 @@ end # If the user selected a new language setting, go ahead and reset the locale - -puts "PARAMS: #{params.inspect}" - if params[:user][:language_id] if @user.language_id != params[:user][:language_id] params[:locale] = Language.find(params[:user][:language_id]).abbreviation diff --git a/app/models/plan.rb b/app/models/plan.rb index 8bf12aa..f25998c 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -138,6 +138,7 @@ end end end + return guidances end diff --git a/app/views/dmptemplates/_guidance_display.html.erb b/app/views/dmptemplates/_guidance_display.html.erb index 8438b71..4082baf 100644 --- a/app/views/dmptemplates/_guidance_display.html.erb +++ b/app/views/dmptemplates/_guidance_display.html.erb @@ -32,16 +32,5 @@ <% end %> - -
    -
    - <%= hidden_field_tag :question_id, question.id, :class => "question_id" %> - <%= link_to t("org_admin.questions.quidance_button"), "# ", :class => "btn btn-primary add_guidance_button"%> -
    -
    - - \ No newline at end of file diff --git a/app/views/dmptemplates/_versions_table.html.erb b/app/views/dmptemplates/_versions_table.html.erb index 259fb5f..e51dbfe 100644 --- a/app/views/dmptemplates/_versions_table.html.erb +++ b/app/views/dmptemplates/_versions_table.html.erb @@ -4,6 +4,7 @@

    <%= t('org_admin.versions.versions_text_html')%>

    + diff --git a/app/views/dmptemplates/admin_phase.html.erb b/app/views/dmptemplates/admin_phase.html.erb index 18ee0a2..b85927b 100644 --- a/app/views/dmptemplates/admin_phase.html.erb +++ b/app/views/dmptemplates/admin_phase.html.erb @@ -2,6 +2,8 @@ <%= stylesheet_link_tag "admin" %> <% javascript 'admin.js' %> +<%= tinymce :content_css => asset_path('application.css') %> +

    <%= @phase.dmptemplate.title %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7015dcd..1568175 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,7 +20,7 @@ } - + <%= stylesheet_link_tag "application" %> <%= javascript_include_tag "application"%> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 0824e7b..f774cda 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -9,7 +9,6 @@

    Cookies

    -

    Please note that %{application_name} uses Cookies. Further information about Cookies and how we use them is available on the main %{organisation_abbreviation} website.

    +

    Please note that %{application_name} uses Cookies. Further information about Cookies and how we use them is available on the main DCC website.


    diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index e363d7c..915b591 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -41,6 +41,8 @@ screencast_text: "Screencast on how to use %{application_name}" screencast_error_text: "Your browser does not support the video tag." + unauthorized: "You need to sign in or sign up before continuing." + admin: org_title: "Organization name" org: "Organization" @@ -569,9 +571,9 @@ project_details_editing_text_html: "Please fill in the basic project details below and click 'Update' to save" confirm_delete_text: "Are you sure you wish to delete this plan? If the plan is being shared with other users, by deleting it from your list, the plan will be deleted from their plan list as well" confirmation_text: "Confirm plan details" - confirmation_text_desc: "Where your funder or institution doesn't have specific requirements (or if you left these options blank), you will see the %{organisation_abbreviation} Checklist. This offers a generic set of DMP questions and guidance. For more details see: DMP checklist 2013." + confirmation_text_desc: "Where your funder or institution doesn't have specific requirements (or if you left these options blank), you will see the %{organisation_abbreviation} Checklist. This offers a generic set of DMP questions and guidance. For more details see: DMP checklist 2013." confirmation_button_text: "Yes, create plan" - default_confirmation_text_desc: "You have selected the Default DMP, which is based on the %{organisation_abbreviation} Checklist. This offers a generic set of DMP questions and guidance. For more details see: DMP checklist 2013." + default_confirmation_text_desc: "You have selected the Default DMP, which is based on the %{organisation_abbreviation} Checklist. This offers a generic set of DMP questions and guidance. For more details see: DMP checklist 2013." default_confirmation_button_text: "Create plan" alert_default_template_text_html: "Please note: %{org_name} provides a DMP template. If you wish to use it select 'Cancel', otherwise select 'Create plan'" share: @@ -724,7 +726,7 @@ A summary of requirements from the NSF, NIH and other key funders in the USA.
  • - Digital Curation Centre Checklist for a Data Management Plan [PDF, 3 pages]
    + Digital Curation Centre Checklist for a Data Management Plan [PDF, 3 pages]
    A list of 13 questions and associated guidance, that represent the main issues to come up in Data Management and Sharing Plans. The Checklist is used as a generic template in %{application_name}, and is presented when no funder or organsiational requirements are applicable for the user.
  • @@ -811,7 +813,7 @@ contact_page: title: "Contact us" intro_text_html: "

    %{application_name} is provided by the %{organisation_name}. You can find out more about us on our website. If you would like to contact us about %{application_name}, please enter your query in the form below or email dmponline@dcc.ac.uk.

    " - github_text_html: "

    If you have a feature request or think you have found a bug, please check out the list of issues on GitHub. If your issue isn't listed there, please add it; if it is, please add a comment if you have more information or just to let us know how important it is to you. This will help us to help us prioritise future developments.

    " + github_text_html: "

    If you have a feature request or think you have found a bug, please check out the list of issues on GitHub. If your issue isn't listed there, please add it; if it is, please add a comment if you have more information or just to let us know how important it is to you. This will help us to prioritise future developments.

    " address_text_html: "
  • Cookies

    -

    Please note that %{application_name} uses Cookies. Further information about Cookies and how we use them is available on the main %{organisation_abbreviation} website.

    +

    Please note that %{application_name} uses Cookies. Further information about Cookies and how we use them is available on the main DCC website.


    diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e0e32cd..31643ce 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -44,6 +44,8 @@ welcome_links: "Le modèle de plan de gestion des données Portage s'appuie sur des normes internationales et sur les meilleures pratiques. Il a été préparé et est gardé à jour par un groupe d'experts en gestion des données de recherche travaillant au sein de bibliothèques de recherche à travers le Canada. " ccid_message: "Veuillez noter que nous travaillons actuellement à un système d'authentification unique. Pour le moment, veuillez créer un nouveau compte dans l'Assistant PGD. Vous pourrez associer votre compte existant à votre identifiant campus dès que la fonction sera disponible." + unauthorized: "S'il vous plaît vous connecter ou vous inscrire pour continuer." + screencast_error_text: "Votre navigateur ne permet pas la balise vidéo." none: "Aucun" admin: @@ -534,7 +536,7 @@ confirmation_text_desc: "Vous utilisez le modèle générique de plan de gestion des données Portage. Si vous avez des suggestions pour améliorer ce modèle, ou si vous souhaiteriez ajouter de nouveaux modèles basés sur les exigences d'un organisme subventionnaire ou sur les besoins d'une discipline, communiquez avec nous à l'adresse suivante : portage@carl-abrc.ca." confirmation_button_text: "Oui, créer un plan" - default_confirmation_text_desc: "Vous avez sélectionné le plan de gestion des données par défaut, qui est établi en fonction de la liste de vérification du Digital Curation Centre (UK). Vous avez ainsi accès à une série générale de questions et de directives sur le plan de gestion des données. Pour de plus amples renseignements, consultez la : DMP checklist 2013 (Liste de vérification 2013 pour un plan de gestion des données)." + default_confirmation_text_desc: "Vous avez sélectionné le plan de gestion des données par défaut, qui est établi en fonction de la liste de vérification du Digital Curation Centre (UK). Vous avez ainsi accès à une série générale de questions et de directives sur le plan de gestion des données. Pour de plus amples renseignements, consultez la : DMP checklist 2013 (Liste de vérification 2013 pour un plan de gestion des données)." default_confirmation_button_text: "Créer un plan" alert_default_template_text_html: " Veuillez noter que %{org_name} fournit un modèle de plan de gestion des données. Si vous désirez l'utiliser, sélectionnez « Annuler », autrement cliquez sur « Créer un plan »." share: diff --git a/db/schema.rb b/db/schema.rb index a1cf34f..c5c053b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,399 +9,454 @@ # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # -# It's strongly recommended to check this file into your version control system. +# It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150809210811) do +ActiveRecord::Schema.define(version: 20161024163920) do - create_table "answers", :force => true do |t| - t.text "text" - t.integer "plan_id" - t.integer "user_id" - t.integer "question_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "answers", force: :cascade do |t| + t.text "text", limit: 65535 + t.integer "plan_id", limit: 4 + t.integer "user_id", limit: 4 + t.integer "question_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "answers_options", :id => false, :force => true do |t| - t.integer "answer_id", :null => false - t.integer "option_id", :null => false + create_table "answers_options", id: false, force: :cascade do |t| + t.integer "answer_id", limit: 4, null: false + t.integer "option_id", limit: 4, null: false end - add_index "answers_options", ["answer_id", "option_id"], :name => "index_answers_options_on_answer_id_and_option_id" + add_index "answers_options", ["answer_id", "option_id"], name: "index_answers_options_on_answer_id_and_option_id", using: :btree - create_table "comments", :force => true do |t| - t.integer "user_id" - t.integer "question_id" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "comments", force: :cascade do |t| + t.integer "user_id", limit: 4 + t.integer "question_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "archived" - t.integer "plan_id" - t.integer "archived_by" + t.integer "plan_id", limit: 4 + t.integer "archived_by", limit: 4 end - create_table "dmptemplates", :force => true do |t| - t.string "title" - t.text "description" + create_table "dmptemplates", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 t.boolean "published" - t.integer "user_id" - t.integer "organisation_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "locale" + t.integer "user_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "locale", limit: 255 t.boolean "is_default" end - create_table "dmptemplates_guidance_groups", :id => false, :force => true do |t| - t.integer "dmptemplate_id" - t.integer "guidance_group_id" + create_table "dmptemplates_guidance_groups", id: false, force: :cascade do |t| + t.integer "dmptemplate_id", limit: 4 + t.integer "guidance_group_id", limit: 4 end - create_table "exported_plans", :force => true do |t| - t.integer "plan_id" - t.integer "user_id" - t.string "format" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "exported_plans", force: :cascade do |t| + t.integer "plan_id", limit: 4 + t.integer "user_id", limit: 4 + t.string "format", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "file_types", :force => true do |t| - t.string "name" - t.string "icon_name" - t.integer "icon_size" - t.string "icon_location" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "file_types", force: :cascade do |t| + t.string "name", limit: 255 + t.string "icon_name", limit: 255 + t.integer "icon_size", limit: 4 + t.string "icon_location", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "file_uploads", :force => true do |t| - t.string "name" - t.string "title" - t.text "description" - t.integer "size" + create_table "file_uploads", force: :cascade do |t| + t.string "name", limit: 255 + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "size", limit: 4 t.boolean "published" - t.string "location" - t.integer "file_type_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "location", limit: 255 + t.integer "file_type_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "friendly_id_slugs", :force => true do |t| - t.string "slug", :null => false - t.integer "sluggable_id", :null => false - t.string "sluggable_type", :limit => 40 + create_table "friendly_id_slugs", force: :cascade do |t| + t.string "slug", limit: 255, null: false + t.integer "sluggable_id", limit: 4, null: false + t.string "sluggable_type", limit: 40 t.datetime "created_at" end - add_index "friendly_id_slugs", ["slug", "sluggable_type"], :name => "index_friendly_id_slugs_on_slug_and_sluggable_type", :unique => true - add_index "friendly_id_slugs", ["sluggable_id"], :name => "index_friendly_id_slugs_on_sluggable_id" - add_index "friendly_id_slugs", ["sluggable_type"], :name => "index_friendly_id_slugs_on_sluggable_type" + add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true, using: :btree + add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree + add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree - create_table "guidance_groups", :force => true do |t| - t.string "name" - t.integer "organisation_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "guidance_groups", force: :cascade do |t| + t.string "name", limit: 255 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "optional_subset" t.boolean "published" end - create_table "guidance_in_group", :id => false, :force => true do |t| - t.integer "guidance_id", :null => false - t.integer "guidance_group_id", :null => false + create_table "guidance_in_group", id: false, force: :cascade do |t| + t.integer "guidance_id", limit: 4, null: false + t.integer "guidance_group_id", limit: 4, null: false end - add_index "guidance_in_group", ["guidance_id", "guidance_group_id"], :name => "index_guidance_in_group_on_guidance_id_and_guidance_group_id" + add_index "guidance_in_group", ["guidance_id", "guidance_group_id"], name: "index_guidance_in_group_on_guidance_id_and_guidance_group_id", using: :btree - create_table "guidances", :force => true do |t| - t.text "text" - t.integer "guidance_group_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_id" + create_table "guidances", force: :cascade do |t| + t.text "text", limit: 65535 + t.integer "guidance_group_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "question_id", limit: 4 + t.boolean "published" end - create_table "option_warnings", :force => true do |t| - t.integer "organisation_id" - t.integer "option_id" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "identifier_schemes", force: :cascade do |t| + t.string "name", limit: 255 + t.string "logo", limit: 255 + t.string "api_key", limit: 255 + t.string "api_secret", limit: 255 + t.string "landing_page_uri", limit: 255 + t.string "params", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" end - create_table "options", :force => true do |t| - t.integer "question_id" - t.string "text" - t.integer "number" + create_table "languages", force: :cascade do |t| + t.string "abbreviation", limit: 255 + t.string "description", limit: 255 + t.string "name", limit: 255 + t.boolean "default_language" + end + + create_table "option_warnings", force: :cascade do |t| + t.integer "organisation_id", limit: 4 + t.integer "option_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "options", force: :cascade do |t| + t.integer "question_id", limit: 4 + t.string "text", limit: 255 + t.integer "number", limit: 4 t.boolean "is_default" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "organisation_types", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "org_token_permissions", force: :cascade do |t| + t.integer "organisation_id", limit: 4 + t.integer "token_permission_type_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" end - create_table "organisations", :force => true do |t| - t.string "name" - t.string "abbreviation" - t.text "description" - t.string "target_url" - t.integer "organisation_type_id" - t.string "domain" - t.integer "wayfless_entity" - t.integer "stylesheet_file_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "parent_id" + create_table "organisation_types", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "organisations", force: :cascade do |t| + t.string "name", limit: 255 + t.string "abbreviation", limit: 255 + t.string "target_url", limit: 255 + t.integer "organisation_type_id", limit: 4 + t.string "domain", limit: 255 + t.string "wayfless_entity", limit: 255 + t.integer "stylesheet_file_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "parent_id", limit: 4 t.boolean "is_other" - t.string "sort_name" - t.text "banner_text" - t.string "logo_file_name" + t.string "sort_name", limit: 255 + t.text "banner_text", limit: 65535 + t.integer "region_id", limit: 4 + t.integer "language_id", limit: 4 + t.string "logo_uid", limit: 255 + t.string "logo_name", limit: 255 + t.string "contact_email", limit: 255 end - create_table "phases", :force => true do |t| - t.string "title" - t.text "description" - t.integer "number" - t.integer "dmptemplate_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "slug" + create_table "phases", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "number", limit: 4 + t.integer "dmptemplate_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "slug", limit: 255 end - add_index "phases", ["dmptemplate_id"], :name => "index_phases_on_dmptemplate_id" - add_index "phases", ["slug"], :name => "index_phases_on_slug", :unique => true + add_index "phases", ["dmptemplate_id"], name: "index_phases_on_dmptemplate_id", using: :btree + add_index "phases", ["slug"], name: "index_phases_on_slug", unique: true, using: :btree - create_table "plan_sections", :force => true do |t| - t.integer "user_id" - t.integer "section_id" - t.integer "plan_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "plan_sections", force: :cascade do |t| + t.integer "user_id", limit: 4 + t.integer "section_id", limit: 4 + t.integer "plan_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.datetime "release_time" end - create_table "plans", :force => true do |t| + create_table "plans", force: :cascade do |t| t.boolean "locked" - t.integer "project_id" - t.integer "version_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "project_id", limit: 4 + t.integer "version_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "project_groups", :force => true do |t| + create_table "project_groups", force: :cascade do |t| t.boolean "project_creator" t.boolean "project_editor" - t.integer "user_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "user_id", limit: 4 + t.integer "project_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "project_administrator" end - create_table "project_guidance", :id => false, :force => true do |t| - t.integer "project_id", :null => false - t.integer "guidance_group_id", :null => false + create_table "project_guidance", id: false, force: :cascade do |t| + t.integer "project_id", limit: 4, null: false + t.integer "guidance_group_id", limit: 4, null: false end - add_index "project_guidance", ["project_id", "guidance_group_id"], :name => "index_project_guidance_on_project_id_and_guidance_group_id" + add_index "project_guidance", ["project_id", "guidance_group_id"], name: "index_project_guidance_on_project_id_and_guidance_group_id", using: :btree - create_table "projects", :force => true do |t| - t.string "title" - t.integer "dmptemplate_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "slug" - t.integer "organisation_id" - t.string "grant_number" - t.string "identifier" - t.text "description" - t.string "principal_investigator" - t.string "principal_investigator_identifier" - t.string "data_contact" - t.string "funder_name" + create_table "projects", force: :cascade do |t| + t.string "title", limit: 255 + t.integer "dmptemplate_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "slug", limit: 255 + t.integer "organisation_id", limit: 4 + t.string "grant_number", limit: 255 + t.string "identifier", limit: 255 + t.text "description", limit: 65535 + t.string "principal_investigator", limit: 255 + t.string "principal_investigator_identifier", limit: 255 + t.string "data_contact", limit: 255 + t.string "funder_name", limit: 255 end - add_index "projects", ["slug"], :name => "index_projects_on_slug", :unique => true + add_index "projects", ["slug"], name: "index_projects_on_slug", unique: true, using: :btree - create_table "question_formats", :force => true do |t| - t.string "title" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "question_formats", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "questions", :force => true do |t| - t.text "text" - t.text "default_value" - t.text "guidance" - t.integer "number" - t.integer "parent_id" - t.integer "dependency_id" - t.text "dependency_text" - t.integer "section_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_format_id" - t.boolean "option_comment_display", :default => true + create_table "questions", force: :cascade do |t| + t.text "text", limit: 65535 + t.text "default_value", limit: 65535 + t.text "guidance", limit: 65535 + t.integer "number", limit: 4 + t.integer "parent_id", limit: 4 + t.integer "dependency_id", limit: 4 + t.text "dependency_text", limit: 65535 + t.integer "section_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "question_format_id", limit: 4 + t.boolean "option_comment_display", default: true end - create_table "questions_themes", :id => false, :force => true do |t| - t.integer "question_id", :null => false - t.integer "theme_id", :null => false + create_table "questions_themes", id: false, force: :cascade do |t| + t.integer "question_id", limit: 4, null: false + t.integer "theme_id", limit: 4, null: false end - add_index "questions_themes", ["question_id", "theme_id"], :name => "index_questions_themes_on_question_id_and_theme_id" + add_index "questions_themes", ["question_id", "theme_id"], name: "index_questions_themes_on_question_id_and_theme_id", using: :btree - create_table "roles", :force => true do |t| - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "region_groups", force: :cascade do |t| + t.integer "super_region_id", limit: 4 + t.integer "region_id", limit: 4 + end + + create_table "regions", force: :cascade do |t| + t.string "abbreviation", limit: 255 + t.string "description", limit: 255 + t.string "name", limit: 255 + end + + create_table "roles", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "role_in_plans" - t.integer "resource_id" - t.string "resource_type" + t.integer "resource_id", limit: 4 + t.string "resource_type", limit: 255 end - add_index "roles", ["name"], :name => "index_roles_on_name" - add_index "roles", ["name"], :name => "index_roles_on_name_and_resource_type_and_resource_id" + add_index "roles", ["name"], name: "index_roles_on_name", using: :btree + add_index "roles", ["name"], name: "index_roles_on_name_and_resource_type_and_resource_id", using: :btree - create_table "sections", :force => true do |t| - t.string "title" - t.text "description" - t.integer "number" - t.integer "version_id" - t.integer "organisation_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "sections", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.integer "number", limit: 4 + t.integer "version_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "published" end - create_table "settings", :force => true do |t| - t.string "var", :null => false - t.text "value" - t.integer "target_id", :null => false - t.string "target_type", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "settings", force: :cascade do |t| + t.string "var", limit: 255, null: false + t.text "value", limit: 65535 + t.integer "target_id", limit: 4, null: false + t.string "target_type", limit: 255, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "settings", ["target_type", "target_id", "var"], :name => "index_settings_on_target_type_and_target_id_and_var", :unique => true + add_index "settings", ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true, using: :btree - create_table "splash_logs", :force => true do |t| - t.string "destination" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "splash_logs", force: :cascade do |t| + t.string "destination", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "suggested_answers", :force => true do |t| - t.integer "question_id" - t.integer "organisation_id" - t.text "text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "suggested_answers", force: :cascade do |t| + t.integer "question_id", limit: 4 + t.integer "organisation_id", limit: 4 + t.text "text", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "is_example" end - create_table "themes", :force => true do |t| - t.string "title" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "locale" + create_table "themes", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "locale", limit: 255 end - create_table "themes_in_guidance", :id => false, :force => true do |t| - t.integer "theme_id" - t.integer "guidance_id" + create_table "themes_in_guidance", id: false, force: :cascade do |t| + t.integer "theme_id", limit: 4 + t.integer "guidance_id", limit: 4 end - create_table "user_org_roles", :force => true do |t| - t.integer "user_id" - t.integer "organisation_id" - t.integer "user_role_type_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_role_types", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_types", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "users", :force => true do |t| - t.string "firstname" - t.string "surname" - t.string "email", :default => "", :null => false - t.string "orcid_id" - t.string "shibboleth_id" - t.integer "user_type_id" - t.integer "user_status_id" + create_table "token_permission_types", force: :cascade do |t| + t.string "token_type", limit: 255 + t.text "text_description", limit: 65535 t.datetime "created_at" t.datetime "updated_at" - t.string "encrypted_password", :default => "" - t.string "reset_password_token" + end + + create_table "user_identifiers", force: :cascade do |t| + t.string "identifier", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id", limit: 4 + t.integer "identifier_scheme_id", limit: 4 + end + + add_index "user_identifiers", ["identifier_scheme_id"], name: "fk_rails_fe95df7db0", using: :btree + add_index "user_identifiers", ["user_id"], name: "fk_rails_65c9a98cdb", using: :btree + + create_table "user_role_types", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "user_statuses", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "user_types", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.string "firstname", limit: 255 + t.string "surname", limit: 255 + t.string "email", limit: 255, default: "", null: false + t.string "orcid_id", limit: 255 + t.string "shibboleth_id", limit: 255 + t.integer "user_type_id", limit: 4 + t.integer "user_status_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", :default => 0 + t.integer "sign_in_count", limit: 4, default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.string "confirmation_token" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.string "confirmation_token", limit: 255 t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "invitation_token" + t.string "invitation_token", limit: 255 t.datetime "invitation_created_at" t.datetime "invitation_sent_at" t.datetime "invitation_accepted_at" - t.string "other_organisation" - t.boolean "dmponline3" + t.string "other_organisation", limit: 255 t.boolean "accept_terms" - t.integer "organisation_id" + t.integer "organisation_id", limit: 4 + t.string "api_token", limit: 255 + t.integer "invited_by_id", limit: 4 + t.string "invited_by_type", limit: 255 + t.integer "language_id", limit: 4 end - add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true - add_index "users", ["email"], :name => "index_users_on_email", :unique => true - add_index "users", ["invitation_token"], :name => "index_users_on_invitation_token", :unique => true - add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["invitation_token"], name: "index_users_on_invitation_token", unique: true, using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree - create_table "users_roles", :id => false, :force => true do |t| - t.integer "user_id" - t.integer "role_id" + create_table "users_roles", id: false, force: :cascade do |t| + t.integer "user_id", limit: 4 + t.integer "role_id", limit: 4 end - add_index "users_roles", ["user_id", "role_id"], :name => "index_users_roles_on_user_id_and_role_id" + add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id", using: :btree - create_table "versions", :force => true do |t| - t.string "title" - t.text "description" + create_table "versions", force: :cascade do |t| + t.string "title", limit: 255 + t.text "description", limit: 65535 t.boolean "published" - t.integer "number" - t.integer "phase_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "number", limit: 4 + t.integer "phase_id", limit: 4 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "versions", ["phase_id"], :name => "index_versions_on_phase_id" + add_index "versions", ["phase_id"], name: "index_versions_on_phase_id", using: :btree -end \ No newline at end of file + add_foreign_key "user_identifiers", "identifier_schemes" + add_foreign_key "user_identifiers", "users" +end diff --git a/lib/custom_failure.rb b/lib/custom_failure.rb index e8fbb7d..a026e01 100644 --- a/lib/custom_failure.rb +++ b/lib/custom_failure.rb @@ -1,12 +1,13 @@ class CustomFailure < Devise::FailureApp - def redirect - store_location! - message = warden.message || warden_options[:message] - - if message == :timeout - redirect_to root_path - else - super + def redirect_url + root_path end + + def respond + if http_auth? + http_auth + else + redirect + end end end \ No newline at end of file diff --git a/public/files/DMP_Checklist_2013.pdf b/public/files/DMP_Checklist_2013.pdf new file mode 100644 index 0000000..5084d79 --- /dev/null +++ b/public/files/DMP_Checklist_2013.pdf Binary files differ diff --git a/public/files/roadmap_logo.png b/public/files/roadmap_logo.png new file mode 100644 index 0000000..e4cc2dc --- /dev/null +++ b/public/files/roadmap_logo.png Binary files differ diff --git a/public/files/roadmap_logo.svg b/public/files/roadmap_logo.svg new file mode 100644 index 0000000..5fd05e5 --- /dev/null +++ b/public/files/roadmap_logo.svg @@ -0,0 +1,7 @@ + + + + +roadmap +