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

Create a "View Story" button in Raintale's GUI #26

Closed
shawnmjones opened this issue Aug 10, 2021 · 2 comments
Closed

Create a "View Story" button in Raintale's GUI #26

shawnmjones opened this issue Aug 10, 2021 · 2 comments
Assignees

Comments

@shawnmjones
Copy link
Member

shawnmjones commented Aug 10, 2021

A user can view their Raintale story if they know which file link to click on, but this is not friendly.

A better way would be to have a "View Story" button as @himarshaj and I have discussed. It would have to be aware of how to handle different story types, for example:

  • for Create Story From Preset, Create Story From Template, and Create Video Story this button will link to the file that was generated as part of the storytelling process
  • for Tell Story With Facebook and Tell Story With Twitter this button will link to the associated social media post

We need to figure out how Django's template engine can tell the difference. Maybe there is a control flow statement we can use that will change behavior based on the job type. A second challenge is how to read the URL from the output in the case of social media stories so we can alter the behavior of this button.

The template controlling this behavior is in raintale-gui/templates/jobs/job_view.html.

@shawnmjones
Copy link
Member Author

Raintale's GUI is intended to create stories, but not necessarily distribute them. We don't want users to get into the habit of just sharing the story from the server. If the Raintale GUI is updated or reinstalled, the stories may disappear.

We should also add a Download Story or Save Story button for downloading the story file. I realize that a user can just right click the appropriate file and download it manually, but this would help to stress that they need to save the story and that the Raintale GUI is not the story's final destination.

@shawnmjones
Copy link
Member Author

shawnmjones commented Aug 16, 2021

I've been thinking about how we could handle this for file outputs. We can modify the template in jobs/results/table_row.html to modify the entry for the file containing output.dat.

Here is a crude idea, but we can make it better. See how the Django template language checks for output.dat in the file.url variable and then behaves differently?

        {% if 'output.dat' in file.url %}
        STORY FILE ➡️ <a href="{{ file.url }}" target="_blank">{{ file.basename }}</a>
        {% else %}
        <a href="{{ file.url }}" target="_blank">{{ file.basename }}</a>
        {% endif %}

We could place the button here, which deviates from the interface paradigm used on the rest of the page. If possible, a better idea is to identify this line with an HTML id attribute containing some value, like story-file, and then use this id value to connect it to the View Story and Download Story buttons through some JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants