forked from MarkUsProject/Markus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_student_form.html.erb
37 lines (26 loc) · 1.17 KB
/
_student_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<div class="section">
<%= form_for @user, :as => :user do |f| %>
<%= render :partial => "shared/error_explanation",
:locals => { :model => @user, :flash_message => flash[:error] } %>
<%= raw(f.label(:user_name, I18n.t("user.user_name"))) %>
<%= raw(f.text_field :user_name) %><br />
<%= raw(f.label(:last_name, I18n.t("user.last_name"))) %>
<%= raw(f.text_field :last_name) %><br />
<%= raw(f.label(:first_name, I18n.t("user.first_name"))) %>
<%= raw(f.text_field :first_name) %><br />
<%= raw(f.label(:grace_credits, I18n.t("user.grace_credits"))) %>
<%= raw(f.text_field :grace_credits) %> <br />
<% if !@sections.empty? %>
<%= f.select :section_id,
options_for_select(
["−"] + @sections.map {|s| [s.name, s.id] },
:selected => (@user.has_section?) ? (@user.section.id) : (["−"]) ) %>
<%= f.label(:section_id, I18n.t("section.legend") ) %> <br />
<%= f.hidden_field :id %>
<%= f.submit t(:submit), :name => 'submit', :class => 'button indent_button' %>
<%= link_to t(:cancel),
{:controller => 'students'},
:class => "button button_link" %>
<% end %>
<% end %>
</div>