opacapp / opacclient

[unmaintained] A Java client library and an Android app to access more than 1,000 public and scientific libraries from all over the world.
https://opacapp.net
MIT License
156 stars 61 forks source link

Improve printing feature with CSS #445

Closed johan12345 closed 8 years ago

johan12345 commented 8 years ago

Hey! If you ever wanted to contribute to an Open Source project, but didn't know how, you just found a perfect place to start. We try to write this issue as instructive as possible, but as we're humans we almost certainly forgot to write something important in here. If you want to try to tackle this issue and get stuck at any point, please do not hesitate and ask us, either here on GitHub or via email at info@opacapp.de. We'll be very happy to help!

We think this issue is very suitable to people who are just starting with Open Source or Android development in general and have never done it before. We'd like to ask people with wide experience in contributing to leave this issue to beginners. Thanks!

Solving this issue requires very little experience in Java/Android programming, but you should be familiar with HTML and CSS.

How to get started

First of all, we recommend that you install the app and play around with it so you know how it looks and feels. Next, you should use git to download this GitHub repository and open the folder opacclient/ from within the repository (not the repository itself) in Android Studio.

Because of a Bug in Android Studio, some configuration files in the .idea folder might be deleted after opening the project for the first time. Run git checkout -- opacclient/.idea/ in the repository to revert this.

Press the green "Play" button to run it on your device. If this works, you have a working development setup, yay! If it doesn't, feel free to ask us for help!

What this is about

When you start the app and set up a library account, you can search this library's catalog, view the search result list and click on the results to get detailed information about a single item, including things like where it is located in the library. Pull Request #440 (see also issue #431) added a printing feature to the app, which means that these details can be sent to a printer using the print button (or overflow menu item on narrow screens) on devices with Android >= 4.4. The print feature is based on an HTML page that is generated by the app.

The printing feature is not yet included in the current version of the app on the Play Store, so you have to install the app from Android Studio if you want to try it.

This issue is about making the printed output a little nicer by applying some CSS to the generated HTML. We have listed some suggestions below, but if you have more ideas, feel free to ask us here and implement them afterwards.

How to do this

We recommend forking this repository and creating a special git branch for this issue before you start. This will make it easier for you to submit a pull request later. If you've never done this before, there are a lot of good guides out there and you can always ask us questions.

The file you need to look at is print_template.mustache. It is basically an HTML file that is filled with data using the Mustache templating language. You can add a <style> tag to the <head> section for your CSS. Below are some suggestions what could be done to improve the printed layout:

As mentioned above, we are also open to additional suggestions about what could be improved.

We're excited to see your pull request!

If you get stuck, don't hestitate to ask. We bound ourselves to a Code of Conduct and we're committed to providing a welcoming experience and giving constructive, friendly and useful feedback on your contributions.

NPuhlmann commented 8 years ago

hey @johan12345, what is meant by "Data for copies and volumes is shown in multiple tables" ? How do I get this view? Whenever I search something there is just one table in the print view. I already added the suggestions and some other small things for example every odd column is gray so the table will be easier to read.

johan12345 commented 8 years ago

what is meant by "Data for copies and volumes is shown in multiple tables" ? How do I get this view?

In some libraries there is no information about copies and volumes, so there is only one table with the details.

I already added the suggestions and some other small things for example every odd column is gray so the table will be easier to read.

Very nice :)