run: ## Run the wallabag built-in server
@php bin/console server:run --env=$(ENV)
-build: ## Run grunt
- @grunt
+build: ## Run webpack
+ @npm run build:$(ENV)
test: ## Launch wallabag testsuite
@ant prepare && bin/simple-phpunit -v
*/
public function showTagAction()
{
- $repository = $this->get('wallabag_core.entry_repository');
$tags = $this->get('wallabag_core.tag_repository')
- ->findAllTags($this->getUser()->getId());
-
- $flatTags = [];
-
- foreach ($tags as $tag) {
- $nbEntries = $repository->countAllEntriesByUserIdAndTagId(
- $this->getUser()->getId(),
- $tag->getId()
- );
-
- $flatTags[] = [
- 'id' => $tag->getId(),
- 'label' => $tag->getLabel(),
- 'slug' => $tag->getSlug(),
- 'nbEntries' => $nbEntries,
- ];
- }
+ ->findAllFlatTagsWithNbEntries($this->getUser()->getId());
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
- 'tags' => $flatTags,
+ 'tags' => $tags,
]);
}
return (int) $qb->getQuery()->getSingleScalarResult();
}
- /**
- * Count all entries for a tag and a user.
- *
- * @param int $userId
- * @param int $tagId
- *
- * @return int
- */
- public function countAllEntriesByUserIdAndTagId($userId, $tagId)
- {
- $qb = $this->createQueryBuilder('e')
- ->select('count(e.id)')
- ->leftJoin('e.tags', 't')
- ->where('e.user=:userId')->setParameter('userId', $userId)
- ->andWhere('t.id=:tagId')->setParameter('tagId', $tagId)
- ;
-
- return (int) $qb->getQuery()->getSingleScalarResult();
- }
-
/**
* Remove all entries for a user id.
* Used when a user want to reset all informations.
return $tags;
}
+ /**
+ * Find all tags (flat) per user with nb entries.
+ *
+ * @param int $userId
+ *
+ * @return array
+ */
+ public function findAllFlatTagsWithNbEntries($userId)
+ {
+ return $this->createQueryBuilder('t')
+ ->select('t.id, t.label, t.slug, count(e.id) as nbEntries')
+ ->distinct(true)
+ ->leftJoin('t.entries', 'e')
+ ->where('e.user = :userId')
+ ->groupBy('t.id')
+ ->orderBy('t.slug')
+ ->setParameter('userId', $userId)
+ ->getQuery()
+ ->getArrayResult();
+ }
+
/**
* Used only in test case to get a tag for our entry.
*
save_link: 'Zapisz link'
back_to_unread: 'Powrót do nieprzeczytanych artykułów'
users_management: 'Zarządzanie użytkownikami'
- # site_credentials: 'Site credentials'
+ site_credentials: 'Poświadczenia strony'
top:
add_new_entry: 'Dodaj nowy wpis'
search: 'Szukaj'
unread: 'Nieprzeczytane'
starred: 'Oznaczone gwiazdką'
archive: 'Archiwum'
- # all: 'All'
+ all: 'Wszystkie'
rss_limit: 'Link do RSS'
form_user:
two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu"
placeholder: Filtruj po nazwie użytkownika lub adresie e-mail
site_credential:
- # page_title: Site credentials management
- # new_site_credential: Create a credential
- # edit_site_credential: Edit an existing credential
- # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
+ page_title: Zarządzanie poświadczeniami strony
+ new_site_credential: Stwórz nowe poświadczenie
+ edit_site_credential: Edytuj istniejące poświadczenie
+ description: "Tutaj możesz zarządzać wszystkim poświadczeniami wymaganymi przez strony (stwórz, edytuj i usuń ), takie jak paywall, autentykacja, itp."
list:
actions: Akcje
edit_action: Edytuj
yes: Tak
no: Nie
- # create_new_one: Create a new credential
+ create_new_one: Stwórz nowe poświadczenie
form:
- # username_label: 'Username'
- # host_label: 'Host'
- # password_label: 'Password'
+ username_label: 'Nazwa użytkownika'
+ host_label: 'Host'
+ password_label: 'Hasło'
save: Zapisz
delete: Usuń
delete_confirm: Jesteś pewien?
deleted: 'Użytkownik "%username%" usunięty'
site_credential:
notice:
- # added: 'Site credential for "%host%" added'
- # updated: 'Site credential for "%host%" updated'
- # deleted: 'Site credential for "%host%" deleted'
+ added: 'Poświadczenie dla "%host%" dodane'
+ updated: 'Poświadczenie dla "%host%" zaktualizowane'
+ deleted: 'Poświadczenie dla "%host%" usuniętę'