-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1353 - Prasanna/Suganthi - Fixed Permissions in My account page
- Loading branch information
Suganthi T
committed
Oct 23, 2012
1 parent
b092f5c
commit c1d604f
Showing
7 changed files
with
115 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,109 @@ | ||
<script type="text/javascript" charset="utf-8"> | ||
|
||
function confirmBlacklisted() { | ||
$(".devices :checkbox").each(function() { | ||
if (this.checked && !this.defaultChecked) | ||
return confirm('Are you sure you want to disable this device?'); | ||
}); | ||
return true; | ||
} | ||
function confirmBlacklisted() { | ||
$(".devices :checkbox").each(function () { | ||
if (this.checked && !this.defaultChecked) | ||
return confirm('Are you sure you want to disable this device?'); | ||
}); | ||
return true; | ||
} | ||
|
||
function confirmDisable() { | ||
var checkbox = $("#user_disabled")[0]; | ||
if (checkbox.checked && !checkbox.defaultChecked) { | ||
return confirm('Are you sure you want to disable this user?'); | ||
function confirmDisable() { | ||
var checkbox = $("#user_disabled")[0]; | ||
if (checkbox.checked && !checkbox.defaultChecked) { | ||
return confirm('Are you sure you want to disable this user?'); | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
|
||
$(document).ready(function() { | ||
$("form").submit(function() { return (confirmDisable() && confirmBlacklisted()); } ); | ||
}); | ||
$(document).ready(function () { | ||
$("form").submit(function () { | ||
return (confirmDisable() && confirmBlacklisted()); | ||
}); | ||
}); | ||
</script> | ||
|
||
<%= form_for editable_user, :html => {:class=> ''} do |f| %> | ||
<%= f.error_messages :header_tag => :h3 %> | ||
<% trying_to_edit_ourself = editing_ourself?(editable_user) %> | ||
<%= form_for editable_user, :html => {:class => ''} do |f| %> | ||
<%= f.error_messages :header_tag => :h3 %> | ||
<% trying_to_edit_ourself = editing_ourself?(editable_user) %> | ||
|
||
|
||
<div class="mandate_panel"><span>*</span> marked fields are mandatory</div> | ||
<div class="clearfix"></div> | ||
<fieldset> | ||
<p> | ||
<%= f.label :full_name, "Full name", :class=>'key' %> | ||
<%= f.text_field :full_name %>* | ||
</p> | ||
|
||
<p> | ||
<%= f.label :user_name, :class=>'key' %> | ||
<%= f.text_field :user_name, :disabled => !editable_user.new_record? %>* | ||
<span class="footnote">user name should not contain blanks</span> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :password, :class=>'key' %> | ||
<%= f.password_field :password %>* | ||
<span class="footnote">password should not contain blanks</span> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :password_confirmation,"Re-enter password", :class=>'key' %> | ||
<%= f.password_field :password_confirmation %>* | ||
</p> | ||
|
||
<% if !trying_to_edit_ourself %> | ||
<p><label class="key">User type</label> | ||
|
||
<%= f.radio_button :user_type, "Administrator" %> | ||
<%= f.label :user_type_administrator, "Administrator" %> | ||
|
||
|
||
<%= f.radio_button :user_type, "User" %> | ||
<%= f.label :user_type_user, "User" %> | ||
</p> | ||
<% end %> | ||
|
||
<p> | ||
<%= f.label :phone, :class=>'key' %> | ||
<%= f.text_field :phone %> | ||
</p> | ||
<p> | ||
<%= f.label :email, :class=>'key' %> | ||
<%= f.text_field :email %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :organisation, :class=>'key' %> | ||
<%= f.text_field :organisation, :disabled => !is_admin?%> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :position, :class=>'key' %> | ||
<%= f.text_field :position %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :location, :class=>'key' %> | ||
<%= f.text_field :location %> | ||
</p> | ||
|
||
<% if !trying_to_edit_ourself %> | ||
<p> | ||
<%= f.label :disabled, "Disabled?", :class=>'key' %> | ||
<%= f.check_box :disabled, {}, "true", "false" %> | ||
</p> | ||
<% end %> | ||
|
||
<p> | ||
<%= f.label :full_name, "Full name", :class => 'key' %> | ||
<%= f.text_field :full_name %>* | ||
</p> | ||
|
||
<p> | ||
<%= f.label :user_name, :class => 'key' %> | ||
<%= f.text_field :user_name, :disabled => !editable_user.new_record? %>* | ||
<span class="footnote">user name should not contain blanks</span> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :password, :class => 'key' %> | ||
<%= f.password_field :password %>* | ||
<span class="footnote">password should not contain blanks</span> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :password_confirmation, "Re-enter password", :class => 'key' %> | ||
<%= f.password_field :password_confirmation %>* | ||
</p> | ||
|
||
<% if !trying_to_edit_ourself %> | ||
<p><label class="key">User type</label> | ||
|
||
<%= f.radio_button :user_type, "Administrator" %> | ||
<%= f.label :user_type_administrator, "Administrator" %> | ||
|
||
|
||
<%= f.radio_button :user_type, "User" %> | ||
<%= f.label :user_type_user, "User" %> | ||
</p> | ||
<% end %> | ||
|
||
<p> | ||
<%= f.label :phone, :class => 'key' %> | ||
<%= f.text_field :phone %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :email, :class => 'key' %> | ||
<%= f.text_field :email %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :organisation, :class => 'key' %> | ||
<%= f.text_field :organisation, :disabled => !is_admin? %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :position, :class => 'key' %> | ||
<%= f.text_field :position %> | ||
</p> | ||
|
||
<p> | ||
<%= f.label :location, :class => 'key' %> | ||
<%= f.text_field :location %> | ||
</p> | ||
|
||
<% if !trying_to_edit_ourself %> | ||
<p> | ||
<%= f.label :disabled, "Disabled?", :class => 'key' %> | ||
<%= f.check_box :disabled, {}, "true", "false" %> | ||
</p> | ||
<% end %> | ||
|
||
<%= f.hidden_field :permissions %> | ||
</fieldset> | ||
|
||
<% if is_admin? %> | ||
<%= render :partial => "devices", :object => editable_user.devices %> | ||
<% end %> | ||
<%= submit_button(editable_user.new_record? ? 'Create' : 'Update') %> | ||
<%= cancel_button(users_path) %> | ||
<% if is_admin? %> | ||
<%= render :partial => "devices", :object => editable_user.devices %> | ||
<% end %> | ||
<%= submit_button(editable_user.new_record? ? 'Create' : 'Update') %> | ||
<!--TODO: After we got the user object in the session replace the DB query with User object--> | ||
<!--<%= cancel_button(user_path(User.find_by_user_name(current_user_name))) %>--> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.