diff --git a/.gitignore b/.gitignore
index ee170d8..c5f7c47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,12 @@
# Ignore db schema.rb
# db/schema.rb
+# Ignore seed DBs
+db/data.yml
+
+# Ignore the test DB
+db/test.sqlite3
+
# Ignore database configuration and token secrets
config/database.yml
config/secrets.yml
@@ -37,6 +43,9 @@
# ignore IDE files
.idea/*
+# Ignore MAC files
+.DS_Store
+
# ignore yard doc files
.yardoc/*
diff --git a/Gemfile.lock b/Gemfile.lock
index 6ef5a6b..873deac 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/activeadmin/activeadmin.git
- revision: 0a5a15b88bffbe5efad7ff2a072ec4fe6eb09511
+ revision: f8926831429fe635d26ac8043ea5d676fb6ee637
specs:
activeadmin (1.0.0.pre4)
arbre (~> 1.0, >= 1.0.2)
@@ -74,14 +74,14 @@
thor (~> 0.19)
builder (3.2.2)
byebug (9.0.5)
- capybara (2.8.1)
+ capybara (2.9.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- caracal (1.0.6)
+ caracal (1.0.8)
nokogiri (~> 1.6)
rubyzip (~> 1.1)
tilt (>= 1.4)
@@ -137,7 +137,7 @@
has_scope (0.6.0)
actionpack (>= 3.2, < 5)
activesupport (>= 3.2, < 5)
- hashie (3.4.4)
+ hashie (3.4.6)
htmltoword (0.5.1)
actionpack
nokogiri
@@ -181,7 +181,7 @@
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
- minitest (5.9.0)
+ minitest (5.9.1)
minitest-capybara (0.8.2)
capybara (~> 2.2)
minitest (~> 5.0)
@@ -221,8 +221,6 @@
pundit (1.1.0)
activesupport (>= 3.0.0)
rack (1.6.4)
- rack-mini-profiler (0.10.1)
- rack (>= 1.2.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.7)
@@ -249,7 +247,7 @@
activesupport (= 4.2.7)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (11.2.2)
+ rake (11.3.0)
ransack (1.8.2)
actionpack (>= 3.0)
activerecord (>= 3.0)
@@ -293,7 +291,7 @@
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
- tinymce-rails (4.4.2)
+ tinymce-rails (4.4.3)
railties (>= 3.1.1)
twitter-bootstrap-rails (2.2.8)
actionpack (>= 3.1)
@@ -347,7 +345,6 @@
omniauth-shibboleth
protected_attributes
pundit
- rack-mini-profiler
rack-test
rails (= 4.2.7)
railties
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 052fbc2..eeea9a8 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -42,11 +42,20 @@
//accordion project details page when project has more than 1 plan
$('.accordion-project').on('show', function() {
- var plus = $(this).parent().find(".plus-laranja").removeClass("plus-laranja").addClass("minus-laranja");
+ var plus = $(this).parent().children(".accordion-heading").find(".plus-laranja").removeClass("plus-laranja").addClass("minus-laranja");
}).on('hide', function(){
- var minus = $(this).parent().find(".minus-laranja").removeClass("minus-laranja").addClass("plus-laranja");
+ var minus = $(this).parent().children(".accordion-heading").find(".minus-laranja").removeClass("minus-laranja").addClass("plus-laranja");
});
+ $('.export-format-selection').click(function(e){
+ e.preventDefault();
+ if($(this).val() == 'pdf'){
+ $('#pdf-format-options').show();
+ }else{
+ $('#pdf-format-options').hide();
+ }
+ });
+
//$('#3-or-4-splash').modal();
$('.typeahead').select2({
diff --git a/app/assets/stylesheets/admin.css.less b/app/assets/stylesheets/admin.css.less
index 05664c9..3a52df1 100644
--- a/app/assets/stylesheets/admin.css.less
+++ b/app/assets/stylesheets/admin.css.less
@@ -149,7 +149,7 @@
}
.main_nav_tabs{
- width: 500px;
+ width: 700px;
float:left;
position:absolute;
bottom:0;
@@ -227,6 +227,7 @@
top: 100%;
right: 0;
left:45%;
+ width: 100%;
z-index: 99;
display: none;
float: right;
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
index f630d8c..f0b730b 100644
--- a/app/assets/stylesheets/bootstrap_and_overrides.css.less
+++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -149,7 +149,7 @@
}
.main_nav_tabs{
- width: 500px;
+ width: 700px;
float:left;
position:absolute;
bottom:0;
@@ -244,6 +244,7 @@
top: 100%;
right: 0;
left:45%;
+ width: 100%;
z-index: 99;
display: none;
float: right;
@@ -710,6 +711,14 @@
border-radius: 3px;
}
+#new_user ul li span.select2 {
+ float: left;
+}
+#select2-user_organisation_id-container {
+ color: @grey_very_light_colour;
+ border-color: @grey_very_light_colour;
+}
+
label.remember_div{
display: inline-block;
margin: 0 0 4px 12px;
@@ -1564,6 +1573,19 @@
/*******************************/
/********* Exporting **********/
/*******************************/
+.plan-export-settings {
+ h4 {
+ background-color: @orange_colour;
+ color: @white_colour;
+ font-size: 1.2rem;
+ padding: 5px 5px 10px 10px;
+
+ small{
+ color: @white_colour;
+ }
+ }
+}
+
#export_font{
font-family: @text_font;
}
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 005e288..9069855 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -24,6 +24,7 @@
if params[:locale] # and I18n.available_locales.include? params[:locale] # throw an error if not available
# if locales data is present in the parameter from url use it
I18n.locale = params[:locale]
+
elsif user_signed_in? and !current_user[:language_id].nil?
I18n.locale = Language.find_by_id(current_user[:language_id]).abbreviation
# if user has set preferred language use it
@@ -31,6 +32,7 @@
elsif user_signed_in? and current_user.organisation.present? and !current_user.organisation[:language_id].nil?
I18n.locale = Language.find_by_id(current_user.organisation[:language_id]).abbreviation
# use user's organization language, keep in mine the "OTHER ORG" edge case which should use default language
+
else
# just use the default language, line can be commented out, included just for clarity
I18n.locale = I18n.default_locale
@@ -77,7 +79,10 @@
def get_plan_list_columns
if user_signed_in?
@selected_columns = current_user.settings(:plan_list).columns
+ @selected_columns = Settings::PlanList::DEFAULT_COLUMNS if @selected_columns.empty?
+
@all_columns = Settings::PlanList::ALL_COLUMNS
end
end
+
end
diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb
index 839d7c4..564a1f1 100644
--- a/app/controllers/organisations_controller.rb
+++ b/app/controllers/organisations_controller.rb
@@ -14,6 +14,8 @@
def admin_edit
@organisation = Organisation.find(params[:id])
authorize @organisation
+
+ @languages = Language.all.order("name")
end
@@ -27,10 +29,17 @@
assign_params.delete(:logo)
respond_to do |format|
- if @organisation.update_attributes(assign_params)
- format.html { redirect_to admin_show_organisation_path(params[:id]), notice: I18n.t("admin.org_updated_message") }
- else
- format.html { render action: "edit" }
+ begin
+ if @organisation.update_attributes(assign_params)
+ format.html { redirect_to admin_show_organisation_path(params[:id]), notice: I18n.t("admin.org_updated_message") }
+ else
+ flash[:noice] = @organisation.errors.collect{|e| e.message}.join('
').html_safe
+ format.html { render action: "admin_edit" }
+ end
+
+ rescue Dragonfly::Job::Fetch::NotFound => dflye
+ flash[:notice] = I18n.t("admin.org_bad_logo")
+ format.html {render action: "admin_edit"}
end
end
end
diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb
index 9a05242..f5125d6 100644
--- a/app/controllers/plans_controller.rb
+++ b/app/controllers/plans_controller.rb
@@ -134,7 +134,7 @@
format.html { render action: "edit" }
else
- format.html { render action: "edit" }]
+ format.html { render action: "edit" }
end
end
else
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index d7127bb..59b52b5 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -1,6 +1,10 @@
# app/controllers/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
+ def edit
+ @languages = Language.all.order("name")
+ end
+
# POST /resource
def create
logger.debug "#{sign_up_params}"
@@ -57,7 +61,6 @@
end
def do_update(require_password = true, confirm = false)
-
if require_password then
successfully_updated = if needs_password?(@user, params)
@user.update_with_password(params[:user])
@@ -72,6 +75,17 @@
successfully_updated = @user.update_without_password(params[:user])
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
+ set_locale
+ end
+ end
+
#unlink shibboleth from user's details
if params[:unlink_flag] == 'true' then
@user.update_attributes(:shibboleth_id => "")
@@ -86,11 +100,11 @@
# Sign in the user bypassing validation in case his password changed
sign_in @user, :bypass => true
- if params[:unlink_flag] == 'true' then
+ #if params[:unlink_flag] == 'true' then
redirect_to({:controller => "registrations", :action => "edit"}, {:notice => I18n.t('helpers.project.details_update_success')})
- else
- redirect_to({:controller => "projects", :action => "index"}, {:notice => I18n.t('helpers.project.details_update_success')})
- end
+ #else
+ # redirect_to({:controller => "projects", :action => "index"}, {:notice => I18n.t('helpers.project.details_update_success')})
+ #end
else
render "edit"
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 5515afb..aa0b716 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -1,27 +1,15 @@
-# app/controllers/sessions_controller.rb
class SessionsController < Devise::SessionsController
- def create
- existing_user = User.find_by_email(params[:user][:email])
+ # Capture the user's shibboleth id if they're coming in from an IDP
+ def create
+ existing_user = User.find_by_email(params[:user][:email])
- if !existing_user.nil? && (existing_user.password == "" || existing_user.password.nil?) && existing_user.confirmed_at.nil? then
- redirect_to :controller => :existing_users, :action => :index, :email => params[:user][:email]
- else
- #after authentication verify if session[:shibboleth] exists
- if !params[:shibboleth_data].nil? then
- existing_user.update_attributes(:shibboleth_id => session[:shibboleth_data][:uid])
- end
- super
-
- end
- end
-
- def destroy
- current_user.plan_sections.each do |lock|
- lock.delete
-
- end
- super
+ if !existing_user.nil? && !params[:shibboleth_data].nil? then
+ #after authentication verify if session[:shibboleth] exists
+ existing_user.update_attributes(shibboleth_id: session[:shibboleth_data][:uid])
end
+ super
+ end
+
end
\ No newline at end of file
diff --git a/app/controllers/settings/plans_controller.rb b/app/controllers/settings/plans_controller.rb
index c9a4adb..2c65aea 100644
--- a/app/controllers/settings/plans_controller.rb
+++ b/app/controllers/settings/plans_controller.rb
@@ -5,7 +5,7 @@
after_action :verify_authorized
def show
- authorize [:settings, plan]
+ authorize @plan
respond_to do |format|
format.html
format.partial
@@ -13,10 +13,10 @@
end
def update
- authorize [:settings, plan]
+ authorize @plan
export_params = params[:export].try(:deep_symbolize_keys)
- settings = plan.super_settings(:export).tap do |s|
+ settings = @plan.super_settings(:export).tap do |s|
if params[:commit] == 'Reset'
s.formatting = nil
s.fields = nil
@@ -29,7 +29,7 @@
if settings.save
respond_to do |format|
- format.html { redirect_to(export_project_path(plan.project)) }
+ format.html { redirect_to(export_project_path(@plan.project)) }
end
else
settings.formatting = nil
@@ -41,6 +41,8 @@
private
def get_settings
+ @plan = Plan.find(params[:id])
+
@export_settings = plan.settings(:export)
end
diff --git a/app/controllers/settings/projects_controller.rb b/app/controllers/settings/projects_controller.rb
index 5a2d48d..6ba2cd3 100644
--- a/app/controllers/settings/projects_controller.rb
+++ b/app/controllers/settings/projects_controller.rb
@@ -10,6 +10,8 @@
authorize [:settings, Project]
respond_to do |format|
format.html
+
+ format.json{ render json: settings_json }
end
end
@@ -20,6 +22,8 @@
if @settings.update_attributes(columns: columns)
respond_to do |format|
format.html { redirect_to(projects_path) }
+
+ format.json{ render json: settings_json }
end
else
render(action: :show) # Expect #show to display errors etc
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 636c44a..4d6bd4f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -3,7 +3,9 @@
def admin_index
authorize User
- @users = current_user.organisation.users.includes(:roles, :project_groups)
+
+ @users = User.where(organisation: current_user.organisation).includes(:project_groups)
+
respond_to do |format|
format.html # index.html.erb
end
diff --git a/app/helpers/plans_helper.rb b/app/helpers/plans_helper.rb
deleted file mode 100644
index 37a6355..0000000
--- a/app/helpers/plans_helper.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-module PlansHelper
-
- def project_list_head(column)
- klass = case column
- when 'name' then :dmp_th_big
- when 'description' then :dmp_th_big
- else :dmp_th_small
- end
-
- content_tag(:th, t("helpers.project.columns.#{column}"), class: klass)
- end
-
- def project_list_body(column, project)
- klass, content = case column[0]
- when 'name'
- [ "dmp_td_big", link_to(project.title, project_path(project), class: "dmp_table_link") ]
-
- when 'owner'
- user = project.owner
-
- text = if user.nil?
- "Unknown"
- elsif user == current_user
- t("helpers.me")
- else
- user.name
- end
-
- [ "tmp_td_small", text ]
- when 'shared'
- shared_num = project.project_groups.count - 1
- text = shared_num > 0 ? (t("helpers.yes_label") + " (with #{shared_num} people) ") : t("helpers.no_label")
- [ "dmp_td_small", text ]
- when 'last_edited'
- [ "dmp_td_small", l(project.latest_update.to_date, formats: :short) ]
- when 'description'
- [ "dmp_td_medium", (project.try(column[0]) || "Unknown") ]
- else
- [ "dmp_td_small", (project.try(column[0]) || "Unknown") ]
- end
-
- content_tag(:td, content, class: klass)
- end
-
- # Shows whether the user has default, template-default or custom settings
- # for the given plan.
- def plan_settings_indicator(plan)
- plan_settings = plan.super_settings(:export)
- template_settings = plan.project.dmptemplate.try(:settings, :export)
-
- key = if plan_settings.try(:value?)
- plan_settings.formatting == template_settings.formatting ? "template_formatting" : "custom_formatting"
- elsif template_settings.try(:value?)
- "template_formatting"
- else
- "default_formatting"
- end
-
- content_tag(:small, t("helpers.settings.plans.#{key}"))
- end
-
-end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
new file mode 100644
index 0000000..fd5881e
--- /dev/null
+++ b/app/helpers/projects_helper.rb
@@ -0,0 +1,76 @@
+module ProjectsHelper
+
+ # Build variable column headings for the project list
+ # --------------------------------------------------------
+ def project_list_column_heading(column)
+ if column.kind_of?(Array)
+ heading = (column.first.kind_of?(String) ? column.first : t("helpers.project.columns.unknown"))
+
+ elsif column.kind_of?(String)
+ heading = column
+
+ else
+ heading = t("helpers.project.columns.unknown")
+ end
+
+ klass = (['name', 'description'].include?(heading) ? :dmp_th_big : :dmp_th_small)
+
+ content_tag(:th, t("helpers.project.columns.#{heading}"), class: klass)
+ end
+
+ # Populate a variable column for the project list
+ # --------------------------------------------------------
+ def project_list_column_body(column, project)
+
+ col = (column.kind_of?(Array) ? column[0] : column)
+
+ klass, content = case col
+ when 'name'
+ [ "dmp_td_big", link_to(project.title, project_path(project), class: "dmp_table_link") ]
+
+ when 'owner'
+ user = project.owner
+
+ text = if user.nil?
+ "Unknown"
+ elsif user == current_user
+ t("helpers.me")
+ else
+ user.name
+ end
+
+ [ "tmp_td_small", text ]
+ when 'shared'
+ shared_num = project.project_groups.count - 1
+ text = shared_num > 0 ? (t("helpers.yes_label") + " (with #{shared_num} people) ") : t("helpers.no_label")
+ [ "dmp_td_small", text ]
+ when 'last_edited'
+ [ "dmp_td_small", l(project.latest_update.to_date, formats: :short) ]
+ when 'description'
+ [ "dmp_td_medium", (project.try(col) || "Unknown") ]
+ else
+ [ "dmp_td_small", (project.try(col) || "Unknown") ]
+ end
+
+ content_tag(:td, content, class: klass)
+ end
+
+ # Shows whether the user has default, template-default or custom settings
+ # for the given plan.
+ # --------------------------------------------------------
+ def plan_settings_indicator(plan)
+ plan_settings = plan.super_settings(:export)
+ template_settings = plan.project.dmptemplate.try(:settings, :export)
+
+ key = if plan_settings.try(:value?)
+ plan_settings.formatting == template_settings.formatting ? "template_formatting" : "custom_formatting"
+ elsif template_settings.try(:value?)
+ "template_formatting"
+ else
+ "default_formatting"
+ end
+
+ content_tag(:small, t("helpers.settings.plans.#{key}"))
+ end
+
+end
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index 8a60e7b..e11166a 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -2,7 +2,7 @@
default from: I18n.t('helpers.main_email.from')
def sharing_notification(project_group)
- @project_group = project_group
+ @project_group = project_group
mail(to: @project_group.user.email, subject: I18n.t('helpers.main_email.access_given'))
end
diff --git a/app/models/exported_plan.rb b/app/models/exported_plan.rb
index 68fe5bf..2ea784b 100644
--- a/app/models/exported_plan.rb
+++ b/app/models/exported_plan.rb
@@ -93,6 +93,11 @@
def as_txt
output = "#{self.plan.project.title}\n\n#{self.plan.version.phase.title}\n"
+
+puts "SETTINGS: #{self.plan.inspect}"
+
+ output += "\nDetails:\n#{self.plan.settings[:export][:fields][:admin].collect{|f| f.to_s}.join('\n')}\n"
+
self.sections.each do |section|
output += "\n#{section.title}\n"
diff --git a/app/models/organisation.rb b/app/models/organisation.rb
index 488debf..d073907 100644
--- a/app/models/organisation.rb
+++ b/app/models/organisation.rb
@@ -8,7 +8,7 @@
has_many :guidance_groups
has_many :dmptemplates
has_many :sections
- has_many :users, through: :user_org_roles
+ has_many :users
has_many :option_warnings
has_many :suggested_answers
has_and_belongs_to_many :token_permission_types, join_table: "org_token_permissions"
diff --git a/app/models/user.rb b/app/models/user.rb
index 6921a36..d3bec38 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -13,11 +13,11 @@
has_many :answers
has_many :user_org_roles
has_many :project_groups, :dependent => :destroy
- has_many :organisations , through: :user_org_roles
+ #has_many :organisations , through: :user_org_roles
has_many :user_role_types, through: :user_org_roles
has_one :language
-
+ belongs_to :organisation
has_many :projects, through: :project_groups do
def filter(query)
@@ -48,7 +48,7 @@
:firstname, :last_login,:login_count, :orcid_id, :password, :shibboleth_id,
:user_status_id, :surname, :user_type_id, :organisation_id, :skip_invitation,
:other_organisation, :accept_terms, :role_ids, :dmponline3, :api_token,
- :language_id
+ :language_id, :organisation
# FIXME: The duplication in the block is to set defaults. It might be better if
# they could be set in Settings::PlanList itself, if possible.
@@ -79,31 +79,34 @@
# @return [String] the empty string as a causality of setting api_token
def organisation_id=(new_organisation_id)
# DEPRICATED STRUCTURE ONLY USED HERE
- if !self.user_org_roles.pluck(:organisation_id).include?(new_organisation_id.to_i) then
+# if !self.user_org_roles.pluck(:organisation_id).include?(new_organisation_id.to_i) then
# if the user has more than one role
- if self.user_org_roles.count != 1 then
- new_user_org_role = UserOrgRole.new
- new_user_org_role.organisation_id = new_organisation_id
- new_user_org_role.user_role_type = UserRoleType.find_by(name: constant("user_role_types.user"));
- self.user_org_roles << new_user_org_role
+# if self.user_org_roles.count != 1 then
+# new_user_org_role = UserOrgRole.new
+# new_user_org_role.organisation_id = new_organisation_id
+# new_user_org_role.user_role_type = UserRoleType.find_by(name: constant("user_role_types.user"));
+# self.user_org_roles << new_user_org_role
# if the user has roles other than one(0/2/3?)
- else
+# else
# set role to first role
- user_org_role = self.user_org_roles.first
+# user_org_role = self.user_org_roles.first
# change org_id to new org_id
- user_org_role.organisation_id = new_organisation_id
+# user_org_role.organisation_id = new_organisation_id
# save modified role
- user_org_role.save
+# user_org_role.save
# if the user is not part of the new organisation
- if !self.user_org_roles.pluck(:organisation_id).include?(new_organisation_id.to_i) then
- unless self.can_change_org?
+# if !self.user_org_roles.pluck(:organisation_id).include?(new_organisation_id.to_i) then
+# unless self.can_change_org?
# rip all permissions from user
- self.roles.delete_all
- self.save!
- end
- end
- end
- end
+# self.roles.delete_all
+# self.save!
+# end
+# end
+# end
+# end
+
+ self.organisation = Organisation.find(new_organisation_id)
+
# rip api_token from user
self.remove_token!
end
@@ -113,24 +116,25 @@
#
# @return [Integer, nil] the id of the user's organisation
def organisation_id
- if self.organisations.count > 0 then
- return self.organisations.first.id
- else
- return nil
- end
+# if self.organisations.count > 0 then
+# return self.organisations.first.id
+# else
+# return nil
+# end
+ (self.organisation.nil? ? nil : self.organisation.id)
end
##
# returns the organisation of the user or nil
#
# @return [Organisation, nil] the organisation of the user
- def organisation
- if self.organisations.count > 0 then
- return self.organisations.first
- else
- return nil
- end
- end
+# def organisation
+# if self.organisations.count > 0 then
+# return self.organisations.first
+# else
+# return nil
+# end
+# end
##
# returns the last organisation in the list of organisations
@@ -138,20 +142,21 @@
#
# @return [Organisation, nil] the organisation for the user
def current_organisation
- if self.organisations.count > 0 then
- return self.organisations.last
- else
- return nil
- end
+# if self.organisations.count > 0 then
+# return self.organisations.last
+# else
+# return nil
+# end
+ self.organisation
end
##
# sets a new organisation for the user
#
# @param new_organisation [Organisation] the new organisation for the user
- def organisation=(new_organisation)
- organisation_id = organisation.id
- end
+# def organisation=(new_organisation)
+# organisation_id = organisation.id
+# end
##
# checks if the user is a super admin
@@ -269,7 +274,7 @@
# generates a new token for the user unless the user already has a token.
# modifies the user's model.
def keep_or_generate_token!
- if api_token.empty?
+ if api_token.nil? || api_token.empty?
self.api_token = loop do
random_token = SecureRandom.urlsafe_base64(nil, false)
break random_token unless User.exists?(api_token: random_token)
@@ -293,7 +298,7 @@
grant_permissions = Role.find_by(name: 'grant_permissions')
modify_templates = Role.find_by(name: 'modify_templates')
modify_guidance = Role.find_by(name: 'modify_guidance')
- change_org_details = Role.find_by(name: 'change_org_detials')
+ change_org_details = Role.find_by(name: 'change_org_details')
User.includes(:roles).all.each do |user|
roles = user.roles
roles.each do |role|
diff --git a/app/policies/guidance_group_policy.rb b/app/policies/guidance_group_policy.rb
index dd3725f..422ea26 100644
--- a/app/policies/guidance_group_policy.rb
+++ b/app/policies/guidance_group_policy.rb
@@ -24,11 +24,11 @@
end
def admin_new?
- user.can_modify_guidance? && (guidance_group.organisation_id == user.organisation_id)
+ user.can_modify_guidance?
end
def admin_create?
- user.can_modify_guidance? && (guidance_group.organisation_id == user.organisation_id)
+ user.can_modify_guidance?
end
def admin_destroy?
diff --git a/app/policies/organisation_policy.rb b/app/policies/organisation_policy.rb
index 677912c..8fb3bb2 100644
--- a/app/policies/organisation_policy.rb
+++ b/app/policies/organisation_policy.rb
@@ -8,15 +8,15 @@
end
def admin_show?
- user.can_modify_org_details? && (user.organisation_id == organisation.id)
+ user.can_modify_org_details? && (user.organisation.id == organisation.id)
end
def admin_edit?
- user.can_modify_org_details? && (user.organisaiton_id == organisation.id)
+ user.can_modify_org_details? && (user.organisation.id == organisation.id)
end
def admin_update?
- user.can_modify_org_details? && (user.organisaiton_id == organisation.id)
+ user.can_modify_org_details? && (user.organisation.id == organisation.id)
end
def parent?
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index bb25316..7357115 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -53,10 +53,15 @@
| <%= t('org_admin.org_name') %> | -<%= f.text_field :name, - :as => :string, - :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.name_help_text') %> | -
| <%= t('org_admin.org_abbr') %> | -
- <%= f.text_field :abbreviation,
- :as => :string,
- :class => 'text_field' %>
-
-
- <%= link_to( image_tag('help_button.png'), '#', :class => 'org_abbr_popover', :rel => "popover", 'data-html' => "true", 'data-content' => t('org_admin.templates.desc_help_text_html'))%>
-
-
- |
-
-
| <%= t('org_admin.org_logo') %> | -<%= image_tag @organisation.logo.url %> | -
| - | <%= f.check_box :remove_logo %> <%= t('org_admin.remove_logo') %> | -
| <%= t('org_admin.new_org_logo') %> | -<%= f.file_field :logo %> | -
| <%= t('org_admin.org_banner_text') %> | -- <%= text_area_tag("org_banner_text", @organisation.banner_text, class: "tinymce") %> - | -
| <%= t('org_admin.org_target_url') %> | -<%= f.text_field :target_url, - :as => :string, - :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.target_url_help_text') %> | -
| <%= t('org_admin.org_contact_email') %> | -<%= f.text_field :contact_email, - :as => :string, - :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.org_contact_email_help_text') %> | -
| <%= t('org_admin.org_type') %> | -<%= @organisation.organisation_type.name %> | -
| <%= t('org_admin.org_name') %> | +<%= f.text_field :name, :as => :string, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.name_help_text') %> | +
| <%= t('org_admin.org_abbr') %> | +
+
+ <%= f.text_field :abbreviation, :as => :string, :class => 'text_field' %>
+
+
+ |
+
| <%= t('org_admin.org_logo') %> | +<%= image_tag @organisation.logo.url %> | +
| + | <%= f.check_box :remove_logo %> <%= t('org_admin.remove_logo') %> | +
| <%= t('org_admin.new_org_logo') %> | +<%= f.file_field :logo %> | +
| <%= t('org_admin.org_banner_text') %> | +<%= text_area_tag("org_banner_text", @organisation.banner_text, class: "tinymce") %> | +
| <%= t('org_admin.org_target_url') %> | +<%= f.text_field :target_url, :as => :string, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.target_url_help_text') %> | +
| <%= t('org_admin.org_contact_email') %> | +<%= f.text_field :contact_email, :as => :string, :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.org_contact_email_help_text') %> | +
| <%= t('org_admin.org_type') %> | ++ <%= @organisation.organisation_type.name %> + | +
| <%= t('org_admin.org_name') %> | -<%= f.text_field :name, - :as => :string, - :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.name_help_text') %> | -
| <%= t('org_admin.org_abbr') %> | -
-
- <%= f.text_field :abbreviation,
- :as => :string,
- :class => 'text_field' %>
-
-
- <%= link_to(image_tag('help_button.png'), '#', :class => 'org_abbr_popover', :rel => "popover", 'data-html' => "true", 'data-content' => t('org_admin.templates.desc_help_text_html')) %>
-
-
- |
-
-
| <%= t('org_admin.org_desc') %> | -<%= f.text_area :description, { - :rows => 5, - :class => 'text_area has-tooltip', 'data-toggle' => "tooltip", 'data-html' => "true", 'title' => t('org_admin.desc_help_text_html')} %> | -
| <%= t('org_admin.org_banner_text') %> | -- <%= text_area_tag("org_banner_text", @organisation.banner_text, class: "tinymce") %> - | -
| <%= t('org_admin.org_target_url') %> | -<%= f.text_field :target_url, - :as => :string, - :class => 'text_field has-tooltip', 'data-toggle' => "tooltip", 'title' => t('org_admin.target_url_help_text') %> | -
| <%= t('org_admin.org_default_language') %> | -
-
- <%= collection_select(:@organisation,
- :language_id, Language.all.order("name"),
- :id, :name, {selected: Language.where(default_language: true).first.id},
- {:class => "typeahead org_sign_up"}) %>
-
-
- <%= link_to(image_tag('help_button.png'), '#', :class => 'org_abbr_popover', :rel => "popover", 'data-html' => "true", 'data-content' => t('org_admin.org_default_language_help_text')) %>
-
-
- |
-
-
| <%= t('org_admin.org_type') %> | -<%= @organisation.organisation_type.name %> | -
Sie können eine Hilfestellungtexte erstellen, die im Zusammenhang mit bestimmten Themen angezeigt werden, oder die sich auf eine spezifische Frage beziehen. Generische Hilfestellungen für Themen helfen Zeit und Arbeit zu sparen, da Ihre Hilfestellungen automatisch für alle Vorlagen angezeigt werden; sie müssen andernfalls für jede Vorlage neu erstellt werden.
Im Normalfall werden Sie wollen, dass Ihre Orinetierungshilfen in allen Vorlagen angezeigt wird. Ausnahmen sind z.B. Hilfestellungen die spezielle Hinweise für einen Förderer geben.
" delete_message: "Sie sind dabei '%{guidance_summary}' zu löschen. Sind Sie sicher?" @@ -295,7 +300,6 @@ institution_sign_in_link: "Oder melden Sie sich mit den Zugangsdaten Ihres Instituts an" institution_sign_in: "" - user_name: "E-Mail-Adresse" email: "E-Mail" org_not_listed: "Meine Organisation ist nicht in der Auflistung." @@ -321,7 +325,7 @@ no_unlock_instructions: "Entsperrungsanleitungen nicht erhalten?" send_password_info: "Anleitung zum Zurücksetzen des Passworts" edit_password_info: "Zum Ändern Ihres Passworts folgende Felder ausfüllen." - accept_terms_html: "Ich akzeptiere die Nutzungsbedingungen *" + accept_terms_html: "Ich akzeptiere die Nutzungsbedingungen *" text_area: "Text area" text_field: "Textfeld" @@ -348,6 +352,13 @@ removing: "Entferne..." unsaved: "Ungesicherte Änderungen" unlink_account: "Trenne Zugang" + + links: + edit: "Bearbeiten" + share: "Teilen" + export: "Export" + destroy: "Löschen" + submit: edit: "Bearbeiten" create: "Erstellen" @@ -564,6 +575,7 @@ principal_investigator: "Principal Investigator / Researcher" data_contact: "Plandatenkontakt" description: "Beschreibung" + unknown: " - " filter: placeholder: "Filter Pläne" submit: "Filter" @@ -596,7 +608,7 @@ duplicate: "Doppelter Spaltenname. Bitte jede Spalte nur einmal einfügen." unknown: "Unbekannter Spaltenname." plans: - title: "Plantitel" + title: "Dateiname" reset: "Zurücksetzen" custom_formatting: "(Verwende eigene Werte bei PDF-Formatierung)" template_formatting: "(Verwende Vorlagenwerte bei PDF-Formatting)" @@ -855,7 +867,7 @@ institution: 'Institution' research_institute: 'Research Institute' template: 'Template' - managing_organisation: 'Digital Curation Center' + managing_organisation: 'Digital Curation Centre' user_role_types: super_admin: 'admin' organisational_admin: 'org_admin' @@ -866,7 +878,7 @@ modify_templates: 'modify_templates' modify_guidance: 'modify_guidance' use_api: 'use_api' - change_org_details: 'change_org_detials' + change_org_details: 'change_org_details' grant_api_to_orgs: 'grant_api_to_orgs' api_endpoint_types: guidances: 'guidances' diff --git a/config/locales/en-UK.yml b/config/locales/en-UK.yml index 6d809eb..3476de2 100644 --- a/config/locales/en-UK.yml +++ b/config/locales/en-UK.yml @@ -1,6 +1,6 @@ # [+Project:+] DMPRoadmap # [+Description:+] This file contains all the text present on DMPRoadmap that is not being retrieve from the database. -# [+Copyright:+] Digital Curation Centre and University of California Curation Center +# [+Copyright:+] Digital Curation Centre and University of California Curation Centre en-UK: date: @@ -55,6 +55,7 @@ org_parent: "Parent organisation" org_created_message: "Organisation was successfully created." org_updated_message: "Organisation was successfully updated." + org_bad_logo: "There seems to be a problem with your logo. Please upload it again." plans: "Plans" title: "Title" desc: "Description" @@ -148,6 +149,7 @@ user_name: "Email address" last_logged_in: "Last logged in" how_many_plans: "How many plans?" + privileges: "Privileges" user_text_html: "Below is a list of users registered for your organisation. You can sort the data by each field." org_name: "Name" org_abbr: "Abbreviation" @@ -165,7 +167,7 @@ top_banner_help_text_html: "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board) or you can write guidance for specific questions. Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
You will usually want your guidance to display on all templates, however there may be cases where you only want it to show for specific funders e.g. if you have specific instructions for applicants to BBSRC for example. This can be set too if needed.
" delete_message_html: "You are about to delete '%{guidance_summary}'. Are you sure?" @@ -369,7 +372,7 @@ no_unlock_instructions: "Didn't receive unlock instructions?" send_password_info: "Reset password instructions" edit_password_info: "If you would like to change your password please complete the following fields." - accept_terms_html: " I accept the terms and conditions *" + accept_terms_html: " I accept the terms and conditions *" you_must_accept: 'You must accept the terms and conditions to register.' email_already_registered: 'That email address is already registered.' email_must_valid_confirmation_message: "This must be a valid email address - a message will be sent to it for confirmation." @@ -426,6 +429,13 @@ removing: "Removing..." unsaved: "Unsaved changes" unlink_account: "Unlink account" + + links: + edit: "Edit" + share: "Share" + export: "Export" + destroy: "Delete" + submit: edit: "Edit" create: "Create" @@ -613,6 +623,7 @@ principal_investigator: "Principal Investigator / Researcher" data_contact: "Plan data contact" description: "Description" + unknown: " - " filter: placeholder: "Filter plans" submit: "Filter" @@ -656,7 +667,7 @@ duplicate: "Duplicate column name. Please only include each column once." unknown: "Unknown column name." plans: - title: "Plan title" + title: "File Name" reset: "Reset" description: "Description" custom_formatting: "(Using custom PDF formatting values)" @@ -704,7 +715,7 @@We are constantly improving the user interface and functionality of %{application_name}. If you would like to contribute with feedback and suggestions, please contact us by emailing - %{organisation_email}. You can also report bugs and request new features directly on GitHub
" + dmponline@dcc.ac.uk. You can also report bugs and request new features directly on GitHub" body_text_tab_2_html: "%{application_name} stories from the %{organisation_abbreviation} website
" @@ -715,7 +726,7 @@ body_text_tab_2_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 %{organisation_email}.
" + 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.
" address_text_html: "Tel. +44 (0) 131 651 1239
-Email %{organisation_email}
" +Email dmponline@dcc.ac.uk
" roadmap_page: title: "Future plans" tab_1: "Releases" tab_2: "Get involved" - body_text_tab_1_html: "The %{organisation_abbreviation} are now collaborating to develop a joint codebase for Data Management Planning called DMP Roadmap. Both of our tools will be delivered using this in the future. We've agreed what features need to be included and are planning a few sprints to deliver these. The initial release will include all of the main priorities we already had flagged, including:
+ body_text_tab_1_html: "The %{organisation_abbreviation} are now collaborating to develop a joint codebase for Data Management Planning called DMP Roadmap. Both of our tools will be delivered using this in the future. We've agreed what features need to be included and are planning a few sprints to deliver these. The initial release will include all of the main priorities we already had flagged, including:
%{application_name} has an active and growing user base, and we are grateful to the members who suggest ideas for new and improved features. If you would like to help shape our future plans, please join the user group. More information on how you can engage with us is available under the 'Get involved' tab.
+%{application_name} has an active and growing user base, and we are grateful to the members who suggest ideas for new and improved features. If you would like to help shape our future plans, please join the user group. More information on how you can engage with us is available under the 'Get involved' tab.
The current version of %{application_name} is %{application_version}.
@@ -847,24 +858,24 @@ body_text_tab_2_html: "%{application_name} is developed and maintained by the UK %{organisation_name}. We’re a small team, and are happy to collaborate with others. There are various ways you can get involved:
We run a listserv for the %{application_name} user group that you can request to join. We also host periodic meetings to consult on our plans. Being part of the user group gives you the opportunity to be informed about future developments and to provide feedback to help shape our plans.
+We run a listserv for the %{application_name} user group that you can request to join. We also host periodic meetings to consult on our plans. Being part of the user group gives you the opportunity to be informed about future developments and to provide feedback to help shape our plans.
Our user group sessions are usually focused around a certain topic (e.g. fleshing out use cases for an API) so invites are sent based on your areas of expertise. It is helpful for us to know your role and interests to invite relevant people to each session. Please introduce yourself on the list and share your ideas.
-Notes from previous user group sessions are provided below:
-Notes from previous user group sessions are provided below:
+Please let us know your interests and share your ideas for future developments via the mailing list so the community as a whole can feedback on them.
%{application_name} can be customised by institutions and disciplines. You can add templates for users in your organisation and tailored guidance that explains local support and services. Example answers can also be offered to help users understand what to write in a Data Management Plan. To do this you’ll need to request admin access, so please email us on %{organisation_email}.
-Futher guidance on customising %{application_name} is available on the %{organisation_abbreviation} website.
+%{application_name} can be customised by institutions and disciplines. You can add templates for users in your organisation and tailored guidance that explains local support and services. Example answers can also be offered to help users understand what to write in a Data Management Plan. To do this you’ll need to request admin access, so please email us on dmponline@dcc.ac.uk.
+Futher guidance on customising %{application_name} is available on the %{application_name} website.
%{application_name} is a Ruby on Rails application. The source code is made available under a GNU Affero General Public License. This permits others to reuse the code freely, but obligates you to share the source code for any extensions in the same way. Please inform us if you install an instance of %{application_name} and offer your contributions back to the community.
+%{application_name} is a Ruby on Rails application. The source code is made available under an MIT License. This permits others to reuse the code freely, but obligates you to share the source code for any extensions in the same way. Please inform us if you install an instance of %{application_name} and offer your contributions back to the community.
If you install an instance of %{application_name} we require that you credit the %{organisation_abbreviation} as originators of the tool. We recommend that the acknowledgement takes the form of the %{application_name} logo with a link back to the %{organisation_abbreviation}-hosted version of the tool.
-We are willing to work with external developers to add new features to the tool. We are also open to delivering new features on a chargeable basis. If there are extensions you would like to see prioritised and have resource to support additional developer effort, please contact us on %{organisation_email} to negotiate terms.
-The code is available on GitHub
+We are willing to work with external developers to add new features to the tool. We are also open to delivering new features on a chargeable basis. If there are extensions you would like to see prioritised and have resource to support additional developer effort, please contact us on dmponline@dcc.ac.uk to negotiate terms.
+The code is available on GitHub
We are impressed by the uptake of %{application_name} both in the UK and internationally and are really keen to hear how you are using the tool and promoting it in your context. We are aware that others have run training courses, developed guidance materials and advocated use of the tool. Please notify us of this as it helps to show impact.
We are currently investigating options for revenue generation. This will help us serve the increased demand more effectively and safeguard the long-term sustainability of %{application_name}. Plans will be released for consultation soon but we also welcome your suggestions on how best to support our work.
" @@ -951,7 +962,7 @@ institution: 'Institution' research_institute: 'Research Institute' template: 'Template' - managing_organisation: 'Digital Curation Center' + managing_organisation: 'Digital Curation Centre' user_role_types: super_admin: 'admin' organisational_admin: 'org_admin' @@ -962,7 +973,7 @@ modify_templates: 'modify_templates' modify_guidance: 'modify_guidance' use_api: 'use_api' - change_org_details: 'change_org_detials' + change_org_details: 'change_org_details' grant_api_to_orgs: 'grant_api_to_orgs' api_endpoint_types: guidances: 'guidances' diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index 2a1fdd7..e363d7c 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -49,6 +49,7 @@ org_parent: "Parent organization" org_created_message: "Organization was successfully created." org_updated_message: "Organization was successfully updated." + org_bad_logo: "There seems to be a problem with your logo. Please upload it again." plans: "Plans" title: "Title" desc: "Description" @@ -138,6 +139,7 @@ user_name: "Email address" last_logged_in: "Last logged in" how_many_plans: "How many plans?" + privileges: "Permissions" user_text_html: "Below is a list of users registered for your organization. You can sort the data by each field." org_name: "Name" org_abbr: "Abbreviation" @@ -157,7 +159,7 @@ top_banner_help_text_html: "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board) or you can write guidance for specific questions. Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
You will usually want your guidance to display on all templates, however there may be cases where you only want it to show for specific funders e.g. if you have specific instructions for applicants to BBSRC for example. This can be set too if needed.
" delete_message_html: "You are about to delete '%{guidance_summary}'. Are you sure?" @@ -358,7 +362,7 @@ no_unlock_instructions: "Didn't receive unlock instructions?" send_password_info: "Reset password instructions" edit_password_info: "If you would like to change your password please complete the following fields." - accept_terms_html: " I accept the terms and conditions *" + accept_terms_html: " I accept the terms and conditions *" you_must_accept: 'You must accept the terms and conditions to register.' email_already_registered: 'That email address is already registered.' email_must_valid_confirmation_message: "This must be a valid email address - a message will be sent to it for confirmation." @@ -415,6 +419,13 @@ removing: "Removing..." unsaved: "Unsaved changes" unlink_account: "Unlink account" + + links: + edit: "Edit" + share: "Share" + export: "Export" + destroy: "Delete" + submit: edit: "Edit" create: "Create" @@ -602,6 +613,7 @@ principal_investigator: "Principal Investigator / Researcher" data_contact: "Plan data contact" description: "Description" + unknown: " - " filter: placeholder: "Filter plans" submit: "Filter" @@ -645,7 +657,7 @@ duplicate: "Duplicate column name. Please only include each column once." unknown: "Unknown column name." plans: - title: "Plan title" + title: "File Name" reset: "Reset" description: "Description" custom_formatting: "(Using custom PDF formatting values)" @@ -693,7 +705,7 @@We are constantly improving the user interface and functionality of %{application_name}. If you would like to contribute with feedback and suggestions, please contact us by emailing - %{organisation_email}. You can also report bugs and request new features directly on GitHub
" + dmponline@dcc.ac.uk. You can also report bugs and request new features directly on GitHub" body_text_tab_2_html: "%{application_name} stories from the %{organisation_abbreviation} website
" @@ -704,7 +716,7 @@ body_text_tab_2_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 %{organisation_email}.
" + 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.
" address_text_html: "Tel. +44 (0) 131 651 1239
-Email %{organisation_email}
" +Email dmponline@dcc.ac.uk
" roadmap_page: title: "Future plans" tab_1: "Releases" tab_2: "Get involved" - body_text_tab_1_html: "The %{organisation_abbreviation} are now collaborating to develop a joint codebase for Data Management Planning called DMP Roadmap. Both of our tools will be delivered using this in the future. We've agreed what features need to be included and are planning a few sprints to deliver these. The initial release will include all of the main priorities we already had flagged, including:
+ body_text_tab_1_html: "The %{organisation_abbreviation} are now collaborating to develop a joint codebase for Data Management Planning called DMP Roadmap. Both of our tools will be delivered using this in the future. We've agreed what features need to be included and are planning a few sprints to deliver these. The initial release will include all of the main priorities we already had flagged, including:
%{application_name} has an active and growing user base, and we are grateful to the members who suggest ideas for new and improved features. If you would like to help shape our future plans, please join the user group. More information on how you can engage with us is available under the 'Get involved' tab.
+%{application_name} has an active and growing user base, and we are grateful to the members who suggest ideas for new and improved features. If you would like to help shape our future plans, please join the user group. More information on how you can engage with us is available under the 'Get involved' tab.
The current version of %{application_name} is %{application_version}.
@@ -836,24 +848,24 @@ body_text_tab_2_html: "%{application_name} is developed and maintained by the UK %{organisation_name}. We’re a small team, and are happy to collaborate with others. There are various ways you can get involved:
We run a listserv for the %{application_name} user group that you can request to join. We also host periodic meetings to consult on our plans. Being part of the user group gives you the opportunity to be informed about future developments and to provide feedback to help shape our plans.
+We run a listserv for the %{application_name} user group that you can request to join. We also host periodic meetings to consult on our plans. Being part of the user group gives you the opportunity to be informed about future developments and to provide feedback to help shape our plans.
Our user group sessions are usually focused around a certain topic (e.g. fleshing out use cases for an API) so invites are sent based on your areas of expertise. It is helpful for us to know your role and interests to invite relevant people to each session. Please introduce yourself on the list and share your ideas.
-Notes from previous user group sessions are provided below:
-Notes from previous user group sessions are provided below:
+Please let us know your interests and share your ideas for future developments via the mailing list so the community as a whole can feedback on them.
%{application_name} can be customised by institutions and disciplines. You can add templates for users in your organization and tailored guidance that explains local support and services. Example answers can also be offered to help users understand what to write in a Data Management Plan. To do this you’ll need to request admin access, so please email us on %{organisation_email}.
-Futher guidance on customising %{application_name} is available on the %{organisation_abbreviation} website.
+%{application_name} can be customised by institutions and disciplines. You can add templates for users in your organisation and tailored guidance that explains local support and services. Example answers can also be offered to help users understand what to write in a Data Management Plan. To do this you’ll need to request admin access, so please email us on dmponline@dcc.ac.uk.
+Futher guidance on customising %{application_name} is available on the %{application_name} website.
%{application_name} is a Ruby on Rails application. The source code is made available under a GNU Affero General Public License. This permits others to reuse the code freely, but obligates you to share the source code for any extensions in the same way. Please inform us if you install an instance of %{application_name} and offer your contributions back to the community.
+%{application_name} is a Ruby on Rails application. The source code is made available under an MIT License. This permits others to reuse the code freely, but obligates you to share the source code for any extensions in the same way. Please inform us if you install an instance of %{application_name} and offer your contributions back to the community.
If you install an instance of %{application_name} we require that you credit the %{organisation_abbreviation} as originators of the tool. We recommend that the acknowledgement takes the form of the %{application_name} logo with a link back to the %{organisation_abbreviation}-hosted version of the tool.
-We are willing to work with external developers to add new features to the tool. We are also open to delivering new features on a chargeable basis. If there are extensions you would like to see prioritised and have resource to support additional developer effort, please contact us on %{organisation_email} to negotiate terms.
-The code is available on GitHub
+We are willing to work with external developers to add new features to the tool. We are also open to delivering new features on a chargeable basis. If there are extensions you would like to see prioritised and have resource to support additional developer effort, please contact us on dmponline@dcc.ac.uk to negotiate terms.
+The code is available on GitHub
We are impressed by the uptake of %{application_name} both in the UK and internationally and are really keen to hear how you are using the tool and promoting it in your context. We are aware that others have run training courses, developed guidance materials and advocated use of the tool. Please notify us of this as it helps to show impact.
We are currently investigating options for revenue generation. This will help us serve the increased demand more effectively and safeguard the long-term sustainability of %{application_name}. Plans will be released for consultation soon but we also welcome your suggestions on how best to support our work.
" @@ -940,7 +952,7 @@ institution: 'Institution' research_institute: 'Research Institute' template: 'Template' - managing_organisation: 'Digital Curation Center' + managing_organisation: 'Digital Curation Centre' user_role_types: super_admin: 'admin' organisational_admin: 'org_admin' @@ -951,7 +963,7 @@ modify_templates: 'modify_templates' modify_guidance: 'modify_guidance' use_api: 'use_api' - change_org_details: 'change_org_detials' + change_org_details: 'change_org_details' grant_api_to_orgs: 'grant_api_to_orgs' api_endpoint_types: guidances: 'guidances' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 42749c7..e0e32cd 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -54,6 +54,7 @@ org_parent: "Organisme d'attache" org_created_message: " L'organisme a été créé avec succès." org_updated_message: " L'organisme a bien été mis à jour." + org_bad_logo: "Il semble y avoir un problème avec notre logo. S'il vous plaît télécharger à nouveau." plans: "Plans" title: "Titre" desc: "Description" @@ -98,7 +99,6 @@ old_temp_field: "Ancien champ de modèle" old_theme_field: "Ancien champ de thème" - org_admin: admin_area: "Section de l'administration" template_label: "Modèles" @@ -139,6 +139,9 @@ option_order_label: "Classer" option_text_label: "Texte" option_default_label: "Défaut" + api_privileges: "Privilèges de l'API?" + edit_user_privileges: "Privilèges Modifier l'utilisateur" + guidance: guidance_list: "Liste des directives" text_label: "Texte" @@ -164,6 +167,7 @@ by_themes_help_text_html: "Sélectionnez le ou les thèmes auxquels ces directives se rapportent." by_question_help_text_html: "Sélectionnez le modèle, la phase, la version, la section et la question appropriés dans les options de la liste déroulante suivante pour déterminer la question précise pour laquelle ces directives devraient être affichées." guidance_group_select_help_text_html: "Sélectionnez le groupe auquel ces directives se rapportent." + guidance_group_published_help_text_html: "Cochez cette case lorsque vous êtes prêt pour cette orientation à apparaître sur les plans de l'utilisateur." guidance_text_html: "Vous pouvez rédiger des directives à afficher par thème (p. ex. des directives générales sur l'entreposage et la sauvegarde qui devraient être présentées à tous les échelons) ou vous pouvez rédiger des directives pour des questions précises. La rédaction de directives générales par thème vous permet d'économiser du temps et des efforts, car vos conseils seront automatiquement affichés dans tous les modèles au lieu d'avoir à rédiger des directives qui accompagneraient chaque modèle.
De manière générale, vous voudrez que vos directives soient affichées dans tous les modèles. Vous voudrez toutefois, dans certains cas, que les directives soient seulement affichées pour des bailleurs de fonds précis, par exemple, si vous avez des consignes précises pour les candidats qui présentent une demande au Biotechnology and Biological Sciences Research Council (BBSRC). Vous pouvez également le préciser, au besoin.
" delete_message_html: "Vous êtes sur le point de supprimer '%{guidance_summary}'. Êtes-vous sûr de vouloir le supprimer?" @@ -274,8 +278,6 @@ question_options_help_text_html: "Indiquez toute option que vous souhaitez afficher. Si vous désirez qu'une option soit sélectionnée au préalable, cochez la case par défaut." - - helpers: home: "Accueil" return_home: "Revenir à la page d'accueil" @@ -298,7 +300,6 @@ signed_in: "Connecté en tant que " institution_sign_in_link: "Ou encore, connectez-vous avec l'authentifiant de votre établissement" institution_sign_in: "Authentification à l'aide du compte institutionnel bientôt disponible!" - user_name: "Adresse électronique" email: "Courriel" @@ -325,7 +326,7 @@ no_unlock_instructions: "Vous n'avez pas reçu les directives de déverrouillage?" send_password_info: "Directives pour réinitialiser le mot de passe" edit_password_info: "Si vous souhaitez modifier votre mot de passe, veuillez remplir les champs suivants." - accept_terms_html: "J'accepte les conditions *" + accept_terms_html: "J'accepte les conditions *" text_area: "Zone de texte" text_field: "Case de saisie simple" @@ -355,6 +356,13 @@ removing: "Suppression..." unsaved: "Modifications non enregistrées" unlink_account: "Dissocier le compte" + + links: + edit: "Modifier" + share: "Partager" + export: "Exporter" + destroy: "Supprimer" + submit: edit: "Modifier" create: "Créer" @@ -526,7 +534,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 Center (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: @@ -575,6 +583,7 @@ principal_investigator: "Chercheur principal/chercheur" data_contact: "Personne-ressource pour les données du plan" description: "Description" + unknown: " - " filter: placeholder: "Filtrer les plans" submit: "Filtrer" @@ -614,7 +623,7 @@ plans: admin_details: "Renseignements administratifs" sections: "Sections" - title: "Titre du plan" + title: "Nom de fichier" reset: "Réinitialiser" custom_formatting: "(À l'aide des valeurs de mise en forme de PDF personnalisées)" template_formatting: "(À l'aide des valeurs de mise en forme de PDF modèles)" @@ -841,7 +850,7 @@ institution: 'Institution' research_institute: 'Research Institute' template: 'Template' - managing_organisation: 'Digital Curation Center' + managing_organisation: 'Digital Curation Centre' user_role_types: super_admin: 'admin' organisational_admin: 'org_admin' @@ -852,7 +861,7 @@ modify_templates: 'modify_templates' modify_guidance: 'modify_guidance' use_api: 'use_api' - change_org_details: 'change_org_detials' + change_org_details: 'change_org_details' grant_api_to_orgs: 'grant_api_to_orgs' api_endpoint_types: guidances: 'guidances' diff --git a/db/seeds.rb b/db/seeds.rb index 37c7723..3be10f2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -201,8 +201,8 @@ 'use_api' => { name: 'use_api' }, - 'change_org_detials' => { - name: 'change_org_detials' + 'change_org_details' => { + name: 'change_org_details' }, 'grant_api_to_orgs' => { name: 'grant_api_to_orgs' @@ -244,7 +244,7 @@ password_confirmation: "password123", organisation: "RCC", language: 'English(UK)', - roles: ['admin','org_admin','add_organisations','change_org_affiliation','grant_permissions','modify_templates','modify_guidance','use_api','change_org_detials','grant_api_to_orgs'], + roles: ['admin','org_admin','add_organisations','change_org_affiliation','grant_permissions','modify_templates','modify_guidance','use_api','change_org_details','grant_api_to_orgs'], accept_terms: true, confirmed_at: Time.zone.now }, @@ -256,7 +256,7 @@ surname: "Admin", organisation: "RegSciFed", language: 'English(UK)', - roles: ['org_admin','grant_permissions','modify_templates','modify_guidance','change_org_detials'], + roles: ['org_admin','grant_permissions','modify_templates','modify_guidance','change_org_details'], accept_terms: true, confirmed_at: Time.zone.now }, @@ -268,7 +268,7 @@ surname: "Admin", organisation: "CapColl", language: 'English(UK)', - roles: ['org_admin','grant_permissions','modify_templates','modify_guidance','change_org_detials'], + roles: ['org_admin','grant_permissions','modify_templates','modify_guidance','change_org_details'], accept_terms: true, confirmed_at: Time.zone.now }, diff --git a/lib/custom_failure.rb b/lib/custom_failure.rb index fe28aa9..e8fbb7d 100644 --- a/lib/custom_failure.rb +++ b/lib/custom_failure.rb @@ -1,13 +1,12 @@ class CustomFailure < Devise::FailureApp - def redirect_url - root_path - end - - def respond - if http_auth? - http_auth + def redirect + store_location! + message = warden.message || warden_options[:message] + + if message == :timeout + redirect_to root_path else - redirect + super end end end \ No newline at end of file