Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make language stats available without JavaScript #20948

Closed
wants to merge 1 commit into from
Closed

Make language stats available without JavaScript #20948

wants to merge 1 commit into from

Conversation

vollkorntomate
Copy link

Fixes #20947.

This PR makes a repository's language stats available to users who have disabled JavaScript. The language names and respective shares are now always shown below the colored bar, rather than faded in when clicked (see screenshot below).

Bildschirmfoto 2022-08-24 um 20 41 09

This has the additional advantage that these stats are now also visible in the mobile/responsive version, even though the bar is not visible there (perhaps this is another issue).

Bildschirmfoto 2022-08-24 um 20 41 19

Since this is my first contribution to Gitea, I am not 100% sure if the removed code breaks other functionality or there are things to be removed that I didn't see.

@silverwind
Copy link
Member

I'm not a huge fan of the current slide mechanism, but always displaying like this PR does seems wrong. It takes away vertical space for questionable benefit. If we ever move to a GitHub-like repo layout, the extra space could be used to display languages like they do.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 24, 2022
@CLanguagePurist
Copy link
Contributor

CLanguagePurist commented Aug 25, 2022

Maybe add the followings for Pure CSS style animation? It's just a rough idea that you can change.

web_src/less/_repository.less

.repository-summary-language-stats {
  height: 48px;
  overflow: hidden;
  -webkit-transition: height 0.1s;
  transition: height 0.1s;

  @media @mediaSm {
    height: auto;
  }
  .language-stats-details {
    display: none
  }
}

.repository-summary-language-stats:hover {
  height: 84px;

  .language-stats-details {
    display: block flow
  }
}

And remove the style="display:none" style from language-stats-details div in templates/repo/sub_menu.tmpl

@CLanguagePurist
Copy link
Contributor

Example.mp4

@lafriks
Copy link
Member

lafriks commented Aug 29, 2022

I don't think that this is so important information that it should be display always, especially since it does take quite some vertical space

@zeripath
Copy link
Contributor

zeripath commented Sep 4, 2022

perhaps it should be a hover thing?

@silverwind
Copy link
Member

We have hover on language since #20923, so it should be easy to add the percentag to the tooltip as well. But OP will probably not like it as that tooltip requires JS 😉.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language stats not available without JavaScript
6 participants