From 17976dbece9f73b392e23d21c8e8285739194ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Mendon=C3=A7a?= Date: Sun, 3 Sep 2023 12:29:09 +0100 Subject: [PATCH 1/2] Use GP buttons (small) for action links in projects, glossary and translation sets --- assets/css/style.css | 29 +++++----------- gp-templates/glossary-view.php | 4 +-- gp-templates/project.php | 61 ++++++++++++++++++---------------- gp-templates/projects.php | 47 ++++++++++++++++++++------ gp-templates/translations.php | 4 +-- 5 files changed, 82 insertions(+), 63 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index cb1001df6..33da653a5 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -249,7 +249,7 @@ h3 { .gp-heading { display: flex; - align-items: baseline; + align-items: center; gap: 0.2em; margin: 0 0 1rem 0; } @@ -1079,7 +1079,7 @@ span.context { margin: 1rem 0; } -a.bubble, .bubble { +.bubble { font-size: 80%; color: white; padding: 0.2em 0.3em 0.1em 0.2em; @@ -1087,25 +1087,8 @@ a.bubble, .bubble { text-align: center; } -a.bubble.action.edit { - background-color: var( --gp-color-btn-bg ); - color: var( --gp-color-btn-text ); - border: 1px solid var( --gp-color-btn-border ); - display: inline-flex; - border-radius: 2px; - box-shadow: none; +a.button.action.edit { margin: 0 0 0 0.2rem; - cursor: pointer; - outline: 0; - white-space: nowrap; - vertical-align: middle; -} - -a.bubble.action.edit:hover, a.bubble.action.edit:focus { - background-color: var( --gp-color-btn-hover-bg ); - color: var( --gp-color-btn-hover-text ); - border-color: var( --gp-color-btn-hover-border ); - box-shadow: 0 0 0 1px var( --gp-color-btn-hover-border ); } span.inactive { @@ -1407,6 +1390,7 @@ a.project-actions { margin-left: -24em; } +#projects dd, #sub-projects dd { font-size: 0.75em; line-height: 1.3em; @@ -1414,18 +1398,22 @@ a.project-actions { margin: 0; } +#projects dl, #sub-projects dl { margin-left: 0.5em; } +#projects dt, #sub-projects dt { margin-top: 0.5em; } +#projects a, #sub-projects a { font-weight: bold; } +#projects a.action, #sub-projects a.action { font-weight: normal; } @@ -1604,6 +1592,7 @@ table.form-table td { } @media (max-width: 799px) { + #projects, #sub-projects { float: none; width: auto; diff --git a/gp-templates/glossary-view.php b/gp-templates/glossary-view.php index 061c250e6..65348fd9e 100644 --- a/gp-templates/glossary-view.php +++ b/gp-templates/glossary-view.php @@ -37,8 +37,8 @@ ); ?> - - + 'button is-small' ) ); ?> + 'button is-small' ) ); ?> 'button is-small' ) ); +$delete_link = gp_link_project_delete_get( $project, null, array( 'class' => 'button is-small' ) ); if ( ! $project->active ) { add_filter( @@ -183,34 +183,39 @@ function( $items ) {
-

-
- -
- name ) ); ?> - 'bubble' ) ); ?> - 'bubble' ) ); ?> - active ) { - echo "" . __( 'Inactive', 'glotpress' ) . ''; +

+
+ active ? 'project-active' : 'project-inactive'; + ?> +
+ name ) ); ?> + 'button is-small' ) ); ?> + 'button is-small' ) ); ?> + active ) { + echo "" . __( 'Inactive', 'glotpress' ) . ''; + } + ?> +
+
+ description, $sub_project ), 111 ) ); + ?> +
+ -
-
- description, $sub_project ), 111 ) ); - ?> -
- -
+
diff --git a/gp-templates/projects.php b/gp-templates/projects.php index dcd8c0fe4..b8691a361 100644 --- a/gp-templates/projects.php +++ b/gp-templates/projects.php @@ -4,17 +4,42 @@ gp_tmpl_header(); ?> -

- - +
+

+
+ active ? 'project-active' : 'project-inactive'; + ?> +
+ name ) ); ?> + 'button is-small' ) ); ?> + 'button is-small' ) ); ?> + active ) { + echo "" . __( 'Inactive', 'glotpress' ) . ''; + } + ?> +
+
+ description, $project ), 111 ) ); + ?> +
+ +
+
+

current_user_can( 'admin' ) ) : ?> diff --git a/gp-templates/translations.php b/gp-templates/translations.php index cd8f0711e..efc0c9e0a 100644 --- a/gp-templates/translations.php +++ b/gp-templates/translations.php @@ -57,8 +57,8 @@ ); ?> - - + 'button is-small' ) ); ?> + 'button is-small' ) ); ?>