~/selfhut

468a751a85048a1cd4d88fae4162f9631f869c5d — Arthur Melton 273578a8 2 years ago
mailing_list option
M README.md => README.md +5 -0
@@ 23,6 23,11 @@ description = "I am supper cool and think that [This](https://exmaple.com) is re

get_location = "/var/git"
domain = "https://billyscoolwebsite.com"
payment_link = "https://paypal.me/billy" # this is optinal, if you dont want to take donations then just remove the line dont set it to ""

[mailing_list]
password = "********"
imap_url = "imap.billyscoolwebsite.com"
port = 993
```

## Making a new git

M src/repository/blame.rs => src/repository/blame.rs +2 -1
@@ 66,7 66,8 @@ pub fn blames(repo: String, branch: String, location: PathBufWithDotfiles) -> Op

            branch: branch.clone(),
            current_dir_file: format!("/{}/", location.get().display()).replace("//", "/"),
            current_dir: format!("/{}", location.get().display()),
            payment: CONFIG.payment_link.clone()
            payment: CONFIG.payment_link.clone(),
            mailing_list: CONFIG.mailing_list.clone()
        },
    ))
}

M src/repository/log.rs => src/repository/log.rs +2 -0
@@ 43,6 43,7 @@ pub fn log_main(repo: String, from: Option<String>) -> Option<Template> {

            current_dir: "/",
            payment: CONFIG.payment_link.clone(),
            last_commit,
            mailing_list: CONFIG.mailing_list.clone()
        },
    ))
}

@@ 93,6 94,7 @@ pub fn log(

            current_dir: format!("/{}", location.get().display()),
            payment: CONFIG.payment_link.clone(),
            last_commit,
            mailing_list: CONFIG.mailing_list.clone()
        },
    ))
}

M src/repository/summary.rs => src/repository/summary.rs +2 -1
@@ 30,7 30,8 @@ pub fn repository(repo: String) -> Option<Template> {

                },
                None => None
            },
            payment: CONFIG.payment_link.clone()
            payment: CONFIG.payment_link.clone(),
            mailing_list: CONFIG.mailing_list.clone()
        },
    ))
}

M src/repository/tree.rs => src/repository/tree.rs +6 -3
@@ 35,7 35,8 @@ pub fn tree_main(repo: String) -> Option<Template> {

            files: files(repo, main_branch, "".to_string()),
            current_dir_file: "/",
            current_dir: "/",
            payment: CONFIG.payment_link.clone()
            payment: CONFIG.payment_link.clone(),
            mailing_list: CONFIG.mailing_list.clone()
        },
    ))
}

@@ 90,7 91,8 @@ pub fn tree(repo: String, branch: String, location: PathBufWithDotfiles) -> Opti

                    fluid: "true",
                    content,
                    lines,
                    payment: CONFIG.payment_link.clone()
                    payment: CONFIG.payment_link.clone(),
                    mailing_list: CONFIG.mailing_list.clone()
                },
            ))
        }

@@ 113,7 115,8 @@ pub fn tree(repo: String, branch: String, location: PathBufWithDotfiles) -> Opti

                files: files(repo, branch, location.get().display().to_string()),
                current_dir_file: format!("/{}/", location.get().display()).replace("//", "/"),
                current_dir: format!("/{}", location.get().display()),
                payment: CONFIG.payment_link.clone()
                payment: CONFIG.payment_link.clone(),
                mailing_list: CONFIG.mailing_list.clone()
            },
        )),
    }

M src/utils/config.rs => src/utils/config.rs +9 -0
@@ 21,6 21,7 @@ lazy_static! {

                git_location: dirs::home_dir().unwrap_or(PathBuf::from("/")),
                domain: "127.0.0.1".to_string(),
                payment_link: None,
                mailing_list: None,
            };
            config.pop();
            let _ = fs::create_dir_all(config.clone());

@@ 42,4 43,12 @@ pub struct Config {

    pub git_location: PathBuf,
    pub domain: String,
    pub payment_link: Option<String>,
    pub mailing_list: Option<Email>,
}

#[derive(Serialize, Deserialize, Clone)]
pub struct Email {
    pub password: String,
    pub imap_url: String,
    pub port: u16,
}

M templates/navbar.html.hbs => templates/navbar.html.hbs +3 -1
@@ 50,6 50,7 @@

			{{/if}}
			" href="/{{repo}}/refs">refs</a>
		</li>
        {{#if mailing_list}}
		<li class="nav-item">
			<a class="nav-link
			{{#if (eq active "mailing_list")}}

@@ 57,6 58,7 @@

			{{/if}}
			" href="/{{repo}}/lists">mailing lists</a>
		</li>
        {{/if}}
		{{#if payment}}
		<li class="nav-item">
			<a class="nav-link" href="{{payment}}" target="_new">

@@ 71,4 73,4 @@

		{{/if}}
	</ul>
</div>
</div>
\ No newline at end of file
</div>