Нет описания

tour.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. 'use strict';
  2. var feed_content_tour = new Tour({
  3. name: "feed_content_tour",
  4. steps: [
  5. {
  6. path: "/",
  7. element: "#navbar-link-feed-content",
  8. title: "Managing feed content",
  9. content: "To manage the content of the SMS feeds, click on the 'Feed Content' link on the navigation bar.",
  10. reflex: true,
  11. },
  12. {
  13. path: "/feed_content/",
  14. element: ".table-container",
  15. title: "Categories",
  16. content: "The feed content page displays a list of the available feed categories. Each category contains a list of SMS messages to be sent, one for each day of the year.",
  17. placement: "top",
  18. },
  19. {
  20. path: "/feed_content/",
  21. element: "th.name",
  22. title: "Category name",
  23. content: "The category name column contains the name of the category. This name is used as the title of the RSS feed. No two categories can have the same name.",
  24. placement: "top",
  25. },
  26. {
  27. path: "/feed_content/",
  28. element: "th.description",
  29. title: "Description",
  30. content: "The description column contains an optional category description, which can be used to store notes about the category.",
  31. placement: "top",
  32. },
  33. {
  34. path: "/feed_content/",
  35. element: "th.rss_url",
  36. title: "RSS URL",
  37. content: "The RSS URL column contains the url that is used to retrieve the daily SMS message details for this category.<br><br>This URL should be given to the SMS provider along with the category name.",
  38. placement: "top",
  39. },
  40. {
  41. path: "/feed_content/",
  42. element: "th.days_required",
  43. title: "Days required",
  44. content: "The days required column specifies the number of messages that are needed for this category. It is usually 366&mdash;one for each day of a leap year.",
  45. placement: "top",
  46. },
  47. {
  48. path: "/feed_content/",
  49. element: "th.status",
  50. title: "Status",
  51. content: "The status column show whether or not a category contains the required number of messages. If there aren't enough, it will display how many and which days are missing.",
  52. placement: "top",
  53. },
  54. {
  55. path: "/feed_content/",
  56. element: "th.delete",
  57. title: "Deleting a category",
  58. content: 'Clicking on an <span class="glyphicon glyphicon-remove"></span> button in this column will delete the corresponding category.<br><br><b>WARNING:</b> This will also delete all messages in the category.',
  59. placement: "top",
  60. },
  61. {
  62. path: "/feed_content/",
  63. element: "#id_d0-search_expr",
  64. title: "Filtering categories",
  65. content: "You can filter the category list by typing some text into the 'Search' box and clicking on the 'Filter' button. Only categories containing this text in their name or description fields will be shown.",
  66. },
  67. {
  68. path: "/feed_content/",
  69. element: "#d0-create_button",
  70. title: "Creating categories",
  71. content: "You can add a new category by clicking on the 'Create' button.",
  72. reflex: true,
  73. },
  74. {
  75. path: "/feed_content/create/",
  76. element: "#id_name",
  77. title: "Category name",
  78. content: "Type in a unique category name.",
  79. },
  80. {
  81. path: "/feed_content/create/",
  82. element: "#id_description",
  83. title: "Description",
  84. content: "The description is optional. You can use it to add notes about the category.",
  85. },
  86. {
  87. path: "/feed_content/create/",
  88. element: "#id_days_required",
  89. title: "Days required",
  90. content: "Days required specifies the number of messages that are required inside this category. It is used to warn you if you haven't provided enough messages. The default value is 366&mdash;one for each day of a leap year. It is very unlikely that you will need to change this value.",
  91. },
  92. {
  93. path: "/feed_content/create/",
  94. element: "#id_create_button",
  95. title: "Create the category",
  96. content: "Once you have typed in the required information, click on the 'Create' button to create the new category (you don't have to do this now).<br><br>If there are any errors, the form will be displayed again with instructions on what needs fixing, otherwise you will be taken back to the category list.",
  97. },
  98. {
  99. path: "/feed_content/",
  100. element: ".clickable-row:first-child",
  101. title: "View category contents",
  102. content: "To view or edit a category, or the messages inside a category, click on one of the rows in the category list.",
  103. },
  104. {
  105. path: "/feed_content/1/",
  106. element: "#id_edit_button",
  107. title: "Edit category",
  108. content: "To edit the category details, click on the 'Edit' button. The process for editing a category is exactly the same as the process for creating a category.",
  109. },
  110. {
  111. path: "/feed_content/1/",
  112. element: "#id_delete_button",
  113. title: "Delete category",
  114. content: "To delete the category and all the messages it contains, click on the 'Delete' button.",
  115. },
  116. {
  117. path: "/feed_content/1/",
  118. element: "#t0 .table-container",
  119. title: "Messages",
  120. content: "The message list displays all the messages in the category.",
  121. placement: "top",
  122. },
  123. {
  124. path: "/feed_content/1/",
  125. element: "#t0 th.day_number",
  126. title: "Day number",
  127. content: "The day number column contains the day of the year on which the message will be sent. Day number 1 is the 1<sup>st</sup> of January, day number 32 is the 1<sup>st</sup> of February, etc. No two messages in a category can have the same day number.",
  128. placement: "top",
  129. },
  130. {
  131. path: "/feed_content/1/",
  132. element: "#t0 th.message_text",
  133. title: "Message text",
  134. content: "The message text column contains the text of the message that will be sent to subscibers.",
  135. placement: "top",
  136. },
  137. {
  138. path: "/feed_content/1/",
  139. element: "#t0 th.delete",
  140. title: "Deleting a message",
  141. content: 'Clicking on an <span class="glyphicon glyphicon-remove"></span> button in this column will delete the corresponding message.',
  142. placement: "top",
  143. },
  144. {
  145. path: "/feed_content/1/",
  146. element: "#id_d1-0-day_number",
  147. title: "Filtering messages",
  148. content: "You can search for a particular day number by typing it into the 'Day' box and clicking on Filter.",
  149. },
  150. {
  151. path: "/feed_content/1/",
  152. element: "#id_d1-0-message_text",
  153. title: "Filtering messages",
  154. content: "You can search for messages containing a particular piece of text by typing it into 'Text' box and clicking on Filter.",
  155. },
  156. {
  157. path: "/feed_content/1/",
  158. element: "#d1-0-create_button",
  159. title: "Creating messages",
  160. content: "You can create a new message by clicking on the 'Create' button.",
  161. reflex: true,
  162. },
  163. {
  164. path: "/feed_content/1/items/create/",
  165. element: "#id_day_number",
  166. title: "Day number",
  167. content: "You can optionally type in a day number for the message. If you leave the day number blank, the next available day number in the category will be automatically assigned. No two messages in a category can have the same day number.",
  168. },
  169. {
  170. path: "/feed_content/1/items/create/",
  171. element: "#id_message_text",
  172. title: "Message text",
  173. content: "Type in the text of the message.",
  174. },
  175. {
  176. path: "/feed_content/1/items/create/",
  177. element: "#id_create_button",
  178. title: "Create the message",
  179. content: "Once you have typed in the required information, click on the 'Create' button to create the new message (you don't have to do this now).<br><br>If there are any errors, the form will be displayed again with instructions on what needs fixing, otherwise you will be taken back to the message list for the category.",
  180. },
  181. {
  182. path: "/feed_content/1/",
  183. element: "#t0 .clickable-row:first-child",
  184. title: "Editing messages",
  185. content: "You can edit a message by clicking on the corresponding row in the message list.<br><br>The process is exactly the same as for creating a new message.",
  186. reflex: true,
  187. },
  188. {
  189. path: "/feed_content/1/",
  190. orphan: true,
  191. title: "Tutorial complete",
  192. content: "That's it as far as managing categories and messages goes.<br><br>You can click on the 'End tour' button to complete the tutorial."
  193. },
  194. ]
  195. });
  196. var feed_logs_tour = new Tour({
  197. name: "feed_logs_tour",
  198. steps: [
  199. {
  200. path: "/",
  201. element: "#navbar-link-feed-logs",
  202. title: "Viewing feed logs",
  203. content: "To view the feed logs, click on the 'Feed Logs' link on the navigation bar.",
  204. reflex: true,
  205. },
  206. {
  207. path: "/rss/daily/logs/",
  208. element: ".table-container",
  209. title: "Feed logs",
  210. content: "The feed logs show you how many times the message for each category was downloaded on a particular day.<br><br>If you don't see an entry for a particular category on a particular day, then the message for that category was not sent on that day.",
  211. placement: "top",
  212. },
  213. {
  214. path: "/rss/daily/logs/",
  215. element: "#id_d0-from_date",
  216. title: "Filtering logs",
  217. content: "You can search for log entries that occur on or <b>after</b> a specific date by entering a value into the 'From' box. Dates should be enterred in the form YYYY-MM-DD.",
  218. },
  219. {
  220. path: "/rss/daily/logs/",
  221. element: "#id_d0-to_date",
  222. title: "Filtering logs",
  223. content: "You can search for log entries that occur on or <b>before</b> a specific date by entering a value into the 'To' box. Dates should be enterred in the form YYYY-MM-DD.",
  224. },
  225. {
  226. path: "/rss/daily/logs/",
  227. element: "#id_d0-category_name",
  228. title: "Filtering logs",
  229. content: "You can search for log entries whose category name contains a particular piece of text by typing it into the 'Category' box.",
  230. },
  231. {
  232. path: "/rss/daily/logs/",
  233. element: "#id_d0-message_text",
  234. title: "Filtering logs",
  235. content: "You can search for log entries whose message contains a particular piece of text by typing it into the 'Message' box.",
  236. },
  237. {
  238. path: "/rss/daily/logs/",
  239. element: ".filter-button",
  240. title: "Filtering logs",
  241. content: "You can perform more complicated searches using combinations of the various filter fields.<br><br>When you are ready to perform the search, click on the 'Filter' button.",
  242. },
  243. {
  244. path: "/rss/daily/logs/",
  245. element: ".filter-button",
  246. title: "Tutorial complete",
  247. content: "That's it as far as viewing the feed logs goes.<br><br>Click on the 'End tour' button to complete the tutorial.",
  248. },
  249. ]
  250. });
  251. if (! String.prototype.startsWith) {
  252. String.prototype.startsWith = function(searchString, position) {
  253. position = position || 0;
  254. return this.indexOf(searchString, position) === position;
  255. };
  256. }
  257. if (document.location.pathname.startsWith('/feed_content/')) {
  258. feed_content_tour.init();
  259. }
  260. else if (document.location.pathname.startsWith('/rss/daily/logs/')) {
  261. feed_logs_tour.init();
  262. }