Initial import
This commit is contained in:
18
app/views/user/change_password.html.erb
Normal file
18
app/views/user/change_password.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h3 class="title">Alterar senha</h3>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action => 'change_password' do %>
|
||||
|
||||
<label for="user_password">Nova senha</label><br/>
|
||||
<%= password_field "user", "password", :size => 20, :value=>"" %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirme nova senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", :size => 20, :value=>"" %><br/>
|
||||
<br/>
|
||||
<%= submit_tag "Enviar" %>
|
||||
|
||||
<% end %>
|
||||
</o>
|
||||
54
app/views/user/edit.html.erb
Normal file
54
app/views/user/edit.html.erb
Normal file
@@ -0,0 +1,54 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Editar Preferências</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action => 'update', :id => @user do %>
|
||||
|
||||
<label for="user_name">Nome</label><br/>
|
||||
<%= text_field "user", "name", :size => 20 %><br/>
|
||||
|
||||
<label for="user_email">Email</label><br/>
|
||||
<%= text_field "user", "email", :size => 20 %><br/><br/>
|
||||
|
||||
|
||||
<label for="user_password">Senha</label><br/>
|
||||
<%= password_field "user", "password", {:value => "", :size => 20, :id => 'password'} %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirmação de Senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", {:value => "", :size => 20} %><br/>
|
||||
|
||||
<div id="passmeter"> </div><br/>
|
||||
|
||||
<label for="user_pref_color">Cor de Preferência:</label><br />
|
||||
<%= select_tag("user[pref_color]", options_for_select( {
|
||||
"Preto" => 0,
|
||||
"Verde (Claro)" => 1,
|
||||
"Azul (Claro)" => 2,
|
||||
"Lilás" => 3,
|
||||
"Vermelho/Cinza" => 4,
|
||||
"Verde-limão" => 5,
|
||||
"Azul (Padrão)" => 6,
|
||||
"Vermelho" => 7,
|
||||
"Azul/Laranja" => 8,
|
||||
"Verde/Vermelho" => 9,
|
||||
"Pink" => 10,
|
||||
"Roxo" => 11,
|
||||
"Vinho" => 12,
|
||||
}.sort)) %><br/><br/>
|
||||
|
||||
<label for="user_courses">Disciplinas matriculadas:</label><br/>
|
||||
<% Course.find(:all).each do |course| %>
|
||||
<%= check_box_tag("user[course_ids][]", course.id, @user.courses.include?(course)) %>
|
||||
<%= h(course.full_name) %><br/>
|
||||
<% end %>
|
||||
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<%= submit_tag "Editar" %>
|
||||
|
||||
<% end %><br/><br/>
|
||||
</p>
|
||||
|
||||
15
app/views/user/forgot_password.html.erb
Normal file
15
app/views/user/forgot_password.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Recuperar senha</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action=>'forgot_password' do %>
|
||||
|
||||
Email<br/>
|
||||
<%= text_field "user","email" %><br/><br/>
|
||||
|
||||
<%= submit_tag 'Enviar nova senha' %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
21
app/views/user/login.html.erb
Normal file
21
app/views/user/login.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Login</h1>
|
||||
|
||||
<p>
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<% form_tag :action=> "login" do %>
|
||||
|
||||
<label for="user_login">Login:</label><br/>
|
||||
<%= text_field "user", "login", :size => 20 %><br/>
|
||||
|
||||
<label for="user_password">Senha:</label><br/>
|
||||
<%= password_field "user", "password", :size => 20 %><br/>
|
||||
|
||||
<%= submit_tag "Login" %><br /><br />
|
||||
|
||||
<%= link_to 'Criar conta', :action => 'signup' %> |
|
||||
<%= link_to 'Recuperar senha', :action => 'forgot_password' %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
13
app/views/user/rss.xml.builder
Normal file
13
app/views/user/rss.xml.builder
Normal file
@@ -0,0 +1,13 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.instruct! :rss, :version=>"2.0"
|
||||
xml.channel{
|
||||
for course in @courses
|
||||
for event in course.events
|
||||
xml.item do
|
||||
xml.title("[" + course.short_name + "] " + event.title)
|
||||
xml.pubDate(Time.parse(event.date.to_s).rfc822)
|
||||
xml.description(event.description)
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
84
app/views/user/show.html.erb
Normal file
84
app/views/user/show.html.erb
Normal file
@@ -0,0 +1,84 @@
|
||||
<% last_event = nil %>
|
||||
|
||||
<div class="cmd">
|
||||
<%= link_to 'preferências', :action => 'edit'%>
|
||||
</div>
|
||||
|
||||
<h4 class="title">Página Pessoal</h4>
|
||||
<h1 class="title">Bem vindo, <%= h(@user.name) %></h1>
|
||||
|
||||
<!-- Noticias -->
|
||||
<div class="box news">
|
||||
<h3>Notícias</h3>
|
||||
<% @news_messages.each do |n| %>
|
||||
<div class="line">
|
||||
<h4 class="left"><%= n.timestamp.strftime("%d de %B") %></h4>
|
||||
<h4><%= link_to h(n.course.full_name) , course_news_url(n.course, n) %> ›
|
||||
<a href="#" id="new_<%=n.id%>"><%= h(n.title) %></a></h4>
|
||||
|
||||
<p id="new_desc_<%= n.id %>" style="display:none">
|
||||
<%= h(n.body) %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<% @news_messages.each do |n| %>
|
||||
events['#new_<%= n.id %>:click'] = function(el, e) {
|
||||
Effect.toggle($('new_desc_<%= n.id %>'), 'blind');
|
||||
Event.stop(e);
|
||||
};
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
<!-- Calendario -->
|
||||
<div class="box div_calendario">
|
||||
<div class="cmd">
|
||||
<%= link_to 'rss', :action => 'rss', :login => h(@user.login)%>
|
||||
<%= link_to 'icalendar', :controller => 'events', :action => 'icalendar'%>
|
||||
</div>
|
||||
<h3>Calendário</h3>
|
||||
|
||||
<% @events.each do |event| %>
|
||||
<% if last_event != event.date %>
|
||||
<% if last_event %></ul></div><% end %>
|
||||
<div class="date"><%= event.date.strftime("%d de %B") %></div>
|
||||
<div><ul>
|
||||
<% end %>
|
||||
<li>
|
||||
<div class="time"><%= event.time.strftime("%H:%M") %></div>
|
||||
<%= link_to h(event.course.full_name), course_event_url(event.course, event) %> ›
|
||||
<a href="#" id="event_<%= event.id %>"><%= h(event.title) %></a>
|
||||
|
||||
<div id="desc_<%= event.id %>" class="description" style="display:none">
|
||||
<%= h(event.description) %>
|
||||
<%= "Sem descrição" if event.description.length == 0 %>
|
||||
</div>
|
||||
</li>
|
||||
<% last_event = event.date %>
|
||||
<% end %>
|
||||
<%= "</ul></div>" if !@events.empty? %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<% @events.each do |event| %>
|
||||
events['#event_<%= event.id %>:click'] = function(el, e) {
|
||||
Effect.toggle($('desc_<%= event.id %>'), 'blind');
|
||||
Event.stop(e);
|
||||
};
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Disciplinas Matriculadas -->
|
||||
<div class="box">
|
||||
<h3>Disciplinas Matriculadas</h3>
|
||||
<ul class="wiki">
|
||||
<% @user.courses.each do |course| %>
|
||||
<li><%= link_to h(course.full_name), course_url(course) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h4><%#= link_to 'Descadastrar usuário', :action => 'destroy'%></h4>
|
||||
58
app/views/user/signup.html.erb
Normal file
58
app/views/user/signup.html.erb
Normal file
@@ -0,0 +1,58 @@
|
||||
<h4 class="title"><%= App.title %></h4>
|
||||
<h1 class="title">Criar conta</h1>
|
||||
|
||||
<p>
|
||||
<% form_tag :action=> "signup" do %>
|
||||
|
||||
<%= error_messages_for 'user' %><br/>
|
||||
|
||||
<label for="user_name">Nome</label><br/>
|
||||
<%= text_field "user", "name", :size => 20 %><br/>
|
||||
|
||||
<label for="user_email">Email</label><br/>
|
||||
<%= text_field "user", "email", :size => 20 %><br/><br/>
|
||||
|
||||
<label for="user_login">Login</label><br/>
|
||||
<%= text_field "user", "login", :size => 20 %><br/>
|
||||
|
||||
<label for="user_password">Senha</label><br/>
|
||||
<%= password_field "user", "password", {:value => "", :size => 20, :id => 'password'} %><br/>
|
||||
|
||||
<label for="user_password_confirmation">Confirmação de Senha</label><br/>
|
||||
<%= password_field "user", "password_confirmation", {:value => "", :size => 20} %><br/>
|
||||
|
||||
<div id="passmeter"> </div><br />
|
||||
|
||||
<label for="user_pref_color">Cor de Preferência:</label>
|
||||
<%= select_tag("user[pref_color]", options_for_select( {
|
||||
"Preto" => 0,
|
||||
"Verde (Claro)" => 1,
|
||||
"Azul (Claro)" => 2,
|
||||
"Lilás" => 3,
|
||||
"Vermelho/Cinza" => 4,
|
||||
"Verde-limão" => 5,
|
||||
"Azul (Padrão)" => 6,
|
||||
"Vermelho" => 7,
|
||||
"Azul/Laranja" => 8,
|
||||
"Verde/Vermelho" => 9,
|
||||
"Pink" => 10,
|
||||
"Roxo" => 11,
|
||||
"Vinho" => 12,
|
||||
}.sort)) %><br/><br/><br/>
|
||||
|
||||
<label for="user_courses">Disciplinas matriculadas:</label><br/>
|
||||
<% @courses.each do |course| %>
|
||||
<%= check_box_tag("user[course_ids][]", course.id, @user.courses.include?(course)) %>
|
||||
<%= h(course.full_name) %><br/>
|
||||
<% end %>
|
||||
|
||||
<% if @courses.empty? %>
|
||||
Nenhuma disciplina cadastrada<br/>
|
||||
<% end %>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<%= submit_tag "Enviar" %>
|
||||
|
||||
<% end %>
|
||||
</p>
|
||||
Reference in New Issue
Block a user