diff --git a/app/assets/javascripts/docs.js.coffee b/app/assets/javascripts/docs.js.coffee index 77d0152a..12097596 100644 --- a/app/assets/javascripts/docs.js.coffee +++ b/app/assets/javascripts/docs.js.coffee @@ -1,10 +1,4 @@ $ -> - for feature in $('.feature-description').toArray().reverse() - id = $(feature).attr('id') - title = $(feature).find('h3').text() - li = $("
  • #{title}
  • ") - li.insertAfter($('#features')) - $('#cancel_tip').on 'ajax:complete', (et, e) -> if JSON.parse(e.responseText) $("#welcome-modal .modal-footer").html("

    Okay, tips will not appear anymore

    ") diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb deleted file mode 100644 index 840e7e30..00000000 --- a/app/helpers/dashboard_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -module DashboardHelper - def display_a_tip - tip = current_account.displayed_next_tip - return unless tip - content_for :tip do - render partial: "/docs/tips/#{tip}" - end - render partial: 'displayed_tip' - end - - def tip_title title - @tip_title = title - end -end diff --git a/app/views/dashboards/_displayed_tip.html.slim b/app/views/dashboards/_displayed_tip.html.slim index abf3879e..3d9e2aab 100644 --- a/app/views/dashboards/_displayed_tip.html.slim +++ b/app/views/dashboards/_displayed_tip.html.slim @@ -1,16 +1,17 @@ -.modal#welcome-modal tabindex="-1" - .modal-dialog - .modal-content - .modal-header - a.close data-dismiss="modal" × - h4.modal-title - small TIP  - = @tip_title - .modal-body - = yield :tip - .modal-footer - .pull-left - 'One tip is displayed every day. - = link_to 'Click here to stop.', cancel_tips_account_path(current_account), method: 'POST', remote: true, id: 'cancel_tip' - .pull-right - a.btn.btn-primary.btn-large data-dismiss="modal" href="" Close +- if tip = current_account.displayed_next_tip + .modal#welcome-modal tabindex="-1" + .modal-dialog + .modal-content + .modal-header + a.close data-dismiss="modal" × + h4.modal-title + small TIP  + = t tip, scope: 'account.tips' + .modal-body + = render partial: "/docs/tips/#{tip}" + .modal-footer + .pull-left + 'One tip is displayed every day. + = link_to 'Click here to stop.', cancel_tips_account_path(current_account), method: 'POST', remote: true, id: 'cancel_tip' + .pull-right + a.btn.btn-primary.btn-large data-dismiss="modal" href="" Close diff --git a/app/views/dashboards/show.html.slim b/app/views/dashboards/show.html.slim index 90ae7ee5..ddd4a5dd 100644 --- a/app/views/dashboards/show.html.slim +++ b/app/views/dashboards/show.html.slim @@ -95,4 +95,4 @@ .modal-footer = f.submit class: 'btn btn-primary' -= display_a_tip += render partial: 'displayed_tip' diff --git a/app/views/docs/index.html.slim b/app/views/docs/index.html.slim index 8315eaea..37f59041 100644 --- a/app/views/docs/index.html.slim +++ b/app/views/docs/index.html.slim @@ -7,6 +7,9 @@ a href="#heroku_button" Heroku Button a href="#manual_install" Manual install li#features.nav-header Features + - Account::TIPS.each do |tip| + li + a href="##{tip}"= t tip, scope: 'account.tips' li.divider li.nav-header FAQ li @@ -37,10 +40,9 @@ 'Adminium doesn’t need to integrate at a code-level and thus isn’t tied to a particular language. It can be used with any app, be it Ruby, Node.js, Clojure, Java, Python, or Scala, as long as it makes use of a PostgreSQL or MySQL database. - Account::TIPS.each do |tip| - - tip_body = render partial: "/docs/tips/#{tip}" - section.feature-description.well(id=tip) - h3== @tip_title - = tip_body + section.feature-description.well id=tip + h3= t tip, scope: 'account.tips' + = render partial: "/docs/tips/#{tip}" section.well#schema_search_path h3 How can I access PostgreSQL schemas other than public? diff --git a/app/views/docs/tips/_advanced_search.slim b/app/views/docs/tips/_advanced_search.slim index 87759a7e..d89796e7 100644 --- a/app/views/docs/tips/_advanced_search.slim +++ b/app/views/docs/tips/_advanced_search.slim @@ -1,4 +1,3 @@ -- tip_title 'Advanced Searches, Views and Widgets' p If you want to perform a complex query on your table, advanced search will let you add multiple constraints on columns. p= image_tag 'docs/advanced_search_form.png', class: 'img-thumbnail img-responsive' p You can name and save this search for easy access later. It will appear as a tab on the listing page. diff --git a/app/views/docs/tips/_basic_search.slim b/app/views/docs/tips/_basic_search.slim index c65e0832..eda61009 100644 --- a/app/views/docs/tips/_basic_search.slim +++ b/app/views/docs/tips/_basic_search.slim @@ -1,4 +1,3 @@ -- tip_title 'Basic Search' p By default, you can search on every string, text and integer columns of a table. p= image_tag 'docs/search_input.png', class: 'img-thumbnail img-responsive' p You can use the symbol % in your query string for a simple regular expression. diff --git a/app/views/docs/tips/_displayed_record.slim b/app/views/docs/tips/_displayed_record.slim index 9728467d..602e8411 100644 --- a/app/views/docs/tips/_displayed_record.slim +++ b/app/views/docs/tips/_displayed_record.slim @@ -1,4 +1,3 @@ -- tip_title 'Customizing the listing page' p 'If your table has too many columns, you can edit which one you want to see in the listing page. br diff --git a/app/views/docs/tips/_editing.html.slim b/app/views/docs/tips/_editing.html.slim index a31ff92a..0286fa9c 100644 --- a/app/views/docs/tips/_editing.html.slim +++ b/app/views/docs/tips/_editing.html.slim @@ -1,4 +1,3 @@ -- tip_title "Edition" p 'There are different ways to edit your records: diff --git a/app/views/docs/tips/_enumerable.slim b/app/views/docs/tips/_enumerable.slim index 899cdcf9..14d85411 100644 --- a/app/views/docs/tips/_enumerable.slim +++ b/app/views/docs/tips/_enumerable.slim @@ -1,4 +1,3 @@ -- tip_title "Enumerable Columns" p 'You may have columns with reference data, like integer that would be more readable if it was a string. A status code column for example. br diff --git a/app/views/docs/tips/_export_import.slim b/app/views/docs/tips/_export_import.slim index 3792ed1a..66f1d7ba 100644 --- a/app/views/docs/tips/_export_import.slim +++ b/app/views/docs/tips/_export_import.slim @@ -1,4 +1,3 @@ -- tip_title "Export and Import your data" p You can easily export a specific search and download a CSV file. In the listing page, just click on the export button, select the columns you wish to export and other export options. p Your CSV file can be locally modified and imported back if the CSV file contains the id column of your records. p If the id of a record is not specified, a new record will be created. diff --git a/app/views/docs/tips/_keyboard_shortcuts.slim b/app/views/docs/tips/_keyboard_shortcuts.slim index e4cc185b..93db378c 100644 --- a/app/views/docs/tips/_keyboard_shortcuts.slim +++ b/app/views/docs/tips/_keyboard_shortcuts.slim @@ -1,4 +1,3 @@ -- tip_title 'Keyboard shortcuts' p ' Keyboard shortcuts help you save time by allowing you to never take your hands off the keyboard to use the mouse. p diff --git a/app/views/docs/tips/_relationships.slim b/app/views/docs/tips/_relationships.slim index c9bd32cd..de4c4b89 100644 --- a/app/views/docs/tips/_relationships.slim +++ b/app/views/docs/tips/_relationships.slim @@ -1,3 +1,2 @@ -- tip_title 'Relationship Display' p By default relationships are displayed using the humanized table name and the primary key (for instance User #37). However you can configure a specific column to be used for labeling these links. You might have for instance a pseudo column on a users table. p To choose the Label column for a table, go to the listing view of the table and click on the cog button. In the modal, you will find a pane titled Miscellaneous, which contains the Label column option. \ No newline at end of file diff --git a/app/views/docs/tips/_serialized.slim b/app/views/docs/tips/_serialized.slim index c7ef5eb7..f1bcaf0e 100644 --- a/app/views/docs/tips/_serialized.slim +++ b/app/views/docs/tips/_serialized.slim @@ -1,4 +1,3 @@ -- tip_title 'Serialized data' p Do you run a ruby application? Do you have serialized data stored in some columns? p If the answer is yes, you should try to activate the serialized option in the column setting. p= image_tag 'docs/serialized.png', class: 'img-thumbnail img-responsive' diff --git a/app/views/docs/tips/_time_charts.slim b/app/views/docs/tips/_time_charts.slim index 42d79373..3f727c65 100644 --- a/app/views/docs/tips/_time_charts.slim +++ b/app/views/docs/tips/_time_charts.slim @@ -1,4 +1,3 @@ -- tip_title 'Time charts' p ' For any column of type date or datetime you can easily display a time chart by clicking on the time chart icon ( i.fa.fa-bar-chart diff --git a/app/views/docs/tips/_time_zones.slim b/app/views/docs/tips/_time_zones.slim index 2ae7ee31..0dc58bca 100644 --- a/app/views/docs/tips/_time_zones.slim +++ b/app/views/docs/tips/_time_zones.slim @@ -1,4 +1,3 @@ -- tip_title 'Time zones' p 'Adminium has two settings related to timestamps and time zones that can be found in your = link_to 'Account settings', edit_account_path diff --git a/app/views/docs/tips/_welcome.slim b/app/views/docs/tips/_welcome.slim index d6c2d5b8..2eb7701a 100644 --- a/app/views/docs/tips/_welcome.slim +++ b/app/views/docs/tips/_welcome.slim @@ -1,4 +1,3 @@ -- @tip_title = "Welcome on board!" p ' Your account b= current_account.name diff --git a/config/locales/en.yml b/config/locales/en.yml index 9c9cf20d..22df4c27 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,3 +13,17 @@ en: sum: Sum count: Count distinct: Number of distinct values + account: + tips: + advanced_search: Advanced Searches, Views and Widgets + basic_search: Basic Search + displayed_record: Customizing the listing page + editing: Edition + enumerable: Enumerable Columns + export_import: Export and Import your data + keyboard_shortcuts: Keyboard shortcuts + relationships: Relationship Display + serialized: Serialized data + time_charts: Time charts + time_zones: Time zones + welcome: Welcome on board!