-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from MarginaliaSearch/new-look
Design Revamp For search.marginalia.nu
- Loading branch information
Showing
84 changed files
with
2,526 additions
and
1,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
code/common/renderer/src/main/java/nu/marginalia/renderer/RendererFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package nu.marginalia.renderer; | ||
|
||
import com.google.inject.Inject; | ||
import nu.marginalia.renderer.config.HandlebarsConfigurator; | ||
|
||
import java.io.IOException; | ||
|
||
public class RendererFactory { | ||
|
||
public RendererFactory() { | ||
private final HandlebarsConfigurator configurator; | ||
|
||
@Inject | ||
public RendererFactory(HandlebarsConfigurator configurator) { | ||
this.configurator = configurator; | ||
} | ||
|
||
/** Create a renderer for the given template */ | ||
public <T> MustacheRenderer<T> renderer(String template) throws IOException { | ||
return new MustacheRenderer<>(template); | ||
return new MustacheRenderer<>(configurator, template); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...n/renderer/src/main/java/nu/marginalia/renderer/config/DefaultHandlebarsConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package nu.marginalia.renderer.config; | ||
|
||
import com.github.jknack.handlebars.Handlebars; | ||
|
||
public class DefaultHandlebarsConfigurator implements HandlebarsConfigurator { | ||
@Override | ||
public void configure(Handlebars handlebars) {} | ||
} |
11 changes: 11 additions & 0 deletions
11
code/common/renderer/src/main/java/nu/marginalia/renderer/config/HandlebarsConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nu.marginalia.renderer.config; | ||
|
||
import com.github.jknack.handlebars.Handlebars; | ||
|
||
/** Configure handlebars rendering by injecting helper methods | ||
* into the setup process */ | ||
public interface HandlebarsConfigurator { | ||
|
||
/** Set up helpers for this handlebars instance */ | ||
void configure(Handlebars handlebars); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
.../services-application/dating-service/src/main/java/nu/marginalia/dating/DatingModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
package nu.marginalia.dating; | ||
|
||
import com.google.inject.AbstractModule; | ||
import nu.marginalia.renderer.config.DefaultHandlebarsConfigurator; | ||
import nu.marginalia.renderer.config.HandlebarsConfigurator; | ||
|
||
public class DatingModule extends AbstractModule { | ||
public void configure() { | ||
bind(HandlebarsConfigurator.class).to(DefaultHandlebarsConfigurator.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ces-application/explorer-service/src/main/java/nu/marginalia/explorer/ExplorerModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nu.marginalia.explorer; | ||
|
||
import com.google.inject.AbstractModule; | ||
import nu.marginalia.renderer.config.DefaultHandlebarsConfigurator; | ||
import nu.marginalia.renderer.config.HandlebarsConfigurator; | ||
|
||
public class ExplorerModule extends AbstractModule { | ||
public void configure() { | ||
bind(HandlebarsConfigurator.class).to(DefaultHandlebarsConfigurator.class); | ||
} | ||
} |
Oops, something went wrong.