mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 07:10:12 +01:00
Make a few more targets translatable. Tracks should now be pretty close to fully translatable.
This commit is contained in:
parent
f2abb970ed
commit
971ef477e5
21 changed files with 457 additions and 403 deletions
|
|
@ -2,15 +2,15 @@ class DataController < ApplicationController
|
|||
require 'csv'
|
||||
|
||||
def index
|
||||
@page_title = "TRACKS::Export"
|
||||
@page_title = t('data.export.page_title')
|
||||
end
|
||||
|
||||
def import; end
|
||||
|
||||
def csv_map
|
||||
if params[:file].blank?
|
||||
flash[:notice] = "File can't be blank"
|
||||
redirect_to :back
|
||||
flash[:notice] = t "data.import.errors.file_blank"
|
||||
redirect_back fallback_location: root_path
|
||||
else
|
||||
@import_to = params[:import_to]
|
||||
|
||||
|
|
@ -20,8 +20,8 @@ class DataController < ApplicationController
|
|||
@headers = import_headers(params[:file].path).collect { |v| [v, i += 1] }
|
||||
@headers.unshift ['', i]
|
||||
rescue Exception => e
|
||||
flash[:error] = "Invalid CVS: could not read headers: #{e}"
|
||||
redirect_to :back
|
||||
flash[:error] = t "data.import.errors.invalid_csv", e: e
|
||||
redirect_back fallback_location: root_path
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ class DataController < ApplicationController
|
|||
path_and_file = Rails.root.join('public', 'uploads', 'csv', @filename)
|
||||
File.open(path_and_file, "wb") { |f| f.write(uploaded_file.read) }
|
||||
rescue Exception => e
|
||||
flash[:error] = "Could not save uploaded CSV (#{path_and_file}). Can Tracks write to the upload directory? #{e}"
|
||||
redirect_to :back
|
||||
flash[:error] = t "data.import.errors.save_error", path_and_file: path_and_file, e: e
|
||||
redirect_back fallback_location: root_path
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -43,8 +43,8 @@ class DataController < ApplicationController
|
|||
when 'todos'
|
||||
@labels = [:description, :context, :project, :notes, :created_at, :due, :completed_at]
|
||||
else
|
||||
flash[:error] = "Invalid import destination"
|
||||
redirect_to :back
|
||||
flash[:error] = t "data.import.errors.invalid_destination"
|
||||
redirect_back fallback_location: root_path
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
@ -59,15 +59,15 @@ class DataController < ApplicationController
|
|||
case params[:import_to]
|
||||
when 'projects'
|
||||
count = Project.import path_and_file, params, current_user
|
||||
flash[:notice] = "#{count} Projects imported"
|
||||
flash[:notice] = t 'data.import.projects_count', count: count
|
||||
when 'todos'
|
||||
count = Todo.import path_and_file, params, current_user
|
||||
flash[:notice] = "#{count} Todos imported"
|
||||
flash[:notice] = t 'data.import.todos.count', count: count
|
||||
else
|
||||
flash[:error] = t('data.invalid_import_destination')
|
||||
flash[:error] = t('data.import.errors.invalid_destination')
|
||||
end
|
||||
rescue Exception => e
|
||||
flash[:error] = t('data.invalid_import_destination') + ": #{e}"
|
||||
flash[:error] = t 'data.import.invalid_destination', e: e
|
||||
end
|
||||
File.delete(path_and_file)
|
||||
redirect_to import_data_path
|
||||
|
|
@ -203,7 +203,7 @@ class DataController < ApplicationController
|
|||
end
|
||||
|
||||
def yaml_import
|
||||
raise "YAML loading is disabled"
|
||||
raise t "data.import.yaml_disabled"
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h3>Map fields to be imported<h3>
|
||||
<h3><%= I18n.t 'data.import.map_title' %><h3>
|
||||
<%= form_tag csv_import_data_path do %>
|
||||
<% @labels.each do |l| %>
|
||||
<%= label_tag l %>:
|
||||
|
|
@ -7,5 +7,5 @@
|
|||
<% end %>
|
||||
<%= hidden_field_tag :file, @filename %>
|
||||
<%= hidden_field_tag :import_to, @import_to %>
|
||||
<%= submit_tag "Import" %>
|
||||
<%= submit_tag I18n.t("data.import.submit") %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<h2>Importing data</h2>
|
||||
<h2><%= I18n.t "data.import.header" %></h2>
|
||||
<div>
|
||||
<h3>Please upload your CSV file</h3>
|
||||
<h3><%= I18n.t "data.import.upload_csv" %></h3>
|
||||
<%= form_tag csv_map_data_path, :id => 'upload_form', multipart: true do %>
|
||||
<label for="import_to">Import to:</label>
|
||||
<label for="import_to"><%= I18n.t "data.import.target_field" %></label>
|
||||
<%= select_tag(:import_to, options_for_select([['Projects', 'projects'], ['Todos', 'todos']], 1) ) %>
|
||||
<br><br>
|
||||
<%= file_field_tag :file %>
|
||||
<%= submit_tag "Upload", :id => "upload_form_submit" %>
|
||||
<%= submit_tag I18n.t("data.import.upload"), :id => "upload_form_submit" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<h3>Daten exportieren</h3>
|
||||
<p>Sie können zwischen den folgenden Formaten wählen:</p>
|
||||
<ul>
|
||||
<li><strong>YAML: </strong>Für den Daten-Import bevorzugt.<br/><i>Bitte beachten Sie, dass der YAML-Import zur Zeit noch experimentelle Funktionalität darstellt. Nutzen Sie diese Option also nicht. um kritische Daten zu sichern.</i></li>
|
||||
<li><strong>CSV: </strong>Am besten für den Export in eine Tabellen-Kalkulation oder ähnliche Auswertungs-Software geeignet</li>
|
||||
<li><strong>XML: </strong>Am besten für den Daten-Import oder automatische Weiterverarbeitung</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<table class="export_table">
|
||||
<tr>
|
||||
<th>Beschreibung</th>
|
||||
<th>Download link</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YAML-Datei mit all Ihren Aktionen, Umgebungen, Projekten, Tags und Notizen</td>
|
||||
<td><%= link_to "YAML Datei", :controller => 'data', :action => 'yaml_export' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSV-Datei mit all Ihren Aktionen, benannten Umgebungen und Projekten</td>
|
||||
<td><%= link_to "CSV Dile (Aktionen, Umgebungen und Projekte)", :controller => 'data', :action => 'csv_actions' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSV-Datei mit all Ihren Notizen</td>
|
||||
<td><%= link_to "CSV Datei (nur Notizen)", :controller => 'data', :action => 'csv_notes' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XML-Datei mit all Ihren Aktionen, Umgebungen, Projekten, Tags und Notizen</td>
|
||||
<td><%= link_to "XML file (actions only)", :controller => 'data', :action => 'xml_export' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- End of feeds -->
|
||||
</div>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<h3>Exporting data</h3>
|
||||
<p>You can choose between the following formats:</p>
|
||||
<ul>
|
||||
<li><strong>YAML: </strong>Best for exporting data. <br/><i>Please note that importing YAML files is currently supported only in experimentally. Do not rely on it for backing up critical data.</i></li>
|
||||
<li><strong>CSV: </strong>Best for importing into spreadsheet or data analysis software</li>
|
||||
<li><strong>XML: </strong>Best for importing or repurposing the data</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<table class="export_table">
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th>Download link</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YAML file containing all your actions, contexts, projects, tags and notes</td>
|
||||
<td><%= link_to "YAML file", data_yaml_export_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSV file containing all of your actions, with named contexts and projects</td>
|
||||
<td><%= link_to "CSV file (actions, contexts and projects)", data_csv_actions_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSV file containing all your notes</td>
|
||||
<td><%= link_to "CSV file (notes only)", data_csv_notes_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XML file containing all your actions, contexts, projects, tags and notes</td>
|
||||
<td><%= link_to "XML file (actions only)", data_xml_export_path %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- End of feeds -->
|
||||
</div>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<h3>Exportar datos</h3>
|
||||
<p>Puede escoger entre los siguientes formatos:</p>
|
||||
<ul>
|
||||
<li><strong>YAML: </strong>Mejor formato para exportar datos. <br/><i>Por favor tenga en cuenta que la importación de ficheros YAML actualmente esta soportada de forma experimental. No confíe en este formato para hacer copias de seguridad de datos importantes.</i></li>
|
||||
<li><strong>CSV: </strong>Mejor formato para importar en una hoja de cálculo o en programas de análisis de datos.</li>
|
||||
<li><strong>XML: </strong>Mejor formato para transformar los datos a otro formato</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<table class="export_table">
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Enlace de descarga</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fichero YAML con todas sus acciones, contextos, proyectos, etiquetas y notas</td>
|
||||
<td><%= link_to "Fichero YAML", data_yaml_export_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fichero CSV con todas sus acciones, con contextos por nombre y proyectos</td>
|
||||
<td><%= link_to "Fichero CSV (acciones, contextos y proyectos)", data_csv_actions_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fichero CSV con todas sus notas</td>
|
||||
<td><%= link_to "Fichero CSV (sólo notas)", data_csv_notes_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fichero XML con todas sus acciones, contextos, proyectos, etiquetas y notas</td>
|
||||
<td><%= link_to "Fichero XML", data_xml_export_path %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- End of feeds -->
|
||||
</div>
|
||||
36
app/views/data/index.html.erb
Normal file
36
app/views/data/index.html.erb
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<h3><%= I18n.t "data.export.title" %></h3>
|
||||
<p><%= I18n.t "data.export.format_header" %></p>
|
||||
<ul>
|
||||
<li><%= raw I18n.t "data.export.yaml_description", yaml: "<strong>" + I18n.t("data.yaml") + "</strong>" %><br/><em><%= I18n.t "data.export.yaml_experimental" %></em></li>
|
||||
<li><%= raw I18n.t "data.export.csv_description", csv: "<strong>" + I18n.t("data.csv") + "</strong>" %></li>
|
||||
<li><%= raw I18n.t "data.export.xml_description", xml: "<strong>" + I18n.t("data.xml") + "</strong>" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<table class="export_table">
|
||||
<tr>
|
||||
<th><%= I18n.t "common.description" %></th>
|
||||
<th><%= I18n.t "data.export.download_link" %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= I18n.t "data.export.yaml_link_description" %></td>
|
||||
<td><%= link_to I18n.t("data.export.yaml_link_title"), data_yaml_export_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= I18n.t "data.export.csv_actions_description" %></td>
|
||||
<td><%= link_to I18n.t("data.export.csv_actions_title"), data_csv_actions_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= I18n.t "data.export.csv_notes_description" %></td>
|
||||
<td><%= link_to I18n.t("data.export.csv_notes_title"), data_csv_notes_path %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= I18n.t "data.export.xml_link_description" %></td>
|
||||
<td><%= link_to I18n.t('data.export.xml_link_title'), data_xml_export_path %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<p><b>Vorsicht</b>: vor dem Import der YAML Datei werden alle Daten in Ihrer Datenbank gelöscht.
|
||||
Falls Sie entsprechenden Zugriff auf Ihre Datenbank haben, empfiehlt es sich, ein Backup anzulegen,
|
||||
bevor Sie fortfahren.
|
||||
</p>
|
||||
<p>Fügen Sie den Inhalt der kopierten YAML Datei in das untenstehende Formular ein:</p>
|
||||
</div>
|
||||
<p>
|
||||
<%= form_for :import, @import, :url => {:controller => 'data', :action => 'yaml_import'} do |f| %>
|
||||
<%= f.text_area :yaml %><br />
|
||||
<input type="submit" value="Daten importieren">
|
||||
<% end %>
|
||||
</p>
|
||||
</div><!-- End of feeds -->
|
||||
</div><!-- End of display_box -->
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<p><b>Beware</b>: all your current data will be destroyed before importing
|
||||
the YAML file, so if you have access to the database, we strongly recommend
|
||||
backing up the database right now in case that anything goes wrong.
|
||||
</p>
|
||||
<p>Paste the contents of the YAML file you exported into the text box below:</p>
|
||||
</div>
|
||||
<p>
|
||||
<%= form_for :import, @import, :url => {:controller => 'data', :action => 'yaml_import'} do |f| %>
|
||||
<%= f.text_area :yaml %><br />
|
||||
<input type="submit" value="Import data">
|
||||
<% end %>
|
||||
</p>
|
||||
</div><!-- End of feeds -->
|
||||
</div><!-- End of display_box -->
|
||||
14
app/views/data/yaml_form.html.erb
Normal file
14
app/views/data/yaml_form.html.erb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<div id="display_box">
|
||||
<div id="feeds">
|
||||
<div id="feedlegend">
|
||||
<p><%= raw I18n.t "data.import.yaml_warning", warning: '<strong>' + I18n.t('data.import.warning') + '</strong>' %></p>
|
||||
<p><%= I18n.t "data.import.paste_field" %></p>
|
||||
</div>
|
||||
<p>
|
||||
<%= form_for :import, @import, :url => {:controller => 'data', :action => 'yaml_import'} do |f| %>
|
||||
<%= f.text_area :yaml %><br />
|
||||
<input type="submit" value="<%= I18n.t 'data.import.submit' %>">
|
||||
<% end %>
|
||||
</p>
|
||||
</div><!-- End of feeds -->
|
||||
</div><!-- End of display_box -->
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<% if !(@errmessage == '') %>
|
||||
<p><%= t('data.import_errors') %>:<pre><%= @errmessage %></pre></p>
|
||||
<p><%= t('data.import.errors.some') %>:<pre><%= @errmessage %></pre></p>
|
||||
<% else %>
|
||||
<p><%= t('data.import_successful') %></p>
|
||||
<p><%= t('data.import.successful') %></p>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
<% has_contexts = !current_user.contexts.empty? -%>
|
||||
<h1>Integration</h1>
|
||||
<p>Tracks kann mit verschiedenen Werkzeugen zusammenarbeiten...
|
||||
was immer Sie brauchen, um Ihre Aufgaben zu erledigen!
|
||||
Auf dieser Seite finden Sie Informationen, um einige dieser Werkzeuge einzurichten.
|
||||
Diese Beispiele sind nicht unbedingt auf Ihre Umgebung anwendbar oder bedürfen mehr
|
||||
technisches Wissen als andere.
|
||||
Weitere Informationen finden Sie in der <%= link_to "Entwickler Documentation der Tracks' REST API", url_for(:action => 'rest_api') %> (englisch).</p>
|
||||
<br/><p>Inhalt:</p>
|
||||
<ul>
|
||||
<li><a href="#email-cron-section">Anstehende Aufgaben automatisch sich via E-Mail zusenden lassen</a></li>
|
||||
<li><a href="#message_gateway">Tracks mit einem Mail-Server integrieren, um Aufgaben via E-Mail zu erstellen</a></li>
|
||||
</ul><br/>
|
||||
<p>Sie haben weitere Beispiele?
|
||||
<a href="http://www.getontracks.org/forums/viewforum/10/" title="Tracks | Tips and Tricks">Berichten Sie uns
|
||||
in unserem Tipps&Tricks Forum</a>, damit wir es für die nächsten Versionen berücksichtigen können.
|
||||
</p>
|
||||
|
||||
<a name="email-cron-section"> </a>
|
||||
<h2>Automatically Email Yourself Upcoming Actions</h2>
|
||||
|
||||
<p>If you enter the following entry to your crontab, you will receive email every day around 5 AM with a list of the upcoming actions which are due within the next 7 days.</p>
|
||||
|
||||
<textarea id="cron" name="cron">0 5 * * * /usr/bin/curl -0 "<%= root_url %>todos.txt?due=6&token=<%= current_user.token %>" | /usr/bin/mail -e -s 'Tracks actions due in the next 7 days' youremail@yourdomain.com</textarea>
|
||||
|
||||
<p>You can of course use other text <%= link_to 'feeds provided by Tracks', feeds_path %> -- why not email a list of next actions in a particular project to a group of colleagues who are working on the project?</p>
|
||||
|
||||
<a name="message_gateway"> </a>
|
||||
<h2>Integrated email/SMS receiver</h2>
|
||||
<p>
|
||||
If Tracks is running on the same server as your mail server, you can use the integrated mail handler built into tracks. Steps to set it up:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Go to <%= link_to t('layouts.navigation.preferences'), preferences_url %> and
|
||||
set your "<%= Preference.human_attribute_name('sms_email') %>" and
|
||||
"<%= Preference.human_attribute_name('sms_context') %>" for todos sent in
|
||||
via email (which could come from an SMS message)</li>
|
||||
<li>In sendmail/qmail/postfix/whatever, set up an email address
|
||||
alias to pipe messages to <pre>/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre></li>
|
||||
<li>Send an email to your newly configured address!</li>
|
||||
</ul>
|
||||
<p>You can also use the Rich Todo API to send in tasks like "do laundry @ Home"
|
||||
or "Call Bill > project X". The subject of the message will fill description,
|
||||
context, and project, while the body will populate the tasks's note.
|
||||
</p>
|
||||
<p>
|
||||
You may need to configure your <tt>site.yml</tt> to tell the message gateway to look at the <tt>to:</tt> field or <tt>from:</tt> field to
|
||||
lookup Tracks' user from the email address in that field. </p>
|
||||
<p>You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to <tt>single_user</tt> and pass the login of the user:
|
||||
<pre>TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre>
|
||||
</p>
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
<% has_contexts = !current_user.contexts.empty? -%>
|
||||
<h1>Integrations</h1>
|
||||
<p>Tracks can be integrated with a number of other tools...
|
||||
whatever it takes to help you get things done!
|
||||
This page has information on setting up some of these.
|
||||
Not all of these are applicable to all platforms, and some require more
|
||||
technical knowledge than others.
|
||||
See also <%= link_to "developer documentation for Tracks' REST API", url_for(:action => 'rest_api') %>.</p>
|
||||
<br/><p>Contents:</p>
|
||||
<ul>
|
||||
<li><a href="#email-cron-section">Automatically Email Yourself Upcoming Actions</a></li>
|
||||
<li><a href="#message_gateway">Integrate Tracks with an email server to be able to send an action through email to Tracks</a></li>
|
||||
<li><a href="#mailgun">Send emails to Tracks with Mailgun</a>
|
||||
<li><a href="#todo_rich_message_format">Rich Todo Message email format</a>
|
||||
</ul><br/>
|
||||
<p>Do you have one of your own to add?
|
||||
<a href="http://www.getontracks.org/forums/viewforum/10/" title="Tracks | Tips and Tricks">Tell us about
|
||||
it in our Tips and Tricks forum</a> and we may include it on this page in a future versions of Tracks.
|
||||
</p>
|
||||
|
||||
<a name="email-cron-section"> </a>
|
||||
<h2>Automatically Email Yourself Upcoming Actions</h2>
|
||||
|
||||
<p>If you enter the following entry to your crontab, you will receive email every day around 5 AM with a list of the upcoming actions which are due within the next 7 days.</p>
|
||||
|
||||
<textarea id="cron" name="cron">0 5 * * * /usr/bin/curl -0 "<%= root_url %>todos.txt?due=6&token=<%= current_user.token %>" | /usr/bin/mail -e -s 'Tracks actions due in the next 7 days' youremail@yourdomain.com</textarea>
|
||||
|
||||
<p>You can of course use other text <%= link_to 'feeds provided by Tracks', feeds_path %> -- why not email a list of next actions in a particular project to a group of colleagues who are working on the project?</p>
|
||||
|
||||
<a name="message_gateway"> </a>
|
||||
<h2>Integrated email/SMS receiver</h2>
|
||||
<p>
|
||||
If Tracks is running on the same server as your mail server, you can use the integrated mail handler built into tracks. Steps to set it up:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Go to <%= link_to t('layouts.navigation.preferences'), preferences_url %> and
|
||||
set your "<%= Preference.human_attribute_name('sms_email') %>" and
|
||||
"<%= Preference.human_attribute_name('sms_context') %>" for todos sent in
|
||||
via email (which could come from an SMS message)</li>
|
||||
<li>In sendmail/qmail/postfix/whatever, set up an email address
|
||||
alias to pipe messages to <pre>/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre></li>
|
||||
<li>Send an email to your newly configured address!</li>
|
||||
</ul>
|
||||
<p>You can also use the Rich Todo API to send in tasks like "do laundry @ Home"
|
||||
or "Call Bill > project X". The subject of the message will fill description,
|
||||
context, and project, while the body will populate the tasks's note.
|
||||
</p>
|
||||
<p>
|
||||
You may need to configure your <tt>site.yml</tt> to tell the message gateway to look at the <tt>to:</tt> field or <tt>from:</tt> field to
|
||||
lookup Tracks' user from the email address in that field. </p>
|
||||
<p>You can also send all email to a specific Tracks user. Configure mail_dispatch in site.yml to <tt>single_user</tt> and pass the login of the user:
|
||||
<pre>TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre>
|
||||
</p>
|
||||
|
||||
<a name="mailgun"> </a>
|
||||
<h2>Send emails to Tracks with Mailgun</h2>
|
||||
<p>
|
||||
If you want to email tasks to Tracks, but cannot run a mailserver on the same host,
|
||||
you could use the <a href='www.mailgun.com'>Mailgun</a> support built in to Tracks.
|
||||
</p>
|
||||
<p>
|
||||
For this to work your Tracks server will need to be reachable from the internet, so
|
||||
that Mailgun can POST data to it.
|
||||
<p>
|
||||
<ul>
|
||||
<li>Go to <%= link_to 'http://mailgun.com' %> and register for a free account.</li>
|
||||
<li>Go to 'Routes' in the Mailgun control panel, and add a new route:</li>
|
||||
<ul>
|
||||
<li>'Filter expression' should be set to 'catch_all()'</li>
|
||||
<li>'Action' should be 'forward("http://mytracksserver.domain.com/mailgun/mime")'
|
||||
</ul>
|
||||
<li>Go to <%= link_to t('layouts.navigation.preferences'), preferences_url %> and
|
||||
enter your incoming Mailgun email address (e.g. tracks@user.mailgun.com) in the
|
||||
"<%= Preference.human_attribute_name('sms_email') %>" box.</li>
|
||||
<li>Select a default context for emails to be put in with
|
||||
"<%= Preference.human_attribute_name('sms_context') %>"</li>
|
||||
<li>Add your Mailgun API key (not the Public API key) to the Tracks 'site.yml'
|
||||
<li>Update the mailmap in 'site.yml' to define which senders can send emails to
|
||||
which incoming addresses. For example, to send emails from your work and home
|
||||
email accounts to your tracks Mailgun route, set it up like this:
|
||||
<pre class=code>
|
||||
mailmap:
|
||||
tracks@user.mailgun.org:
|
||||
- me@myhome.domain.net
|
||||
- mr.user@work.company.com
|
||||
</pre>
|
||||
</ul>
|
||||
<p>All the comments about the email format from the section above apply to the
|
||||
Mailgun handling, as the data is processed the same way</p>
|
||||
|
||||
<a name="todo_rich_message_format"> </a>
|
||||
<h2>Rich Todo Message Format</h2>
|
||||
<p> For both of the above methods, the follow format can be used:</p>
|
||||
<pre>my awesome todo @context ~project <131012 >131009 #tag1 #tag2 *</pre>
|
||||
<p>The fields are:</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Symbol</th><th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@</td><td>The context to place the Todo in</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>~</td><td>The project to place the Todo in</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><</td><td>The due date for the Todo (may be 2 digits for day, 4 digits for month-day, or 6 digits for year-month-day)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>></td><td>The due date for the Todo (may be 2 digits for day, 4 digits for month-day, or 6 digits for year-month-day)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#</td><td>A tag to apply to the Todo - may be used multiple times</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*</td><td>Flag to star the Todo</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>All symbols are optional, and text up to the first symbol (or end of string) is used as the description of the todo</p>
|
||||
85
app/views/integrations/index.html.erb
Normal file
85
app/views/integrations/index.html.erb
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<% has_contexts = !current_user.contexts.empty? -%>
|
||||
<h1><%= I18n.t 'integrations.title' %></h1>
|
||||
<p><%= raw I18n.t 'integrations.intro', documentation_link: link_to(I18n.t('integrations.developer_documentation_link'), url_for(:action => 'rest_api')) %></p>
|
||||
<br/><p><%= I18n.t 'integrations.contents_header' %></p>
|
||||
<ul>
|
||||
<li><a href="#email-cron-section"><%= I18n.t 'integrations.sections.automatic_email' %></a></li>
|
||||
<li><a href="#message_gateway"><%= I18n.t 'integrations.sections.message_gateway' %></a></li>
|
||||
<li><a href="#mailgun"><%= I18n.t 'integrations.sections.mailgun' %></a></li>
|
||||
<li><a href="#todo_rich_message_format"><%= I18n.t 'integrations.sections.email_rich' %></a></li>
|
||||
</ul>
|
||||
<p><%= raw I18n.t 'integrations.add_your_own', tell_us_link: link_to(I18n.t('integrations.tell_us_link_text'), 'https://github.com/TracksApp/tracks/issues') %></p>
|
||||
|
||||
<a name="email-cron-section"> </a>
|
||||
<h2><%= I18n.t 'integrations.sections.automatic_email' %></h2>
|
||||
|
||||
<p><%= I18n.t 'integrations.cron_1' %></p>
|
||||
|
||||
<textarea id="cron" name="cron">0 5 * * * /usr/bin/curl -0 "<%= root_url %>todos.txt?due=6&token=<%= current_user.token %>" | /usr/bin/mail -e -s 'Tracks actions due in the next 7 days' youremail@yourdomain.com</textarea>
|
||||
|
||||
<p><%= raw I18n.t 'integrations.cron_2', feeds_link: link_to(I18n.t('integrations.feeds_link_text'), feeds_path) %></p>
|
||||
|
||||
<a name="message_gateway"> </a>
|
||||
<h2><%= I18n.t 'integrations.sections.message_gateway' %></h2>
|
||||
<p><%= I18n.t 'integrations.message_gateway.description' %></p>
|
||||
<ul>
|
||||
<li><%= raw I18n.t 'integrations.message_gateway.instructions.1', preferences_link: link_to(t('layouts.navigation.preferences'), preferences_url), sms_email_name: Preference.human_attribute_name('sms_email'), sms_context_name: Preference.human_attribute_name('sms_context') %></li>
|
||||
<li><%= raw I18n.t 'integrations.message_gateway.instructions.2', command: "<pre>/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre>" %></li>
|
||||
<li><%= I18n.t 'integrations.message_gateway.instructions.3' %></li>
|
||||
</ul>
|
||||
<p><%= I18n.t 'integrations.message_gateway.rich_api_tip' %></p>
|
||||
<p><%= raw I18n.t 'integrations.message_gateway.configuration', site_yml: '<tt>site.yml</tt>', to_name: '<tt>to:</tt>', from_name: '<tt>from:</tt>' %></p>
|
||||
<p><%= raw I18n.t 'integrations.message_gateway.one_user_configuration', single_user_var_name: '<tt>single_user</tt>', code: "<pre>TRACKS_MAIL_RECEIVER=" + current_user.login + " /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre>" %></p>
|
||||
|
||||
<a name="mailgun"> </a>
|
||||
<h2><%= I18n.t 'integrations.sections.mailgun' %></h2>
|
||||
<p><%= raw I18n.t 'integrations.mailgun.description', mailgun_link: link_to('Mailgun', 'http://www.mailgun.com/') %></p>
|
||||
<p><%= I18n.t 'integrations.mailgun.conditions' %></p>
|
||||
<ul>
|
||||
<li><%= raw I18n.t 'integrations.mailgun.instructions.1', mailgun_link: link_to('Mailgun', 'http://www.mailgun.com/') %></li>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.2' %></li>
|
||||
<ul>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.2a' %></li>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.2b' %></li>
|
||||
</ul>
|
||||
<li><%= raw I18n.t 'integrations.mailgun.instructions.3', preferences_link: link_to(t('layouts.navigation.preferences'), preferences_url), sms_email_name: Preference.human_attribute_name('sms_email') %></li>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.4', sms_context_name: Preference.human_attribute_name('sms_context') %></li>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.5' %></li>
|
||||
<li><%= I18n.t 'integrations.mailgun.instructions.6', code: '<pre class=code>
|
||||
mailmap:
|
||||
tracks@user.mailgun.org:
|
||||
- me@myhome.domain.net
|
||||
- mr.user@work.company.com
|
||||
</pre>' %></li>
|
||||
</ul>
|
||||
<p><%= I18n.t 'integrations.mailgun.gateway_instructions' %></p>
|
||||
|
||||
<a name="todo_rich_message_format"> </a>
|
||||
<h2><%= I18n.t 'integrations.sections.email_rich' %></h2>
|
||||
<p><%= I18n.t 'integrations.email_rich.description' %></p>
|
||||
<pre><%= I18n.t 'integrations.example_names.todo' %> @<%= I18n.t 'integrations.example_names.context' %> ~<%= I18n.t 'integrations.example_names.project' %> <131012 >131009 #<%= I18n.t 'integrations.example_names.tag.1' %> #<%= I18n.t 'integrations.example_names.tag.2' %> *</pre>
|
||||
<p><%= I18n.t 'integrations.email_rich.fields_title' %></p>
|
||||
<table>
|
||||
<tr>
|
||||
<th><%= I18n.t 'integrations.email_rich.symbol_title' %></th><th><%= I18n.t 'integrations.email_rich.meaning_title' %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.context' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>~</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.project' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.due_date' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>></td><td><%= I18n.t 'integrations.email_rich.field_descriptions.due_date' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.tag' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.star' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><%= I18n.t 'integrations.email_rich.fields_instruction' %>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<% has_contexts = !current_user.contexts.empty? -%>
|
||||
<h1>Integratie</h1>
|
||||
<p>Tracks kan met een aantal tools worden geïntegreerd...
|
||||
Alles om je te helpen om dingen gedaan te krijgen!
|
||||
Deze pagina heeft informatie over het tot stand brengen van sommige integratievormen.
|
||||
Deze voorbeelden zijn niet altijd voor alle platformen van toepassing en
|
||||
sommige voorbeelden vragen meer technische kennis dan anderen
|
||||
Zie ook <%= link_to "de documentatie voor ontwikkelaars met Tracks' REST API", url_for(:action => 'rest_api') %>.</p>
|
||||
<br/><p>Inhoud:</p>
|
||||
<ul>
|
||||
<li><a href="#email-cron-section">Email jezelf automatisch de acties met een aflopende deadline</a></li>
|
||||
<li><a href="#message_gateway">Integreer Tracks met een email server om een actie via email naar Tracks te sturen</a></li>
|
||||
</ul><br/>
|
||||
<p>Heb je een tip om hier toe te voegen?
|
||||
<a href="http://www.getontracks.org/forums/viewforum/10/" title="Tracks | Tips and Tricks">Vertel ons er over in onze
|
||||
Tips and Tricks forum</a> en misschien voegen we jouw tip toe op deze pagina in een toekomstige versie van Tracks.
|
||||
</p>
|
||||
|
||||
<a name="email-cron-section"> </a>
|
||||
<h2>Email jezelf automatisch de acties met een aflopende deadline</h2>
|
||||
|
||||
<p>Als je de volgende regel toevoegd aan jouw crontab, dat ontvang je een e-mail op elke dag rond 05:00 met een lijst met acties waarvan de deadline afloopt binnen de komende 7 dagen.</p>
|
||||
|
||||
<textarea id="cron" name="cron">0 5 * * * /usr/bin/curl -0 "<%= root_url %>todos.txt?due=6&token=<%= current_user.token %>" | /usr/bin/mail -e -s 'Tracks actions due in the next 7 days' youremail@yourdomain.com</textarea>
|
||||
|
||||
<p>Uiteraard kan je ook een andere <%= link_to 'text feed gebruiken die Tracks biedt', feeds_path %> -- bijvoorbeeld een email met een lijst van acties voor een specifiek project naar een groep collega's die werken aan dat project?</p>
|
||||
|
||||
<a name="message_gateway"> </a>
|
||||
<h2>Integreer Tracks met een email server om een actie via email naar Tracks te sturen</h2>
|
||||
<p>
|
||||
Als Tracks draait op dezelfde server als jouw mailserver, dan kan je de geïntegreerde mail handler gebruiken van Tracks. Om dit in te stellen:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Ga naar <%= link_to t('layouts.navigation.preferences'), preferences_url %>
|
||||
en stel in "<%= Preference.human_attribute_name('sms_email') %>" en
|
||||
"<%= Preference.human_attribute_name('sms_context') %>" voor acties die
|
||||
verzonden zijn via email (die bijv. komen via een SMS message)</li>
|
||||
<li>In sendmail/qmail/postfix/whatever, stel een email address
|
||||
alias in om berichten door te sturen naar
|
||||
<pre>/PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre></li>
|
||||
<li>Verstuur een email naar het net geconfigureerde e-mail adres!</li>
|
||||
</ul>
|
||||
<p>Je kan ook de Rich Todo API gebruiken om acties te maken zoals "do laundry @ Home"
|
||||
of "Call Bill > project X". Het onderwerp van het bericht zal de bijschrijving van de actie vullen,
|
||||
de context, en het project, terwijl de body van het bericht de notities van de actie zal vullen.
|
||||
</p>
|
||||
<p>
|
||||
Het kan nodig zijn om jouw <tt>site.yml</tt> te configureren om de message gateway te laten kijken naar het <tt>to:</tt> veld of het <tt>from:</tt> veld om
|
||||
de Tracks-gebruiker op te zoeken met het emailadres uit dat veld. </p>
|
||||
<p>Je kan ook alle email naar een specifieke Tracks gebruiker sturen. Stel mail_dispatch in site.yml in op <tt>single_user</tt> en geeft de login van de gebruiker door:
|
||||
<pre>TRACKS_MAIL_RECEIVER=<%=current_user.login%> /PATH/TO/TRACKS/bin/rails r -e production 'MessageGateway.receive(STDIN.read)'</pre>
|
||||
</p>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<%= pref_with_text_field('prefs', 'date_format') %>
|
||||
|
||||
<div class='prefs_example'>This will result in: <span id='prefs.date_format'><%= l(Time.zone.today, :format => current_user.prefs.date_format) %></span></div>
|
||||
<div class='prefs_example'><%= I18n.t('preferences.result_in') %> <span id='prefs.date_format'><%= l(Time.zone.today, :format => current_user.prefs.date_format) %></span></div>
|
||||
<br/>
|
||||
Or pick one of the following:<br/>
|
||||
<%= I18n.t('preferences.pick_one') %><br/>
|
||||
<div class="form-group btn-group" role="group" data-toggle="buttons">
|
||||
<% [:default, :short, :long, :longer].each do |format| %>
|
||||
<label class="btn btn-default">
|
||||
|
|
@ -14,9 +14,9 @@ Or pick one of the following:<br/>
|
|||
<div class="form-group">
|
||||
<%= pref_with_text_field('prefs', 'title_date_format') %>
|
||||
</div>
|
||||
<div class='prefs_example'>This will result in: <span id='prefs.title_date_format'><%= l(Time.zone.today, :format => current_user.prefs.title_date_format) %></span></div>
|
||||
<div class='prefs_example'><%= I18n.t('preferences.result_in') %> <span id='prefs.title_date_format'><%= l(Time.zone.today, :format => current_user.prefs.title_date_format) %></span></div>
|
||||
<br/>
|
||||
Or pick one of the following:<br/>
|
||||
<%= I18n.t('preferences.pick_one') %><br/>
|
||||
<div class="form-group btn-group" role="group" data-toggle="buttons">
|
||||
<% [:default, :short, :long, :longer].each do |format| %>
|
||||
<label class="btn btn-default">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue