Commit graph

50 commits

Author SHA1 Message Date
Andy Allan
a32854fa52 Wrap the rss and upload buttons in a div, with suitable padding for both vertical and horizontal tab layouts
This ensures it looks right when the tabs are collapsed vertically.
2021-06-16 17:08:26 +01:00
Andy Allan
81ad715474 Rework tabs to use flexbox
This improves the behaviour on small widths, where the tabs stack neatly. It also avoids the use of ml-auto which isn't RTL compatible.

The change in indentation is because it was previously coded with multiple li nested inside another li
2021-06-16 16:48:23 +01:00
Andy Allan
62349d1856 Make tab labels into nouns that describe what's on the tab
I think that works better with tabs, whereas actions (verbs) work better with buttons.
2021-06-16 16:27:45 +01:00
Andy Allan
7996b84380 Rearrange tabs for inter-page consistency
The all traces tab comes first, since it's shown on every page as you click around. Otherwise the tabs appear to be constantly rearranging themselves.
2021-06-16 16:26:25 +01:00
Michal Migurski
33f9b7c55f Fixed remaining erblint complaint 2021-06-16 15:55:55 +01:00
Michal Migurski
21eafac304 Fix erblint complaints 2021-06-16 15:55:55 +01:00
Tobias Jordans
f4e998804d Traces#index: Introduce tab navigation, fix tag-filter
- introduce bootstrap tabs to switch the views
- introduce `content_for :heading_class` to remove the padding below the bootstrap tabs
- update the rss-image to use a svg, adopted from https://icons.getbootstrap.com/icons/rss/ (without the outer border)
- move rss- and new-button away from the view-switching actions
- the `@tag` logic was broken. introduce new link to remove the tag-filter; the tabs keep the filter once given; use params[:tag] directly in the view
- use `&.` syntax nil-safety so we can remove `@display_name`
2021-06-16 15:55:55 +01:00
Tom Hughes
2c5e981684 Fix erblint warnings 2021-06-05 07:40:55 +01:00
Andy Allan
a08fe1c291 Use list-inline to achieve spacing between elements on a line
This is a better solution than spans and margins. Additionally, rework
to use mb-* instead of my-* (bootstrap advises against using margin-top)
and get rid of <br>s by using paragraphs instead.
2021-03-17 18:57:36 +00:00
Andy Allan
4dc584421a Refactor traces list display
Ideas taken from #3036
2021-03-17 18:04:00 +00:00
Andy Allan
76146baf60 Remove spacing tweaks and legacy pagination spacing CSS
No need to fight against something that we no longer use.
2021-01-06 15:40:53 +00:00
Tobias Jordans
18ec273038 Traces: Migrate pagination to bootstrap
Same feature, different style.
- Change pagination to use bootstrap default styles
- … but with empty span-tags instead of non-active a-tags
- refactor partial to not use @-variables but get the variables via
the render-call, simplify render-call-syntax
- remove the additional `if @traces.size > 1` inside the pagination
partial since that caused the pagination to disappear on the last page.
The partial will be visible with inactive links.
- Add bootstrap spacer-classes to overwrite commons-css so removing. Eg.
commons also has a pagination class same as bootstrap.
2021-01-03 20:55:50 +01:00
Andy Allan
c8e1b3c662 Prefer string interpolation to concatenation in erb files 2020-11-11 14:44:42 +00:00
Andy Allan
613b748c55 Avoid lego translations for coordinates
Use the i18n system for joining coordinate values together, while
avoiding making any changes or standardisation involving the exact
symbol used in each situation.

Refs #2732
2020-08-19 16:43:16 +02:00
Tom Hughes
c24c2e481c Merge remote-tracking branch 'upstream/pull/2667' 2020-08-05 21:50:08 +01:00
Tom Hughes
cfb2f2988c Merge remote-tracking branch 'upstream/pull/2698' 2020-07-08 19:10:01 +01:00
Andy Allan
1977e66ace Use bootstrap text-muted in place of custom deemphasze class
This avoids changing anything related to forms, since they will be
switched over to bootstrap separately.
2020-07-08 18:30:15 +02:00
Andy Allan
6d9434e14d Remove some extraneous css
The trace part is actually removing html, but I thought it was CSS
when I first noticed the blank space on the page.
2020-07-08 16:57:49 +02:00
Andy Allan
8d2271699b Use bootstrap_form as the formbuilder for GPX upload form
This also uses the recommended bs-custom-file-input javascript plugin
for the file input control.
2020-07-01 17:23:02 +02:00
Andy Allan
627f2493fa Refactor away from global form control styling
This enables forms to be converted one-by-one to bootstrap. Without this
refactoring, these global styles interfere with form control styling from
bootstrap.

