mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-19 13:48:09 +01:00
get the first cucumber feature running: calendar
This commit is contained in:
parent
393eae1937
commit
c9d64e6f4b
28 changed files with 400 additions and 418 deletions
|
|
@ -3,7 +3,6 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<%= stylesheet_link_tag "scaffold" %>
|
||||
<%= javascript_include_tag 'jquery-1.7.1.min', 'jquery.cookie' %>
|
||||
|
||||
<title><%= @page_title -%></title>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
setup_periodic_check("<%=check_deferred_todos_path(:format => 'js')%>", 10*60, 'POST');
|
||||
<%= generate_i18n_strings %>
|
||||
</script>
|
||||
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
|
||||
<link rel="shortcut icon" href="<%= image_path ('favicon.ico') %>" />
|
||||
<%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => t('layouts.next_actions_rss_feed')}) %>
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="Tracks" href="<%= search_plugin_path %>" />
|
||||
<title><%= @page_title %></title>
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
|
|
||||
<%= link_to(t('layouts.toggle_notes'), "#", {:accesskey => "S", :title => t('layouts.toggle_notes_title'), :id => "toggle-notes-nav"}) %>
|
||||
|
|
||||
<%= link_to( t('common.logout') + " (#{current_user.display_name}) »", logout_path) %>
|
||||
<%= link_to("#{t('common.logout')} (#{current_user.display_name}) »".html_safe, logout_path) %>
|
||||
</div>
|
||||
<div id="navcontainer">
|
||||
<ul class="sf-menu">
|
||||
|
|
|
|||
|
|
@ -1,16 +1,9 @@
|
|||
<% auth_schemes = Tracks::Config.auth_schemes
|
||||
show_database_form = auth_schemes.include?('database') || auth_schemes.include?('ldap')
|
||||
show_openid_form = auth_schemes.include?('open_id')
|
||||
show_cas_form = auth_schemes.include?('cas')
|
||||
-%>
|
||||
|
||||
<div title="<%= t('login.account_login') %>" id="loginform" class="form">
|
||||
|
||||
<%= render_flash %>
|
||||
|
||||
<h3><%= t('login.please_login') %>:</h3>
|
||||
<% if show_database_form %>
|
||||
<div id="database_auth_form" style="display:<%=(@prefered_auth.eql?('database')) ? "block" : "none"%>">
|
||||
<div id="database_auth_form" style="display:block">
|
||||
<%= form_tag :action=> 'login' do %>
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -27,111 +20,9 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="login" value="<%= t('login.sign_in') %> »" class="primary" /></td>
|
||||
<td><input type="submit" name="login" value="<%= t('login.sign_in') %>" class="primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if show_openid_form %>
|
||||
<div id="openid_auth_form" style="display:<%=(@prefered_auth.eql?('openid')) ? "block" : "none"%>">
|
||||
<%= form_tag :action=> 'login' do %>
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="openid_url"><%= User.human_attribute_name('open_id_url') %>:</label></td>
|
||||
<td><input type="text" name="openid_url" id="openid_url" value="<%= @openid_url %>" class="login_text open_id" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="user_noexpiry"><%= t('login.user_no_expiry') %>:</label></td>
|
||||
<td><input type="checkbox" name="user_noexpiry" id="user_noexpiry" checked /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="login" value="<%= t('login.sign_in') %> »" class="primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if show_cas_form %>
|
||||
<div id="cas_auth_form" style="display:<%=(@prefered_auth.eql?('cas')) ? "block" : "none"%>">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<% if @username && @user%>
|
||||
<p><%= t('login.cas_logged_in_greeting', :username => @username) %></p>
|
||||
<% elsif @username %>
|
||||
<p><%= t('login.cas_no_user_found', :username => @username) %>
|
||||
<%if SITE_CONFIG['open_signups']%>
|
||||
<%= t('login.cas_create_account', :signup_link => link_to(t('login.cas_signup_link'), signup_url)) %>
|
||||
<%end%>
|
||||
</p>
|
||||
<% else %>
|
||||
<p><%= link_to(t('login.cas_login'), login_cas_url) %> </p>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% if show_openid_form %><p id="alternate_auth_openid" class="alternate_auth"><%= t('login.option_separator') %> <a href="#" onclick="Login.showOpenid();return false;"><%= t('login.login_with_openid') %></a></p><% end %>
|
||||
<% if show_database_form %><p id="alternate_auth_database" class="alternate_auth"><%= t('login.option_separator') %> <a href="#" onclick="Login.showDatabase();return false;"><%= t('login.login_standard') %></a></p><% end %>
|
||||
<% if show_cas_form %><p id="alternate_auth_cas" class="alternate_auth"><%= t('login.option_separator') %> <a href="#" onclick="Login.showCAS();return false;"><%= t('login.login_cas')%></a></p><% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function showPreferredAuth() {
|
||||
var preferredAuth = $.cookie('preferred_auth');
|
||||
var casEnabled = <%= show_cas_form ? 'true' : 'false' %>;
|
||||
var databaseEnabled = <%= show_database_form ? 'true' : 'false' %>;
|
||||
var openidEnabled = <%= show_openid_form ? 'true' : 'false' %>;
|
||||
if (preferredAuth && preferredAuth == 'openid' && openidEnabled) {
|
||||
Login.showOpenid();
|
||||
}
|
||||
else if (preferredAuth && preferredAuth == 'database' && databaseEnabled) {
|
||||
Login.showDatabase();
|
||||
}
|
||||
else if (preferredAuth && preferredAuth == 'cas' && casEnabled) {
|
||||
Login.showCAS();
|
||||
}
|
||||
}
|
||||
$(document).ready(showPreferredAuth);
|
||||
|
||||
var Login = {
|
||||
showOpenid: function() {
|
||||
$('#database_auth_form').hide();
|
||||
$('#openid_auth_form').show();
|
||||
$('#alternate_auth_openid').hide();
|
||||
$('#alternate_auth_database').show(); ;
|
||||
$('#alternate_auth_cas').show();
|
||||
$('#openid_url').focus();
|
||||
$('#openid_url').select();
|
||||
$.cookie('preferred_auth', 'openid');
|
||||
},
|
||||
|
||||
showDatabase: function(container) {
|
||||
$('#openid_auth_form').hide();
|
||||
$('#database_auth_form').show();
|
||||
$('#alternate_auth_database').hide();
|
||||
$('#alternate_auth_openid').show();
|
||||
$('#alternate_auth_cas').show();
|
||||
$('#user_login').focus();
|
||||
$('#user_login').select();
|
||||
$.cookie('preferred_auth', 'database');
|
||||
},
|
||||
showCAS: function(container) {
|
||||
$('#database_auth_form').hide();
|
||||
$('#openid_auth_form').hide();
|
||||
$('#cas_auth_form').show();
|
||||
$('#alternate_auth_cas').hide();
|
||||
$('#alternate_auth_openid').show();
|
||||
$('#alternate_auth_database').show();
|
||||
$.cookie('preferred_auth', 'cas');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="container">
|
||||
<h2><%= t('todos.calendar.due_today') %></h2>
|
||||
<div id="empty_due_today" <%= "style=\"display:none\"" unless @due_today.empty? %>>
|
||||
<div id="empty_due_today" <%= raw "style=\"display:none\"" unless @due_today.empty? %>>
|
||||
<%= t('todos.calendar.no_actions_due_today') %>
|
||||
</div>
|
||||
<div id="due_today">
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<div class="container">
|
||||
<h2><%= t('todos.calendar.due_this_week') %></h2>
|
||||
<div id="empty_due_this_week" <%= "style=\"display:none\"" unless @due_this_week.empty? %>>
|
||||
<div id="empty_due_this_week" <%= raw "style=\"display:none\"" unless @due_this_week.empty? %>>
|
||||
<%= t('todos.no_actions_due_this_week') %>
|
||||
</div>
|
||||
<div id="due_this_week">
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<div class="container">
|
||||
<h2><%= t('todos.calendar.due_next_week') %></h2>
|
||||
<div id="empty_due_next_week" <%= "style=\"display:none\"" unless @due_next_week.empty? %>>
|
||||
<div id="empty_due_next_week" <%= raw "style=\"display:none\"" unless @due_next_week.empty? %>>
|
||||
<%= t('todos.calendar.no_actions_due_next_week') %>
|
||||
</div>
|
||||
<div id="due_next_week">
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<div class="container">
|
||||
<h2><%= t('todos.calendar.due_this_month', :month => l(Time.zone.now, :format => "%B")) %></h2>
|
||||
<div id="empty_due_this_month" <%= "style=\"display:none\"" unless @due_this_month.empty? %>>
|
||||
<div id="empty_due_this_month" <%= raw "style=\"display:none\"" unless @due_this_month.empty? %>>
|
||||
<%= t('todos.calendar.no_actions_due_this_month') %>
|
||||
</div>
|
||||
<div id="due_this_month">
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
<div class="container">
|
||||
<h2><%= t('todos.calendar.due_next_month_and_later', :month => l(Time.zone.now+1.month, :format => "%B")) %></h2>
|
||||
<div id="empty_due_after_this_month" <%= "style=\"display:none\"" unless @due_after_this_month.empty? %>>
|
||||
<div id="empty_due_after_this_month" <%= raw "style=\"display:none\"" unless @due_after_this_month.empty? %>>
|
||||
<%= t('todos.calendar.no_actions_due_after_this_month') %>
|
||||
</div>
|
||||
<div id="due_after_this_month">
|
||||
|
|
@ -52,6 +52,6 @@
|
|||
|
||||
</div><!-- End of display_box -->
|
||||
<div class="input_box" id="input_box">
|
||||
<p><%= link_to('<span class="feed">iCal</span>', {:format => 'ics', :token => current_user.token}, :title => "iCal feed" ) %>
|
||||
<p><%= link_to('<span class="feed">iCal</span>'.html_safe, {:format => 'ics', :token => current_user.token}, :title => "iCal feed" ) %>
|
||||
- <%= t('todos.calendar.get_in_ical_format') %></p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function update_predecessors() {
|
|||
}
|
||||
|
||||
function html_for_error_messages() {
|
||||
return "<%= escape_javascript(error_messages_for('todo', :object_name => 'action')) %>";
|
||||
return "<%= escape_javascript(get_list_of_error_messages_for(@todo)) %>";
|
||||
}
|
||||
|
||||
function html_for_new_context() {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
<div id="display_box">
|
||||
<div id="no_todos_in_view" class="container context" style="display:<%= @not_done_todos.empty? ? "block" : "none" %>">
|
||||
<h2><%= t('todos.no_actions_found_title')%></h2>
|
||||
<h2><%= t('todos.no_actions_found_title')%></h2>
|
||||
<div class="message"><p><%= t('todos.no_actions_found') %></p></div>
|
||||
</div>
|
||||
<%= render(:partial => @contexts_to_show, :locals => { :collapsible => true }) -%>
|
||||
<% unless @done.nil? -%>
|
||||
<%= render(
|
||||
:partial => "todos/completed",
|
||||
:object => @done,
|
||||
:locals => { :collapsible => true, :append_descriptor => nil }) -%>
|
||||
<%= render(:partial => "todos/completed", :object => @done,
|
||||
:locals => { :collapsible => true, :append_descriptor => nil }) -%>
|
||||
<% end -%>
|
||||
</div><!-- End of display_box -->
|
||||
</div>
|
||||
<div id="input_box">
|
||||
<%= render :partial => "shared/add_new_item_form" %>
|
||||
<%= render :file => "sidebar/sidebar" %>
|
||||
</div><!-- End of input box -->
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue