`Test::Unit` is deprecated, and we can switch to `Minitest::Test` with
almost no side effects.
This commit does all of the work required to make Minitest tests run
with Gollum's existing test helpers.
* Remove explicit nokogori version requirement
* Require ruby >= 2.6, use latest JRuby
No longer needed after nokogiri's recent release, see https://github.com/gollum/gollum/issues/1779
* Add `.header-title` style
This style shows smaller text on mobile devices. It reverts back to the
`2em` size used in Primer for H1 tags.
* Use `.header-title` for all `#head` headings
This commit:
1. Updates all main templates to use the new `.header-title` class,
making these titles less disruptively large on mobile devices.
2. Centers these titles for mobile breakpoints only, re-setting them
back to left-aligned text for `md-` breakpoints and up.
Note that in `lib/gollum/templates/wiki_contentf.mustache`, the
`.header-title` is not a `#head .header-title`, so it doesn't inherit
all of the new styles added in this commit.
* Adjust padding and presentation of mobile menu
To give mobile page headers more structure, this commit adjusts the
padding to be more symmetrical. It also adds a `border-bottom` on mobile
only. In my opinion this improves readability by telling the reader,
"This is where the navigation menu ends and the page content begins."
* Recompile assets
* Fix failing spec
My changes to the header layout seem to changed where the spaces in
`last_response.body` are placed. So let's assert only that the content
is present, since that's all this test should actually care about.
* Simplify test
I came across this test because it was failing JRuby CI runs. I should
emphasize, though, that this test was only failing due do an upstream
bug in Nokogiri v1.12.5.
When I was reviewing the test, to understand why it was failing at all,
I noticed that the assertion was rather obfuscated. Specifically, we
were post-processing the entire `response.body` and using that as an
expectation.
* Use an older version of Nokogiri in our test env
This is a temporary fix. See the commit diff for more information.
* Split JRuby CI runs from MRI CI runs
We can improve the performance of our MRI test runs by not installing
Java as part of their run. (Java is only required for JRuby.)
* Use latest Ruby patch versions during CI runs
* Simplify GitHub Action workflow steps
Judging by the output in the GitHub Actions workflow UI, the `echo`
steps were not providing much value to us.
We can get rid of them to slightly increase run performance.
I've also named the other steps to make it easier to skim the Actions
workflow output.
* Remove `twitter_cldr` development dependency
This is no longer being used.
* Change GitHub Actions workflow Ruby matrix
We can drop Ruby 2.4 from our test run matrix. It is beyond EOL.
Let's add 2.7 instead.
* Add `i18n` dependency
We will use `i18n` to provide localization for Gollum's frontend. I
chose this because it's a well-supported, pretty normal Ruby library.
* Configure I18n
- Locale files will be kept in `lib/gollum/locales/[lang].yml`
- The available locales, to start, will be English (`en`).
* Add I18n interface for mustache templates
This commit adds an interface that allows mustache templates to get I18n
translation strings, transform any arguments that may be present in
them, and then render them on the frontend.
This is our first real step to getting internationalizing the Gollum
frontend.
An issue was reported (see #1721) where, in docker containers where the
`LANG` was not being set, `Precious::App` would serve Mustache templates
in an ASCII encoding. This caused templates to error out.
In the past, this would have happened in environments where `LANG` was
not set and the Gollum applciation configuration had enabled MathJax.
Now, it happens even if MathJax is disabled because of a UTF-8 character
I added to the mobile navigation menu.
Basically, we should enforce a UTF-8 encoding from now on to avoid
runtime errors related to ASCII encoding.
* fixes#1723: Github Actions Supported
- This is to switch from Travis CI which is shutting down the org version,
and the .com version, a free account is limited.
- Switch test environment variable from TRAVIS to CI to be more generic.
* Adding jruby-9.2.18.0 to matrix for github actions
I made a mistake when I made `#title` a private method. I did not see
that it was being called from `layout.mustache` to generate the
`<title></title>` tag in the `<head></head>` of each page.
This fixes my error, and adds tests so the behaviour is more explicit.
* Fix tabnav styles on #create and #edit views
The Primer CSS-provided `tabnav` styles were not being used on the Edit
and Preview tabs on the create and edit pages.
After following Primer's documentation [1], it looks like we were using
the `aria-current` attribute incorrectly. Dynamically adding/removing
this attribute on the selected tab fixes the issue.
[1]: https://primer-css-git-next-inputs.primer.now.sh/css/components/navigation#tabnav
* Recompile static assets
It is more semantic to use a `<button>` tag in the place of an `<a>`
when there is no other page being linked to. In this circumstance, we're
using JavaScript to present a modal to the user on click.
This change makes the "Upload" and "Rename" buttons appear in the
browser's tab index.
There was a display issue, where navbar items's outline styles were
being cut off due to the parent `<nav>` element's margin and padding.
Fortunately, we can do away with the navbar wrapper div entirely. It was
not doing anything important except defining its children as
`TableObject` items. But we can just do this on the `<nav>` itself.
If the user has edit permissions, the "History" button is shown in a
button group with "Edit" and "Rename". If the user does not have edit
permissions, it's shown by itself.
This commit also renames the label from "Page History" to "History".