The rearrangement of the search and directions styling is to solve CSS selector specitivity issues.
2020-07-01 17:23:02 +02:00
Tom Hughes
6ad0340b05 Localise formatting of point count for traces
Fixes #2592
2020-04-15 22:42:41 +01:00
Andy Allan
055a976051 Remove custom table styling
This removes the custom table styling code, and move to using bootstrap table styling for almost all remaining tables.
2020-04-01 12:29:01 +02:00
Andy Allan
b8c1bbb4f8 Remove unnecessary h() calls on model attributes
These were necessary in the rails 2.x era, but not now.
2020-03-18 14:33:30 +01:00
Andy Allan
5fdada204c Use bootstrap table striping to replace hand-cycled table stripes
This cuts down on the complexity of having to use the `cycle` function
and makes the templates easier to read. CSS-based striping has been
around for many years.

The CSS is in order to keep our custom colour for striped tables.
2020-03-18 12:14:24 +01:00
Andy Allan
f885cfe0f5 Rename form-row to standard-form-row to avoid clashing with a bootstrap class 2020-01-15 17:16:11 +01:00
Tom Hughes
a570f59187 Merge remote-tracking branch 'upstream/pull/2494' 2020-01-05 18:51:42 +00:00
Andy Allan
53f2c36f1d Use ActionView's safe_join to avoid using raw when joining arrays of text 2020-01-02 18:07:23 +01:00
Andy Allan
1ff7e3ac71 Replace custom css class with bootstrap inline utility
This has actually been broken since the controller was renamed,
but nobody noticed.
2019-12-19 19:31:52 +01:00
Andy Allan
1586e2ba80 Use badges for the trace visibility labels
Our green is currently just on the side of triggering black text,
hence the override to make it look consistent with the other badges.
2019-12-19 19:18:00 +01:00
Andy Allan
a3e3be007e Use text-danger style for pending trace warning 2019-12-19 19:15:36 +01:00
Tom Hughes
86b355c4df Use delete method correctly when deleting traces
Fixes #2453
2019-12-04 21:06:19 +00:00
Andy Allan
44c6fdc273 Use the conventional 'destroy' method name for destroying traces 2019-12-04 11:59:18 +01:00
Andy Allan
7410b59a50 Remove unused trace_optionals partial
Although the code to render the partial runs, `yield :optionals`
was removed from the site layout in 2013. So the code has been
ineffective since then.
2019-10-30 15:02:35 +01:00
Tom Hughes
3b636ddb6f Don't try and commas to the trace size
It breaks pluralisation lookups in the locale and in any case
adding a comma every three digits is locale specific.

Fixes #2388
2019-10-13 10:54:47 +01:00
Tom Hughes
f280dcb2d7 Merge remote-tracking branch 'upstream/pull/2278' 2019-06-26 13:36:44 +01:00
Andy Allan
3914050fcc Simplify partial rendering when the partial is named after the model 2019-06-26 14:13:09 +02:00
Andy Allan
1298d80549 Use the distance_in_words_ago scope for trace display
Refs #2255
2019-06-19 18:04:08 +02:00
Andy Allan
a08b65a6ac Use built-in form submit translation keys for traces 2019-06-12 19:24:06 +02:00
Tom Hughes
3af16f6337 erblint: fix remaining single quoted strings 2019-03-27 16:15:19 +00:00
Andy Allan
74b91c0e3e erblint: Add or remove curly braces around hash parameters as required 2019-03-27 10:30:48 +01:00
Andy Allan
bbd44f8099 Whitespace fixes in traces erb files 2019-03-26 20:23:35 +00:00
Tom Hughes
141df02e67 Move status into the settings object
Only the very early boot code needs to look at the value
from the environment directly.
2019-03-17 11:15:34 +00:00
Tom Hughes
ba05009de1 Update trace RSS for renaming of trace#view to trace#show 2018-09-09 11:50:05 +01:00
Andy Allan
44217775f0 Rename i18n keys track->trace 2018-08-29 17:59:58 +08:00
Andy Allan
d0089f0ce8 Rename traces#list to traces#index 2018-08-29 17:58:37 +08:00
Andy Allan
16fef14b61 Rename traces#view to traces#show 2018-08-29 17:43:38 +08:00
Andy Allan
b745126b6e Split out updating a trace into an update action 2018-08-29 17:31:12 +08:00
Andy Allan
57d3b3af55 Refactor trace creation pages
Split the trace creation into new and create methods, with standard resourceful routing. Provide a redirect for external requests to the old url.
2018-06-06 10:22:42 +08:00
Andy Allan
e1c62f1bf2 Remove if_user and similar methods
Rather than hiding features based on CSS, just avoid including them
in the output. Fixes #1862
2018-05-16 13:05:20 +08:00
Andy Allan
b446138aef Rename trace_controller to traces_controller 2018-05-09 12:38:09 +08:00