Skip to content

Commit

Permalink
Simplify tip display (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
isc authored Oct 30, 2023
1 parent 6e1cf9c commit 5f63746
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 53 deletions.
6 changes: 0 additions & 6 deletions app/assets/javascripts/docs.js.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
$ ->
for feature in $('.feature-description').toArray().reverse()
id = $(feature).attr('id')
title = $(feature).find('h3').text()
li = $("<li><a href='##{id}'>#{title}</a></li>")
li.insertAfter($('#features'))

$('#cancel_tip').on 'ajax:complete', (et, e) ->
if JSON.parse(e.responseText)
$("#welcome-modal .modal-footer").html("<p class='alert alert-info'>Okay, tips will not appear anymore</p>")
Expand Down
14 changes: 0 additions & 14 deletions app/helpers/dashboard_helper.rb

This file was deleted.

33 changes: 17 additions & 16 deletions app/views/dashboards/_displayed_tip.html.slim
Original file line number Diff line number Diff line change
@@ -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&nbsp;
= @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&nbsp;
= 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
2 changes: 1 addition & 1 deletion app/views/dashboards/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
.modal-footer
= f.submit class: 'btn btn-primary'

= display_a_tip
= render partial: 'displayed_tip'
10 changes: 6 additions & 4 deletions app/views/docs/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_advanced_search.slim
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_basic_search.slim
Original file line number Diff line number Diff line change
@@ -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 <code>%</code> in your query string for a simple regular expression.
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_displayed_record.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_editing.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- tip_title "Edition"
p
'There are different ways to edit your records:

Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_enumerable.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_export_import.slim
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_keyboard_shortcuts.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_relationships.slim
Original file line number Diff line number Diff line change
@@ -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 <code>User #37</code>). 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.
1 change: 0 additions & 1 deletion app/views/docs/tips/_serialized.slim
Original file line number Diff line number Diff line change
@@ -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'
1 change: 0 additions & 1 deletion app/views/docs/tips/_time_charts.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_time_zones.slim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion app/views/docs/tips/_welcome.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- @tip_title = "Welcome on board!"
p
' Your account
b= current_account.name
Expand Down
14 changes: 14 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit 5f63746

Please sign in to comment.