Browse Source

Added shorter/ical routes and made them defaults.

Thorsten Eckel 9 years ago
parent
commit
b7c3403e0e

+ 2 - 2
app/assets/javascripts/app/views/profile/calendar_subscriptions.jst.eco

@@ -8,7 +8,7 @@
 <p><%= @T('See your tickets from within your favorite calendar by adding the following url to your calendar app.') %></p>
 
 <h3><%= @T('URL') %></h3>
-<input class="form-control js-select" readonly value="<%= @baseurl %>/calendar_subscriptions/tickets">
+<input class="form-control js-select" readonly value="<%= @baseurl %>/ical/tickets">
 
 <h3><%= @T('Subscription Settings') %></h3>
 <table class="settings-list">
@@ -25,7 +25,7 @@
       <td style="text-transform: capitalize"><%= @translationTable[stateType] %>
       <td><label class="inline-label"><input type="checkbox" name="<%= stateType %>/own"<%= if options.own then ' checked' %>> <%= @T('own tickets') %></label>
       <td><label class="inline-label"><input type="checkbox" name="<%= stateType %>/not_assigned"<%= if options.not_assigned then ' checked' %>> <%= @T('not assigned tickets') %></label>
-      <td><div class="btn btn--table btn--text js-showLink"><%= @T('Show') %></div><input class="form-control form-control--borderless js-select is-hidden" readonly value="<%= @baseurl %>/calendar_subscriptions/tickets/<%= stateType %>">
+      <td><div class="btn btn--table btn--text js-showLink"><%= @T('Show') %></div><input class="form-control form-control--borderless js-select is-hidden" readonly value="<%= @baseurl %>/ical/tickets/<%= stateType %>">
     </tr>
     <% end %>
   </tbody>

+ 6 - 0
config/routes/calendar_subscriptions.rb

@@ -1,5 +1,11 @@
 Zammad::Application.routes.draw do
 
+  # shorter version
+  match '/ical',                 to: 'calendar_subscriptions#all',    via: :get
+  match '/ical/:object',         to: 'calendar_subscriptions#object', via: :get
+  match '/ical/:object/:method', to: 'calendar_subscriptions#object', via: :get
+
+  # wording version
   match '/calendar_subscriptions',                 to: 'calendar_subscriptions#all',    via: :get
   match '/calendar_subscriptions/:object',         to: 'calendar_subscriptions#object', via: :get
   match '/calendar_subscriptions/:object/:method', to: 'calendar_subscriptions#object', via: :get