Notify user if they cannot create projects
This commit is contained in:
parent
d2f9a9012d
commit
1c53dc28b5
|
@ -2,3 +2,9 @@ class @User
|
|||
constructor: ->
|
||||
$('.profile-groups-avatars').tooltip("placement": "top")
|
||||
new ProjectsList()
|
||||
|
||||
$('.hide-project-limit-message').on 'click', (e) ->
|
||||
path = '/'
|
||||
$.cookie('hide_project_limit_message', 'false', { path: path })
|
||||
$(@).parents('.project-limit-message').remove()
|
||||
e.preventDefault()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
.no-ssh-key-message {
|
||||
.no-ssh-key-message, .project-limit-message {
|
||||
background-color: #f28d35;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ class ProfilesController < Profiles::ApplicationController
|
|||
:email,
|
||||
:hide_no_password,
|
||||
:hide_no_ssh_key,
|
||||
:hide_project_limit,
|
||||
:linkedin,
|
||||
:location,
|
||||
:name,
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
= content_for :flash_message do
|
||||
= render 'shared/project_limit'
|
||||
|
||||
%ul.center-top-menu
|
||||
= nav_link(path: ['projects#index', 'root#index']) do
|
||||
= link_to dashboard_projects_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
- if cookies[:hide_project_limit_message].blank? && !current_user.hide_project_limit && !current_user.can_create_project?
|
||||
.project-limit-message.alert.alert-warning.hidden-xs
|
||||
You won't be able to create new projects because you have reached your project limit.
|
||||
|
||||
.pull-right
|
||||
= link_to "Don't show again", profile_path(user: {hide_project_limit: true}), method: :put, class: 'alert-link'
|
||||
|
|
||||
= link_to 'Remind later', '#', class: 'hide-project-limit-message alert-link'
|
|
@ -0,0 +1,5 @@
|
|||
class AddHideProjectLimitToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :hide_project_limit, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20151118162244) do
|
||||
ActiveRecord::Schema.define(version: 20151203162133) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -814,6 +814,7 @@ ActiveRecord::Schema.define(version: 20151118162244) do
|
|||
t.integer "project_view", default: 0
|
||||
t.integer "consumed_timestep"
|
||||
t.integer "layout", default: 0
|
||||
t.boolean "hide_project_limit", default: false
|
||||
end
|
||||
|
||||
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
|
||||
|
|
Loading…
Reference in New Issue