Skip to content

Commit

Permalink
display error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
agmps17 committed Jun 21, 2014
1 parent 9e3b0a8 commit 97f2c6f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/webapps.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ $(document).on "ajax:success", ".edit_form", (event, results) ->
else if results.type is "permission"
element = "#permission_webapp"+results.webappid+"_user"+results.userid
$(element).html(results.content)
else if results.type is "permission"
element = "#permission_webapp"+results.webappid+"_user"+results.userid
$(element).find('.messages').html(results.status)

$(document).on "ajax:beforeSend", ".edit_form", ->
form = $(this)
Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/webapp_style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#alias-delete-icon{
.alias-delete-icon, .user_access_delete_icon{
background: url("img/delete.png");
height: 19px;
width: 19px;
display: inline-block;
text-indent: -9999px;
}

.settings-table{
margin-top: 30px;
}
2 changes: 1 addition & 1 deletion app/controllers/webapps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def add_permission
w.addUser(@user,password)
end
end
@status = check ? "ok" : "notok"
@status = check ? "ok" : "Wrong password"
@users_allowed = WebappAccess.find_or_create(@webapp.id).getUsers
end

Expand Down
9 changes: 5 additions & 4 deletions app/views/webapps/_user_permissions.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

td = @user.name
td
span
div
- if checked
= link_to("[x]",webapps_engine.remove_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id), {:remote=>true, :method=>:delete, :class=>:edit_form})
= link_to("[x]",webapps_engine.remove_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id), {:remote=>true, :method=>:delete, :class=>'edit_form user_access_delete_icon'})
- else
a.click_change Add Permission
a.click_change Add access password
form.edit_form.form_hidden action=webapps_engine.add_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id) data-remote="true" method="post" style=("display: none;")
input name="password" type="password"
input name="password" type="password" placeholder="Enter User login password"
button.btn.btn-create.margin-for-message type="submit"
span = t('add')
a.cancel_link Cancel
span.spinner.theme-image style=("display: none")
.messages



2 changes: 1 addition & 1 deletion app/views/webapps/_webapp_aliases.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ div id="webapp_aliases_#{uid}"

- for a in @webapp.webapp_aliases.map do
br/
= link_to("[x]",webapps_engine.webapp_alias_destroy_webapp_path(:id => a.id), {:remote=>true, :method=>:delete, :class=>:edit_form, :id=>'alias-delete-icon'})
= link_to("[x]",webapps_engine.webapp_alias_destroy_webapp_path(:id => a.id), {:remote=>true, :method=>:delete, :class=>'edit_form alias-delete-icon'})

= link_to("http://#{a}", " http://#{a}", { :target => '_blank'})

0 comments on commit 97f2c6f

Please sign in to comment.